/* CareContinuum design system: a soft pastel health dashboard.
   Off-white ground, big rounded pastel tiles with mini charts, white circular
   icon badges, white list rows, Jost type, deep green for actions and a floating
   pill tab bar. Physical = blue, Mind = lavender, Social = sage green. */

@font-face { font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/jost-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/jost-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --page: #f3f3f1;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --fill: #e8e8e4;
  --line: #e2e2dd;
  --line-soft: #ececE8;
  --ink: #1e1f22;
  --muted: #62656a;
  --faint: #9a9da2;
  --dark: #1f2a24;
  --tile-blue: #dce8ee;
  --tile-lav: #e7dff1;
  --tile-sage: #dfe9d3;
  --tile-sand: #f5e8da;
  --brand: #2e5e46;
  --brand-h: #244a37;
  --brand-2: #2e5e46;
  --brand-ink: #ffffff;
  --brand-soft: #dfe9d3;
  --on-ink: #ffffff;
  --phys: #2d5a72;
  --phys-2: #8db3c7;
  --phys-bg: #dce8ee;
  --psych: #5b4686;
  --psych-2: #b6a2d6;
  --psych-bg: #e7dff1;
  --soc: #3e6234;
  --soc-bg: #dfe9d3;
  --danger: #b8261c;
  --danger-bg: #fbe4e1;
  --warn: #9a3d06;
  --warn-bg: #f5e8da;
  --ok: #2e5e46;
  --ok-bg: #dfe9d3;
  --band: rgba(62, 98, 52, .12);
  --radius: 20px;
  --frame: #fbfbfa;
  --scrim: rgba(20, 22, 24, .38);
  --shadow: 0 40px 80px rgba(40, 50, 45, .16), 0 0 0 1px rgba(0, 0, 0, .04);
  --shadow-sm: 0 6px 20px rgba(30, 40, 35, .08);
  --font: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #141615; --surface: #1d201e; --surface-2: #141615; --fill: #2a2e2b; --line: #303532; --line-soft: #282c29;
    --ink: #eef0ee; --muted: #b6bab7; --faint: #858a86; --dark: #e9f1ea;
    --tile-blue: #22323a; --tile-lav: #2d2738; --tile-sage: #26301f; --tile-sand: #362a1e;
    --brand: #8fc6a6; --brand-h: #a6d4b9; --brand-2: #8fc6a6; --brand-ink: #0d1d14; --brand-soft: #26301f; --on-ink: #0d1d14;
    --phys: #9fc7dc; --phys-2: #5f8aa0; --phys-bg: #22323a; --psych: #c8b6ea; --psych-2: #8571a8; --psych-bg: #2d2738; --soc: #b5d6a3; --soc-bg: #26301f;
    --danger: #ff8a80; --danger-bg: #3a1f1c; --warn: #ffb27a; --warn-bg: #362a1e; --ok: #8fc6a6; --ok-bg: #26301f; --band: rgba(181, 214, 163, .14);
    --frame: #232624; --scrim: rgba(0, 0, 0, .6); --shadow: 0 40px 80px rgba(0, 0, 0, .6); --shadow-sm: 0 6px 20px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #141615; --surface: #1d201e; --surface-2: #141615; --fill: #2a2e2b; --line: #303532; --line-soft: #282c29;
  --ink: #eef0ee; --muted: #b6bab7; --faint: #858a86; --dark: #e9f1ea;
  --tile-blue: #22323a; --tile-lav: #2d2738; --tile-sage: #26301f; --tile-sand: #362a1e;
  --brand: #8fc6a6; --brand-h: #a6d4b9; --brand-2: #8fc6a6; --brand-ink: #0d1d14; --brand-soft: #26301f; --on-ink: #0d1d14;
  --phys: #9fc7dc; --phys-2: #5f8aa0; --phys-bg: #22323a; --psych: #c8b6ea; --psych-2: #8571a8; --psych-bg: #2d2738; --soc: #b5d6a3; --soc-bg: #26301f;
  --danger: #ff8a80; --danger-bg: #3a1f1c; --warn: #ffb27a; --warn-bg: #362a1e; --ok: #8fc6a6; --ok-bg: #26301f; --band: rgba(181, 214, 163, .14);
  --frame: #232624; --scrim: rgba(0, 0, 0, .6); --shadow: 0 40px 80px rgba(0, 0, 0, .6); --shadow-sm: 0 6px 20px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root.contrast { --muted: var(--ink); --faint: var(--ink); --line: var(--ink); }
:root.text-1 { font-size: 112.5%; }
:root.text-2 { font-size: 125%; }
:root.calm *, :root.calm *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--surface-2); color: var(--ink); font-size: 1rem; line-height: 1.45; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-display); }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.note { font-size: .9rem; color: var(--muted); margin-top: 8px; line-height: 1.45; text-wrap: pretty; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 500; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font-size: inherit; font-weight: 500; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.spacer { flex: 1; }
.i { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex: none; }
[data-icon] { display: inline-flex; }

/* ---------- Desktop shell ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 28px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: .5px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 650; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; }
.logo { color: var(--brand); font-size: 1.75rem; display: inline-flex; }
.tag { font-size: .78rem; font-weight: 500; background: var(--fill); color: var(--muted); padding: 2px 9px; border-radius: 99px; letter-spacing: 0; }
.switch { margin-left: auto; display: flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.switch button, .switch-link { border: 0; background: none; padding: 6px 16px; border-radius: 7px; font-weight: 500; font-size: .9rem; color: var(--ink); white-space: nowrap; text-decoration: none; }
.switch button[aria-selected="true"], .switch-link[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; }
.topbar .linkish { font-size: .95rem; }
.guide-btn { display: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); color: var(--ink); font-size: 1.25rem; place-items: center; }

.layout { display: grid; grid-template-columns: minmax(270px, 340px) 1fr; gap: 40px; max-width: 1240px; margin: 0 auto; padding: 32px 28px 56px; align-items: start; }
.stage { display: flex; justify-content: center; min-width: 0; }
.guide { position: sticky; top: 88px; }
.guide summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 0 4px 10px; }
.guide summary::-webkit-details-marker { display: none; }
.guide h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.guide-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.guide-list li + li button { border-top: .5px solid var(--line); }
.guide-list button { width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; }
.guide-list .n { grid-row: span 3; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.guide-list strong { font-size: .98rem; font-weight: 600; }
.guide-list .d { font-size: .88rem; color: var(--muted); grid-column: 2; }
.guide-list .dims { grid-column: 2; display: flex; gap: 5px; margin-top: 4px; }
.guide-list button[aria-current="step"] { background: var(--brand-soft); }
.guide-list button[aria-current="step"] .n { background: var(--brand); color: var(--brand-ink); }
.legend { margin-top: 12px; padding: 0 4px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .85rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.phys { background: var(--phys); } .dot.psych { background: var(--psych); } .dot.soc { background: var(--soc); }

/* ---------- Phone ---------- */
.phone { width: 402px; max-width: 100%; height: min(840px, calc(100vh - 110px)); min-height: 640px; background: var(--frame); border-radius: 54px; padding: 11px; box-shadow: var(--shadow); }
.app { position: relative; height: 100%; background: var(--page); border-radius: 44px; overflow: hidden; display: flex; flex-direction: column; }
.proto-banner { font-size: .78rem; text-align: center; padding: 10px 18px 8px; color: var(--muted); }
.proto-banner .linkish { color: var(--danger); font-weight: 600; font-size: 1rem; display: block; margin: 2px auto 0; position: relative; line-height: 1.3; }
.proto-banner .linkish::after { content: ""; position: absolute; inset: -12px -16px -8px; }
.screen { flex: 1; overflow-y: auto; padding: 4px 16px 28px; scroll-behavior: smooth; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen:focus { outline: none; }
.tabbar { display: grid; grid-template-columns: repeat(6, 1fr); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line); padding: 6px 4px 14px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .75rem; font-weight: 500; color: var(--muted); text-decoration: none; padding: 4px 0; letter-spacing: 0; }
.tabbar a span .i { width: 1.45rem; height: 1.45rem; }
.tabbar a[aria-current="page"] { color: var(--brand); }
.tabbar a[aria-current="page"] span .i { stroke-width: 2.2; }
.app.no-tabs .tabbar { display: none; }

/* ---------- Headers ---------- */
.hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.hdr h1 { font-size: 2.05rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.08; text-wrap: balance; }
.hdr .sub { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: .9rem; flex: none; }
.back { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--brand); font-size: 1.02rem; font-weight: 500; padding: 6px 0; margin-top: 2px; }
.section { margin-top: 26px; }
.section > h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; margin: 0 4px 9px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section > h2 .count { font-size: .9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.h3 { font-size: 1.05rem; font-weight: 600; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 0; border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 10px; }
.card h3 { font-size: 1.05rem; font-weight: 600; }
.card.list, .card.mlist { padding: 0 16px; }

/* Grouped list rows */
.mrow { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; min-height: 56px; padding: 10px 0; color: inherit; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; font: inherit; }
.mrow + .mrow { border-top: .5px solid var(--line); }
.mrow.static { grid-template-columns: 32px minmax(0, 1fr); }
.mr-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 1.1rem; background: var(--fill); color: var(--muted); }
.mr-ic.phys { background: var(--phys); color: #fff; }
.mr-ic.psych { background: var(--psych); color: #fff; }
.mr-ic.soc { background: var(--soc); color: #fff; }
.mr-ic.brand { background: var(--brand); color: #fff; }
.mr-ic.warn { background: var(--warn); color: #fff; }
.mr-txt { display: grid; gap: 1px; min-width: 0; }
.mr-txt b { font-weight: 500; font-size: 1.02rem; }
.mr-txt .small { color: var(--muted); }
.mr-val { font-size: 1rem; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-val b { color: var(--ink); font-weight: 600; }
.mr-val .hi, .hi { color: var(--warn); }
.mr-chev { color: var(--faint); font-size: 1.35rem; line-height: 1; }

/* Summary cards (category name, then a big number) */
.sumcard { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; color: inherit; text-decoration: none; border: 0; width: 100%; text-align: left; font: inherit; }
.sumcard + .sumcard { margin-top: 8px; }
.sc-cat { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .95rem; }
.sc-cat.phys { color: var(--phys); } .sc-cat.psych { color: var(--psych); } .sc-cat.soc { color: var(--soc); }
.sc-meta { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sc-meta .chev { font-size: 1.2rem; color: var(--faint); }
.sc-val { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sc-val .n { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sc-val .u { font-size: .95rem; color: var(--muted); font-weight: 500; }
.sc-val .st { font-size: .9rem; font-weight: 600; margin-left: auto; }
.sc-val .st.hi { color: var(--warn); } .sc-val .st.ok { color: var(--ok); } .sc-val .st.act { color: var(--brand); background: var(--brand-soft); padding: 5px 12px; border-radius: 99px; }

/* Needs attention */
.attn { display: grid; gap: 10px; }
.attn-h { display: flex; justify-content: space-between; align-items: center; }
.attn-t { font-size: 1.02rem; line-height: 1.45; text-wrap: pretty; }
.attn .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.attn .actions .btn { flex: 1 1 120px; padding: 12px 10px; }

/* Big metric (detail pages) */
.metric { display: grid; gap: 2px; margin: 4px 0 10px; }
.metric .cap b.okc { color: var(--ok); }
.metric .n { font-size: 2.6rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric .n small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.metric .cap { font-size: .9rem; color: var(--muted); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 1rem; padding: 12px 18px; border-radius: 12px; min-height: 48px; text-decoration: none; white-space: nowrap; }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: none; color: var(--brand); padding: 8px 6px; min-height: 0; font-weight: 500; }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.sm { min-height: 34px; padding: 6px 14px; font-size: .9rem; border-radius: 99px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn .i { width: 1.1em; height: 1.1em; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: .85rem; font-weight: 500; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; }
.segtabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; margin: 0 0 6px; }
.segtabs a { text-align: center; padding: 7px 8px; border-radius: 7px; font-weight: 500; font-size: .92rem; color: var(--ink); text-decoration: none; }
.segtabs a[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--line); padding: 8px 14px; border-radius: 99px; font-size: .92rem; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.pill .i { width: .95rem; height: .95rem; }
.pill.phys { background: var(--phys-bg); color: var(--phys); } .pill.psych { background: var(--psych-bg); color: var(--psych); } .pill.soc { background: var(--soc-bg); color: var(--soc); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea, .field select, select { border: 0; background: var(--fill); border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.err { color: var(--danger); font-size: .9rem; }

/* Checklist with round ticks */
.check { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 8px 0; }
.check + .check { border-top: .5px solid var(--line); }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border-radius: 50%; border: 2px solid var(--faint); background: var(--surface); cursor: pointer; transition: background-color .2s, border-color .2s; }
.check input:checked { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/15px no-repeat; border-color: var(--brand); animation: tick .35s cubic-bezier(.16, 1, .3, 1); }
.check label { flex: 1; font-size: 1.02rem; }
.check.done label { color: var(--muted); }
@keyframes tick { from { transform: scale(.72); } }
.progress { height: 4px; background: var(--fill); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* Toggles */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; }
.toggle + .toggle { border-top: .5px solid var(--line); }
.toggle .t { font-size: 1rem; }
.toggle .d { font-size: .88rem; color: var(--muted); }
.switchbox { position: relative; width: 51px; height: 31px; flex: none; }
.switchbox input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switchbox span { position: absolute; inset: 0; background: var(--fill); border-radius: 99px; transition: background .2s; pointer-events: none; }
.switchbox span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; background: #fff; border-radius: 50%; transition: transform .22s cubic-bezier(.3, .7, .4, 1); box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .1); }
.switchbox input:checked + span { background: var(--brand); }
.switchbox input:checked + span::after { transform: translateX(20px); }
.switchbox input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Health data ---------- */
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .ref { stroke: var(--faint); stroke-dasharray: 3 4; stroke-width: 1; }
.chart .band { fill: var(--band); }
.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }
.key i.bandkey { border-radius: 3px; width: 14px; background: var(--band); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.readings { margin-top: 4px; }
.readings div { display: flex; justify-content: space-between; min-height: 46px; align-items: center; font-size: 1rem; font-variant-numeric: tabular-nums; }
.readings div + div { border-top: .5px solid var(--line); }
.readings .hi { color: var(--warn); font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv .card { padding: 14px; margin: 0; }
.kv .lbl { font-size: .88rem; color: var(--muted); font-weight: 500; }
.kv .val { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.big { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.dots span { text-align: center; font-size: .78rem; color: var(--muted); }
.dots b { display: grid; place-items: center; height: 30px; border-radius: 8px; margin-bottom: 4px; background: var(--brand); }
.dots b.miss { background: var(--warn-bg); box-shadow: inset 0 0 0 1.5px var(--warn); }
.dots b.todo { background: var(--fill); }

/* Alerts */
.alert { border-radius: var(--radius); padding: 14px 16px; }
.alert.warn { background: var(--warn-bg); }
.alert.urgent { background: var(--danger-bg); }
.alert.ok { background: var(--ok-bg); }
.alert h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.alert.warn h3 { color: var(--warn); } .alert.urgent h3 { color: var(--danger); } .alert.ok h3 { color: var(--ok); }
.alert .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.list { margin: 8px 0 0; padding-left: 20px; }
.list li + li { margin-top: 6px; }

/* ---------- Circles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; background: var(--surface); border: 0; border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; align-content: start; }
.tile .ic { font-size: 1.3rem; color: var(--brand); display: inline-flex; }
.tile b { font-size: .98rem; font-weight: 600; }
.tile span { font-size: .88rem; color: var(--muted); }
.post { padding: 12px 0; }
.post + .post { border-top: .5px solid var(--line); }
.post .who { font-weight: 600; font-size: .9rem; }
.gc { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.gc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.gc-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.gc-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .8rem; background: var(--fill); border: 0; }
.gc-b { background: var(--surface); border-radius: 18px 18px 18px 6px; padding: 8px 13px; }
.gc-msg.me .gc-b { background: var(--brand); color: var(--brand-ink); border-radius: 18px 18px 6px 18px; }
.gc-who { font-weight: 600; font-size: .8rem; }
.gc-who span { font-weight: 400; opacity: .7; margin-left: 4px; }
.gc-b p { font-size: .98rem; margin-top: 2px; }
.gc-held { font-size: .82rem; margin-top: 6px; opacity: .9; }
.gc-compose { position: sticky; bottom: 0; display: flex; gap: 8px; margin-top: 14px; padding: 8px 0; background: var(--page); }
.gc-compose textarea, .composer textarea { flex: 1; resize: none; border: 0; box-shadow: inset 0 0 0 .5px var(--line); border-radius: 20px; padding: 10px 14px; min-height: 42px; max-height: 110px; background: var(--surface); }
button.gc-av { cursor: pointer; color: inherit; font: inherit; font-weight: 600; font-size: .8rem; }
.gc-av.big { width: 44px; height: 44px; font-size: 1.1rem; }
.gc-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; text-decoration: underline dotted; }
.dm-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; text-decoration: none; color: inherit; }
.dm-row + .dm-row { border-top: .5px solid var(--line); }
.dm-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dm-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

/* ---------- Chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.app.chat-mode .screen { display: flex; flex-direction: column; padding-bottom: 0; }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.bubble { max-width: 84%; padding: 9px 14px; border-radius: 20px; font-size: 1rem; line-height: 1.4; }
.bubble p + p { margin-top: 8px; }
.bubble.user { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.bubble.assistant { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; }
.bubble .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bubble .acts button { font-size: .88rem; padding: 6px 12px; border-radius: 99px; border: 0; color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.bubble.crisis { background: var(--danger-bg); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { position: sticky; bottom: 0; background: var(--page); padding: 8px 0 10px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer .btn { width: 42px; min-height: 42px; padding: 0; border-radius: 50%; }
.composer .hint { font-size: .78rem; color: var(--muted); margin-top: 6px; text-align: center; }
.mode { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.mode.ai { background: var(--ok-bg); color: var(--ok); } .mode.scripted { background: var(--warn-bg); color: var(--warn); }

/* ---------- Sheets and toast ---------- */
.overlay { position: absolute; inset: 0; background: var(--scrim); display: flex; align-items: flex-end; z-index: 30; animation: fade .2s; }
.sheet { background: var(--page); width: 100%; max-height: 90%; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 8px 16px 24px; animation: up .32s cubic-bezier(.16, 1, .3, 1); }
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.sheet .x { float: right; background: var(--fill); border: 0; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--muted); }
.sheet .card + .card, .sheet details.card + details.card { margin-top: 8px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.emojis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0; }
.emojis button { border: 0; background: var(--surface); border-radius: 12px; padding: 10px 2px 8px; display: grid; gap: 4px; justify-items: center; font-size: .78rem; color: var(--muted); }
.emojis button span { display: inline-flex; color: var(--ink); }
.emojis button .i { width: 2rem; height: 2rem; stroke-width: 1.6; }
.emojis button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.emojis button[aria-pressed="true"] span { color: var(--brand); }
.helpline { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 8px 16px; background: var(--surface); }
.helpline + .helpline { border-top: .5px solid var(--line); }
.helpline:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.helpline:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.helpline b { font-size: 1.05rem; color: var(--brand); }
.gp-sheets .overlay { position: fixed; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.gp-sheets .sheet { max-width: 480px; border-radius: 16px; }
.gp-sheets .sheet::before { display: none; }
.toast { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(16px); background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--page); padding: 10px 18px; border-radius: 99px; font-size: .92rem; font-weight: 500; opacity: 0; pointer-events: none; transition: all .25s cubic-bezier(.16, 1, .3, 1); z-index: 40; max-width: 86%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.triage textarea { width: 100%; margin: 8px 0; border: 0; background: var(--fill); border-radius: 10px; padding: 10px 12px; min-height: 64px; resize: vertical; }
.triage .chip { font-size: .88rem; min-height: 36px; padding: 6px 12px; text-align: left; }
.tri-res { margin-top: 12px; font-size: .95rem; }
.tri-res p + p, .tri-res ul + p { margin-top: 6px; }
.tri-res ul { margin: 6px 0 0; padding-left: 18px; }
.tri-res li + li { margin-top: 3px; }
/* CareCircles group chat */
.gc { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.gc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.gc-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.gc-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); }
.gc-b { background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; }
.gc-msg.me .gc-b { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); border-radius: 16px 16px 4px 16px; }
.gc-who { font-weight: 700; font-size: .78rem; }
.gc-who span { font-weight: 400; opacity: .7; margin-left: 4px; }
.gc-b p { font-size: .9rem; margin-top: 2px; }
.gc-held { font-size: .74rem; margin-top: 6px; opacity: .9; }
.gc-compose { position: sticky; bottom: 0; display: flex; gap: 8px; margin-top: 14px; padding: 8px 0; background: var(--page); }
.gc-compose textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 44px; max-height: 110px; background: var(--surface); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; font-size: inherit; cursor: pointer; }
/* Private messages */
button.gc-av { cursor: pointer; color: inherit; font: inherit; font-weight: 700; font-size: .8rem; }
.gc-av.big { width: 44px; height: 44px; font-size: 1.1rem; }
.gc-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; text-decoration: underline dotted; cursor: pointer; }
.dm-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.dm-row:last-child { border-bottom: 0; }
.dm-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dm-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
/* ---------- Installed app (PWA) ---------- */
.install-btn { border: 1px solid var(--brand); color: var(--brand); background: none; border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.install-help { position: fixed; inset: 0; z-index: 100; background: rgba(10, 20, 16, .55); display: grid; place-items: center; padding: 16px; }
.ih-card { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 24px; max-width: 380px; width: 100%; box-shadow: var(--shadow); text-align: center; }
.ih-card img { border-radius: 14px; }
.ih-card h2 { font-size: 1.2rem; margin-top: 10px; }
.ih-card p { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.ih-card ol { text-align: left; margin: 14px 0 0; padding-left: 20px; font-size: .95rem; }
.ih-card li + li { margin-top: 6px; }
.ih-close { margin-top: 18px; width: 100%; border: 0; border-radius: 12px; padding: 12px; font-weight: 700; background: var(--brand); color: var(--brand-ink); }
/* When opened from the home screen: full-screen app, no website chrome */
html.is-app .topbar, html.is-app .guide { display: none !important; }
html.is-app .layout { display: block; padding: 0; max-width: none; }
html.is-app .phone { width: 100%; height: 100dvh; min-height: 0; border-radius: 0; padding: 0; box-shadow: none; background: none; }
html.is-app .app { border-radius: 0; }
html.is-app .proto-banner { padding-top: max(8px, env(safe-area-inset-top)); }
html.is-app .tabbar { padding-bottom: env(safe-area-inset-bottom); }
@media (display-mode: standalone) {
  .topbar, .guide { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .phone { width: 100%; height: 100dvh; min-height: 0; border-radius: 0; padding: 0; box-shadow: none; background: none; }
  .app { border-radius: 0; }
}
html.is-app .stage { justify-content: center; }
html.is-app .phone { max-width: 560px; margin: 0 auto; }
@media (display-mode: standalone) { .phone { max-width: 560px; margin: 0 auto; } }
/* Before you call NHS 111 */
.steps111 { margin: 12px 0 0; padding-left: 20px; font-size: .9rem; }
.steps111 li + li { margin-top: 6px; }
.ready111 { margin-top: 12px; background: var(--surface-2); }
.ready111 dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: .88rem; }
.ready111 dt { color: var(--muted); }
.ready111 dd { margin: 0; font-weight: 600; }
.tri-res .calm { background: var(--surface); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: .9rem; }
.tri-res .calm span { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
/* Calm down and re-check */
.breathe-card { text-align: center; }
.breathe { width: 120px; height: 120px; margin: 14px auto 8px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--phys-bg), color-mix(in srgb, var(--phys) 35%, var(--surface))); display: grid; place-items: center; transform: scale(.7); transition: transform 4s ease-in-out; box-shadow: 0 0 0 8px color-mix(in srgb, var(--phys) 12%, transparent); }
.breathe.in { transform: scale(1); transition-duration: 4s; }
.breathe.out { transform: scale(.7); transition-duration: 6s; }
.breathe span { font-weight: 700; font-size: .85rem; color: var(--phys); transform: scale(1.2); }
@media (prefers-reduced-motion: reduce) { .breathe, .breathe.in, .breathe.out { transition: none; transform: none; } }
.attach { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; padding: 6px 0; font-weight: 400; }
.attach input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--brand); }
/* GP booking */
.slot { display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.slot:hover, .slot:focus-visible { border-color: var(--brand); }
.slot-when { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Onboarding ---------- */
.onb { min-height: 100%; display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.onb .steps { display: flex; gap: 6px; }
.onb .steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--fill); }
.onb .steps i.on { background: var(--brand); }
.hero { text-align: center; padding: 22px 8px 4px; }
.hero .logo-lg { font-size: 3.6rem; color: var(--brand); display: inline-flex; }
.hero h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; margin-top: 10px; text-wrap: balance; }
.hero p { color: var(--muted); margin-top: 8px; font-size: 1.02rem; text-wrap: pretty; }
.three { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; border: 0; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: inset 0 0 0 .5px var(--line); }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.opt .ic { font-size: 1.5rem; color: var(--brand); display: inline-flex; }

/* ---------- Legacy GP panel inside index.html ---------- */
.gp { width: 100%; max-width: 980px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }

/* ---------- Interaction ---------- */
.btn, .chip, .opt, .tile, .emojis button, .guide-list button, .switch button, .switch-link, .seg button, .segtabs a, .tabbar a, .back, .avatar, .sheet .x, .bubble .acts button, .mrow, .sumcard, .helpline, .gc-av, .dm-row, .linkish, .linkbtn {
  transition: background-color .18s, color .18s, box-shadow .18s, opacity .18s, transform .12s;
}
.btn:not(:disabled):active, .chip:active, .opt:active, .tile:active, .emojis button:active, .bubble .acts button:active, .avatar:active, .sheet .x:active, .guide-btn:active { transform: scale(.96); }
a.mrow:active, button.mrow:active, .sumcard:active, .guide-list button:active { background: var(--fill); }
.tabbar a:active, .switch button:active, .seg button:active, .segtabs a:active { transform: scale(.94); }
@media (hover: hover) {
  .btn:not(:disabled):hover { background: var(--brand-h); }
  .btn.secondary:not(:disabled):hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
  .btn.ghost:not(:disabled):hover, .btn.danger:not(:disabled):hover { background: var(--fill); }
  a.mrow:hover, button.mrow:hover, .sumcard:hover, .tile:hover, .guide-list button:not([aria-current="step"]):hover { background: color-mix(in srgb, var(--fill) 50%, var(--surface)); }
  .chip:not([aria-pressed="true"]):hover, .opt:not([aria-pressed="true"]):hover { box-shadow: inset 0 0 0 1px var(--faint); }
  .back:hover, .linkish:hover, .linkbtn:hover { opacity: .7; }
  .tabbar a:not([aria-current="page"]):hover { color: var(--ink); }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px 0 0; gap: 16px; }
  .guide { position: static; margin: 0 16px; }
  .guide details:not([open]) .legend { display: none; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .topbar .tag { display: none; }
}
@media (max-width: 520px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .screen { overflow-x: hidden; }
  .brand .tag { display: none; }
  .topbar .linkish { display: none; }
  .brand { font-size: .95rem; }
  .switch button, .switch-link { padding: 5px 10px; font-size: .82rem; }
  .layout { padding-top: 0; }
  .phone { width: 100%; height: calc(100dvh - 54px); min-height: 0; border-radius: 0; padding: 0; box-shadow: none; background: none; }
  .app { border-radius: 0; }
  .guide { display: none; }
  .guide-btn { display: grid; }
}
.mrow.habit { grid-template-columns: 10px minmax(0, 1fr); align-items: start; }
.hb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: .55em; }

.mr-chev .i, .sc-meta .chev .i { width: 1rem; height: 1rem; stroke-width: 2.2; }
.back .i { width: 1.15rem; height: 1.15rem; stroke-width: 2.4; }


/* ================= Pastel dashboard ================= */
body { background: var(--page); letter-spacing: 0; }
h1, h2, h3, h4 { letter-spacing: -.01em; }
.app { background: var(--page); }
.proto-banner { background: var(--page); padding-top: 12px; }
.proto-banner .linkish { position: relative; display: block; margin: 2px auto 0; font-size: 1rem; }
.screen { padding: 4px 18px 112px; }

/* Floating pill tab bar, icons only, dark circle on the active tab */
.tabbar { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 25; display: grid; grid-template-columns: repeat(6, 1fr); align-items: center; padding: 7px; background: var(--surface); border: 0; border-radius: 999px; box-shadow: var(--shadow-sm); backdrop-filter: none; -webkit-backdrop-filter: none; }
.tabbar a { height: 52px; width: 52px; justify-self: center; display: grid; place-items: center; border-radius: 50%; color: var(--ink); padding: 0; }
.tabbar a span .i { width: 1.5rem; height: 1.5rem; stroke-width: 1.7; }
.tabbar a .tl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabbar a[aria-current="page"] { background: var(--dark); color: var(--page); }
.tabbar a[aria-current="page"] span .i { stroke-width: 2; }

/* Headers */
.hdr { margin: 14px 0 18px; align-items: flex-end; }
.hdr h1 { font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; line-height: 1.15; letter-spacing: -.015em; }
.hdr .sub { font-size: 1rem; }
.hello { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; font-size: 1.15rem; }
.hello b { font-weight: 600; }
.hello .round-btn { margin-left: auto; }
.round-btn { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; font-size: 1.35rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.avatar { width: 50px; height: 50px; background: var(--tile-sand); color: var(--warn); font-weight: 600; font-size: 1rem; }
h1.glance { font-weight: 400; font-size: 2.15rem; line-height: 1.15; letter-spacing: -.015em; margin: 6px 0 18px; text-wrap: balance; }
.back { background: var(--surface); border-radius: 999px; padding: 10px 16px 10px 12px; color: var(--ink); font-weight: 500; margin-top: 6px; }
.section { margin-top: 28px; }
.section > h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; margin: 0 2px 12px; border: 0; padding: 0; }
.section > h2 .count, .section > h2 .see { font-size: .98rem; font-weight: 400; color: var(--muted); }

/* Bento of pastel tiles */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: grid; align-content: start; gap: 10px; border: 0; border-radius: 26px; padding: 16px; text-align: left; color: var(--ink); text-decoration: none; font: inherit; min-height: 190px; position: relative; overflow: hidden; }
.tile.blue { background: var(--tile-blue); } .tile.lav { background: var(--tile-lav); } .tile.sage { background: var(--tile-sage); } .tile.sand { background: var(--tile-sand); }
.tile.wide { grid-column: 1 / -1; min-height: 0; }
.t-top { display: flex; gap: 9px; align-items: center; }
.ti { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.25rem; color: var(--ink); }
.t-top .v { display: block; font-size: 1.28rem; white-space: nowrap; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; }
.t-top .l { display: block; font-size: .85rem; color: var(--muted); line-height: 1.25; }
.tile .st { font-size: .88rem; font-weight: 500; }
.tile .st.hi { color: var(--warn); }
.tile .st.act { color: var(--brand); }
.mini { width: 100%; height: auto; display: block; }
.mini .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }

/* Cards and rows: white, rounded, separate */
.card { background: var(--surface); border: 0; border-radius: 26px; padding: 18px; }
.card.list, .card.mlist { background: none; border: 0; border-radius: 0; padding: 0; display: grid; gap: 10px; }
.mrow, .card.list .check { background: var(--surface); border-radius: 22px; padding: 12px 16px 12px 12px; min-height: 68px; }
.mrow + .mrow, .check + .check, .card.list .check + .check { border-top: 0; }
.mr-ic { width: 46px; height: 46px; border-radius: 50%; font-size: 1.25rem; }
.mr-ic.phys { background: var(--tile-blue); color: var(--phys); }
.mr-ic.psych { background: var(--tile-lav); color: var(--psych); }
.mr-ic.soc, .mr-ic.brand { background: var(--tile-sage); color: var(--soc); }
.mr-ic.warn { background: var(--tile-sand); color: var(--warn); }
.mr-txt b { font-weight: 500; font-size: 1.05rem; }
.mrow { grid-template-columns: 46px minmax(0, 1fr) auto auto; }
.mrow.static { grid-template-columns: 46px minmax(0, 1fr); }
.mrow.habit { grid-template-columns: 10px minmax(0, 1fr); min-height: 0; padding: 14px 16px; }
.hb-dot { background: var(--brand); }
.mr-chev { color: var(--ink); }
.mr-chev .i { width: 1.2rem; height: 1.2rem; stroke-width: 2; }
.check .tm { width: 44px; flex: none; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.check input { border-color: var(--faint); }
.check input:checked { background-color: var(--brand); border-color: var(--brand); }
.progress { display: none; }
.readings div + div { border-top: 1px solid var(--line); }
.toggle + .toggle { border-top: 1px solid var(--line); }

/* Attention row */
.attn { background: var(--surface); border-radius: 26px; padding: 16px; display: grid; gap: 12px; }
.attn-r { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; }
.attn-r b { font-weight: 500; font-size: 1.08rem; display: block; }
.attn-r span.s { color: var(--muted); font-size: .95rem; }

/* Controls */
.btn { border-radius: 999px; font-weight: 500; min-height: 50px; padding: 12px 20px; }
.btn.secondary { background: var(--tile-sage); color: var(--soc); }
.btn.sm { min-height: 36px; padding: 6px 15px; }
.segtabs, .seg, .switch { background: var(--fill); border-radius: 999px; padding: 4px; }
.segtabs a, .seg button, .switch button, .switch-link { border-radius: 999px; }
.segtabs a[aria-selected="true"], .seg button[aria-pressed="true"], .switch button[aria-selected="true"], .switch-link[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); font-weight: 500; }
.pill { font-weight: 500; }
.metric .n { font-weight: 500; font-size: 3rem; letter-spacing: -.02em; }
.metric .n small { display: block; font-weight: 400; font-size: 1rem; margin: 2px 0 6px; }
.chart .band { fill: var(--band); }
.chart text { fill: var(--muted); }

/* Shell */
@media (min-width: 521px) { .phone { background: var(--frame); border-radius: 56px; padding: 10px; } .app { border-radius: 46px; } }
.guide-list { border-radius: 24px; }
.guide-list button[aria-current="step"] { background: var(--tile-sage); }
.guide-list button[aria-current="step"] .n { background: var(--dark); color: var(--page); }
.logo, .hero .logo-lg { color: var(--brand); }
.bubble.user, .gc-msg.me .gc-b { background: var(--dark); color: var(--page); }
.bubble.assistant, .gc-b { background: var(--surface); }
.sheet { background: var(--page); border-radius: 30px 30px 0 0; }
.tile, .round-btn, .back { transition: transform .12s, filter .18s, background-color .18s; }
.tile:active, .round-btn:active, .back:active { transform: scale(.97); }
@media (hover: hover) { .tile:hover { filter: brightness(.98); } .round-btn:hover, .back:hover { background: var(--fill); } }
@media (max-width: 520px) { .tabbar { bottom: 12px; } }

/* Keep message boxes clear of the floating tab bar */
.app.chat-mode .composer { padding-bottom: 92px; }
.gc-compose { bottom: 0; padding-bottom: 92px; margin-bottom: -92px; position: sticky; z-index: 26; }

/* Review fixes: one light lettering voice, stronger tile numbers, fades behind floating chrome */
.hero h1, .signin h1 { font-weight: 400; letter-spacing: -.015em; }
.metric .n { font-weight: 400; }
.guide h2, .sheet h2 { font-weight: 500; }
.t-top .v { font-size: 1.85rem; font-weight: 400; color: var(--ink); letter-spacing: -.01em; }
.ti .i { width: 22px; height: 22px; stroke-width: 1.9; }
.round-btn .i { width: 22px; height: 22px; }
.app::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 104px; background: linear-gradient(to top, var(--page) 58%, transparent); pointer-events: none; z-index: 24; }
.app.no-tabs::after { display: none; }
.proto-banner { position: relative; z-index: 3; }
.proto-banner::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; background: linear-gradient(var(--page), transparent); pointer-events: none; }
.key i.bandkey { width: 14px; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; }
/* Review round 2: tile values keep the tile's inset; banner edge hides scrolled content */
.t-top .v { font-size: 1.6rem; }
.t-top { gap: 8px; }
.ti { width: 38px; height: 38px; }
.proto-banner::after { height: 26px; background: linear-gradient(var(--page) 45%, transparent); }
/* Mood: a quick log, no graph */
.faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: auto; }
.faces button { aspect-ratio: 1; border: 0; border-radius: 50%; background: var(--surface); color: var(--psych); display: grid; place-items: center; padding: 0; transition: transform .12s, background-color .18s; }
.faces button .i { width: 70%; height: 70%; stroke-width: 1.7; }
.faces button[aria-pressed="true"] { background: var(--psych); color: #fff; }
.faces button:active { transform: scale(.9); }
.tile .linkish.st { justify-self: start; font-size: .88rem; font-weight: 500; padding: 4px 0; }
.mrow.moodrow { grid-template-columns: 46px minmax(0, 1fr) auto 0; }
.mrow.moodrow .mr-ic .i { width: 26px; height: 26px; }
.mr-val.small { font-size: .85rem; line-height: 1.35; }
.mr-val .i { width: 1.25rem; height: 1.25rem; color: var(--soc); }

/* Merge fix: action buttons inside the AI triage answer stand out from the tinted card */
.tri-res .btn.secondary { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
/* Logo: the navy mark needs a light disc to stay visible on dark backgrounds */
:root[data-theme="dark"] .logo .i, :root[data-theme="dark"] .logo-lg .i { background: #fff; border-radius: 50%; padding: .08em; box-sizing: content-box; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .i, :root:not([data-theme="light"]) .logo-lg .i { background: #fff; border-radius: 50%; padding: .08em; box-sizing: content-box; }
}

/* Phone fit for the hosted demo: keep the top bar inside the screen and
   leave a strip at the bottom for the host's "Powered by Netlify" badge. */
@media (max-width: 520px) {
  .install-btn { font-size: 0; padding: 0; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; }
  .install-btn .i { width: 1.1rem; height: 1.1rem; }
  .topbar { flex-wrap: nowrap; min-width: 0; }
  .topbar .brand { min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; }
  .topbar .switch { flex: none; }
  .guide-btn { flex: none; }
  html.on-netlify .phone { height: calc(100dvh - 54px - 66px); }
  html.on-netlify body { min-height: 100dvh; }
}
@media (max-width: 380px) {
  .topbar .brand { font-size: 0; gap: 0; flex: none; }
  .topbar .brand .logo { font-size: 1.6rem; }
}
