/* Organdle: "Clinic & lab". A pale chart-paper page with a faint grid, ward-style mono labels, blood-tube-cap colours
   for the three modes, specimen-label hint chips, strong same/close/no-match cells (check / approx marks, hatching
   for "close") and the result as a lab report. The brand is the red kidney-bean wordmark (its colours stay the same).
   Fonts (self-hosted, SIL OFL, see fonts/OFL-IBMPlex.txt): IBM Plex Sans, IBM Plex Sans Condensed, IBM Plex Mono.
   The wordmark's letters are paths (Bricolage Grotesque ExtraBold, SIL OFL), so it needs no font of its own. */
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/plex-sans-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/plex-sans-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/plex-sans-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/plex-sans-700.woff2) format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/plex-sans-italic.woff2) format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url(/fonts/plex-sans-condensed-600.woff2) format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plex-mono-500.woff2) format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plex-mono-600.woff2) format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --bg: #edf3f3; --grid: rgba(14, 74, 84, .055); --surface: #ffffff; --surface2: #f6f9f9;
  --ink: #0c2830; --muted: #557079; --line: #cddbde; --line-strong: #9fb6bb;
  --accent: #0b5f6c; --accent-ink: #ffffff; --focus: #1b8fa0;
  --hit: #17784a; --hit-ink: #ffffff;
  --near: #e3a468; --near-ink: #3a1f05; --near-hatch: rgba(255, 255, 255, .28);
  --miss: #e2e9eb; --miss-ink: #4f646b;
  --cap-classic: #8a6cc2; --cap-hard: #c4433a; --cap-rx: #4f9fd1;
  --report: #fbfdfd; --flag: #c4433a;
  /* the brand (wordmark, favicon): Direction C's blood red and organ pink */
  --blood: #B0132F; --flesh: #F2A3AD; --flesh-2: #FFC9D0; --mark-shadow: rgba(110, 10, 30, .25);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(12, 40, 48, .08), 0 12px 30px -10px rgba(12, 40, 48, .28);

  --dg-ink: var(--ink); --dg-bg: var(--bg); --dg-surface: var(--surface2);
  --dg-accent: var(--accent); --dg-accent-ink: var(--accent-ink); --dg-muted: var(--muted); --dg-line: var(--line);
  --dg-current: var(--accent); --dg-focus: var(--focus);
  --dg-font: var(--sans); --dg-font-label: var(--mono); --dg-font-num: var(--mono);
  --dg-label-size: .72rem; --dg-label-track: .07em; --dg-radius: 6px;
  --dg-rule: 1px solid var(--line); --dg-rule-strong: 2px solid var(--ink);
  --dg-flame-outer: #c4433a; --dg-flame-inner: #e3a468;
  --dg-bar: var(--accent); --dg-bar-ink: var(--accent-ink); --dg-bar-me: var(--hit); --dg-bar-me-ink: var(--hit-ink);
  --dg-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b181d; --grid: rgba(120, 200, 210, .05); --surface: #11242b; --surface2: #0f2026;
    --ink: #e2eef0; --muted: #8aa5ad; --line: #21404a; --line-strong: #3b6470;
    --accent: #4fb3bf; --accent-ink: #04222a; --focus: #7fd3dd;
    --hit: #2e9f63; --hit-ink: #ffffff;
    --near: #c98a4f; --near-ink: #1f1003; --near-hatch: rgba(0, 0, 0, .16);
    --miss: #1b333b; --miss-ink: #93acb3;
    --report: #0f2229; --flag: #ef7a6f;
    --blood: #E8324F; --flesh: #F59AA6; --mark-shadow: rgba(0, 0, 0, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -12px rgba(0, 0, 0, .8);
    --dg-flame-outer: #ef7a6f; --dg-flame-inner: #e3a468;
  }
}
:root[data-theme="dark"] {
  --bg: #0b181d; --grid: rgba(120, 200, 210, .05); --surface: #11242b; --surface2: #0f2026;
  --ink: #e2eef0; --muted: #8aa5ad; --line: #21404a; --line-strong: #3b6470;
  --accent: #4fb3bf; --accent-ink: #04222a; --focus: #7fd3dd;
  --hit: #2e9f63; --hit-ink: #ffffff;
  --near: #c98a4f; --near-ink: #1f1003; --near-hatch: rgba(0, 0, 0, .16);
  --miss: #1b333b; --miss-ink: #93acb3;
  --report: #0f2229; --flag: #ef7a6f;
  --blood: #E8324F; --flesh: #F59AA6; --mark-shadow: rgba(0, 0, 0, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -12px rgba(0, 0, 0, .8);
  --dg-flame-outer: #ef7a6f; --dg-flame-inner: #e3a468;
}

