/* ==========================================================================
   Healveda Care demo app: the hands-on end of "A week with Healveda Care".
   Adapted from demo variant F (site/demo/laptop/). This page holds only the
   app; the story page shows it in a browser frame, scaled from a desktop
   width, and lets it fill the window for full screen. The app lays itself
   out for its real width with container queries, down to a phone's.
   Tokens are the web app's Version C (healveda-care/web/src/app/globals.css).
   ========================================================================== */

@font-face { font-family: "Jakarta"; font-weight: 200 800; font-display: swap; src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); }

:root {
  /* App tokens (Version C) */
  --ink-950: #141d22; --ink-900: #1f2a30; --ink-800: #2c4a4a; --ink-700: #2f6f6b; --ink-600: #367671;
  --ink-500: #4d8f8a; --ink-400: #86b4b0; --ink-300: #b4d1ce; --ink-200: #d2e3e1; --ink-100: #e4eeec; --ink-50: #f1f6f5;
  --lav-900: #3f2d6b; --lav-800: #563e98; --lav-700: #6f52b5; --lav-600: #7b5fc0; --lav-500: #9b7fc7; --lav-400: #b9a3d9;
  --lav-300: #d5c9ec; --lav-200: #e7e1f3; --lav-150: #ebe5f6; --lav-100: #efebf8; --lav-50: #f8f6fd;
  --sky-800: #264f6a; --sky-700: #2f5f7f; --sky-600: #3f7398; --sky-500: #5c8db0; --sky-300: #b6d0e3; --sky-200: #d3e4f0; --sky-100: #e2eef6; --sky-50: #f1f7fb;
  --sun-700: #6b5400; --sun-200: #e9d27a; --sun-100: #fff3c4;
  --mauve-700: #8b4f76; --mauve-100: #f8ecf3;
  --paper: #f6f4fb; --paper-deep: #eeebf5; --surface: #fff;
  --line-soft: #eff0f2; --line: #e6e7ea; --line-strong: #d4d6db;
  --muted: #4b5a61; --subtle: #627077; --text: #1f2a30;
  --good-700: #23694d; --good-100: #e1f1e9; --good-50: #f0f8f4;
  --warn-700: #8a5a12; --warn-100: #fbefd9; --warn-50: #fdf7ec;
  --risk-700: #9b2f48; --risk-100: #f8e1e6;
  --info-700: #2e5b8a; --info-100: #e2ecf7;
  --radius-card: 1.5rem;
  --shadow-card: 0 1px 2px rgb(31 25 64 / .04), 0 10px 24px -10px rgb(31 25 64 / .1);
  --shadow-pop: 0 16px 40px -10px rgb(31 25 64 / .24);
  --app-font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --app-head: "Jakarta", "Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; -webkit-text-size-adjust: 100%; }
body { background: var(--paper); overflow: hidden; }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lav-700); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ==========================================================================
   The app (.hc). Everything below is scoped to it.
   ========================================================================== */
