/* Viora's installable patient application. Desktop clinic screens keep their existing layout. */
[hidden] { display: none !important; }
:root { --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #b1a4d5; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 30; padding: 12px; background: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.loading img { margin-bottom: 20px; border-radius: 23%; }
.phone-header, .mobile-nav { display: none; }
.app-install-link { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: white; border-radius: 14px; padding: 12px 15px; color: var(--purple); text-align: left; }
.app-install-link img { border-radius: 10px; }
.app-install-link span { display: block; }
.app-install-link small { display: block; font-size: 11px; color: var(--muted); }
.desktop-install { margin: 0 0 24px; }
.app-status { background: var(--lavender); border: 1px solid #e2ddef; border-radius: 17px; padding: 20px; margin-bottom: 20px; }
.app-status-head { display: flex; gap: 13px; align-items: center; margin-bottom: 15px; }
.app-status img { border-radius: 12px; }
.app-status b, .app-status small { display: block; }
.app-status small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.install-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.install-head img { border-radius: 23%; }
.install-head h2 { font-family: Georgia,serif; font-size: 25px; font-weight: 400; margin: 5px 0 0; }
.install-instructions { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 17px; margin: 14px 0; }
.install-instructions.recommended { border-color: #c9bfdf; background: var(--lavender); }
.install-instructions h3 { margin: 0; font-size: 15px; }
.install-instructions ol { padding-left: 20px; margin-bottom: 0; font-size: 13px; color: #666075; }
.install-instructions li { padding: 5px 0 5px 5px; }
.install-note { font-size: 12px; color: var(--muted); line-height: 1.65; }
.install-success { padding: 14px; border-radius: 12px; background: var(--green); color: #426c54; font-size: 13px; }
#pwa-dialog { max-width: 540px; }
.is-standalone .desktop-install { display: none; }
.connection-banner { position: sticky; top: 0; z-index: 15; background: #fff2d9; border-bottom: 1px solid #ecdbba; color: #7c5c27; font-size: 12px; line-height: 1.5; padding: 11px 18px; text-align: center; }
.app-update { position: fixed; bottom: 22px; right: 22px; left: auto; z-index: 18; display: flex; gap: 15px; align-items: center; padding: 12px 15px; background: var(--ink); color: white; border-radius: 14px; box-shadow: 0 6px 25px #29223e26; font-size: 12px; }
.app-update button { color: #e4dcff; background: transparent; min-height: 38px; font-weight: 600; }
.install-page { max-width: 580px; margin: 0 auto; padding: calc(40px + var(--safe-top)) 24px calc(35px + var(--safe-bottom)); }
.install-page .install-mark { width: 84px; height: 84px; border-radius: 23%; margin-bottom: 28px; box-shadow: 0 12px 32px #60578e25; }
.install-page h1 { font-size: 37px; margin: 12px 0 17px; }
.install-page > p { font-size: 14px; color: var(--muted); }
.install-page > .actions { margin: 24px 0; }
.offline-panel { min-height: 100dvh; max-width: 430px; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 25px; text-align: center; }
.offline-panel img { border-radius: 23%; margin-bottom: 28px; }
.offline-panel h1 { font-size: 31px; }
.offline-panel p { color: var(--muted); font-size: 14px; }
@media (max-width: 700px) {
  body { overscroll-behavior-y: none; }
  .patient-app .sidebar { display: none; }
  .patient-app .main { min-height: 100dvh; padding: calc(18px + var(--safe-top)) max(20px, env(safe-area-inset-right)) calc(100px + var(--safe-bottom)) max(20px, env(safe-area-inset-left)); }
  .phone-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 27px; }
  .phone-brand { display: flex; gap: 9px; align-items: center; }
  .phone-brand > img { border-radius: 11px; width: 37px; height: 37px; }
  .phone-brand b { font: 28px/1 Georgia,serif; letter-spacing: -1px; color: var(--purple-dark); }
  .phone-brand small { display: block; font-size: 8px; letter-spacing: 1.7px; margin-top: 5px; color: var(--muted); text-transform: uppercase; }
  .phone-account { width: 43px; height: 43px; border-radius: 50%; border: 1px solid #e7dbe5; background: #f3e7ee; color: #a7768e; font-size: 16px; }
  .patient-app .topbar { display: none; }
  .patient-app .heading { margin-bottom: 23px; }
  .patient-app .heading h1 { font-size: 31px; margin-bottom: 9px; }
  .patient-app .heading .eyebrow { font-size: 9px; letter-spacing: 1.3px; }
  .patient-app .heading > .button { display: none; }
  .patient-app .sub { font-size: 13px; line-height: 1.7; }
  .patient-app .stat { border-radius: 18px; padding: 17px 16px; }
  .patient-app .stat-title { font-size: 11px; min-height: 34px; }
  .patient-app .stat-value { font-size: 32px; margin: 7px 0 8px; }
  .patient-app .stat-note { font-size: 10px; line-height: 1.5; }
  .patient-app .card { border-radius: 20px; padding: 21px 18px; }
  .patient-app .card-head { align-items: flex-start; }
  .patient-app .card-head h2 { font-size: 16px; }
  .patient-app .card-head .badge { font-size: 9px; padding: 4px 7px; }
  .patient-app .legend { font-size: 10px; gap: 12px; }
  .patient-app .day-content { font-size: 12px; overflow-wrap: anywhere; }
  .patient-app .day-row { gap: 9px; flex-wrap: wrap; }
  .patient-app .day-row > .day-content { min-width: 125px; }
  .patient-app .day-row .text-button { min-height: 38px; }
  .patient-app .text-button { min-height: 42px; font-size: 12px; }
  .patient-app .footer { font-size: 10px; line-height: 1.6; padding-top: 10px; }
  .patient-app .desktop-install { display: none; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; z-index: 16; bottom: 0; left: 0; right: 0; min-height: 76px; padding: 9px max(8px,env(safe-area-inset-right)) calc(9px + var(--safe-bottom)) max(8px,env(safe-area-inset-left)); background: #fffffffa; border-top: 1px solid #e9e5ef; box-shadow: 0 -6px 28px #34284405; }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #8a8398; background: transparent; font-size: 10px; min-height: 48px; border-radius: 12px; padding: 4px 0; }
  .mobile-nav button svg { width: 22px; height: 22px; stroke-width: 1.7; }
  .mobile-nav button.active { color: var(--purple-dark); background: #f2eff9; }
  .keyboard-open .mobile-nav { display: none; }
  .app-update { left: 12px; right: 12px; bottom: calc(88px + var(--safe-bottom)); justify-content: space-between; }
  #toast { right: 15px; left: 15px; bottom: calc(91px + var(--safe-bottom)); max-width: none; font-size: 13px; }
  input, select, textarea { font-size: 16px; min-height: 48px; border-radius: 12px; }
  .field > label, .field > span { font-size: 13px; }
  .button { min-height: 46px; padding: 13px 18px; font-size: 13px; border-radius: 12px; }
  .patient-app .segmented { display: grid; grid-template-columns: 1fr 1fr; }
  .patient-app .segmented button { min-height: 47px; font-size: 12px; }
  .checks { grid-template-columns: 1fr; }
  .check { min-height: 38px; align-items: center; font-size: 13px; }
  .check input { min-height: auto; width: 20px; height: 20px; }
  dialog { padding: 24px 21px; border-radius: 23px; max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom)); }
  .login-form { min-height: 100dvh; padding: calc(34px + var(--safe-top)) 26px calc(34px + var(--safe-bottom)); }
  .login-inner .brand { font-size: 40px; margin-bottom: 35px; }
  .login-inner h1 { font-size: 31px; }
  .login-install { margin: 20px 0; width: 100%; }
  .app-status .button { width: 100%; }
  .is-standalone .login-tabs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