html { background-color: var(--bg); }
body {
  min-height: 100vh; background-color: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--accent); }
i[lang="la"], .o-la { font-style: italic; }
.o-fill { fill: currentColor; stroke: none; }

/* ---------- chart strip (full width), header with the wordmark ---------- */
.o-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px;
  /* the strip's band and rule run the full width of the window without widening the page */
  border-image: linear-gradient(to top, var(--line) 1px, var(--surface2) 1px) fill 0 / 0 / 0 100vmax;
}
.o-strip-l {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums;
}
.o-strip .dg-langs { flex: none; gap: 2px; }
.o-strip .dg-langs a { min-width: 36px; font: 500 12px/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
.o-strip .dg-langs a[aria-current] { color: var(--ink); font-weight: 600; text-decoration: underline 2px var(--accent); text-underline-offset: 6px; }

.o-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 6px; }
.o-logo { display: block; flex: 0 1 auto; min-width: 0; color: var(--ink); text-decoration: none; }
.o-mark {
  display: block; width: clamp(196px, 31vw, 318px); height: auto; overflow: visible; margin: 2px 0 0 -6px;
  transform: rotate(-4deg); filter: drop-shadow(0 10px 12px var(--mark-shadow));
}
.o-mark-bean { fill: var(--blood); }
.o-mark-hl { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 9; stroke-linecap: round; }
.o-mark-tube { fill: none; stroke: var(--flesh); stroke-width: 15; stroke-linecap: round; }
.o-mark-w1 { fill: #fff; }
.o-mark-w2 { fill: var(--flesh-2); }
.o-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.o-icon, .o-tools .dg-flame {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); text-decoration: none; cursor: pointer;
  font: 600 14px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase;
}
.o-icon:hover { border-color: var(--line-strong); color: var(--ink); }
.o-icon svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.o-tools .dg-flame { cursor: default; gap: 6px; color: var(--ink); font: 600 15px/1 var(--mono); --dg-flame-size: 18px; }
.o-tools .dg-flame.cold { color: var(--muted); }
@media (max-width: 760px) { .o-icon-l { display: none; } .o-icon, .o-tools .dg-flame { padding: 0 9px; } }

/* ---------- question, intro, modes as sample tubes ---------- */
.o-q { margin: 16px 0 10px; font: 700 clamp(28px, 4.4vw, 46px)/1.08 var(--sans); letter-spacing: -.025em; text-wrap: balance; }
.o-intro { margin: 0 0 24px; max-width: 46em; color: var(--muted); font-size: 17px; text-wrap: pretty; }
.q-hard, .q-rx { display: none; }
.mode-hard .q-normal, .mode-rx .q-normal { display: none; }
.mode-hard .q-hard, .mode-rx .q-rx { display: inline; }

.dg-modes {
  display: inline-grid; grid-template-columns: repeat(3, minmax(132px, 1fr)); gap: 0; margin: 0 0 22px;
  border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface);
}
.dg-mode-normal { --cap: var(--cap-classic); } .dg-mode-hard { --cap: var(--cap-hard); } .dg-mode-rx { --cap: var(--cap-rx); }
.dg-modes a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 62px; margin: 0;
  padding: 14px 18px 11px; border: 0; color: var(--muted); text-align: center; font: 600 15px/1 var(--sans);
}
.dg-modes a + a { border-left: 1px solid var(--line); }
.dg-modes a::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--cap); opacity: .45; }
.dg-modes a small { display: block; margin-top: 6px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .8; white-space: nowrap; }
.dg-modes a[aria-current] { background: var(--ink); color: var(--bg); }
.dg-modes a[aria-current]::before { opacity: 1; }
.dg-modes a:not([aria-current]):hover { color: var(--ink); background: var(--surface2); }