.hc {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  container-type: inline-size; container-name: hc;
  font-family: var(--app-font); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--paper); overflow: hidden;
}
/* This page holds only the app, so it fills the window (the story page sizes the frame). */
.hc { position: fixed; inset: 0; width: 100%; height: 100%; }
.hc h1, .hc h2, .hc h3, .hc h4 { font-family: var(--app-head); color: var(--ink-900); letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.hc p { margin: 0; text-wrap: pretty; }
/* Headings get focus when a screen opens (for screen readers); no ring for that. */
.hc h1[tabindex="-1"]:focus { outline: none; }
:where(.hc) :is(ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(.hc) button { background: none; border: 0; padding: 0; }
.hc :focus-visible { outline: 2.5px solid var(--lav-700); outline-offset: 2px; }
.hc ::selection { background: var(--lav-300); }

.shell { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.ribbon {
  display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 14px; min-height: 28px;
  background: var(--surface); color: var(--subtle); font-size: 12px; font-weight: 400; border-bottom: 1px solid var(--line-soft);
}
.ribbon .grow { flex: 1; min-width: 0; }
.ribbon button { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: 999px; font-weight: 500; color: var(--subtle); }
.ribbon button:hover { background: var(--ink-50); color: var(--ink-800); }
.ribbon svg { width: 13px; height: 13px; }
.ribbon b { font-weight: 500; }
.ribbon .long { display: none; }
@container hc (min-width: 640px) { .ribbon .long { display: inline; } .ribbon .short { display: none; } }

.body { display: grid; grid-template-columns: 1fr; min-height: 0; }
@container hc (min-width: 860px) { .body { grid-template-columns: 240px 1fr; } }

/* Sidebar */
.side { display: none; flex-direction: column; min-height: 0; background: var(--lav-100); border-right: 1px solid var(--lav-200); padding: 16px 12px 10px; }
@container hc (min-width: 860px) { .side { display: flex; } }
.drawer .side { display: flex; height: 100%; width: min(290px, 86%); box-shadow: var(--shadow-pop); }
.logo { display: inline-flex; align-items: center; gap: 9px; padding: 0 8px; font-family: var(--app-head); font-weight: 700; font-size: 18px; color: var(--ink-900); }
.logo svg { height: 28px; width: auto; }
.logo .care { font-weight: 500; opacity: .8; }
.namecard { margin: 12px 0 8px; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.namecard:hover { background: var(--lav-50); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-family: var(--app-head); font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--lav-600), var(--ink-700)); }
.namecard b { display: block; font-family: var(--app-head); font-size: 14.5px; color: var(--ink-900); }
.namecard small { display: block; font-size: 12px; color: var(--subtle); }
.nav { flex: 1; overflow-y: auto; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px; }
.nav h3 { margin: 10px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lav-700); }
.nav h3.t-treat { color: var(--ink-700); }
.nav h3.t-out { color: var(--sky-700); }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 10px; border-radius: 12px;
  font-family: var(--app-head); font-weight: 600; font-size: 14px; color: var(--ink-900); text-decoration: none; text-align: left;
}
.nav .nav-item:hover { background: rgb(255 255 255 / .65); }
.nav .nav-item[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink-800); }
.nav .nav-item svg { width: 18px; height: 18px; flex: none; color: var(--ink-700); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--lav-200); color: var(--lav-800); }
.side-foot { border-top: 1px solid var(--lav-200); margin: 8px -12px 0; padding: 8px 18px 0; font-size: 11.5px; line-height: 1.5; color: var(--subtle); }

/* Main column */
.main { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; position: relative; }
.top {
  height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: rgb(255 255 255 / .92); border-bottom: 1px solid var(--line); position: relative; z-index: 3;
}
@container hc (min-width: 860px) { .top { padding: 0 24px; } }
.top .menu, .top .logo-sm { display: inline-flex; }
@container hc (min-width: 860px) { .top .menu, .top .logo-sm { display: none; } }
.crumbs { display: none; flex: 1; min-width: 0; font-size: 13.5px; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--ink-900); font-family: var(--app-head); font-weight: 700; }
@container hc (min-width: 860px) { .crumbs { display: block; } .top .grow { display: none; } }
.top .grow { flex: 1; }
.icon-btn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--ink-900); }
.icon-btn:hover { background: var(--paper); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge-dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--lav-700); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.logo-sm svg { height: 26px; width: auto; }

.view { container: page / inline-size; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: thin; scroll-behavior: smooth; }
.page { max-width: 1120px; margin: 0 auto; padding: 22px 16px 40px; animation: fade-up .35s ease-out both; }
@container page (min-width: 700px) { .page { padding: 28px 32px 48px; } }

.tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding: 4px 4px max(4px, env(safe-area-inset-bottom)); }
@container hc (min-width: 860px) { .tabs { display: none; } }
.tabs button { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 2px; border-radius: 12px; font-family: var(--app-head); font-size: 11.5px; font-weight: 600; color: var(--subtle); }
.tabs button svg { width: 21px; height: 21px; }
.tabs button[aria-current="page"] { color: var(--ink-800); background: var(--ink-50); }

/* Drawer (phone-size menu) */
.drawer { position: absolute; inset: 0; z-index: 20; background: rgb(20 29 34 / .35); display: none; }
.drawer.open { display: block; }

/* Popover (notifications) */
.pop { position: absolute; right: 12px; top: 52px; z-index: 15; width: min(340px, calc(100% - 24px)); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); padding: 8px; }
.pop h2 { font-size: 14px; padding: 8px 10px 4px; }
.pop li button { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 12px; }
.pop li button:hover { background: var(--paper); }
.pop li b { display: block; font-family: var(--app-head); font-size: 14px; color: var(--ink-900); }
.pop li span { display: block; font-size: 13px; color: var(--muted); }
.pop li small { display: block; font-size: 12px; color: var(--subtle); margin-top: 2px; }

