/* ============================================================
   PainTrack App — application styles (extends styles.css tokens)
   ============================================================ */

.app-body { margin: 0; background: #ECE7DD; }
#root { min-height: 100vh; }

/* shared button extensions */
.btn--block { width: 100%; justify-content: center; }
.btn--grow { flex: 1; justify-content: center; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn.is-busy { opacity: .8; pointer-events: none; }
.btn--primary[disabled] { opacity: .7; }

.brand--ink { color: var(--ink); }

/* ===================================================================
   LOGIN
   =================================================================== */
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login__brand {
  background: var(--ink-bg); color: var(--on-dark);
  padding: 44px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.login__brand::after {
  content: ""; position: absolute; right: -160px; top: -120px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(17,112,92,0.45), transparent 70%); pointer-events: none;
}
.login__brand .brand { color: var(--on-dark); font-size: 21px; gap: 11px; }
.login__brand-mid { margin-top: auto; position: relative; z-index: 1; }
.login__brand-mid h1 { font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 3vw, 2.8rem); color: var(--on-dark); margin: 18px 0 0; max-width: 15ch; line-height: 1.08; }
.login__brand-mid p { color: var(--on-dark-soft); margin-top: 16px; max-width: 42ch; font-size: 16px; }
.login__curve { margin: 26px 0; background: rgba(255,255,255,0.04); border: 1px solid var(--line-dark); border-radius: var(--r-lg); padding: 16px; position: relative; z-index: 1; }
.login__brand-foot { display: flex; gap: 22px; flex-wrap: wrap; position: relative; z-index: 1; }
.login__brand-foot span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--on-dark-soft); }
.login__brand-foot svg { color: #5FC2A6; }

.login__form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--paper); }
.login__form { width: 100%; max-width: 380px; }
.login__form-logo { display: none; gap: 10px; align-items: center; font-family: var(--display); font-weight: 600; font-size: 19px; margin-bottom: 24px; }
.login__form h2 { font-family: var(--display); font-size: 2rem; }
.login__sub { color: var(--ink-soft); margin-top: 6px; font-size: 15px; }

.role-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin: 26px 0 20px; }
.role-toggle__btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border: none; background: transparent; border-radius: 10px; font-family: var(--sans); font-weight: 600; font-size: 14.5px; color: var(--ink-soft); transition: all .15s; }
.role-toggle__btn.on { background: var(--card); color: var(--teal-deep); box-shadow: var(--shadow-sm); }

.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field input { width: 100%; padding: 13px 15px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card); font-family: var(--sans); font-size: 15px; color: var(--ink); }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.field__pw { position: relative; }
.field__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); padding: 8px; }

.login__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 13.5px; }
.login__row a { color: var(--teal); font-weight: 500; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); cursor: pointer; }
.checkbox input { accent-color: var(--teal); width: 15px; height: 15px; }

.demo-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 20px; padding: 13px 14px; background: var(--teal-soft); border-radius: 11px; font-size: 12.5px; color: var(--teal-deep); line-height: 1.45; }
.demo-note svg { flex: none; margin-top: 1px; }
.login__back { display: inline-block; margin-top: 22px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.login__back:hover { color: var(--ink); }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__brand { display: none; }
  .login__form-logo { display: flex; }
}

/* ===================================================================
   PHONE FRAME + PATIENT APP
   =================================================================== */
.stage--patient { min-height: 100vh; background: var(--paper); }
.phone-stage { display: flex; align-items: center; justify-content: center; }
.phone-lg { width: 390px; height: min(838px, 92vh); background: #0a120f; border-radius: 46px; padding: 11px;
  box-shadow: 0 40px 90px rgba(20,32,28,0.32), 0 12px 30px rgba(20,32,28,0.2), inset 0 0 0 2px rgba(255,255,255,0.05); position: relative; flex: none; }
