/* Calc Voice — dark, Taste app rules (ledger move from "achromatic ledger", seed 1341809309, on the
   "true black flat" grounds). The one hue (#5b9bff) only on live data: answers, points, the score. */
:root {
  color-scheme: dark;
  /* Taste "true black flat" (app-screens §9.3): elevation by lightness alone, colour only on the data */
  --ground: #000000;  --surface: #111111;  --raised: #1a1a1a;  --active: #222222;
  --border: #2e2e2e;  --rule: #1f1f1f;     --control: #444444;
  --text: #ffffff;    --muted: #b4b4b4;    --faint: #949494;
  --primary: #ffffff; --on-primary: #000000; --data: #5b9bff; --data-tint: #12233f; --data-wash: rgba(91,155,255,.09);
  --brand: #1d5fbf; --brand-deep: #143f80; --brand-ink: #ffffff; --rec: #e5484d;
  --negative: #e5566f; --warning: #f5c56b; --notice-bg: #1f1a0c; --notice-line: #4d3d12;
  --radius-card: 8px; --radius-control: 6px;
  --gap: 12px; --pad: 24px; --card-pad: 20px; --control-height: 36px; --row: 44px;
  --fs-title: 24px; --fs-section: 16px; --fs-score: 30px; --fs-body: 14px; --fs-small: 12px;
  --font: "Geist", Inter, system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --primary-hover: #e5e5e5; --secondary-hover: #2a2a2a; --overlay-shadow: rgba(0,0,0,.6);
  --behind: #0b0b0b;
  --peek: 30px;  /* how much of each card behind shows above the one in front */
}
/* Light: Taste "achromatic ledger" (seed 1341809309) on a blue-grey ledger ground */
:root[data-theme="light"] { color-scheme: light;
  --data-wash: rgba(29,95,191,.07); --brand: #1d5fbf; --brand-deep: #174c99; --rec: #d93036;
  --ground: #f2f4f7; --surface: #ffffff; --raised: #f6f7f9; --active: #eceef1;
  --border: #e3e6ea; --rule: #eef0f3; --control: #d4d7dc;
  --text: #0a0a0a; --muted: #5f6368; --faint: #6b6b6b;
  --primary: #141414; --on-primary: #ffffff; --data: #1d5fbf; --data-tint: #e3edfb;
  --negative: #c4242a; --warning: #92400e; --notice-bg: #fffbeb; --notice-line: #fde68a;
  --behind: #f6f7f9; --primary-hover: #2b2b2b; --secondary-hover: #e2e5e9; --overlay-shadow: rgba(0,0,0,.08); }
@media (prefers-color-scheme: light) { :root[data-theme="system"] { color-scheme: light;
  --data-wash: rgba(29,95,191,.07); --brand: #1d5fbf; --brand-deep: #174c99; --rec: #d93036;
  --ground: #f2f4f7; --surface: #ffffff; --raised: #f6f7f9; --active: #eceef1;
  --border: #e3e6ea; --rule: #eef0f3; --control: #d4d7dc;
  --text: #0a0a0a; --muted: #5f6368; --faint: #6b6b6b;
  --primary: #141414; --on-primary: #ffffff; --data: #1d5fbf; --data-tint: #e3edfb;
  --negative: #c4242a; --warning: #92400e; --notice-bg: #fffbeb; --notice-line: #fde68a;
  --behind: #f6f7f9; --primary-hover: #2b2b2b; --secondary-hover: #e2e5e9; --overlay-shadow: rgba(0,0,0,.08); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font: 400 var(--fs-body)/20px var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; caret-color: var(--data);
}
::selection { background: var(--data-tint); color: var(--text); }
:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--control) transparent; }
h1, h2, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.i { width: 16px; height: 16px; flex: none; }
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 12vh 16px 32px; text-align: center; }
.gate[hidden] { display: none; }
.gate img { border-radius: 14px; }
.gate h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; margin-top: 16px; }
.gate p { color: var(--muted); margin: 6px 0 28px; max-width: 34ch; }
#signin { display: flex; justify-content: center; width: 100%; }