/* ---------- App primitives ---------- */
.eyebrow { font-family: var(--app-head); font-size: 12px; font-weight: 700; letter-spacing: .16em; line-height: 1.4; text-transform: uppercase; color: var(--lav-700); }
.h1 { font-family: var(--app-head); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin-top: 6px !important; }
@container page (min-width: 700px) { .h1 { font-size: 36px; } }
.lead { margin-top: 8px !important; font-size: 16px; color: var(--muted); max-width: 46em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.tile { background: var(--paper); border-radius: 16px; }
.pad { padding: 18px; }
@container page (min-width: 700px) { .pad { padding: 22px 24px; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 18px;
  border-radius: 999px; font-family: var(--app-head); font-weight: 700; font-size: 14.5px; white-space: nowrap;
  background: var(--ink-800) !important; color: #fff; box-shadow: 0 8px 18px -8px rgb(44 74 74 / .55); transition: background .15s;
}
.btn:hover { background: var(--ink-900) !important; }
.btn svg { width: 16px; height: 16px; }
.btn.sec { background: var(--surface) !important; color: var(--ink-900); border: 1px solid var(--line-strong) !important; box-shadow: none; }
.btn.sec:hover { background: var(--paper) !important; }
.btn.ghost { background: transparent !important; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--paper) !important; color: var(--ink-900); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn.on { background: var(--lav-100) !important; color: var(--lav-900); border-color: var(--lav-300) !important; }
.btn.light { background: #fff !important; color: var(--ink-900); box-shadow: none; }
.btn.light:hover { background: var(--ink-50) !important; }
.link { color: var(--ink-700); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; border-radius: 6px; }
.link:hover { text-decoration: underline; }
.link svg { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-family: var(--app-head); font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; background: var(--paper-deep); color: var(--muted); }
.badge.lav { background: var(--lav-100); color: var(--lav-800); }
.badge.ink { background: var(--ink-100); color: var(--ink-800); }
.badge.sky { background: var(--sky-100); color: var(--sky-800); }
.badge.warn { background: var(--warn-100); color: var(--warn-700); }
.badge.good { background: var(--good-100); color: var(--good-700); }
.badge.mauve { background: var(--mauve-100); color: var(--mauve-700); }
.badge.sun { background: var(--sun-100); color: var(--sun-700); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge svg { width: 12px; height: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.why { font-size: 13px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 4px !important; } .mt-2 { margin-top: 8px !important; } .mt-3 { margin-top: 12px !important; } .mt-4 { margin-top: 16px !important; } .mt-5 { margin-top: 22px !important; } .mt-6 { margin-top: 30px !important; }
.stack > * + * { margin-top: 14px; }
.grid2 { display: grid; gap: 14px; }
@container page (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-h h2 { font-size: 19px; font-weight: 800; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--info-100); color: var(--info-700); font-size: 14px; line-height: 1.5; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note.lav { background: var(--lav-50); color: var(--lav-900); box-shadow: inset 0 0 0 1px var(--lav-200); }
.note.warn { background: var(--warn-50); color: var(--warn-700); box-shadow: inset 0 0 0 1px var(--warn-100); }
.note.plain { background: var(--paper); color: var(--muted); }
.field { display: grid; gap: 6px; }
.field label, .field .lbl { font-family: var(--app-head); font-weight: 700; font-size: 14.5px; color: var(--ink-900); }
.input, .textarea { width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 10px 12px; font-size: 15px; line-height: 1.45; }
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .textarea:focus { outline: 2.5px solid var(--lav-700); outline-offset: 1px; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-family: var(--app-head); font-weight: 600; font-size: 14px; cursor: pointer; }
.choice:has(input:checked) { background: var(--lav-100); border-color: var(--lav-400); color: var(--lav-900); }
.choice:has(input:focus-visible) { outline: 2.5px solid var(--lav-700); outline-offset: 2px; }
.choice input { accent-color: var(--lav-700); }

/* Toast */
.toast { position: absolute; left: 50%; bottom: 76px; translate: -50% 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 999px; background: var(--ink-900); color: #fff; font-size: 14px; box-shadow: var(--shadow-pop); max-width: calc(100% - 24px); animation: fade-up .25s ease-out both; }
@container hc (min-width: 860px) { .toast { bottom: 24px; } }
.toast button { color: var(--ink-200); font-weight: 700; min-height: 30px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.toast button:hover { background: rgb(255 255 255 / .1); }
.toast svg { width: 14px; height: 14px; }

/* Highlight from "Things to try" */
.spot { animation: spot 1.6s ease-out 2; border-radius: 18px; }
@keyframes spot { 0% { box-shadow: 0 0 0 0 rgb(111 82 181 / .55); } 100% { box-shadow: 0 0 0 16px rgb(111 82 181 / 0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---------- Home ---------- */
.brief { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; font-size: 15.5px; color: var(--muted); }
.brief b { color: var(--ink-900); font-weight: 600; }
.brief .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--lav-400); }
.conds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.conds > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--app-head); font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
button.chip:hover { background: var(--lav-50); }
.today { margin-top: 22px; padding: 10px; border-radius: 28px; background: var(--lav-150); display: grid; gap: 10px; align-items: start; }
@container page (min-width: 600px) { .today { grid-template-columns: 1fr 1fr; } .today > :last-child { grid-column: 1 / -1; } }
@container page (min-width: 900px) { .today { grid-template-columns: .9fr 1.2fr 1fr; padding: 12px; gap: 12px; } .today > :last-child { grid-column: auto; } }
.checkin { border-radius: var(--radius-card); padding: 18px; background: var(--ink-800); color: var(--ink-50); display: flex; flex-direction: column; }
.checkin.done { background: var(--good-50); color: var(--text); box-shadow: inset 0 0 0 1px var(--good-100); }
.checkin .day { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-content: center; text-align: center; background: rgb(255 255 255 / .1); }
.checkin.done .day { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.checkin .day small { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-200); }
.checkin.done .day small { color: var(--good-700); }
.checkin .day b { font-family: var(--app-head); font-weight: 800; font-size: 20px; line-height: 1; color: #fff; }
.checkin.done .day svg { width: 20px; height: 20px; color: var(--good-700); margin: 0 auto; }
.checkin h2 { color: #fff; font-size: 18px; font-weight: 700; }
.checkin.done h2 { color: var(--ink-900); }
.checkin p { font-size: 14.5px; color: var(--ink-200); }
.checkin.done p { color: var(--muted); }
.checkin .foot { margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--ink-300); }
.checkin.done .foot { color: var(--muted); }
.checkin .btn { width: 100%; margin-top: 14px; }
.map { padding: 14px 12px; }
.map-h { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.map-h h2 { font-size: 17px; font-weight: 700; }
.map li { display: flex; align-items: flex-start; gap: 2px; padding: 6px 0; }
.map li + li { border-top: 1px solid var(--line-soft); }
.circle-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; }
.circle-btn .ring { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); transition: border-color .15s, background .15s; }
.circle-btn:hover .ring { border-color: var(--ink-700); background: var(--paper); }
.circle-btn svg { width: 19px; height: 19px; color: var(--muted); }
.circle-btn:hover { background: var(--paper); }
.map .item { flex: 1; min-width: 0; padding: 7px 4px; border-radius: 12px; text-align: left; }
.map .item:hover { background: var(--paper); }
.map .item b { display: block; font-family: var(--app-head); font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--ink-900); }
.map .item .when { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-top: 1px; }
.map .item .why { display: block; margin-top: 2px; }
.map .undo-list { padding: 6px 8px 0; font-size: 13.5px; color: var(--muted); }
.map .undo-list li { border: 0; padding: 0; align-items: center; gap: 8px; }
.map .undo-list svg { width: 15px; height: 15px; }
.map .foot { padding: 6px 8px 0; font-size: 12.5px; color: var(--subtle); }
.ew { padding: 18px; display: flex; flex-direction: column; }
.ew .sentence { margin-top: 6px !important; font-family: var(--app-head); font-weight: 600; font-size: 15.5px; line-height: 1.35; color: var(--ink-900); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; height: 52px; margin-top: 14px; }
.bars li { display: flex; align-items: flex-end; height: 100%; }
.bars span { width: 100%; }
.bars span { display: block; border-radius: 3px; }
.bars .gap { height: 8px; border: 1px dashed var(--line-strong); }
.bars .zero { height: 8px; background: var(--sky-200); }
.bars .off { background: var(--sky-500); }
.bars .off3 { background: var(--sky-700); }
.bars .today-bar { outline: 2px solid var(--sun-700); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--subtle); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.ew .notice { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.ew .acts { margin-top: auto; padding-top: 12px; }
.exp { display: grid; gap: 12px; margin-top: 22px; }
@container page (min-width: 740px) { .exp { grid-template-columns: repeat(3, 1fr); } }
.xcard { padding: 18px; display: flex; flex-direction: column; border-top: 4px solid var(--lav-500); }
.xcard.treat { border-top-color: var(--ink-600); }
.xcard.out { border-top-color: var(--sky-600); }
.xcard h2 { font-size: 17px; font-weight: 800; }
.xcard .q { font-size: 13.5px; color: var(--muted); margin-top: 3px !important; }
.xcard ul { margin-top: 10px; }
.xcard li button { display: block; width: 100%; text-align: left; padding: 8px 10px; margin: 0 -10px; width: calc(100% + 20px); border-radius: 12px; }
.xcard li button:hover { background: var(--paper); }
.xcard li + li { border-top: 1px solid var(--line-soft); }
.xcard .k { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }
.xcard .t { display: block; font-family: var(--app-head); font-weight: 600; font-size: 14.5px; color: var(--ink-900); }
.xcard .d { display: block; font-size: 13px; color: var(--muted); }
.xcard .next { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--paper); font-size: 13.5px; color: var(--muted); }
.xcard .next b { color: var(--ink-900); }
.xcard .acts { margin-top: auto; padding-top: 12px; }
.coming { margin-top: 22px; }
.coming li { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.coming li + li { border-top: 1px solid var(--line-soft); }
.datebox { flex: none; width: 48px; text-align: center; border-radius: 14px; padding: 5px 0; background: var(--lav-50); box-shadow: inset 0 0 0 1px var(--lav-200); }
.datebox small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lav-700); }
.datebox b { display: block; font-family: var(--app-head); font-weight: 800; font-size: 18px; line-height: 1.1; color: var(--ink-900); }
.coming .t { font-family: var(--app-head); font-weight: 600; color: var(--ink-900); }
.coming .d { font-size: 13px; color: var(--muted); }
.coming .grow { flex: 1; min-width: 0; }

/* ---------- Check-in ---------- */
.area { padding: 14px 16px; }
.area + .area { border-top: 1px solid var(--line-soft); }
.area-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.area-h label { font-family: var(--app-head); font-weight: 700; font-size: 15.5px; color: var(--ink-900); }
.area-h output { font-family: var(--app-head); font-weight: 800; font-size: 20px; color: var(--ink-800); min-width: 2ch; text-align: right; }
.range { width: 100%; margin: 10px 0 2px; accent-color: var(--ink-700); height: 28px; }
.ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--subtle); }
.usual { font-size: 12.5px; color: var(--muted); margin-top: 2px !important; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--app-font); font-size: 11px; fill: var(--subtle); }
.chart .lbl-strong { font-family: var(--app-head); font-weight: 700; fill: var(--ink-900); font-size: 11.5px; }
.chart .mk text { fill: var(--lav-800); font-size: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 0; border-top: 2.5px solid var(--ink-700); }
.chart-legend i.dash { border-top: 2px dashed var(--lav-600); }
.chart-legend i.gap { border-top: 2px dotted var(--line-strong); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-deep); }
.seg button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-family: var(--app-head); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-card); }