.phone-lg__notch { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 116px; height: 28px; background: #0a120f; border-radius: 16px; z-index: 20; }
.phone-lg__screen { background: var(--paper); border-radius: 36px; height: 100%; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone-lg__status { display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 4px; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); flex: none; }
.phone-lg__status-r { display: flex; align-items: center; gap: 6px; }

/* ----- responsive app shell ----- */
.ptweb { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.pt-topbar { display: none; position: sticky; top: 0; z-index: 40; background: rgba(245,242,236,0.9); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
.pt-topbar__in { max-width: 1120px; margin: 0 auto; height: 66px; display: flex; align-items: center; gap: 18px; padding: 0 28px; }
.pt-topbar .brand { font-family: var(--display); font-weight: 600; font-size: 19px; gap: 10px; }
.pt-topbar__nav { display: flex; gap: 4px; margin-left: 14px; }
.pt-topbar__link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: none; background: none; font-family: var(--sans); font-weight: 600; font-size: 14.5px; color: var(--ink-soft); transition: all .15s; }
.pt-topbar__link:hover { color: var(--ink); background: rgba(27,32,30,0.04); }
.pt-topbar__link.on { color: var(--teal-deep); background: var(--teal-soft); }
.pt-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pt-iconbtn { position: relative; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; }
.pt-iconbtn i { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; background: var(--coral); border-radius: 50%; border: 1.5px solid var(--card); }
.pt-avatar { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--teal); color: #fff; font-family: var(--display); font-weight: 600; font-size: 15px; cursor: pointer; }

.pt-viewport { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.pt-statusbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px 4px; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); flex: none; }
.pt-statusbar__r { display: flex; align-items: center; gap: 6px; }
.pt-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.pt-scroll::-webkit-scrollbar { width: 0; }

.scr { padding: 8px 20px 0; }
.scr__head { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px 0 18px; }
.scr__hello { font-family: var(--display); font-size: 24px; font-weight: 500; color: var(--ink); }
.scr__date { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.scr__bell { position: relative; background: var(--card); border: 1px solid var(--line); width: 42px; height: 42px; border-radius: 12px; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; }
.scr__bell i { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; background: var(--coral); border-radius: 50%; border: 1.5px solid var(--card); }
.scr__back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--ink-soft); font-family: var(--sans); font-weight: 600; font-size: 14px; padding: 10px 0; }