.o-howto { margin: 0 0 18px; padding: 12px 14px 10px 16px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 6px; background: var(--surface); font-size: 15px; }
.o-howto p { margin: 0 0 8px; }

/* ---------- buttons, input, list ---------- */
.o-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  font: 600 15px/1 var(--sans); cursor: pointer; text-decoration: none;
}
.o-btn:disabled { opacity: .45; cursor: default; }
.o-btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.o-btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.o-game { position: relative; }
.o-play { margin: 0 0 6px; scroll-margin-top: 8px; }
.o-search { position: relative; display: flex; border-radius: 8px; scroll-margin-top: 8px; }
.o-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
#guess {
  flex: 1; min-width: 0; height: 60px; padding: 0 18px; border: 2px solid var(--ink); border-right: 0; border-radius: 8px 0 0 8px;
  background: var(--surface); color: var(--ink); font: 500 20px/1 var(--sans); outline: none;
}
#guess::placeholder { color: var(--muted); opacity: .85; }
#guess:disabled { opacity: 1; }
.o-go {
  flex: none; height: 60px; padding: 0 28px; border: 2px solid var(--ink); border-left: 0; border-radius: 0 8px 8px 0;
  background: var(--accent); color: var(--accent-ink); font: 600 16px/1 var(--sans); letter-spacing: .01em; cursor: pointer;
}
.o-go:disabled { cursor: default; }
.o-go:not(:disabled):hover { filter: brightness(1.1); }
.o-opts {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: min(50vh, 340px); margin: 0; padding: 0;
  overflow: auto; overscroll-behavior: contain; list-style: none; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow);
}
.o-opts li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px; min-height: 44px; padding: 11px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 500;
}
.o-opts li:last-child { border-bottom: 0; }
.o-opts li small { color: var(--muted); font-size: 13.5px; font-weight: 400; text-align: right; }
.o-opts li[aria-selected="true"], .o-opts li:hover { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.o-opts .o-none { color: var(--muted); cursor: default; font-weight: 400; }
.o-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 12px; }
.o-hints { display: flex; flex-wrap: wrap; gap: 8px; }
/* hint chips: specimen labels, a mono key and a value */
.o-hint, .o-hint-btn {
  display: inline-flex; align-items: stretch; min-height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font: 400 14px/1.25 var(--sans); text-align: left; overflow: hidden;
}
.o-hint small, .o-hint-btn small {
  display: flex; align-items: center; padding: 0 10px; border-right: 1px dashed var(--line-strong);
  font: 600 12px/1.25 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.o-hint b, .o-hint-btn span { display: flex; align-items: center; padding: 0 12px; font-weight: 600; }
.o-hint b { font-size: 15px; }
.o-hint-btn { cursor: pointer; border-color: var(--ink); }
.o-hint-btn span { color: var(--accent); }
.o-hint-btn:not(:disabled):hover { background: var(--surface2); }
.o-hint-btn:disabled { cursor: default; border-style: dashed; border-color: var(--line-strong); }
.o-hint-btn:disabled span { color: var(--muted); font-weight: 400; }
.o-link {
  min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--muted); font: 400 14px var(--sans);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; cursor: pointer;
}
.o-link:hover { color: var(--ink); }
.o-link:disabled { opacity: .5; cursor: default; }
.o-link.o-armed { color: var(--flag); text-decoration-color: var(--flag); font-weight: 600; }
.o-msg { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.o-msg.o-error { color: var(--flag); }
.o-msg:empty { display: none; }
.o-noscript { padding: 12px 14px; border-left: 4px solid var(--flag); background: var(--surface); }

/* ---------- Rx: the clues as a lab requisition ---------- */
.o-clues {
  margin: 0 0 16px; padding: 0; list-style: none; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); overflow: hidden; scroll-margin-top: 6px;
}
.o-clue {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 11px 16px 12px 20px;
  scroll-margin-top: 6px;
}
.o-clue + .o-clue { border-top: 1px solid var(--line); }
.o-clue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cap-rx); }
.o-clue-k { font: 600 11.5px/1.35 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.o-clue-v { font: 600 19px/1.25 var(--sans); }
.o-clue-s { color: var(--muted); font-size: 14px; }
.o-clue-locked { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--surface2) 7px 9px); }
.o-clue-locked::before { background: var(--line); }
.o-clue-locked { grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; align-items: baseline; padding-top: 9px; padding-bottom: 9px; }
.o-clue-locked .o-clue-s { font-style: italic; }
.o-clue-new { animation: o-in .45s ease-out; }