/* ---------- Treatments ---------- */
.ep { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 16px 18px; }
.ep:hover { background: var(--ink-50); }
.ep .swatch { flex: none; width: 10px; align-self: stretch; border-radius: 99px; }
.ep h3 { font-size: 16.5px; font-weight: 700; }
.ep .meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.ep + .ep { border-top: 1px solid var(--line-soft); }
.quote { padding: 12px 14px; border-radius: 14px; background: var(--sun-100); color: var(--ink-900); font-size: 14.5px; }
.quote small { display: block; font-size: 12px; font-weight: 600; color: var(--sun-700); margin-bottom: 2px; }
.changes { padding: 12px 14px; border-radius: 14px; background: var(--lav-50); box-shadow: inset 0 0 0 1px var(--lav-200); }
.changes p.h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--lav-800); }
.changes svg { width: 16px; height: 16px; }
.changes li { font-size: 14px; margin-top: 4px; }
.changes li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 0; }
.timeline li + li { border-top: 1px solid var(--line-soft); }
.timeline .dt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline b { font-family: var(--app-head); font-weight: 600; font-size: 14.5px; color: var(--ink-900); }
.timeline .who { display: block; font-size: 12.5px; color: var(--subtle); }
.kv { display: grid; gap: 10px 18px; grid-template-columns: 1fr 1fr; font-size: 14px; }
.kv dt { color: var(--subtle); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; color: var(--ink-900); }