.today-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); cursor: pointer; transition: transform .15s; }
.today-card:active { transform: scale(0.99); }
.today-card--cta { background: var(--ink-bg); color: var(--on-dark); }
.today-card--done { background: var(--teal-soft); border: 1px solid #BfDfD2; }
.today-card__pulse { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.today-card--cta .today-card__pulse { color: #F0A58E; }
.today-card__pulse--ok { background: var(--teal); color: #fff; }
.today-card__body { flex: 1; }
.today-card__body b { font-size: 15.5px; display: block; }
.today-card--cta .today-card__body b { color: #fff; }
.today-card--done .today-card__body b { color: var(--teal-deep); }
.today-card__body p { font-size: 13px; margin-top: 2px; }
.today-card--cta .today-card__body p { color: var(--on-dark-soft); }
.today-card--done .today-card__body p { color: #3C7A66; }
.today-card--cta > svg { color: var(--on-dark-soft); }

.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 16px 0; }
.stat-mini { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; text-align: center; }
.stat-mini__v { font-family: var(--display); font-size: 26px; font-weight: 500; color: var(--ink); display: block; line-height: 1; }
.stat-mini__v small { font-size: 14px; }
.stat-mini__k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-top: 5px; display: block; }

.snap-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer; }
.snap-card__head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.snap-spark { margin: 10px 0 6px; display: flex; justify-content: center; }
.snap-spark svg { width: 100%; height: auto; }
.snap-card__note { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }

.appt-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-top: 14px; }
.appt-card__date { width: 50px; height: 50px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.appt-card__date span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; color: var(--coral); }
.appt-card__date b { font-family: var(--display); font-size: 20px; line-height: 1; }
.appt-card__body b { font-size: 14.5px; }
.appt-card__body p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.section-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 12px; }
.team-row { display: flex; flex-direction: column; gap: 9px; }
.team-chip { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; }
.team-chip__ic { width: 36px; height: 36px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.team-chip b { font-size: 14px; white-space: nowrap; }
.team-chip > div { min-width: 0; }
.team-chip p { font-size: 12px; color: var(--muted); }

/* bottom tabs */
.pt-tabs { display: flex; background: rgba(251,249,244,0.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 8px 14px; flex: none; }
.pt-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--muted); padding: 6px 0; }
.pt-tab span { font-size: 10.5px; font-weight: 600; }
.pt-tab.on { color: var(--teal); }

/* FAB */
.pt-fab { position: absolute; right: 18px; bottom: 84px; width: 56px; height: 56px; border-radius: 50%; background: var(--teal); color: #fff; border: none; box-shadow: 0 10px 24px rgba(17,112,92,0.4); display: flex; align-items: center; justify-content: center; z-index: 15; }
.pt-fab:active { transform: scale(0.95); }

/* check-in sheet */
.sheet-overlay { position: fixed; inset: 0; background: rgba(20,32,28,0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 60; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: 100%; background: var(--paper-2); border-radius: 28px 28px 36px 36px; padding: 12px 22px 24px; max-height: 92%; display: flex; flex-direction: column; box-shadow: 0 -20px 50px rgba(20,32,28,0.25); }
@keyframes slideUp { from { transform: translateY(100%); } }
.anim-ok .sheet { animation: slideUp .28s cubic-bezier(.2,.8,.2,1); }
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 4px auto 14px; }
.sheet__steps { display: flex; gap: 6px; margin-bottom: 18px; }
.sheet__steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .25s; }
.sheet__steps i.on { background: var(--teal); }
.sheet__pane { flex: 1; }
.sheet__pane h3 { font-family: var(--display); font-size: 23px; font-weight: 500; }
.sheet__hint { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.bm-selected { text-align: center; font-family: var(--mono); font-size: 13px; color: var(--teal-deep); margin-top: 6px; font-weight: 500; }
.bm--lg { width: 150px; height: auto; }
.big-score { font-family: var(--display); font-size: 64px; font-weight: 500; text-align: center; margin: 18px 0 6px; line-height: 1; }
.big-score small { font-size: 22px; color: var(--muted); }
.func-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 18px; }
.func-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border: 1.5px solid var(--line-2); background: var(--card); border-radius: 14px; color: var(--ink-soft); transition: all .15s; }
.func-tile span { font-size: 12px; font-weight: 600; }
.func-tile.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); }
.confirm-list { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.confirm-row { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.confirm-row:last-child { border-bottom: none; }
.confirm-row span { font-size: 14px; }
.confirm-row b { margin-left: auto; font-size: 14.5px; color: var(--ink); }
.sheet__actions { display: flex; gap: 10px; margin-top: 22px; }

/* timeline */
.tl-chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 12px; }
.tl-chart svg { width: 100%; height: auto; }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.tl-legend span { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.phase-list { display: flex; flex-direction: column; }
.phase-item { display: flex; gap: 14px; }
.phase-item__rail { display: flex; flex-direction: column; align-items: center; }
.phase-item__dot { width: 13px; height: 13px; border-radius: 50%; margin-top: 4px; flex: none; box-shadow: 0 0 0 4px var(--paper); }
.phase-item:not(:last-child) .phase-item__rail::after { content: ""; flex: 1; width: 2px; background: var(--line); margin: 4px 0; }
.phase-item__body { padding-bottom: 18px; flex: 1; }
.phase-item__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.phase-item__top b { font-size: 15px; min-width: 0; }
.phase-item__top span { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: none; white-space: nowrap; }
.phase-item__body p { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }

.ci-list { display: flex; flex-direction: column; gap: 8px; }
.ci-item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; }
.ci-item__score { width: 32px; height: 32px; border-radius: 9px; color: #fff; font-family: var(--mono); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.ci-item b { font-size: 13.5px; }
.ci-item p { font-size: 11.5px; color: var(--muted); }

/* learn */
.podcast-mini { display: flex; align-items: center; gap: 13px; background: var(--ink-bg); color: var(--on-dark); border-radius: var(--r-lg); padding: 14px; margin-bottom: 18px; }
.podcast-mini__cover { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--teal), var(--teal-deep)); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.podcast-mini .eyebrow { color: var(--on-dark-soft); }
.podcast-mini b { font-size: 14px; color: #fff; display: block; margin: 2px 0; }
.podcast-mini p { font-family: var(--mono); font-size: 11px; color: var(--on-dark-soft); }
.learn-list { display: flex; flex-direction: column; gap: 12px; }
.learn-card { display: block; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; padding: 0; }
.learn-card__thumb { height: 92px; display: flex; align-items: flex-end; padding: 12px; }
.learn-card__thumb .tag, .article-hero .tag, .clin-edu-card__thumb .tag { font-family: var(--mono); font-size: 10.5px; background: rgba(255,255,255,0.85); padding: 4px 10px; border-radius: 999px; color: var(--ink); }
.learn-card__b { padding: 14px 16px 16px; }
.learn-card__b b { font-family: var(--display); font-size: 17px; font-weight: 500; }
.learn-card__b p { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.learn-card__meta { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 12px; }

.article-hero { height: 150px; border-radius: var(--r-lg); display: flex; align-items: flex-end; padding: 14px; }
.article-title { font-family: var(--display); font-size: 26px; font-weight: 500; margin-top: 18px; line-height: 1.12; }
.article-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.article-body { font-size: 15px; color: var(--ink-soft); line-height: 1.62; margin-top: 16px; }
.article-cta { display: flex; gap: 10px; align-items: flex-start; background: var(--teal-soft); border-radius: var(--r-md); padding: 14px; margin-top: 18px; font-size: 13px; color: var(--teal-deep); line-height: 1.45; }
.article-cta svg { flex: none; margin-top: 1px; }

/* profile */
.profile-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.profile-card__avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--teal); color: #fff; font-family: var(--display); font-size: 20px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.profile-card b { font-size: 17px; font-family: var(--display); }
.profile-card p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.profile-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; text-align: center; }
.profile-stats b { font-family: var(--display); font-size: 21px; display: block; }
.profile-stats span { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px; text-align: left; }
.menu-item__ic { width: 36px; height: 36px; border-radius: 10px; background: var(--paper-2); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.menu-item__txt { flex: 1; }
.menu-item__txt b { font-size: 14px; }
.menu-item__txt p { font-size: 12px; color: var(--muted); }
.logout-btn { margin-top: 18px; }
.profile-disc { font-size: 11px; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.5; }

/* ----- patient app: web / desktop layout ----- */
@media (min-width: 860px) {
  .ptweb { display: block; }
  .pt-topbar { display: block; }
  .pt-statusbar, .pt-tabs, .pt-fab, .scr__bell, .tab-spacer { display: none; }
  .pt-viewport { display: block; }
  .pt-scroll { overflow: visible; }

  .scr { max-width: 1120px; margin: 0 auto; padding: 36px 28px 64px; }
  .scr--narrow { max-width: 720px; }
  .scr__head { padding: 4px 0 24px; }
  .scr__hello { font-size: 30px; }

  .home-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 28px; align-items: start; }
  .home-main > :first-child { margin-top: 0; }
  .snap-spark svg { height: 84px; }

  .tl-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 32px; align-items: start; }
  .tl-col { min-width: 0; }
  .tl-chart svg { height: auto; }

  .learn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; align-items: start; }
  .podcast-mini { max-width: 620px; }
  .article-hero { height: 200px; }

  .sheet-overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 460px; border-radius: 26px; max-height: 86vh; box-shadow: var(--shadow-lg); }
  .sheet__grab { display: none; }
  .sheet__pane h3 { font-size: 25px; }
}