/* ---------- top bar (no-sidebar shell: two destinations do not earn a sidebar) */
.bar {
  display: flex; align-items: center; gap: var(--gap);
  height: 56px; padding: 0 var(--pad); padding-top: env(safe-area-inset-top);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; }
.mark { width: 22px; height: 22px; border-radius: 5px; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-left: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--control); transition: background-color 200ms ease; }
.listening .dot { background: var(--rec); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.spacer { flex: 1; }
.now { display: none; }
.stat { color: var(--muted); font-size: var(--fs-small); }
.user { width: 28px; height: 28px; }
.theme { display: inline-flex; padding: 2px; gap: 2px; background: var(--active); border-radius: var(--radius-control); }
.theme button {
  all: unset; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; color: var(--muted); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.theme button:active { transform: scale(0.95); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.theme button:focus-visible { outline: 2px solid var(--data); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: var(--control-height); padding: 0 14px;
  border-radius: var(--radius-control); border: 0; font: 500 var(--fs-body)/1 var(--font); cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary.recording { background: #c9302c; color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn.primary.recording:hover { background: #b52a26; } }
.btn.primary { background: var(--primary); color: var(--on-primary); min-width: 96px; justify-content: center; }
.btn.secondary { background: var(--active); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { background: var(--primary-hover); }
  .btn.secondary:hover { background: var(--secondary-hover); }
}
#reset .short { display: none; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ---------- canvas: 2 panes. Arithmetic at 1440: 24 + 560 + 12 + 820 + 24 = 1440 (5fr : 7fr of 1380) */
.canvas {
  display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: var(--gap);
  padding: 0 var(--pad) var(--pad); height: calc(100dvh - 56px);
}
.pane { min-height: 0; display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
.pane-head h2 { font-size: var(--fs-section); font-weight: 500; }
.meta { color: var(--muted); font-size: var(--fs-small); }

.transcript .t-body {
  flex: 1; overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--card-pad); font-size: 16px; line-height: 26px;
}
.t-body p { max-width: 68ch; }
.t-body p + p { margin-top: 10px; }
.t-body p { color: var(--muted); transition: color 400ms ease; }
.t-body p:nth-last-child(-n+2):not(.draft):not(.empty) { color: var(--text); }
.t-body .draft { color: var(--data); }
.t-body .empty { color: var(--muted); font-size: var(--fs-body); line-height: 20px; }
.t-body mark { background: var(--data-tint); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- finder */
.deck { overflow-y: auto; padding-right: 2px; }
.finder { position: relative; padding: 4px 0 10px; }
.search {
  display: flex; align-items: center; gap: 8px; height: var(--control-height); padding: 0 12px;
  background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-control); color: var(--muted);
}
.search:focus-within { border-color: var(--text); }
.search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--text); min-width: 0; }
.search input::placeholder { color: var(--faint); }
.results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% - 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: 0 8px 24px var(--overlay-shadow); /* taste-skill-ignore: a real overlay (dropdown) */ transform-origin: top center;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.results[hidden] { display: block; opacity: 0; transform: scale(0.98); pointer-events: none; }
.results button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.results button:hover, .results button:focus-visible { background: var(--active); outline: none; }
.results small { display: block; color: var(--muted); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- the stack: front card in flow, earlier cards behind it peeking above, like cards in a wallet */
.stack { position: relative; display: grid; transition: padding-top 300ms var(--ease-drawer); }
.card {
  grid-area: 1 / 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--card-pad); transform-origin: top center;
  transition: transform 320ms var(--ease-drawer), opacity 240ms ease;
}
.card[data-depth="0"] { position: relative; z-index: 10; box-shadow: inset 0 3px 0 var(--brand); }
.card[data-depth="2"], .card[data-depth="3"] { background: var(--brand-deep) !important; }
.card[data-depth]:not([data-depth="0"]) {
  position: absolute; inset: 0; overflow: hidden; cursor: pointer; background: var(--brand); border-color: transparent;
}
.card[data-depth]:not([data-depth="0"]) .card-body { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .card[data-depth="1"]:hover { transform: translateY(calc(var(--peek) * -1 - 4px)) scale(0.97); }
}
.card.entering { opacity: 0; transform: translateY(16px) scale(0.98); }
.card.leaving { opacity: 0; transform: translateY(calc(var(--peek) * -4)) scale(0.88); pointer-events: none; }
.placeholder h1 { font-size: 18px; font-weight: 500; }
.placeholder .lede { color: var(--muted); margin-top: 6px; }

.card-head { display: flex; align-items: baseline; gap: 12px; min-height: 28px; }
.card-head .ct { flex: 1; font-size: var(--fs-title); line-height: 30px; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.card-head .peek-score { display: none; color: var(--muted); white-space: nowrap; }
.card[data-depth]:not([data-depth="0"]) .card-head .ct { font-size: var(--fs-body); line-height: 20px; color: var(--brand-ink); font-weight: 500; }
.card[data-depth]:not([data-depth="0"]) .peek-score, .card[data-depth]:not([data-depth="0"]) .src { color: rgba(255,255,255,.8); }
.card[data-depth]:not([data-depth="0"]) .peek-score { display: block; }
.card[data-depth]:not([data-depth="0"]) { padding-top: 5px; }
.card[data-depth]:not([data-depth="0"]) .card-head { min-height: 0; }
.src { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-small); text-decoration: none; white-space: nowrap; }
.src:hover { color: var(--text); }
.src .i { width: 12px; height: 12px; }
.card .summary { color: var(--muted); margin: 4px 0 14px; max-width: 70ch; }

/* ---------- the ledger: one row per item, points in a right column, the total at the foot */
.ledger { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 48px; column-gap: 12px; align-items: start;
  padding: 11px 0; border-top: 1px solid var(--rule);
}
.row .state { width: 16px; height: 16px; margin-top: 2px; color: var(--control); transition: color 200ms ease, transform 200ms var(--ease-out); }
.row .label { transition: color 200ms ease; }
.row .ev { display: block; color: var(--muted); font-size: var(--fs-small); line-height: 16px; margin-top: 2px; min-height: 0; }
.row .ev:empty { display: none; }
.row .ans { color: var(--data); font-weight: 500; text-align: right; max-width: 22ch; }
.row .pts { text-align: right; color: var(--text); }
.row .pts:empty::after, .row .ans:empty::after { content: "—"; color: var(--control); font-weight: 400; }
.no-points .row { grid-template-columns: 16px minmax(0, 1fr) auto; }
.no-points .row .pts { display: none; }
.row.asked .state { color: var(--muted); }
.row.asked .label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--control); }
.row.done .state { color: var(--data); }
.row.done .label { color: var(--muted); }
.row { margin: 0 calc(var(--card-pad) * -1); padding-left: var(--card-pad); padding-right: var(--card-pad); transition: background-color 400ms ease; }
.row.done { background: var(--data-wash); }
.row.flip .state { transform: scale(0.8); }
.row.unsure .ans { color: var(--warning); }

.total {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px;
  margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--data-tint);
}
.total .t-label { font-weight: 500; }
.total .t-progress { grid-column: 1; color: var(--muted); font-size: var(--fs-small); }
.total .score { grid-row: 1 / span 2; grid-column: 2; font-size: 34px; line-height: 40px; font-weight: 700; color: var(--data); text-align: right; }
.total .score small { font-size: var(--fs-body); color: var(--muted); font-weight: 400; margin-left: 4px; }
.total .score.none { display: none; }
.interp { margin-top: 12px; max-width: 70ch; }
.interp:empty { display: none; }
.detail { margin-top: 6px; color: var(--muted); font-size: var(--fs-small); }
.detail:empty { display: none; }
.provisional {
  margin-top: 12px; padding: 8px 10px; border-radius: 6px; font-size: var(--fs-small);
  background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--warning);
}
.provisional[hidden] { display: none; }