/* ---------- Labs ---------- */
.labs { width: 100%; border-collapse: collapse; font-size: 14px; }
.labs th { text-align: left; font-family: var(--app-head); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.labs td { padding: 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.labs .rowbtn { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 54px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; text-align: left; padding: 11px 10px; border-radius: 10px; }
.labs .rowbtn:hover { background: var(--paper); }
.labs .rowbtn b { font-family: var(--app-head); font-weight: 600; color: var(--ink-900); }
.labs .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.labs .ref { color: var(--muted); font-size: 13px; }
.labs .missing { color: var(--subtle); font-style: italic; }
.flag { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-family: var(--app-head); font-weight: 800; font-size: 12px; background: var(--warn-100); color: var(--warn-700); }
.trend { padding: 4px 10px 14px; }
.labs-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 54px minmax(0, 1fr); gap: 8px; padding: 8px 20px; font-family: var(--app-head); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); border-bottom: 1px solid var(--line); }

/* ---------- Modality deck ---------- */
.deck-wrap { display: grid; gap: 20px; margin-top: 18px; }
@container page (min-width: 900px) { .deck-wrap { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; } }
.mcard { padding: 20px; display: flex; flex-direction: column; min-height: 360px; animation: card-in .22s ease-out both; }
@container page (min-width: 700px) { .mcard { padding: 26px 30px 22px; } }
.mcard.back { animation-name: card-back; }
@keyframes card-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.mcard h2 { font-size: 26px; font-weight: 800; line-height: 1.15; margin-top: 6px !important; }
.mcard .intro-t { margin-top: 10px !important; font-size: 15.5px; line-height: 1.6; color: var(--text); }
.mcard .why-box { margin-top: 14px; padding: 12px 16px; }
.mcard .why-box h3 { font-size: 14px; font-weight: 700; }
.mcard .why-box li { display: flex; gap: 9px; font-size: 14.5px; color: var(--ink-800); margin-top: 4px; }
.mcard .why-box li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--lav-600); margin-top: 8px; }
.mcard .acts { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.idline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cardid { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--ink-800); background: var(--ink-50); box-shadow: inset 0 0 0 1px var(--ink-200); padding: 1px 7px; border-radius: 6px; }
.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.deck-nav .pos { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.dots i.on { background: var(--ink-700); width: 18px; border-radius: 99px; }
.aside-list li { display: flex; gap: 9px; font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 6px; }
.aside-list li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--lav-500); margin-top: 7px; }
.src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--subtle); }
.qlist li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 14.5px; }
.qlist li + li { border-top: 1px solid var(--line-soft); }
.qlist li p { flex: 1; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.compare th, .compare td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.compare thead th { font-family: var(--app-head); font-size: 15px; color: var(--ink-900); }
.compare tbody th { font-family: var(--app-head); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); width: 140px; }
.scroll-x { overflow-x: auto; }

