/* Amanda's Health: styles ported from docs/mockup/index.html. Light and dark via [data-theme]. */
:root, [data-theme="light"] {
  color-scheme: light;
  --page: #d8dde8; --bg: #f4f6fb; --card: #ffffff; --ink: #1c2333; --muted: #667085; --line: #e4e8f0;
  --primary: #2563eb; --primary-ink: #ffffff; --teal: #0f9f8f; --amber: #b45309; --amber-dot: #d97706; --amber-bg: #fff4e0;
  --ai: #7c3aed; --ai-btn: #7c3aed; --ai-bg: #f3edff; --ok-bg: #e7f7f4; --ok-ink: #065f55; --fail: #dc2626; --fail-bg: #fde8e8;
  --range: #d9f2ec; --range-ink: #0f766e; --gray: #7b8496; --blue-bg: #e6efff; --blue-ink: #1d4ed8; --indigo: #4f46e5;
  --hover: #f0f3f9; --sel: #e6efff; --shadow: 0 1px 2px rgba(16,24,40,.06);
  --s1: #2563eb; --s2: #0f9f8f; --s3: #c2410c; --s4: #7c3aed; --s5: #be185d; --s6: #4d7c0f;
}
[data-theme="dark"] {
  color-scheme: dark;
  --page: #070a0f; --bg: #0f141c; --card: #18202b; --ink: #e6eaf2; --muted: #9aa4b5; --line: #2a3442;
  --primary: #3b82f6; --primary-ink: #ffffff; --teal: #14b8a6; --amber: #fbbf24; --amber-dot: #f59e0b; --amber-bg: #3a2a0c;
  --ai: #a78bfa; --ai-btn: #6d28d9; --ai-bg: #261d3d; --ok-bg: #0f2e2a; --ok-ink: #5eead4; --fail: #f87171; --fail-bg: #3b1414;
  --range: #12352f; --range-ink: #5eead4; --gray: #5b6578; --blue-bg: #1b2a4a; --blue-ink: #93b4ff; --indigo: #6366f1;
  --hover: #1f2935; --sel: #1b2a4a; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --s1: #60a5fa; --s2: #2dd4bf; --s3: #fb923c; --s4: #c4b5fd; --s5: #f472b6; --s6: #a3e635;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
a { color: var(--primary); }
a.plain { color: inherit; text-decoration: none; }

/* ---------- shared components */
.card { background: var(--card); border-radius: 14px; padding: 14px; margin: 10px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card.link { cursor: pointer; display: block; color: inherit; text-decoration: none; }
.big { font-size: 20px; font-weight: 650; margin: 2px 0; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; margin: 0 -6px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; color: inherit; text-decoration: none; }
.row:first-of-type, h2 + .row { border-top: 0; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--sel); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row.static { cursor: default; }
.row.static:hover { background: none; }
.chev { color: var(--gray); font-size: 20px; }
.pill { display: inline-block; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.p-amber { background: var(--amber-bg); color: var(--amber); }
.p-ok { background: var(--ok-bg); color: var(--ok-ink); }
.p-ai { background: var(--ai-bg); color: var(--ai); }
.p-blue { background: var(--blue-bg); color: var(--blue-ink); }
.p-fail { background: var(--fail-bg); color: var(--fail); }
.btn { display: inline-block; border: 0; border-radius: 12px; padding: 12px 16px; font-size: 16px; font-weight: 650; cursor: pointer; text-decoration: none; text-align: center; font-family: inherit; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ai { background: var(--ai-btn); color: #fff; }
.btn-indigo { background: var(--indigo); color: #fff; }
.btn-gray { background: var(--gray); color: #fff; } /* cancel / sign out only */
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn-block { display: block; width: 100%; }
.iconbtn { background: var(--primary); color: #fff; border: 0; border-radius: 10px; padding: 8px 11px; font-size: 15px; cursor: pointer; text-decoration: none; }
.banner { border-radius: 12px; padding: 11px 13px; margin: 10px 0; font-size: 14px; display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.banner .grow { flex: 1; }
.banner[hidden] { display: none; }
.b-run { background: var(--blue-bg); color: var(--blue-ink); }
.b-done { background: var(--ok-bg); color: var(--ok-ink); }
.b-fail { background: var(--fail-bg); color: var(--fail); }
.banner button { background: none; border: 0; color: inherit; font-size: 16px; cursor: pointer; }
.ai-note { background: var(--ai-bg); border-left: 4px solid var(--ai); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.ai-note b { color: var(--ai); }
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 15px; }
.kv .v { font-weight: 650; text-align: right; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 4px 4px; text-transform: uppercase; letter-spacing: .05em; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 15px; line-height: 1.45; }
.bubble p:first-child { margin-top: 0; } .bubble p:last-child { margin-bottom: 0; }
.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.cite { display: inline-block; margin: 6px 6px 0 0; font-size: 12px; background: var(--blue-bg); color: var(--blue-ink); border-radius: 8px; padding: 3px 8px; text-decoration: none; }
.askbar { display: flex; gap: 8px; margin-top: 12px; }
input.field, select.field, textarea.field, .askbar input { flex: 1; width: 100%; font-size: 16px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; color: var(--ink); font-family: inherit; text-decoration: none; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.steps .s { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.steps .s:first-child { border-top: 0; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: #fff; flex: none; }
.d-done { background: var(--teal); } .d-run { background: var(--primary); } .d-wait { background: var(--gray); } .d-fail { background: var(--fail); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > div { height: 100%; background: var(--primary); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t td, table.t th { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--hover); }
table.t tr.editable { cursor: pointer; } table.t tr.editable:hover td, table.t tr.editable:focus td { background: var(--hover); }
/* Note editor on /vitals: a modal @mikestools/panel; position is set when it opens. */
.note-dialog { width: min(420px, calc(100vw - 24px)); margin: 0; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.note-dialog-head { font-weight: 700; margin-bottom: 8px; cursor: move; }
.note-dialog .row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.note-dialog .ve-danger { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.note-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.note-dialog fieldset[hidden] { display: none; }
.note-dialog .field { width: 100%; box-sizing: border-box; }
.form-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form-grid3 label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
td.oor { color: var(--amber); font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* Sharing (/sharing): who sees what, invites and share codes */
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid2 label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.grant-set { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.grant-set legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.hide-group { max-height: 340px; overflow-y: auto; }
.share-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.share-row:first-of-type { border-top: 0; }
.share-row .grow { flex: 1 1 220px; min-width: 0; }
.share-row .title { font-weight: 600; }
.share-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.copy-row { display: flex; gap: 8px; }
.copy-row .field { flex: 1; min-width: 0; }
.share-code { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: 2px; text-transform: uppercase; }
.card.narrow { max-width: 560px; }
.note { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; font-size: 14px; white-space: pre-wrap; max-height: 480px; overflow: auto; }
.theme { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 15px; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg a { background: var(--card); color: var(--ink); padding: 7px 12px; font-size: 14px; text-decoration: none; }
.seg a.on { background: var(--primary); color: #fff; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.chart text { font-family: inherit; fill: var(--ink); }
.chart text.mut { fill: var(--muted); }
/* A day-axis chart wider than its card: scroll sideways; row-reverse makes it open at the newest (right) end. */
.chart-scroll { display: flex; flex-direction: row-reverse; overflow-x: auto; max-width: 100%; color: var(--muted); }
.chart-scroll > svg { flex: 0 0 auto; }
/* The full-width BP card: a short (scaled) chart would grow ~3x across the whole card; cap it, it stays centered. */
#bp > svg.chart { max-height: 260px; }
/* A day with several readings on the BP chart: click to show each reading / the range again. */
/* Chart zones (BP categories). Fill and label ink per theme; no red (red = failed only). */
.zone.z-low { fill: var(--z-low); } .zone.z-norm { fill: var(--range); } .zone.z-s1 { fill: var(--z-s1); }
.zone.z-s2 { fill: var(--z-s2); } .zone.z-crisis { fill: var(--z-crisis); }
.zone-legend rect.zone { stroke: var(--line); }
:root, [data-theme="light"] { --z-low: #e3ecfb; --z-s1: #fff1c7; --z-s2: #ffdcbc; --z-crisis: #f6b98f; }
[data-theme="dark"] { --z-low: #16233d; --z-s1: #3a2f0c; --z-s2: #48280f; --z-crisis: #6a2c0c; }
/* Zoomable time charts (zoomchart.js). Drawn at their on-screen width, so text is true size. The chart lets the page
   scroll vertically on touch (pan-y) but takes horizontal drags and pinches; the strip takes every touch. */
.zchart-ranges { margin: 4px 0 6px; }
.zchart svg.zmain { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; display: block; }
.zchart svg.zmain:active { cursor: grabbing; }
.zchart svg.znav { touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; display: block; margin-top: 2px; color: var(--muted); }
.zchart svg.znav .znav-win { cursor: grab; }
.zchart svg.znav .znav-hl, .zchart svg.znav .znav-hr { cursor: ew-resize; }
.zchart svg.znav:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* While a gesture runs the drawn chart is stretched: hide text that would look smeared until the redraw. */
.zchart svg.zbusy text.vl, .zchart svg.zbusy .zticks text, .zchart svg.zbusy .marker text { opacity: 0; }
.chart a.day-link { cursor: pointer; }
.chart a.day-link:hover rect, .chart a.day-link:focus-visible rect { fill: currentColor; opacity: 0.08; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label, .stack label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.stack > * + * { margin-top: 10px; }
.stack label.check { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--ink); margin: 6px 0; }
.stack label.check input { width: auto; margin: 0; }
.inline-form { display: inline; }
.pages img { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0; background: #fff; }
.validation { color: var(--fail); font-size: 14px; }
.answer-md .mt-md { font-size: 15px; }
.mt-toast, .mt-panel { font-family: inherit; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 10px; top: 10px; z-index: 99999; background: var(--card); padding: 8px; }

/* ---------- phone layout */
.shell { max-width: 430px; min-height: 100vh; margin: 0 auto; background: var(--bg); position: relative; padding-bottom: 78px; }
.shell.nologin { padding-bottom: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.topbar h1 { font-size: 21px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .search-top { display: none; }
.topbar .patient-pick { flex: none; }
.topbar .patient-pick select { max-width: 150px; padding: 7px 10px; font-size: 15px; }
main { padding: 6px 14px 14px; }
nav.side { display: none; }
nav.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 50; }
nav.tabs a { flex: 1; text-align: center; padding: 9px 0 11px; font-size: 12px; color: var(--muted); text-decoration: none; }
nav.tabs a .ic { display: block; font-size: 21px; }
nav.tabs a.on { color: var(--primary); font-weight: 700; }
.login { padding: 40px 22px; max-width: 420px; margin: 0 auto; }
.login input { display: block; width: 100%; font-size: 16px; padding: 13px; border-radius: 12px; border: 1px solid var(--line); margin: 8px 0 14px; background: var(--card); color: var(--ink); }
.desk-only { display: none !important; }
.split > .pane-list { display: none; }

/* ---------- desktop layout */
@media (min-width: 1000px) {
  .shell { max-width: none; display: grid; grid-template-columns: 240px 1fr; padding-bottom: 0; }
  .shell.nologin { display: block; }
  nav.tabs { display: none !important; }
  nav.side { display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; padding: 18px 12px; gap: 2px; overflow-y: auto; }
  nav.side .brand { font-size: 20px; font-weight: 750; padding: 4px 10px 14px; }
  nav.side .grp { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 4px; }
  nav.side a.nav { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 10px; font-size: 15px; color: var(--ink); text-decoration: none; }
  nav.side a.nav:hover { background: var(--hover); }
  nav.side a.nav.on { background: var(--sel); color: var(--blue-ink); font-weight: 700; }
  nav.side a.nav .ic { width: 20px; text-align: center; }
  nav.side .badge { margin-left: auto; }
  nav.side .foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); }
  .content { min-width: 0; }
  .topbar { padding: 18px 28px 8px; }
  .topbar h1 { font-size: 26px; }
  .topbar .menu-btn, .topbar .back-btn { display: none; }
  .topbar .search-top { display: block; width: 340px; flex: none; }
  main { padding: 4px 28px 28px; max-width: 1400px; }
  .desk-only { display: block !important; }
  .phone-only { display: none !important; }
  /* minmax(0, ...) and min-width: 0: a wide chart scrolls inside its card instead of widening its column. */
  .grid3 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .grid3 > *, .grid2 > * { min-width: 0; }
  .grid3 > div > .card:first-child, .grid3 > .card { margin-top: 0; }
  .split { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
  .split > .pane-list { display: block; position: sticky; top: 10px; max-height: calc(100vh - 120px); overflow: auto; }
  .split > div > .card:first-child, .split > div > *:first-child { margin-top: 0; }
  .split3 { display: grid; grid-template-columns: 260px 1fr 300px; gap: 20px; align-items: start; }
  .bubble { max-width: 75%; }
}
/* ---------- chat assistant (@mikestools/chatbot), themed from the app's colours */
.mt-chat, .mt-chat-launcher {
  --mt-chat-accent: var(--primary); --mt-chat-surface: var(--card); --mt-chat-header-bg: var(--bg);
  --mt-chat-border: var(--line); --mt-chat-fg: var(--ink); --mt-chat-muted: var(--muted);
  --mt-chat-bubble-user-bg: var(--primary); --mt-chat-bubble-user-fg: var(--primary-ink);
  --mt-chat-bubble-bot-bg: var(--bg); --mt-chat-bubble-bot-fg: var(--ink);
  --mt-chat-input-bg: var(--card); --mt-chat-send-bg: var(--primary); --mt-chat-send-fg: var(--primary-ink);
  --mt-chat-abort-bg: var(--indigo); --mt-chat-launcher-bg: var(--ai-btn); --mt-chat-launcher-size: 54px;
  --mt-chat-msg-size: 15px;
}
.chat-hdr-btn { background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 8px; width: 30px; height: 30px; font-size: 15px; cursor: pointer; font-family: inherit; }
.chat-empty { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chat-empty p { margin: 0 0 4px; flex-basis: 100%; }
/* Calendar: month grid on desktop, agenda list on phone. */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-head .cal-title { flex: 1; text-align: center; font-size: 18px; margin: 0; color: var(--ink); text-transform: none; letter-spacing: 0; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 0 6px; font-size: 13px; }
.ev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--ev); }
.ev-appt { --ev: var(--s1); } .ev-visit { --ev: var(--s2); } .ev-reg { --ev: var(--s4); } .ev-note { --ev: var(--s6); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-dn { background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 650; text-align: center; padding: 6px 0; }
.cal-day { background: var(--card); min-height: 104px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day.other { background: var(--bg); }
.cal-day.other .cal-num { opacity: .5; }
.cal-day.today .cal-num { background: var(--primary); color: var(--primary-ink); border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.cal-num { font-size: 13px; font-weight: 650; }
.ev { display: block; font-size: 12px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; border-left: 3px solid var(--ev); background: var(--hover); color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.ev:hover { background: var(--sel); }
.ev-more { font-size: 12px; color: var(--primary); }
.cal-agenda { display: none; }
.cal-agenda-date { font-weight: 700; margin: 14px 0 2px; }
.cal-agenda-day.today .cal-agenda-date { color: var(--primary); }
.cal-agenda-day:target { background: var(--sel); border-radius: 8px; }
@media (max-width: 999px) {
  .cal-grid, .cal-legend { display: none; }
  .cal-agenda { display: block; }
}
/* Desktop: the agenda is only the "+N more" target; just the clicked day shows, under the grid. */
@media (min-width: 1000px) {
  .cal-agenda { display: block; margin-top: 10px; }
  .cal-agenda > .muted, .cal-agenda-day:not(:target) { display: none; }
  .cal-agenda-day:target { padding: 0 8px 4px; }
}
/* BP card: "Larger" mode makes the chart taller. */
#bp.bp-big > svg.chart { max-height: 75vh; }
.add-bp { margin: 0 0 12px; padding: 10px; border-radius: 10px; background: var(--bg); }
.add-bp label { font-weight: 650; }
.add-bp-row { display: flex; gap: 8px; margin: 4px 0; }
.add-bp-row .field { flex: 1; min-width: 0; font-size: 17px; }
.add-bp-more summary { cursor: pointer; color: var(--primary); font-size: 14px; margin: 4px 0; }
.bp-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.bp-tools h2 { flex: 1; margin: 0; }
@media (max-width: 999px) {
  .mt-chat-launcher { bottom: calc(74px + env(safe-area-inset-bottom)); } /* above the phone tab bar */
  /* Phone pass: every tap at least 40px tall (small buttons, chips, banner close, section toggles, fields). */
  .btn-sm { min-height: 40px; padding: 9px 12px; }
  .chip { min-height: 40px; display: inline-flex; align-items: center; }
  .banner button { min-width: 40px; min-height: 40px; }
  main summary { padding-top: 12px; padding-bottom: 12px; }
  input.field, select.field { min-height: 44px; }
}
/* ---------- /log: the phone entry page (BP, pulse, symptoms). Big targets, all within thumb reach. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.b-warn { background: var(--amber-bg); color: var(--amber); }
/* Someone else's records on screen (shared with this login): always visible, never mistaken for your own. */
.b-shared { background: var(--blue-bg); color: var(--blue-ink); border-left: 6px solid var(--indigo); font-size: 15px; }
.banner .btn { background: var(--primary); color: var(--primary-ink); font-size: 14px; white-space: nowrap; }
.nav-group { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .65; padding: 10px 12px 4px; }
.quick { max-width: 560px; }
.quick fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.quick legend { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 6px; }
.quick legend .muted { font-weight: 400; font-size: 13px; }
.q-nums { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: end; }
.q-num label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; text-align: center; }
.q-num .field { width: 100%; font-size: 30px; font-weight: 700; text-align: center; padding: 6px 4px; min-height: 56px; font-variant-numeric: tabular-nums; }
.q-pulse { margin-left: 8px; }
.q-slash { font-size: 34px; color: var(--muted); padding-bottom: 12px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.q-chip input, .q-sev-btn input { position: absolute; opacity: 0; pointer-events: none; }
.q-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 13px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; cursor: pointer; user-select: none; }
.q-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 650; }
.q-chip input:checked + span::before { content: "✓ "; white-space: pre; }
.q-chip input:focus-visible + span, .q-sev-btn input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.q-other { width: 100%; font-size: 17px; min-height: 48px; }
.q-sev-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.q-sev-btn span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 18px; font-weight: 650; cursor: pointer; user-select: none; }
.q-sev-btn input:checked + span { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.q-when { margin: 0 0 14px; }
.q-when summary { font-size: 16px; padding: 8px 0; min-height: 44px; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.q-when summary b { font-weight: 650; }
.q-when .q-change { color: var(--primary); text-decoration: underline; margin-left: 4px; }
.q-when[open] .q-change { display: none; }
.q-when .field { width: 100%; font-size: 17px; min-height: 48px; }
/* Save stays in view above the tab bar however long the form gets (small phones, keyboard open). */
.q-save { font-size: 20px; min-height: 56px; position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 0 0 6px var(--card), 0 -8px 16px var(--card); }
@media (min-width: 1000px) { .q-save { position: static; box-shadow: none; } }
/* The chat bubble would sit on Save; on this page the assistant is one tab away (Ask). */
body:has(#quick) .mt-chat-launcher { display: none; }
.q-saved { border-left: 6px solid var(--teal); }
.q-saved-head { font-size: 20px; font-weight: 750; color: var(--ok-ink); }
.q-saved-what { font-size: 22px; font-weight: 700; margin: 4px 0 2px; overflow-wrap: anywhere; }
.q-saved-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.q-alert { display: block; font-weight: 600; }
/* The "+ BP" tab: the one action that matters most on the phone, so it stands out from the other tabs. */
nav.tabs a.tab-add .ic { width: 34px; height: 34px; line-height: 34px; margin: -4px auto 0; border-radius: 50%; background: var(--primary); color: #fff; font-size: 24px; }
nav.tabs a.tab-add { color: var(--primary); font-weight: 700; }
.topbar .add-btn { display: none; }
@media (min-width: 1000px) { .topbar .add-btn { display: inline-block; flex: none; } }
@media print {
  .mt-chat, .mt-chat-launcher { display: none !important; }
  nav.side, nav.tabs, .topbar, .banner, .no-print { display: none !important; }
  .shell { display: block; max-width: none; padding: 0; background: #fff; }
  html, body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