/* ---------- also possible */
.also { padding-top: 16px; }
.also h2 { font-size: var(--fs-small); font-weight: 400; color: var(--muted); margin-bottom: 4px; }
.also ul { list-style: none; margin: 0; padding: 0; }
.also button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: 12px; width: 100%;
  padding: 8px 10px; margin: 0 -10px; border-radius: 6px; cursor: pointer;
}
.also button:hover, .also button:focus-visible { background: var(--active); }
.also .pc { color: var(--muted); }

/* ---------- tablet and phone: one column, the card first (it answers the question), transcript after */
@media (max-width: 860px) {
  :root { --pad: 16px; --card-pad: 16px; --fs-title: 20px; --peek: 26px; }
  .canvas { grid-template-columns: 1fr; height: auto; grid-template-areas: "deck" "transcript"; }
  .deck { grid-area: deck; overflow: visible; }
  .transcript { grid-area: transcript; }
  .transcript .t-body { max-height: 40vh; font-size: 15px; line-height: 24px; }
  .stat, .status { display: none; }
  .now {
    display: block; position: sticky; top: 56px; z-index: 29; margin: 0; padding: 0 var(--pad) 10px;
    background: var(--ground); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .now:empty { display: none; }
  .bar { position: sticky; top: 0; z-index: 30; background: var(--ground); }
  .btn { height: 44px; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .theme button { width: 28px; }
  #reset .long { display: none; }
  #reset .short { display: inline; }
  .row .ans { max-width: 14ch; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .stack, .row .state, .results { transition: opacity 150ms ease, color 150ms ease; }
  .card.entering, .card.leaving { transform: none; }
  .row.flip .state { transform: none; }
  .listening .dot { animation: none; }
}

/* ---------- Med Voice: counselling cards */
.med .summary { margin-bottom: 10px; }
.gp { margin: 0 0 6px; border-radius: 6px; background: var(--raised); }
.gp summary { cursor: pointer; padding: 8px 10px; color: var(--muted); font-size: var(--fs-small); list-style: none; }
.gp summary::-webkit-details-marker { display: none; }
.gp summary::before { content: "+"; display: inline-block; width: 14px; color: var(--faint); }
.gp[open] summary::before { content: "\2212"; }
.gp dl { margin: 0; padding: 0 10px 10px 24px; font-size: 13px; line-height: 18px; }
.gp dt { color: var(--muted); margin-top: 6px; }
.gp dd { margin: 2px 0 0; }
.gp ul { margin: 0; padding-left: 16px; }
.sec h3 { font-size: var(--fs-small); font-weight: 500; color: var(--muted); margin: 16px 0 2px; }
.sec-help h3, .sec-important h3 { color: var(--rec); }
li.point { grid-template-columns: 16px minmax(0, 1fr) auto !important; font-size: 15px; line-height: 22px; }
.point .say { color: var(--text); transition: color 300ms ease; }
.point.done .say { color: var(--muted); }
mark.anchor {
  background: var(--data-tint); color: var(--text); font-weight: 600; border-radius: 4px; padding: 0 3px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background-color 300ms ease, color 300ms ease;
}
.point.must mark.anchor { background: rgba(229,72,77,.18); }
.point.done mark.anchor { background: transparent; color: var(--muted); font-weight: 500; }
.must-tag {
  align-self: center; flex: none; white-space: nowrap; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px;
  background: rgba(229,72,77,.16); color: #ff8a8e; font-weight: 500;
}
:root[data-theme="light"] .must-tag { color: #9f1c20; background: #ffedea; }
.point.done .must-tag { opacity: 0; transition: opacity 300ms ease; }
.point.done .state { color: var(--data); }
.left { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(229,72,77,.35); }
.left h3 { font-size: var(--fs-small); font-weight: 500; color: #ff8a8e; margin: 0 0 4px; }
:root[data-theme="light"] .left h3 { color: #9f1c20; }
.left ul { margin: 0; padding-left: 16px; }
.left li { margin: 3px 0; }
.left[hidden] { display: none; }
.total .score small { font-size: var(--fs-body); }

/* ---------- vivid (Firdaus's vivid-pdf style): a coloured banner per medicine, a coloured card per section,
   yellow highlighter on the must-say words */
.med { padding: 0; overflow: hidden; }
.med .card-body { padding: 0 var(--card-pad) var(--card-pad); }
.banner {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 20px 20px; margin-bottom: 14px; color: #fff;
  background: oklch(0.5 0.17 var(--h));   /* even lightness across hues so white text always reads */
}
.banner::before, .banner::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none; }
.banner::before { width: 160px; height: 160px; right: -40px; top: -70px; }
.banner::after { width: 110px; height: 110px; left: -30px; bottom: -60px; background: rgba(255,255,255,.08); }
.banner .kicker { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .85; position: relative; }
.banner .ct { color: #fff !important; font-size: 30px !important; line-height: 36px !important; font-weight: 700 !important; letter-spacing: -0.02em; position: relative; }
.banner .peek-score { color: rgba(255,255,255,.9) !important; position: relative; }
.card.med[data-depth]:not([data-depth="0"]) { background: oklch(0.42 0.14 var(--h)) !important; padding: 0; }
.card.med[data-depth]:not([data-depth="0"]) .banner { flex-direction: row; justify-content: space-between; padding: 6px 18px; background: none; margin: 0; }
.card.med[data-depth]:not([data-depth="0"]) .banner .kicker { display: none; }
.card.med[data-depth]:not([data-depth="0"]) .banner .ct { font-size: 14px !important; line-height: 20px !important; }
.card.med[data-depth="0"] { box-shadow: none; }
.med .summary { text-align: center; margin: 0 auto 12px; max-width: 60ch; }

.sec { margin-top: 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); overflow: hidden; }
.sec h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 !important; padding: 8px 14px; font-size: 13px !important; font-weight: 700 !important;
  color: #fff !important; background: color-mix(in srgb, var(--c) 78%, #000); letter-spacing: .01em;   /* deepened so 13px white text reads at 4.5:1 */
}
.sec h3 .ic, .left h3 .ic { width: 12px; height: 12px; flex: none; }
.sec .ledger { padding: 0 14px; }
.sec .row { margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-top: 1px solid color-mix(in srgb, var(--c) 18%, transparent); }
.sec .row:first-child { border-top: 0; }
.sec .row.done { background: color-mix(in srgb, var(--c) 16%, transparent); }
.sec .row.done .state { color: var(--c); }
.sec .row .state { color: color-mix(in srgb, var(--c) 55%, var(--control)); }
mark.anchor { background: #fde047 !important; color: #111 !important; font-weight: 600; }
.point.must mark.anchor { background: #fde047 !important; box-shadow: inset 0 -2px 0 #dc2626; }
.point.done mark.anchor { background: color-mix(in srgb, #fde047 35%, transparent) !important; color: var(--muted) !important; box-shadow: none; }
.must-tag { background: #dc2626 !important; color: #fff !important; }
.left { border: 0; background: color-mix(in srgb, #ca8a04 14%, var(--surface)); border-left: 4px solid #ca8a04; border-radius: 8px; }
.left h3 { color: #eab308 !important; display: flex; gap: 6px; align-items: center; }
:root[data-theme="light"] .left h3 { color: #a16207 !important; }
.med .total { background: oklch(0.5 0.17 var(--h) / .16); }
.med .total .score { color: oklch(0.8 0.14 var(--h)); }
:root[data-theme="light"] .med .total .score { color: oklch(0.45 0.17 var(--h)); }

/* ---------- BNF dose panel: indication chips, verbatim dose lines (coloured by the medicine's own hue) */
.dose { margin: 0 0 10px; border-radius: 10px; overflow: hidden; border: 1px solid oklch(0.5 0.17 var(--h) / .45); background: oklch(0.5 0.17 var(--h) / .08); }
.dose[hidden] { display: none; }
.dose header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: oklch(0.5 0.17 var(--h)); }
.dose header h3 { margin: 0; font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .01em; }
.dose header .src { color: rgba(255,255,255,.85); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.pills button {
  font: 500 13px/1 var(--font); padding: 7px 11px; border-radius: 999px; cursor: pointer; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.pills button:active { transform: scale(0.96); }
.pills button[aria-pressed="true"] { background: oklch(0.5 0.17 var(--h)); border-color: transparent; color: #fff; }
.pills.drugs button[aria-pressed="true"] { background: var(--text); color: var(--ground); }
.ind-detail { padding: 8px 14px 0; color: var(--muted); font-size: 12px; line-height: 17px; }
.route { padding: 10px 14px 0; }
.route:last-child { padding-bottom: 12px; }
.route h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: oklch(0.82 0.12 var(--h)); }
:root[data-theme="light"] .route h4 { color: oklch(0.45 0.17 var(--h)); }
.route dl { margin: 0; }
.dg { display: grid; grid-template-columns: 108px 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid oklch(0.5 0.17 var(--h) / .2); }
.dg:first-child { border-top: 0; }
.dg dt { color: var(--muted); font-size: 13px; }
.dg dd { margin: 0; font-size: 14px; line-height: 21px; }
.kids summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 6px 0 2px; }
@media (max-width: 480px) { .dg { grid-template-columns: 1fr; gap: 2px; } }

.left li b { color: #ff8a8e; font-weight: 600; margin-right: 4px; }
:root[data-theme="light"] .left li b { color: #9f1c20; }

/* ---------- interactions: the clinician's own check, verbatim from the notes, last on the card */
.ix { margin-top: 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--raised); }
.ix h3 { margin: 0; padding: 8px 14px; font-size: 13px; font-weight: 700; color: #fff; background: #475569; }
.ix ul { list-style: none; margin: 0; padding: 8px 14px 12px; font-size: 14px; line-height: 21px; }
.ix li { position: relative; padding-left: 14px; margin-top: 4px; }
.ix li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; }
.ix li.lv0 { font-weight: 500; margin-top: 8px; }
.ix li.lv0:first-child { margin-top: 0; }
.ix li.lv1 { margin-left: 16px; color: var(--muted); }
.ix li.lv2 { margin-left: 32px; color: var(--muted); }
.ix li.lv1::before, .ix li.lv2::before { background: transparent; border: 1px solid #94a3b8; }

/* said points are crossed off as well as ticked */
.point.done .say { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--c, #888) 70%, transparent); }
.point.done mark.anchor { text-decoration: line-through; }

/* Important as a lookup table: If the patient has… | What to say */
.if-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.if-table thead th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 14px 4px; }
.if-table thead th:first-child { width: 34%; }
.if-table tbody tr { border-top: 1px solid color-mix(in srgb, var(--c) 18%, transparent); transition: background-color 400ms ease; }
.if-table tbody th { text-align: left; vertical-align: top; padding: 10px 8px 10px 14px; font-weight: 600; color: var(--text); }
.if-table tbody th .state { width: 14px; height: 14px; vertical-align: -2px; margin-right: 8px; color: color-mix(in srgb, var(--c) 55%, var(--control)); }
.if-table tbody td { vertical-align: top; padding: 10px 14px 10px 6px; }
.if-table tr.done { background: color-mix(in srgb, var(--c) 16%, transparent); }
.if-table tr.done th { color: var(--muted); text-decoration: line-through; }
.if-table tr.done .state { color: var(--c); }
.if-table .must-tag { vertical-align: 1px; margin-left: 4px; }
@media (max-width: 480px) { .if-table thead th:first-child { width: 38%; } .if-table { font-size: 14px; } }

/* no highlighter (Firdaus): anchor words are simply bold */
mark.anchor, .point.must mark.anchor { background: none !important; color: inherit !important; font-weight: 700; padding: 0; box-shadow: none !important; }
.point.done mark.anchor { background: none !important; color: inherit !important; font-weight: 600; }