/* ---------- the board ---------- */
.o-board-wrap { margin-top: 28px; }
.o-board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.o-board-h { margin: 0; font: 600 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.o-board-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.o-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; color: var(--muted); font-size: 13px; }
.o-legend span { display: inline-flex; align-items: center; gap: 6px; }
.o-legend .o-arrows { font-family: var(--mono); font-size: 12.5px; }
.o-legend .o-arrows b { font-size: 9px; letter-spacing: 1px; }
.o-sw { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; }
.o-sw svg, .o-gl svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.o-sw.st-wrong { box-shadow: inset 0 0 0 1px var(--line-strong); }
.o-sw.st-partial { background-image: repeating-linear-gradient(135deg, var(--near-hatch) 0 2px, transparent 2px 5px); }

/* a grid on every screen; --w is the cells' column template (game.js renderHead) */
.o-board, .o-board thead, .o-board tbody { display: block; }
.o-board { width: 100%; }
.o-board tr { display: grid; grid-template-columns: minmax(150px, 1.5fr) var(--w, repeat(var(--n), minmax(0, 1fr))); gap: 4px; }
.o-board thead tr { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 2px solid var(--ink); }
.o-board thead th {
  align-self: end; padding: 0 2px; font: 600 11.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); text-align: center; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto;
}
.o-board thead .o-th-name { text-align: left; }
.o-board:not(:has(tbody tr)) thead { display: none; }
.o-board tbody tr { margin-bottom: 4px; }
.o-spec { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 4px; text-align: left; font-weight: 400; }
.o-no { flex: none; width: 22px; font: 500 12px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.o-nmw { display: block; min-width: 0; }
.o-nm { display: block; font-weight: 600; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.o-la { display: block; color: var(--muted); font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.o-win .o-nm { color: var(--hit); }
.o-board td {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 62px;
  padding: 8px 6px; border-radius: 5px; text-align: center; font-size: 14px; font-weight: 500; line-height: 1.2;
  overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
.o-cols8 td { font-size: 12.5px; padding-left: 4px; padding-right: 4px; }
.o-cols8 td.o-c-mass { font-size: 14px; }
.o-v span span { display: block; }
.o-board .o-short { display: none; }
.st-correct { background-color: var(--hit); color: var(--hit-ink); }
.st-partial { background-color: var(--near); background-image: repeating-linear-gradient(135deg, var(--near-hatch) 0 3px, transparent 3px 8px); color: var(--near-ink); }
.st-wrong { background-color: var(--miss); color: var(--miss-ink); }
.o-board td.st-correct, .o-board td.st-partial { font-weight: 600; }
.o-gl { position: absolute; top: 4px; right: 5px; display: block; line-height: 0; opacity: .95; }
.o-gl svg { width: 11px; height: 11px; stroke-width: 1.9; }
.o-tri { display: block; width: 9px; height: 9px; margin: 4px auto 0; fill: currentColor; }
.o-c-mass { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.o-new td { animation: o-in .5s ease-out both; animation-delay: calc(var(--i) * 70ms); }
@keyframes o-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .o-new td, .o-clue-new { animation: none; } }
.o-board .o-k { display: none; }
.o-yesterday { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.o-yesterday:empty { display: none; }

/* "Full labels" (shared switch, DG.fullLabels), drawn as a small switch */
.o-fullbox { display: flex; }
.o-fullbox .dg-fulltoggle { min-height: 44px; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.o-fullbox .dg-fulltoggle-in {
  appearance: none; -webkit-appearance: none; position: relative; width: 30px; height: 18px; margin: 0; border-radius: 9px;
  background: var(--line-strong); cursor: pointer; transition: background .15s;
}
.o-fullbox .dg-fulltoggle-in::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s;
}
.o-fullbox .dg-fulltoggle-in:checked { background: var(--accent); }
.o-fullbox .dg-fulltoggle-in:checked::after { transform: translateX(12px); }
@media (prefers-reduced-motion: reduce) { .o-fullbox .dg-fulltoggle-in, .o-fullbox .dg-fulltoggle-in::after { transition: none; } }

/* ---------- phones: one compact line per guess under a single header ---------- */
@media (max-width: 640px) {
  .o-strip { gap: 6px; }
  .o-strip-l { font-size: 11px; letter-spacing: 0; }
  .o-strip .dg-langs { gap: 0; }
  .o-strip .dg-langs a { min-width: 31px; padding: 0 2px; font-size: 11px; letter-spacing: .02em; }
  .o-head { padding: 10px 0 2px; }
  .o-mark { width: min(200px, 54vw); margin-left: -4px; filter: drop-shadow(0 6px 7px var(--mark-shadow)); }
  .o-q { margin-top: 12px; font-size: clamp(24px, 7vw, 28px); }
  .o-intro { font-size: 15px; margin-bottom: 16px; }
  .dg-modes { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
  .dg-modes a { min-height: 56px; padding: 12px 4px 10px; font-size: 15px; }
  .dg-modes a small { font-size: 9.5px; letter-spacing: .03em; }
  #guess { height: 54px; padding: 0 14px; font-size: 18px; }
  .o-go { height: 54px; padding: 0 18px; }
  .o-actions { margin-top: 10px; gap: 2px 14px; }
  .o-hints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 100%; gap: 8px; }
  .o-hint, .o-hint-btn { flex-direction: column; min-height: 54px; }
  .o-hint small, .o-hint-btn small { padding: 6px 10px 5px; border-right: 0; border-bottom: 1px dashed var(--line-strong); font-size: 10.5px; letter-spacing: .04em; }
  .o-hint b, .o-hint-btn span { flex: 1; padding: 5px 10px 7px; font-size: 14px; line-height: 1.25; }
  .o-clue { padding: 9px 12px 10px 16px; gap: 1px; }
  .o-clue-k { font-size: 10.5px; }
  .o-clue-v { font-size: 17px; }
  .o-clue-locked { gap: 0 10px; padding-top: 8px; padding-bottom: 8px; }
  .o-clue-locked .o-clue-s { font-size: 13px; }

  .o-board-wrap { margin-top: 22px; }
  .o-board-head { flex-direction: column; align-items: stretch; gap: 4px; margin-bottom: 6px; }
  .o-board-tools { justify-content: space-between; flex-wrap: wrap; gap: 0 12px; }
  .o-fullbox { margin-left: auto; }
  .o-legend { gap: 2px 10px; font-size: 12px; }
  .o-legend .o-arrows { display: none; }
  .o-board tr { grid-template-columns: 64px var(--w, repeat(var(--n), minmax(0, 1fr))); gap: 3px; }
  .o-board thead { position: sticky; top: 0; z-index: 2; background: var(--bg); }
  .o-board thead tr { padding: 6px 0 6px; margin-bottom: 5px; }
  .o-board thead th { padding: 0; font-size: 9.5px; letter-spacing: .02em; overflow: hidden; }
  .o-board .o-full { display: none; }
  .o-board .o-short { display: block; }
  .o-board tbody tr { margin-bottom: 3px; }
  .o-spec { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: 0 2px 0 0; }
  .o-no { display: none; }
  .o-nmw { width: 100%; }
  .o-nm { font-size: 13px; line-height: 1.15; hyphens: auto; -webkit-hyphens: auto; }
  .o-la { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .o-board td { min-height: 48px; padding: 5px 2px; border-radius: 4px; font-size: 11.5px; line-height: 1.15; overflow: hidden; }
  .o-gl { display: none; }
  .o-tri { width: 8px; height: 8px; margin-top: 2px; }
  .o-board td.o-c-mass { font-size: 10.5px; letter-spacing: -.05em; }
  /* Hard (eight columns): the organ's name gets its own line above its cells */
  .o-cols8 tr { grid-template-columns: var(--w, repeat(var(--n), minmax(0, 1fr))); }
  .o-cols8 thead .o-th-name { display: none; }
  .o-cols8 .o-spec { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; padding: 5px 2px 0; }
  .o-cols8 .o-nmw { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .o-cols8 .o-nm { flex: none; max-width: 70%; }
  .o-cols8 td { font-size: 9.5px; letter-spacing: -.01em; padding-left: 1px; padding-right: 1px; overflow-wrap: normal; }
  .o-cols8 td.o-c-mass { font-size: 9.5px; letter-spacing: -.06em; }
  .o-cols8 thead th { font-size: 8.5px; letter-spacing: 0; }

  /* Full labels on: three cells per line, each cell names its column, no header row */
  .dg-full .o-board thead { display: none; }
  .dg-full .o-board tr { grid-template-columns: repeat(var(--h), minmax(0, 1fr)); padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  .dg-full .o-board .o-spec { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; padding: 4px 2px 2px; }
  .dg-full .o-board .o-nmw { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .dg-full .o-board .o-nm { flex: none; max-width: 70%; font-size: 14px; }
  .dg-full .o-board .o-full { display: block; }
  .dg-full .o-board .o-short { display: none; }
  .dg-full .o-board td { min-height: 54px; justify-content: center; padding: 17px 4px 6px; font-size: 12.5px; }
  .dg-full .o-board td .o-k {
    display: block; position: absolute; top: 4px; left: 5px; right: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    text-align: left; font: 600 8.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; opacity: .78;
  }
  .dg-full .o-board .o-gl { display: block; top: 3px; right: 4px; }
  .dg-full .o-board .o-gl svg { width: 9px; height: 9px; }
  .dg-full .o-board td.o-c-mass { font-size: 12.5px; letter-spacing: 0; }
}

/* small phones: the strip drops the mode name (the mode control right below shows it) */
@media (max-width: 400px) {
  .o-strip-mode { display: none; }
  #guess { padding: 0 12px; font-size: 17px; }
  .o-go { padding: 0 15px; }
}

/* ---------- the result: a lab report ---------- */
.o-end {
  display: grid; grid-template-columns: minmax(0, 1fr); margin: 34px 0 8px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--report); overflow: hidden; outline: none; scroll-margin-top: 10px;
}
.o-rp-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 12px 22px;
  border-bottom: 1px solid var(--line); background: var(--surface2);
  font: 500 12px/1.35 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.o-rp-head p { margin: 0; }
.o-rp-res { color: var(--ink); }
.o-cap { display: inline-block; width: 10px; height: 14px; margin-right: 9px; border-radius: 2px 2px 0 0; background: var(--cap); vertical-align: -2px; }
.mode-normal .o-cap { --cap: var(--cap-classic); } .mode-hard .o-cap { --cap: var(--cap-hard); } .mode-rx .o-cap { --cap: var(--cap-rx); }
.o-rp-main { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 0 24px; align-content: start; padding: 22px; }
.o-rp-main > * { grid-column: 2; }
.o-rp-main > .o-fig { grid-column: 1; grid-row: 1 / span 4; }
.o-rp-side { padding: 22px; border-top: 1px solid var(--line); }
@media (min-width: 820px) {
  .o-end { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .o-rp-head { grid-column: 1 / -1; }
  .o-rp-side { border-top: 0; border-left: 1px solid var(--line); }
}
.o-kicker { margin: 0; font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.o-ans { margin: 8px 0 4px; font: 700 clamp(34px, 4.6vw, 44px)/1.02 var(--sans); letter-spacing: -.025em; overflow-wrap: anywhere; }
.o-lat { margin: 0 0 16px; color: var(--muted); font-size: 17px; }
.o-lat span { margin-left: 8px; font: 500 11.5px/1 var(--mono); letter-spacing: .05em; white-space: nowrap; }
.o-fig { margin: 0; }
.o-fig-svg { display: block; width: 116px; height: auto; }
.o-fig-body { fill: color-mix(in srgb, var(--accent) 5%, var(--report)); }
.o-fig-line { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; opacity: .75; }
.o-fig-band { fill: var(--hit); opacity: .14; }
.o-fig-hl { stroke: var(--hit); stroke-width: .8; opacity: .45; }
.o-fig-brace { fill: none; stroke: var(--hit); stroke-width: 1.4; }
.o-fig-tick { stroke: var(--line-strong); stroke-width: 1; }
.o-fig-site { fill: var(--blood); stroke: var(--report); stroke-width: 1.4; }
.o-fig-ring { fill: none; stroke: var(--blood); stroke-width: 1.1; opacity: .55; }
.o-fig figcaption { margin-top: 8px; color: var(--muted); font: 500 10.5px/1.4 var(--mono); letter-spacing: .03em; text-transform: uppercase; }
.o-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; margin: 0 0 4px; font-size: 14.5px; }
.o-facts > div { display: contents; }
.o-facts dt { font: 500 11.5px/1.65 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.o-facts dd { margin: 0; font-weight: 500; line-height: 1.4; }
.o-facts dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.35; }
.o-facts .o-q { margin: 0; font: 400 12.5px var(--sans); color: var(--muted); letter-spacing: 0; }
.o-facts .o-m { font-family: var(--mono); font-size: 13.5px; }
.o-notes { margin: 14px 0 0; font-size: 14px; }
.o-notes p { margin: 4px 0 0; }
.o-rp-act { margin-top: 20px; }
.o-end-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 14px 0 0; }
.o-end-row .dg-flame { font: 600 15px/1 var(--mono); --dg-flame-size: 18px; }
.o-end-row .dg-countdown { font: 500 12px/1.4 var(--mono); }
.o-end-row .dg-countdown-label { font: 500 12px/1.4 var(--mono); letter-spacing: .04em; }
.o-end-row .dg-countdown-time { font-size: 13px; }
.o-rp-act > .o-btn-quiet { margin-top: 14px; }
.o-rp-side h3 { margin: 0 0 10px; font: 600 13px/1.25 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.o-rxlist { margin: 0 0 16px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.o-rxlist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.o-rxlist li span { color: var(--muted); font-size: 13.5px; font-weight: 400; text-align: right; }
.o-meds-none { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.o-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 14px 18px; border-radius: 8px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 16px; line-height: 1.25;
}
.o-pill small { display: block; margin-top: 3px; font: 500 12px/1.3 var(--mono); letter-spacing: .03em; opacity: .75; }
.o-pill svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.o-pill:hover { filter: brightness(1.15); }
.o-nomed { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.o-rp-side .dg-next { margin: 0 0 22px; padding: 0; border: 0; }
@media (max-width: 640px) {
  .o-end { margin-top: 26px; }
  .o-rp-head { flex-direction: column; align-items: flex-start; padding: 10px 16px; font-size: 11px; }
  .o-rp-main { grid-template-columns: minmax(0, 1fr) 58px; gap: 0 12px; padding: 18px 16px; }
  .o-rp-main > * { grid-column: 1 / -1; }
  .o-rp-main > .o-rp-id { grid-column: 1; }
  .o-rp-main > .o-fig { grid-column: 2; grid-row: 1; }
  .o-fig-svg { width: 58px; }
  .o-fig figcaption { display: none; }
  .o-ans { font-size: 34px; }
  .o-lat { font-size: 15px; margin-bottom: 14px; }
  .o-lat span { display: block; margin: 4px 0 0; }
  .o-facts { grid-template-columns: minmax(0, 1fr); gap: 0; font-size: 14px; }
  .o-facts dt { margin-top: 8px; line-height: 1.4; }
  .o-rp-side { padding: 18px 16px; }
  .o-rxlist li { flex-direction: column; gap: 2px; }
  .o-rxlist li span { text-align: left; }
}

/* ---------- shared components in the lab manner ---------- */
.dg-next-kicker { color: var(--muted); }
.dg-next-done { font: 600 16px/1.3 var(--sans); letter-spacing: 0; text-transform: none; }
.dg-next-cta {
  margin-top: 8px; padding: 14px 16px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--surface);
}
.dg-next-cta:hover { background: var(--surface2); }
.dg-next-cta:hover .dg-next-title { text-decoration: none; }
.dg-next-title { font: 700 20px/1.2 var(--sans); letter-spacing: -.01em; }
.dg-next-desc { color: var(--muted); font-size: 14px; }
.dg-next-go { color: var(--accent); font: 600 14px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase; }
.dg-suggest { border-top: 1px solid var(--line); }
.dg-share-main { border-radius: 6px; font: 600 15px/1 var(--sans); }
.dg-share-main.dg-primary { min-height: 46px; padding: 0 20px 0 16px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dg-share-via { font-size: 11px; }
.dg-share .dg-share-nets .dg-share-link { font-weight: 500; font-size: 14px; }
.dg-card-name, .dg-picker-name { font-weight: 700; }
.dg-howto { border-left-color: var(--accent); }
.dg-slot::before { letter-spacing: .08em; }
.dg-promo, .dg-slot .dg-promo {
  padding: 14px 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
@media (min-width: 768px) { .dg-slot-bottom .dg-promo { padding: 12px 20px; } }
.dg-promo-name { font-weight: 700; }
.dg-promo-go { color: var(--accent); font: 600 14px/1.2 var(--cond); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }

/* ---------- collapsed text sections ---------- */
.o-texts { margin-top: 44px; border-bottom: 1px solid var(--line); }
.o-text { border-top: 1px solid var(--line); }
.o-fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; cursor: pointer; }
.o-fold > summary::-webkit-details-marker { display: none; }
.o-fold > summary h2 { margin: 0; font: 600 14px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.o-fold > summary::after { content: "+"; flex: none; width: 22px; text-align: center; font: 500 20px/1 var(--mono); color: var(--accent); }
.o-fold[open] > summary::after { content: "\2013"; }
.o-fold-body { padding: 0 0 18px; max-width: 46em; font-size: 15px; }
.o-fold-body p { margin: 0 0 10px; }
.o-fold-body h3 { margin: 16px 0 6px; font: 600 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.o-faq details { border-top: 1px solid var(--line); }
.o-faq summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.o-faq details p { margin: 0 0 12px; }
.o-credit { margin: 16px 0 14px; color: var(--muted); font-size: 13px; }
.o-credit strong { color: var(--ink); font-weight: 600; }
.dg-guide a { color: var(--accent); }

/* ---------- dialog ---------- */
.o-dialog {
  width: min(calc(100vw - 32px), 460px); max-height: calc(100dvh - 32px); padding: 0 18px 18px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--report); color: var(--ink); box-shadow: var(--shadow);
}
.o-dialog::backdrop { background: rgba(6, 22, 27, .55); }
.o-dialog-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -18px 14px; padding: 6px 6px 6px 18px;
  background: var(--surface2); border-bottom: 1px solid var(--line);
}
.o-dialog-head h2 { margin: 0; font: 600 13px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.o-x { padding: 0; }
.o-x svg { width: 14px; height: 14px; stroke-width: 2; }
.dg-stats-tiles { border-top: 2px solid var(--ink); }
.dg-stats-tiles b { font-weight: 600; }

/* ---------- footer ---------- */
.dg-footer { border-top: 1px solid var(--line); background: var(--surface2); font-size: 13px; }
.dg-footer-home { font-weight: 700; font-size: 15px; }
.dg-picker-title { font-weight: 700; }

/* touch screens: the toast sits at the top, never under the soft keyboard */
@media (pointer: coarse) {
  .dg-toast { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; transform: translate(-50%, -8px); }
  .dg-toast.dg-show { transform: translate(-50%, 0); }
}

/* ---------- 404 (public/404.html: no ads, no consent loader) ---------- */
.o-404 { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.o-404-logo { margin: 0 0 18px; }
.o-404-logo img { display: block; width: 240px; height: auto; transform: rotate(-4deg); filter: drop-shadow(0 8px 10px var(--mark-shadow)); }
.o-404-k { margin: 0; font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.o-404 p a, .o-404 li a { display: inline-flex; align-items: center; min-height: 44px; }
.o-404 ul { padding-left: 18px; }