/* ===================================================================
   CLINICIAN
   =================================================================== */
.clin { display: flex; height: 100vh; background: var(--paper); }
.clin__side { width: 244px; flex: none; background: var(--ink-bg); color: var(--on-dark); display: flex; flex-direction: column; padding: 22px 16px; }
.clin__brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 19px; color: #fff; padding: 4px 8px 22px; }
.clin__nav { display: flex; flex-direction: column; gap: 4px; }
.clin__nav-btn { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; background: none; border: none; color: var(--on-dark-soft); font-family: var(--sans); font-weight: 500; font-size: 14.5px; text-align: left; transition: all .15s; }
.clin__nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--on-dark); }
.clin__nav-btn.on { background: rgba(17,112,92,0.28); color: #fff; }
.clin__side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-dark); }
.clin__me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.clin__me-av { width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: #fff; font-family: var(--display); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.clin__me > div { min-width: 0; }
.clin__me b { font-size: 13.5px; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clin__me p { font-size: 11.5px; color: var(--on-dark-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clin__logout { background: rgba(255,255,255,0.06); border: none; color: var(--on-dark-soft); width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.clin__logout:hover { color: #fff; background: rgba(255,255,255,0.12); }

.clin__main { flex: 1; overflow-y: auto; padding: 30px 36px; }
.clin__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 20px; }
.clin__head h1 { font-family: var(--display); font-size: 30px; font-weight: 500; }
.clin__head p { color: var(--ink-soft); margin-top: 5px; font-size: 14.5px; }
.clin__search { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; color: var(--muted); }
.clin__search input { border: none; background: none; outline: none; font-family: var(--sans); font-size: 14px; width: 180px; color: var(--ink); }

.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; position: relative; }
.kpi__ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.kpi--ink .kpi__ic { background: var(--paper-2); color: var(--ink-soft); }
.kpi--good .kpi__ic { background: var(--teal-soft); color: var(--teal-deep); }
.kpi--watch .kpi__ic { background: var(--amber-soft); color: #8a5e16; }
.kpi--flag .kpi__ic { background: var(--coral-soft); color: #a23c22; }
.kpi__v { font-family: var(--display); font-size: 32px; font-weight: 500; line-height: 1; }
.kpi__k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 7px; }

.case-split { display: grid; grid-template-columns: 1.45fr 1fr; gap: 20px; align-items: start; }
.case-list-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.case-filters { display: flex; gap: 8px; padding: 16px 16px 12px; flex-wrap: wrap; }
.case-filter { font-family: var(--sans); font-size: 13px; font-weight: 500; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; }
.case-filter i { font-family: var(--mono); font-style: normal; font-size: 11px; background: var(--paper-2); border-radius: 999px; padding: 1px 7px; color: var(--muted); }
.case-filter.on { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.case-filter.on i { background: rgba(255,255,255,0.15); color: #fff; }

.case-table { width: 100%; border-collapse: collapse; }
.case-table th { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 16px; font-weight: 500; border-bottom: 1px solid var(--line); }
.case-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.case-table tr { cursor: pointer; transition: background .12s; }
.case-table tbody tr:hover { background: var(--paper-2); }
.case-table tr.sel { background: var(--teal-soft); }
.case-table tr:last-child td { border-bottom: none; }
.ct-name { font-weight: 600; }
.ct-cond { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 1px; }
.adh { display: flex; align-items: center; gap: 8px; }
.adh__bar { width: 54px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.adh__bar i { display: block; height: 100%; border-radius: 3px; }
.adh span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }

/* patient detail panel */
.detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; position: sticky; top: 0; }
.detail__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail__id { display: flex; gap: 13px; }
.detail__av { width: 46px; height: 46px; border-radius: 50%; color: #fff; font-family: var(--display); font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; flex: none; }
.detail__id h3 { font-family: var(--display); font-size: 19px; font-weight: 500; }
.detail__id p { font-size: 12.5px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.detail__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.detail__meta b { font-size: 14px; display: block; margin-top: 3px; }
.detail__meta p { font-size: 12px; color: var(--muted); }
.detail__chart { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.detail__chart svg { width: 100%; height: auto; }
.previsit { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; margin-top: 16px; }
.previsit__head { display: flex; align-items: center; justify-content: space-between; }
.ai-chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--teal); background: var(--teal-soft); padding: 3px 8px; border-radius: 999px; }
.previsit p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin-top: 11px; }
.previsit__actions { display: flex; gap: 8px; margin-top: 14px; }
.detail__flags { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.detail__flags .eyebrow { margin-bottom: 4px; }
.flag-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-md); font-size: 13px; line-height: 1.4; }
.flag-row svg { flex: none; margin-top: 1px; }
.flag-row--good { background: var(--teal-soft); color: var(--teal-deep); }
.flag-row--watch { background: var(--amber-soft); color: #8a5e16; }
.flag-row--flag { background: var(--coral-soft); color: #a23c22; }

/* insights */
.insight-cards { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.ins-card--feature { background: var(--ink-bg); color: var(--on-dark); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; }
.ins-flag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--amber); border: 1px solid rgba(197,138,46,0.4); background: rgba(197,138,46,0.1); padding: 6px 12px; border-radius: 999px; align-self: flex-start; }
.ins-card--feature h3 { font-family: var(--display); font-size: 22px; font-weight: 500; color: #fff; margin-top: 18px; max-width: 22ch; }
.ins-card--feature p { color: var(--on-dark-soft); margin-top: 12px; font-size: 14.5px; }
.corr-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: auto; padding-top: 24px; }
.corr-mini .eyebrow { color: var(--on-dark-soft); }
.corr-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-top: 10px; }
.corr-bars i { flex: 1; border-radius: 3px 3px 0 0; display: block; }
.ins-stack { display: flex; flex-direction: column; gap: 14px; }
.ins-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.ins-stat b { font-family: var(--display); font-size: 30px; font-weight: 500; display: block; margin-top: 6px; }
.ins-stat b small { font-size: 15px; color: var(--ink-soft); }
.ins-stat p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ins-note { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding: 14px 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13px; color: var(--ink-soft); }
.ins-note svg { color: var(--teal); flex: none; }

/* schedule */
.sched-list { display: flex; flex-direction: column; gap: 10px; }
.sched-row { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; text-align: left; }
.sched-row:hover { border-color: var(--line-2); background: var(--paper-2); }
.sched-time { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink); width: 52px; flex: none; }
.sched-line { width: 2px; align-self: stretch; background: var(--line); flex: none; }
.sched-body { flex: 1; }
.sched-body b { font-size: 15px; }
.sched-body p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sched-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; padding: 5px 11px; border-radius: 999px; }
.sched-tag--ready { background: var(--teal-soft); color: var(--teal-deep); }
.sched-tag--review { background: var(--amber-soft); color: #8a5e16; }

/* clinician education */
.clin-edu-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.clin-edu-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.clin-edu-card__thumb { height: 120px; display: flex; align-items: flex-end; padding: 14px; }
.clin-edu-card__b { padding: 18px; }
.clin-edu-card__b b { font-family: var(--display); font-size: 18px; font-weight: 500; }
.clin-edu-card__b p { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.clin-edu-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.clin-edu-card__foot span { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* demo switch */
.demo-switch { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.demo-switch__fab { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--paper-2); border: none; border-radius: 999px; padding: 11px 16px; font-family: var(--sans); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); }
.demo-switch__menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.demo-switch__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 6px 10px; }
.demo-switch__menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; background: none; border-radius: 9px; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink-soft); text-align: left; }
.demo-switch__menu button:hover { background: var(--paper-2); }
.demo-switch__menu button.on { color: var(--teal-deep); background: var(--teal-soft); }

@media (max-width: 1080px) {
  .case-split { grid-template-columns: 1fr; }
  .detail { position: static; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .insight-cards { grid-template-columns: 1fr; }
  .clin-edu-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .clin__side { display: none; }
  .clin__main { padding: 20px; }
  .clin-edu-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   PATIENT FEATURES — questionnaire, sub-screens, records, report
   =================================================================== */

/* assigned questionnaire card (Home) */
.quest-card { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, box-shadow .15s; margin-bottom: 14px; }
.quest-card:hover { box-shadow: var(--shadow-sm); }
.quest-card:active { transform: scale(0.99); }
.quest-card__ic { width: 44px; height: 44px; border-radius: 13px; background: var(--amber-soft); color: #8a5e16; display: flex; align-items: center; justify-content: center; flex: none; }
.quest-card__ic--ok { background: var(--teal-soft); color: var(--teal-deep); }
.quest-card__b { flex: 1; min-width: 0; }
.quest-card__tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber); }
.quest-card--done .quest-card__tag { color: var(--teal); }
.quest-card__b b { display: block; font-size: 15px; margin-top: 2px; }
.quest-card__b p { font-size: 12.5px; color: var(--muted); }
.quest-card__go { font-family: var(--mono); font-size: 12px; color: var(--teal-deep); display: inline-flex; align-items: center; gap: 5px; flex: none; font-weight: 600; }

/* timeline explainer + log button */
.tl-explain { display: flex; gap: 12px; align-items: flex-start; background: var(--teal-soft); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; }
.tl-explain__ic { width: 34px; height: 34px; border-radius: 9px; background: var(--card); color: var(--teal-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.tl-explain p { font-size: 13px; color: var(--teal-deep); line-height: 1.52; }
.tl-explain b { font-weight: 700; }
.tl-add { flex: none; align-self: center; }

/* sub-screen overlay */
.subscreen-overlay { position: fixed; inset: 0; background: rgba(20,32,28,0.45); display: flex; align-items: stretch; justify-content: center; z-index: 70; }
.anim-ok .subscreen-overlay, .anim-ok .sheet-overlay { animation: fadeIn .2s ease; }
.subscreen { background: var(--paper); width: 100%; display: flex; flex-direction: column; max-height: 100%; }
.subscreen__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--paper-2); flex: none; }
.subscreen__bar b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.subscreen__back { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.subscreen__back:hover { color: var(--ink); }
.subscreen__body { padding: 20px; overflow-y: auto; flex: 1; }
.sub-lede { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 18px; }
@media (min-width: 860px) {
  .subscreen-overlay { align-items: center; padding: 24px; }
  .subscreen { max-width: 540px; border-radius: 24px; max-height: 90vh; box-shadow: var(--shadow-lg); overflow: hidden; }
}

/* toggles / reminders */
.toggle-list { display: flex; flex-direction: column; gap: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.toggle-row > div { min-width: 0; }
.toggle-row b { font-size: 14.5px; white-space: nowrap; }
.toggle-row p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.switch { width: 46px; height: 27px; border-radius: 999px; background: var(--line-2); border: none; position: relative; transition: background .18s; flex: none; cursor: pointer; }
.switch i { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-sm); }
.switch.on { background: var(--teal); }
.switch.on i { transform: translateX(19px); }

/* record cards (procedures / appts / meds) */
.rec-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.rec-card { display: flex; gap: 13px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.rec-card__ic { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.rec-card__date { width: 46px; height: 46px; border-radius: 11px; background: var(--paper-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.rec-card__date span { font-family: var(--mono); font-size: 9px; color: var(--coral); letter-spacing: 0.06em; }
.rec-card__date b { font-family: var(--display); font-size: 18px; line-height: 1; }
.rec-card__b { flex: 1; min-width: 0; }
.rec-card__b b { font-size: 14.5px; }
.rec-card__b p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rec-tag { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; padding: 3px 9px; border-radius: 999px; }
.rec-tag--good { background: var(--teal-soft); color: var(--teal-deep); }
.rec-tag--muted { background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); }

/* add form */
.addbox { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; margin-top: 6px; }
.ti { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card); font-family: var(--sans); font-size: 14.5px; color: var(--ink); margin-bottom: 10px; }
.ti:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.addbox__row { display: flex; gap: 10px; margin-top: 4px; }
.ta { width: 100%; min-height: 78px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--card); font-family: var(--sans); font-size: 14.5px; color: var(--ink); resize: vertical; }
.ta:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }

/* selectable chips (rich record) */
.chip-group { margin-bottom: 18px; }
.chip-group__label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sel-chip { font-family: var(--sans); font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink-soft); transition: all .14s; }
.sel-chip.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); }

/* privacy */
.priv-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.priv-item { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.priv-item__ic { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.priv-item b { font-size: 14px; }
.priv-item p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.danger { color: #a23c22; border-color: var(--coral-soft) !important; }
.danger:hover { background: var(--coral-soft); }
.subscreen__body .btn--block + .btn--block { margin-top: 10px; }

/* flash confirmation */
.flash { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 11px 14px; background: var(--teal-soft); color: var(--teal-deep); border-radius: 11px; font-size: 13px; font-weight: 500; }

/* questionnaire */
.qz-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.qz-progress { height: 5px; border-radius: 3px; background: var(--line); margin: 10px 0 22px; overflow: hidden; }
.qz-progress i { display: block; height: 100%; background: var(--teal); border-radius: 3px; transition: width .3s; }
.qz-q { font-family: var(--display); font-size: 22px; font-weight: 500; line-height: 1.2; text-align: center; }
.qz-done { text-align: center; }
.qz-score { font-family: var(--display); font-size: 64px; font-weight: 500; line-height: 1; margin-top: 6px; }
.qz-score small { font-size: 22px; color: var(--muted); }
.qz-band { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; margin-top: 4px; }
.qz-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.qz-breakdown div { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; }
.qz-breakdown span { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: block; }
.qz-breakdown b { font-family: var(--display); font-size: 24px; }

/* report */
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.report__hd { display: flex; align-items: flex-start; justify-content: space-between; }
.report__hd b { font-family: var(--display); font-size: 17px; }
.report__hd p { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.report__chart { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; margin: 14px 0; }
.report__chart svg { width: 100%; height: auto; }
.report__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.report__stats div { text-align: center; }
.report__stats span { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; color: var(--muted); display: block; }
.report__stats b { font-family: var(--display); font-size: 18px; }
.report__summary { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }

/* enriched check-in sheet */
.sheet--tall { max-height: 90%; }
.sheet__pane--scroll { overflow-y: auto; }
.confirm-row b { max-width: 58%; text-align: right; }

/* ---------------- Brand lockup (raster logo) ---------------- */
/* The full PainTrack lockup already contains the wordmark, so brand
   containers that used to add a separate text node now just hold the image. */
.pt-logo { width: auto; max-width: 100%; flex: none; -webkit-user-drag: none; user-select: none; }
.brand .pt-logo,
.clin__brand .pt-logo { display: block; }
/* On dark surfaces (login hero panel, clinician sidebar) lift the colourful
   lockup off the background with a soft shadow so edges stay crisp. */
.pt-logo--on-dark { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)); }
/* keep compact nav lockups from overflowing on narrow phones */
.pt-topbar .pt-logo { max-width: 46vw; }