/* ---------- Groups ---------- */
.post { padding: 16px 18px; }
.post + .post { border-top: 1px solid var(--line-soft); }
.post .who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; color: var(--muted); }
.post .who b { font-family: var(--app-head); font-weight: 700; color: var(--ink-900); font-size: 14px; }
.post .txt { margin-top: 6px !important; font-size: 15px; line-height: 1.6; }
.post .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.post.reply { margin-left: 18px; border-left: 3px solid var(--lav-200); padding-left: 16px; }
.mini-av { width: 26px; height: 26px; border-radius: 9px; display: inline-grid; place-items: center; font-family: var(--app-head); font-weight: 700; font-size: 11.5px; color: #fff; }

/* ---------- Lists (experts, sessions, saved) ---------- */
.list-card li { padding: 14px 18px; display: flex; gap: 14px; align-items: flex-start; }
.list-card li + li { border-top: 1px solid var(--line-soft); }
.list-card .grow { flex: 1; min-width: 0; }
.list-card h3 { font-size: 16px; font-weight: 700; }
.list-card .meta { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.list-card .side-act { flex: none; }
.big-av { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-family: var(--app-head); font-weight: 800; color: #fff; font-size: 16px; }
.empty { padding: 22px; text-align: center; color: var(--muted); font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Charts are drawn 640 units wide and scaled to fit; on a phone-width app, draw their text larger
   so it still reads at about 11px. */
@container hc (max-width: 560px) {
  .chart text { font-size: 21px; }
  .chart .lbl-strong { font-size: 22px; }
  .chart .mk circle { r: 15px; }
  .chart .mk text { font-size: 19px; dominant-baseline: middle; transform: translateY(-4px); transform-box: fill-box; }
}
