
/* House fixes applied to every exported page (export.ts). Founder, 4 Nov: "i do not like the curved left borders of
   buttons ... that shows red or blue, looks vibe coded". A coloured stripe down the left edge of a rounded box is gone
   everywhere: the state is a full ring in its colour over a soft tint of it (TASTE.md §"no side stripes"). */
.cc-v.high { box-shadow: 0 0 0 1.5px oklch(60% 0.19 28) !important; background: color-mix(in oklab, oklch(60% 0.19 28) 12%, transparent) !important; }
.cc-v.low { box-shadow: 0 0 0 1.5px oklch(62% 0.13 240) !important; background: color-mix(in oklab, oklch(62% 0.13 240) 12%, transparent) !important; }
.pv-mark li.right { box-shadow: 0 0 0 1.5px var(--good) !important; background: color-mix(in oklab, var(--good) 10%, transparent) !important; }
.pv-mark li.wrong { box-shadow: 0 0 0 1.5px var(--bad) !important; background: color-mix(in oklab, var(--bad) 10%, transparent) !important; }
.pv-mark li.blank { box-shadow: 0 0 0 1px var(--line) !important; }
.vs-rows li.vs-key button { box-shadow: 0 0 0 1.5px var(--t-coral) !important; background: color-mix(in oklab, var(--t-coral) 10%, transparent) !important; }
.vo-lines li.now { box-shadow: 0 0 0 1.5px var(--accent-line, var(--accent)) !important; }
.ch-m.hl, .go-r.me, .rs-row.me, .lv-row.key, .pv-side i:nth-child(2) { box-shadow: 0 0 0 1.5px var(--accent) !important; }
.ia-row.is-lit, .ic-q.is-lit, .ds-bands span.now { box-shadow: 0 0 0 1.5px var(--ink) !important; }
.step.is-done + .step:not(.is-done), .step:first-child:not(.is-done) { box-shadow: 0 0 0 1.5px var(--accent-line, var(--accent)) !important; border-radius: 12px !important; }
.qf-book { border-left: 0 !important; box-shadow: 0 0 0 1px var(--line) !important; }
q.qn { border-left: 0 !important; border-radius: var(--r-sm) !important; box-shadow: 0 0 0 1px var(--line); }

/* web-v3's own fixes, after the harness's house fixes (scripts/port.ts): rules for the app, not the design preview. */

/* Learn's "Lessons in this preview" switcher belongs to the design preview: in the app the lesson is the address */
.ex-switch { display: none !important; }

/* the documents shelf (HAL-5004): a student's own upload carries its review state in the same chip as the bank's files */
.cs.waiting { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--ink-2); }
.cs.used { background: var(--accent); color: var(--accent-ink); }
.cs.rejected { background: transparent; color: var(--ink-2); border-color: var(--ink-3); border-style: dashed; }

/*
 * (Every rule here is scoped under :root: these fixes come before the page's own styles, so an equal selector would lose.)
 *
 * The account menu (founder, 5 Nov): on a phone it opens 64px from the top with no height of its own, so its lower
 * half (Settings, Invite, Help, Sign out) ran off the screen. It now stops above the screen's foot and scrolls inside
 * itself. Its eight accents sat in one squeezed row whose names ran into each other ("Lavender" into "Clay"); they now
 * sit in two rows of four, like the themes above them, everywhere.
 */
:root .accent-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2) var(--s1); }
:root .acc-opt { text-align: center; line-height: 1.25; }
:root .pop.menu { overscroll-behavior: contain; }
@media (max-width: 767px) {
  :root .pop.menu {
    width: min(336px, calc(100vw - 24px));
    max-height: calc(100dvh - 64px - 12px - env(safe-area-inset-bottom));
    overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
}

/*
 * More (founder, 5 Nov): liquid glass, the dock's own material. The sheet floats a little off the screen's edges with
 * the dock's rim, sheen and blur; the page shows through, softened, behind a lighter scrim; its groups are panes of the
 * same glass. Reduced transparency gets the solid sheet back.
 */
:root .sheet.more {
  --g-tint: rgb(255 255 255 / 0.5);
  --g-rim: rgb(255 255 255 / 0.9);
  --g-edge: rgb(255 255 255 / 0.38);
  --g-shade: rgb(12 13 14 / 0.16);
  --g-pane: rgb(255 255 255 / 0.5);
  --g-pane-edge: rgb(255 255 255 / 0.55);
  position: fixed; isolation: isolate; overflow-x: hidden;
  margin: auto 8px calc(8px + env(safe-area-inset-bottom)); width: calc(100% - 16px); max-width: 560px;
  border-radius: 32px;
  padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom));
  max-height: calc(90dvh - env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--g-tint), color-mix(in srgb, var(--g-tint) 70%, transparent));
  backdrop-filter: blur(30px) saturate(1.9) brightness(1.04);
  -webkit-backdrop-filter: blur(30px) saturate(1.9) brightness(1.04);
  box-shadow:
    inset 0 1px 0.5px var(--g-rim),
    inset 0 -1px 1px rgb(255 255 255 / 0.12),
    inset 0 0 0 1px var(--g-edge),
    0 1px 2px var(--g-shade),
    0 24px 60px var(--g-shade);
}
@media (min-width: 576px) { :root .sheet.more { margin-left: auto; margin-right: auto; } }
:root .sheet.more::before {
  content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 40% at 30% -6%, rgb(255 255 255 / 0.6), transparent 60%);
  opacity: 0.7;
}
:root .sheet.more::backdrop { background: rgb(10 11 12 / 0.16); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
:root .sheet.more .group, :root[data-mode="dark"] .sheet.more .group {
  background: var(--g-pane);
  box-shadow: inset 0 1px 0.5px var(--g-pane-edge), inset 0 0 0 1px color-mix(in srgb, var(--g-pane-edge) 60%, transparent);
}
:root .sheet.more .row-ic { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
:root[data-mode="dark"] .sheet.more {
  --g-tint: rgb(36 38 42 / 0.55);
  --g-rim: rgb(255 255 255 / 0.22);
  --g-edge: rgb(255 255 255 / 0.1);
  --g-shade: rgb(0 0 0 / 0.5);
  --g-pane: rgb(255 255 255 / 0.06);
  --g-pane-edge: rgb(255 255 255 / 0.12);
}
:root[data-mode="dark"] .sheet.more::before { background: radial-gradient(120% 40% at 30% -6%, rgb(255 255 255 / 0.16), transparent 60%); }
:root[data-mode="dark"] .sheet.more::backdrop { background: rgb(0 0 0 / 0.32); }
@media (prefers-reduced-transparency: reduce) {
  :root .sheet.more { background: var(--raised); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 0 0 1px var(--line), 0 -8px 24px rgb(0 0 0 / 0.12); }
  :root .sheet.more::before { display: none; }
  :root .sheet.more .group, :root[data-mode="dark"] .sheet.more .group { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
}

/* The phone dock in one line (founder, 5 Nov: "the former one line, mock zero elevation"). The designs' 5 Nov dock
   lifts Mock into a glass orb above the bar; here it sits in the bar like every other place, at the bar's own height,
   with no shadow: a flat accent circle, ringed when it is the current place. */
:root .dock-mock { width: var(--dk); }
:root .dock-orb { top: 0; width: var(--dk); height: var(--dk); aspect-ratio: auto; margin-left: calc(var(--dk) * -0.5); }
:root .dock-orb.glass { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
:root .dock-orb.glass::before, :root .dock-orb.glass::after { display: none; }
:root .dock-orb-core { width: 76%; height: auto; aspect-ratio: 1; background: var(--accent); box-shadow: none; }
:root .dock-mock[aria-current="page"] .dock-orb-core { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
:root .dock-mock:active .dock-orb { transform: scale(0.94); }

/* Review's "Where you lose marks" (practice/solve-review): the card's grid track took the longest topic name's width
   (458 px), so on a phone the whole page scrolled sideways. The track is the card's width; long names end in an ellipsis. */
:root .rv-lcard { grid-template-columns: minmax(0, 1fr); }
:root .rv-lose, :root .rv-lose li, :root .rv-lose p, :root .rv-lose p span { min-width: 0; }

/* The same fault on four more pages (a 360 px sweep of every route): a grid track sized to its longest label, or a
   chip row bleeding past the screen. Each now keeps to the screen. */
/* New mock (practice/solve-mock-new-baby): a wide field's chips and its label set the track */
:root .mn-f { grid-template-columns: minmax(0, 1fr); }
:root .mn-f > *, :root .mn-f .sv-chips { min-width: 0; }
/* New clerking case (clerk/clerk-new): a recent case's name kept its card wider than its column */
:root .nw-r { grid-template-columns: minmax(0, 1fr); min-width: 0; }
:root .nw-r .top, :root .nw-r .steps { min-width: 0; }
:root .nw-r b { overflow: hidden; text-overflow: ellipsis; }
/* Build a set (practice/solve-practice-new): the chip scroller bled left as if it touched the screen's edge, but it
   sits beside the step number, so it ran 40 px past the right edge. It bleeds only to the right. */
:root .pn-step .pn-chips-scroll { margin-inline-start: 0; padding-inline-start: 0; min-width: 0; }
/* Reading a set (practice/set-read): on a phone the bar's tools ran past the edge; they wrap under the title */
@media (max-width: 420px) { :root .rd-tools { flex-wrap: wrap; min-width: 0; row-gap: var(--s2); } }
/* Build a set and New mock: real syllabus topics ("Anaesthetic Machine, Equipment and Universal Precautions") are far
   longer than the design's samples and a chip never wrapped, so one chip was 456 px wide on a 360 px phone. In a row
   that wraps, a chip is at most the row's width and its name wraps; rows built to scroll sideways keep one line. */
:root .sv-chips:not(.pn-chips-scroll) .sv-chip { max-width: 100%; min-width: 0; white-space: normal; height: auto; text-align: left; padding-block: 6px; }
/* New clerking case at 320 px: a card head's hint ("Tap to add or remove") never wrapped past its title */
:root .nw-h { flex-wrap: wrap; row-gap: 2px; }
/* 320 px phones (the sweep's narrowest width) */
/* Settings, Reading: the four text sizes in one row ran past the card; they share the row and wrap if they must */
@media (max-width: 380px) { :root .st-seg { flex-wrap: wrap; } :root .st-seg button { flex: 1 1 auto; min-width: 0; } }
:root .st-rt, :root .sc-h { min-width: 0; }
/* Checkout, How long: the length options' grid took its inputs' width */
:root .lens, :root .co-len .len { grid-template-columns: minmax(0, 1fr); min-width: 0; }
:root .co-len .len > *, :root .co-h { min-width: 0; }
:root .co-h { flex-wrap: wrap; }
/* About, the founder: the card's track was wider than the card */
:root .founder { grid-template-columns: minmax(0, 1fr); }
:root .founder > *, :root .founder .fwho > * { min-width: 0; overflow-wrap: anywhere; }
/* Apps: "Open MBPrep on the web" never wrapped */
:root .pfoot .btn { white-space: normal; max-width: 100%; text-align: center; }
/* Settings, Reading: the control column (.st-rc, "od-fixed") keeps its width; on a 320 px phone it is the row's width */
@media (max-width: 380px) { :root .st-rc.od-fixed { flex: 1 1 100%; min-width: 0; max-width: 100%; flex-wrap: wrap; } }
/* About: the founder's links ("… on LinkedIn") wrap inside the card */
:root .founder .acts .btn { white-space: normal; max-width: 100%; text-align: left; }
/* More single-column cards whose track took their content's width at 320 px: Exam Intel's panels, the price plans,
   the home page's boards, onboarding's frame */
:root .it-panel, :root .xf-lk, :root .card.plan, :root .card.h-board { grid-template-columns: minmax(0, 1fr); }
:root .it-panel > *, :root .card.plan > *, :root .card.h-board > *, :root .it-sec-head { min-width: 0; }
:root .it-sec-head, :root .pname, :root .h-board-top { flex-wrap: wrap; }
@media (max-width: 380px) { :root .focus { grid-template-columns: minmax(0, 1fr); } :root .focus-bar, :root .focus-main { min-width: 0; } :root .focus-bar { flex-wrap: wrap; } }
/* Library upload at 320 px: the document tabs scroll sideways inside themselves; the upload's steps wrap */
@media (max-width: 380px) { :root .dtabs { overflow-x: auto; scrollbar-width: none; min-width: 0; } :root .du-steps { flex-wrap: wrap; row-gap: var(--s2); min-width: 0; } }
/* Library upload at 320 px: the card's fields (a date input's own width) held its column wider than the card */
:root .du-panel, :root .du-q, :root .du-fields, :root .du-classes { grid-template-columns: minmax(0, 1fr); min-width: 0; }
:root .du-fields .fld, :root .du-fields .inp { min-width: 0; max-width: 100%; }

/* Goals (and every account card): a card head's note wraps under its title on a phone instead of running off the side. */
@media (max-width: 520px) {
  :root .ak-card-h { flex-wrap: wrap; row-gap: 4px; }
  :root .ak-card-h .ak-meta { min-width: 0; white-space: normal; flex-basis: 100%; margin-left: 0; }
}
:root .gl-legend { flex-wrap: wrap; min-width: 0; }
:root .gl-legend .ak-meta { white-space: normal; min-width: 0; }

/*
 * Toasts on every page (founder, 5 Nov: "this is bad and not good looking"): .in-toast and .toast sit at left: 50%, so
 * their width shrank to fit half the screen (185 px on a 360 px phone) and a real message ("Stopped using Respiratory
 * Tract Infections and Pneumonia") wrapped six lines inside a 999 px radius, a circle cutting its own words. They take
 * their text's own width up to the screen less 16 px a side; a long message runs at most two lines in a rounded bar, and
 * the action never shrinks.
 */
:root .in-toast, :root .toast { width: max-content; max-width: min(560px, calc(100vw - 32px)); box-sizing: border-box; }
:root .in-toast { border-radius: 24px; padding-block: 6px; }
:root .in-toast > span { flex: 1 1 auto; min-width: 0; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
:root .in-toast > button { flex: 0 0 auto; }
:root .toast { border-radius: 24px; overflow-wrap: anywhere; }

/* Today with no exam date (HAL-5090): the hero's words clear the peeking face. */
.tb-hero .next-exam.ne-none { padding-right: 84px; }
.tb-hero .next-exam.ne-none .n small { font-size: var(--fs-h3, 1.25rem); font-weight: 600; color: inherit; }

/* Progress on a phone (HAL-5151): "What this means" waits in a pill that floats above the dock, over the page. The
   page's end clears the pill as well as the dock, so the last card can always be read in full; and while the student
   scrolls, the pill steps aside (live.js marks it data-v3-away), coming back once the page is still. */
@media (max-width: 767px) {
  :root .pgmain { padding-bottom: calc(var(--dock-h) + 26px + 52px + var(--s4) + env(safe-area-inset-bottom)); }
  :root .wtm-peek { transition: opacity 180ms var(--ease-out), translate 220ms var(--ease-out); }
  :root .wtm-peek[data-v3-away] { opacity: 0; translate: -50% 16px; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { :root .wtm-peek { transition: none; } }

/* A row that scrolls sideways (Intel's tabs and subjects, and any like them) fades at the edge that has more, so a
   cut-off "Paediatrics" reads as "there is more this way", not as a broken page. live.js sets --v3-fl / --v3-fr. */
:root [data-v3-edge] {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--v3-fl, 0px), #000 calc(100% - var(--v3-fr, 0px)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--v3-fl, 0px), #000 calc(100% - var(--v3-fr, 0px)), transparent 100%);
}

/*
 * The documents shelf (HAL-5167). The design's shelves held a dozen sample books and fit their column, so only a phone
 * scrolled them. A real bank puts hundreds of papers on one shelf: the row grew to ~15,800px and dragged the whole page
 * sideways. Every shelf now keeps to its column at every width and zoom: the row scrolls sideways inside the shelf
 * (wheel, trackpad, keyboard, touch), its spines snap, and its ends fade where there is more to see.
 */
:root .ds-shelves, :root .ds-focus, :root .ds-rest { grid-template-columns: minmax(0, 1fr); min-width: 0; }
:root .sh, :root .ds-case > .sh { min-width: 0; }
:root .sh-row {
  min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--s5); scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--s5), #000 calc(100% - var(--s5)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--s5), #000 calc(100% - var(--s5)), transparent 100%);
}
:root .sh-row .slot { scroll-snap-align: start; flex: 0 0 var(--w); }
:root .sh-row .slot.out { flex-basis: 0px; }
:root .sh-row::after { content: ""; flex: none; width: 1px; }

/*
 * Moving between pages (HAL-5167). Every page is its own document, so each tap blanked the whole screen, sidebar and
 * all, before the next page drew. Now a page change is a cross-document view transition: the sidebar is the same
 * on both sides, so it holds still, and only the content cross-fades, quickly. (With the links
 * fetched ahead on hover, live.js, the next page is usually there before the tap ends.) Reduced motion: no fade.
 */
@view-transition { navigation: auto; }
:root aside.side { view-transition-name: v3-side; }
::view-transition-group(v3-side) { animation-duration: 0s; }
/* No cross-fade (founder, 18 Nov 2026: "everything flickers… feels unstable"): fading the old page out while the new
   one faded in showed both at once, one through the other. The new page replaces the old in one step; the sidebar
   still holds still, and the bar along the top still answers the tap. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@keyframes v3-out { to { opacity: 0; } }
@keyframes v3-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(*) { animation: none !important; }
}

/*
 * The accent colours the whole page (HAL-5167). Choosing an accent changed its buttons and marks, and the page under
 * them leaned toward it by a trace (chroma 0.004 to 0.008) that read as grey. With "Match the page" on (the default
 * now) the background, cards, sidebar, lines and text all take the accent's hue, clearly, in Light and in Dark; the
 * text keeps its contrast (ink at 21% / 94.5% lightness). Off gives the plain greys, every accent. The named themes
 * keep their own character, as the design meant.
 */
:root[data-accent="deepblue"] { --v3-hue: 262; }
:root[data-accent="deepgreen"] { --v3-hue: 160; }
:root[data-accent="sage"] { --v3-hue: 152; }
:root[data-accent="mist"] { --v3-hue: 240; }
:root[data-accent="lavender"] { --v3-hue: 295; }
:root[data-accent="clay"] { --v3-hue: 40; }
:root[data-accent="softlime"] { --v3-hue: 122; }
:root[data-accent="lime"] { --v3-hue: 125; }
:root:root[data-tint="on"][data-theme="light"] {
  --bg: oklch(96.8% 0.022 var(--v3-hue, 262)); --raised: oklch(99.2% 0.008 var(--v3-hue, 262)); --surface: oklch(93.6% 0.032 var(--v3-hue, 262)); --surface-2: oklch(90% 0.04 var(--v3-hue, 262)); --line: oklch(88.6% 0.036 var(--v3-hue, 262)); --ink: oklch(21% 0.045 var(--v3-hue, 262)); --ink-2: oklch(36% 0.045 var(--v3-hue, 262)); --ink-3: oklch(46% 0.04 var(--v3-hue, 262)); --bar-muted: oklch(61% 0.045 var(--v3-hue, 262)); --focus: oklch(21% 0.045 var(--v3-hue, 262));
}
:root:root[data-tint="on"][data-theme="dark"] {
  --bg: oklch(16.5% 0.028 var(--v3-hue, 262)); --raised: oklch(22% 0.032 var(--v3-hue, 262)); --surface: oklch(21% 0.032 var(--v3-hue, 262)); --surface-2: oklch(26% 0.036 var(--v3-hue, 262)); --line: oklch(29% 0.036 var(--v3-hue, 262)); --ink: oklch(94.5% 0.014 var(--v3-hue, 262)); --ink-2: oklch(82% 0.024 var(--v3-hue, 262)); --ink-3: oklch(71% 0.028 var(--v3-hue, 262)); --bar-muted: oklch(46% 0.036 var(--v3-hue, 262)); --focus: oklch(94.5% 0.014 var(--v3-hue, 262));
}
:root:root[data-tint="off"][data-theme="light"][data-accent="deepblue"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="deepblue"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="deepgreen"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="deepgreen"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="sage"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="sage"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="mist"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="mist"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="lavender"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="lavender"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="clay"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="clay"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="softlime"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="softlime"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }
:root:root[data-tint="off"][data-theme="light"][data-accent="lime"] { --bg: #FAFAFA; --raised: #FFFFFF; --surface: #F1F2F3; --surface-2: #E6E7E9; --line: #E2E3E5; --ink: #0C0D0E; --ink-2: #44474D; --ink-3: #5E6268; --bar-muted: #868990; --focus: #0C0D0E; }
:root:root[data-tint="off"][data-theme="dark"][data-accent="lime"] { --bg: #0F1011; --raised: #17181A; --surface: #18191B; --surface-2: #232427; --line: #27292C; --ink: #ECEDEE; --ink-2: #B4B7BC; --ink-3: #989BA1; --bar-muted: #6C6F75; --focus: #ECEDEE; }

/*
 * What the size audit found (HAL-5167, 7 Nov 2026).
 * Intel's "How to answer" cards went two to a row on a portrait tablet beside the sidebar, about 200 px each, so each
 * heading ran a word a line in 59 px beside its bar. The cards now take as many columns as fit at 300 px or more:
 * three on a desktop as designed, one on a portrait tablet, never squeezed.
 */
:root .xf-fws { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
/* on touch, the small links and cells a thumb aims at get at least 24 px (WCAG 2.2) without changing how they look */
@media (pointer: coarse) {
  :root .mx-link, :root .sh-link { display: inline-flex; align-items: center; min-height: 44px; }
  :root .tc-cells .tc-cell { min-height: 24px; }
  :root .cq-bar > .cq { min-width: 24px; }
}

/*
 * Documents with a real bank (HAL-5314). The shelf held about thirty spines that all read their subject, cut
 * ("Medical Microbiolo…"), with year ranges broken onto two lines and no sign the shelf went on. Now each spine names
 * its paper in its subject's colour; a key of subjects above the shelves (each with its count) narrows them to one;
 * each shelf says how many it holds and scrolls with buttons when it is longer than its column.
 */
/* the live spines' subject colours: the design's depth, with enough colour that five subjects read apart */
:root .t-s1 { --tint: oklch(41% 0.085 255); }
:root .t-s2 { --tint: oklch(41% 0.085 25); }
:root .t-s3 { --tint: oklch(41% 0.085 150); }
:root .t-s4 { --tint: oklch(41% 0.085 75); }
:root .t-s5 { --tint: oklch(41% 0.085 340); }
:root .t-s6 { --tint: oklch(41% 0.085 200); }
:root .t-s7 { --tint: oklch(41% 0.085 300); }
:root .t-s8 { --tint: oklch(41% 0.085 110); }
:root[data-mode="dark"] .t-s1 { --tint: oklch(48% 0.085 255); }
:root[data-mode="dark"] .t-s2 { --tint: oklch(48% 0.085 25); }
:root[data-mode="dark"] .t-s3 { --tint: oklch(48% 0.085 150); }
:root[data-mode="dark"] .t-s4 { --tint: oklch(48% 0.085 75); }
:root[data-mode="dark"] .t-s5 { --tint: oklch(48% 0.085 340); }
:root[data-mode="dark"] .t-s6 { --tint: oklch(48% 0.085 200); }
:root[data-mode="dark"] .t-s7 { --tint: oklch(48% 0.085 300); }
:root[data-mode="dark"] .t-s8 { --tint: oklch(48% 0.085 110); }
:root .ds-keys { display: flex; flex-wrap: wrap; gap: var(--s2); min-width: 0; }
/* the key keeps to the column: on a phone it scrolls sideways inside it, never widening the page */
:root .ds-tools > .ds-status:has(.ds-keys) { min-width: 0; max-width: 100%; }
:root .ds-status > .ds-keys { flex: 1 1 100%; max-width: 100%; }
:root .ds-key { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: inherit; font-size: var(--fs-small); font-weight: 600;
  color: var(--ink); white-space: nowrap; cursor: pointer; transition: background 160ms var(--ease-out), color 160ms var(--ease-out); }
:root .ds-key > i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--tint); }
:root .ds-key > span { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
:root .ds-key[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
:root .ds-key[aria-pressed="true"] > span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
:root .ds-key:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) { :root .ds-key:not(:disabled):not([aria-pressed="true"]):hover { box-shadow: inset 0 0 0 1.5px var(--ink); } }
:root .ds-key:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the key and the view switch share the first row; the search and the kinds take the second, whole */
@media (min-width: 768px) {
  :root .ds-tools:has(.ds-keys) > .ds-status { flex: 1 1 calc(100% - 120px) !important; min-width: 0; order: 0; }
  :root .ds-tools:has(.ds-keys) > .ds-view { order: 1; }
  /* .ds-chips is display: contents, so its two segments are the row's items */
  :root .ds-tools:has(.ds-keys) > .searchbox, :root .ds-tools:has(.ds-keys) > .ds-chips > *, :root .ds-tools:has(.ds-keys) > .grow { order: 2; }
  :root .ds-tools:has(.ds-keys) > .searchbox { flex: 1 1 200px; max-width: 280px; }
}
@media (max-width: 767px) {
  :root .ds-keys { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); }
  :root .ds-keys::-webkit-scrollbar { display: none; }
}
@media (pointer: coarse) { :root .ds-key { min-height: 40px; } }
/* on a phone the kinds bar sticks under the header; its frosted blur drew a lime band across the screen in Chromium
   (measured 8 Nov, gone with the blur off), so it is plain page colour */
@media (max-width: 767px) { :root .ds-pg .ds-chips { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); } }
:root .sh-h .sh-n { font-size: var(--fs-small); font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
:root .sh-h { align-items: center; min-height: 36px; }
:root .sh-h .sh-link { white-space: nowrap; }
:root .sh-nav { display: inline-flex; gap: 4px; margin-left: auto; }
:root .sh-h .sh-link + .sh-nav { margin-left: var(--s2); }
:root .sh-nav[hidden] { display: none; }
:root .sh-nav .icon-btn { width: 36px; height: 36px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); --od-icon-size: 18px; }
:root .sh-nav .icon-btn:disabled { opacity: 0.35; cursor: default; }
@media (pointer: coarse) { :root .sh-nav { display: none; } }
/* a subject's papers close up on the shelf, the rest step out, the way a pulled book's slot closes */
:root .sh-row .slot.v3-gone { flex-grow: 0; flex-basis: 0px; max-width: 0px; margin-right: -4px; }
:root .slot.v3-gone .sp { visibility: hidden; }

/*
 * The programme switcher (HAL-5314). Its Switch to rows wrapped each MB's subjects onto two or three lines with no
 * space between rows, and on a laptop the popover ran off the bottom of the screen. Each row is now one line (the
 * subjects end in "…"), rows breathe, the popover scrolls inside itself, and the founder's v3 chip steps away.
 */
:root .prog-pop { overscroll-behavior: contain; }
/* under 768px the design makes the popover the screen's width less 32px; it was still placed as if 316px wide, so on
   a 390px phone it ran 26px off the right edge */
@media (max-width: 767px) { :root .prog-pop { left: 16px !important; right: auto !important; } }
:root .pp-mbs { display: grid; gap: 2px; }
:root .pp-mb { min-height: 56px; padding-block: 8px; }
:root .pp-mb .od-field { min-width: 0; gap: 2px; }
:root .pp-mb .od-field > strong, :root .pp-mb .od-field > span { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
:root .pp-mb .od-field > span { font-size: 13px; color: var(--ink-3); }
body:has(.prog-pop:not([hidden])) #v3-chip { visibility: hidden !important; }

/* HAL-5435: the boards and physiotherapy designs carry a "States" picker for reviewing a page's states; students never see it */
.tb-proto { display: none !important; }

/* The board pages on live data (HAL-5436): the design's review switcher between sample moments has nothing to switch */
.bd-live .bd-states, .bd-live #states-slot { display: none !important; }

/*
 * The marked answer reads like the classic (HAL-5739; founder 27 Oct "answers look like the classic", 11 Nov colours).
 * Colour means right or wrong only: lime for the key, the classic indigo for a wrong pick, whatever accent the student
 * chose (HAL-5409). Each option's reason sits in its own row under a dashed rule. The worked answer opens with the
 * principle as a 22px lead, then Normal → Abnormal → So → The trap as plain prose (labels in the body font, sentence
 * case), with no big "Reasoning" heading and no grey box. Body 14.5/1.65, reasons 13.5/1.5.
 */
:root { --v3-right: #D4F53C; --v3-right-ink: #0C0D0E; --v3-wrong: oklch(50% 0.2 272); --v3-wrong-ink: #fff; }
:root:is([data-mode="dark"], [data-theme="dark"], [data-theme="midnight"], [data-theme="forest"], [data-theme="oled"], [data-theme="contrast"]) { --v3-wrong: oklch(66% 0.17 272); --v3-wrong-ink: #0C0D0E; }

/* options, marked: option text strong, its reason quiet under a dashed rule */
:root .v3-rows .v3-row { grid-template-columns: 36px minmax(0, 1fr) 24px; align-items: start; padding: var(--s3); min-height: 0; }
:root .v3-rows .v3-row .qf-let { margin-top: 1px; }
:root .v3-rows .v3-row .qf-mk { margin-top: 6px; }
:root .v3-ot { display: grid; gap: 0; min-width: 0; }
:root .v3-ot > b { font-size: 15.5px; line-height: 1.45; font-weight: 600; color: var(--ink); padding-top: 5px; }
:root .v3-why { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
:root .v3-why p + p { margin-top: 6px; }
:root .v3-why b { color: var(--ink); font-weight: 700; }
:root .v3-rows .v3-row.is-key { border-color: color-mix(in srgb, var(--v3-right) 70%, var(--ink) 10%); background: color-mix(in srgb, var(--v3-right) 17%, var(--raised)); box-shadow: none; }
:root .v3-rows .v3-row.is-key .qf-let { background: var(--v3-right); color: var(--v3-right-ink); }
:root .v3-rows .v3-row.is-key .v3-why { color: var(--ink); border-top-color: color-mix(in srgb, var(--v3-right) 60%, var(--ink) 15%); }
:root .v3-rows .v3-row.is-key .qf-mk.ok { color: color-mix(in srgb, var(--v3-right) 45%, var(--ink)); }
:root:is([data-mode="dark"], [data-theme="dark"], [data-theme="midnight"], [data-theme="forest"], [data-theme="oled"], [data-theme="contrast"]) .v3-rows .v3-row.is-key .qf-mk.ok { color: var(--v3-right); }
:root .v3-rows .v3-row.is-mine { border-style: solid; border-color: color-mix(in srgb, var(--v3-wrong) 55%, transparent); background: color-mix(in srgb, var(--v3-wrong) 7%, var(--raised)); color: var(--ink); }
:root .v3-rows .v3-row.is-mine .qf-let { background: var(--v3-wrong); color: var(--v3-wrong-ink); }
:root .v3-rows .v3-row .qf-mk.no { color: var(--v3-wrong); }
:root .v3-rows .v3-row.is-dim .v3-ot > b { color: var(--ink-2); font-weight: 500; }

/* the verdict: a tinted banner under the options, as the classic draws it */
:root .v3-verdict { display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-sm); border: 1px solid; --od-icon-size: 18px; }
:root .v3-verdict b { display: block; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--ink); }
:root .v3-verdict small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
:root .v3-vi { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; }
:root .v3-verdict.ok { border-color: color-mix(in srgb, var(--v3-right) 70%, var(--ink) 10%); background: color-mix(in srgb, var(--v3-right) 17%, var(--raised)); }
:root .v3-verdict.ok .v3-vi { background: var(--v3-right); color: var(--v3-right-ink); }
:root .v3-verdict.no { border-color: color-mix(in srgb, var(--v3-wrong) 45%, transparent); background: color-mix(in srgb, var(--v3-wrong) 7%, var(--raised)); }
:root .v3-verdict.no .v3-vi { background: var(--v3-wrong); color: var(--v3-wrong-ink); }
/* the other formats' marks follow the same two colours */
:root .qf-mk.ok, :root .qf-verdict .ok { color: color-mix(in srgb, var(--v3-right) 45%, var(--ink)); }
:root .qf-mk.no, :root .qf-verdict .no { color: var(--v3-wrong); }
:root:is([data-mode="dark"], [data-theme="dark"], [data-theme="midnight"], [data-theme="forest"], [data-theme="oled"], [data-theme="contrast"]) :is(.qf-mk.ok, .qf-verdict .ok) { color: var(--v3-right); }

/* the worked answer: the tab says Explanation, so its section heading is for screen readers only */
:root .qf-dp[data-part="explain"] > .qf-dh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root .qf-lead.v3-lead { font-size: 22px; line-height: 1.25; font-weight: 400; letter-spacing: -0.025em; color: var(--ink); margin-bottom: var(--s4); }
:root .qf-dp[data-part="explain"] .qf-why { padding: 0; border-radius: 0; background: none; gap: var(--s4); }
:root .qf-dp[data-part="explain"] .qf-part { padding: 0; border-top: 0; }
:root .qf-dp[data-part="explain"] .qf-part p { font-size: 14.5px; line-height: 1.65; color: var(--ink); }
:root .qf-dp[data-part="explain"] .qf-part p b { font-weight: 700; }
:root .qf-dp[data-part="explain"] .qf-part p::before,
:root .qf-dp[data-part="explain"] .qf-part[data-k] p::before { color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
:root .qf-dp[data-part="explain"] > p, :root .qf-dp[data-part="explain"] .qf-ul li { font-size: 14.5px; line-height: 1.65; color: var(--ink); }
:root .qf-sol p.qf-sl, :root .qf-sl { margin: var(--s4) 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
/* "About the topic", folded under the reasoning */
:root .qf-topic { margin-top: var(--s5); border-top: 1px solid var(--line); }
:root .qf-topic > summary { display: flex; align-items: center; gap: var(--s2); min-height: 48px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--ink-2); --od-icon-size: 16px; }
:root .qf-topic > summary::-webkit-details-marker { display: none; }
:root .qf-topic > summary .od-icon { transition: transform var(--t-fast) var(--ease-out); }
:root .qf-topic[open] > summary .od-icon { transform: rotate(180deg); }
:root .qf-topic-in > :first-child { margin-top: 0; }
:root .qf-topic-in p, :root .qf-topic-in li { font-size: 14.5px; line-height: 1.65; color: var(--ink); }

/* the key list (?) */
:root .v3-kl { display: grid; gap: var(--s2); margin: var(--s3) 0 var(--s4); }
:root .v3-kl > div { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: var(--s3); align-items: baseline; }
:root .v3-kl kbd { display: inline-block; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); }
:root .v3-kl dd { margin: 0; font-size: 14px; color: var(--ink-2); }
:root .qf-lead.v3-lead p { font: inherit; letter-spacing: inherit; color: inherit; margin: 0; }
:root .qf-lead.v3-lead p + p { margin-top: var(--s2); }
/* the reason runs under the row's mark too, so a phone keeps a readable measure */
:root .v3-rows .v3-row .v3-why { margin-right: calc(-24px - var(--s3)); }
/* HAL-5739: a written answer's marking points sit under their section's name, said once */
:root .sa-m .v3-sah { margin: 16px 0 8px; }
:root .sa-m .v3-sah:first-child, :root .sa-m .sa-q + .v3-sah { margin-top: 4px; }

/* A written question's parts (HAL-5751): the letter is the marker, never a bullet beside it. */
:root .qf-parts { display: grid; gap: var(--s2); margin: var(--s4) 0 0; padding: 0; list-style: none; }
:root .qf-parts li { display: grid; grid-template-columns: 1.5em minmax(0, 1fr); gap: var(--s2); font-size: 15px; line-height: 1.6; color: var(--ink); }
:root .qf-parts li > b { font-weight: 600; color: var(--ink-2); }

/*
 * Phones (HAL-6005, founder's screenshots of 16 Nov). The programme switcher's names ran off in "…" ("MB1 · Anatomy,
 * Physiology and …"): they wrap now, and the popover takes the screen's width less 16px a side and scrolls inside
 * itself instead of stopping short with the page showing on the right. Its headings and the More sheet's group labels
 * were in capitals (PROGRESS, THE EXAM, ALL PROGRAMMES): sentence case, as everywhere (founder, 12 Nov). A badge holds
 * at most five letters and sets smaller past three, so "MR", "PLAB1" and "S2CK" sit inside their square.
 */
:root .sheet.more .group-label, :root .prog-pop .eyebrow, :root .prog-pop .pp-sec, :root .prog-pop .bd-pp-sec { text-transform: none; letter-spacing: 0; font-size: 13px; }
:root .prog-badge.is-long, :root .prog-ic.is-long { font-size: 11px; letter-spacing: 0; }
:root .pp-mb .prog-badge, :root .pp-current .prog-badge { flex: none; width: 48px; min-width: 48px; padding: 0; box-sizing: border-box; }
@media (max-width: 767px) {
  /* it rises from the foot of the screen, where the More sheet's row that opens it sits, so it always ends on screen */
  :root .prog-pop { left: 16px !important; right: 16px !important; top: auto !important; bottom: calc(16px + env(safe-area-inset-bottom)) !important; width: auto !important; max-width: none !important; max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; overflow-y: auto; }
  /* the sheet's close is the plain 40px icon button of every other sheet, not a ringed circle */
  :root .sheet.more .more-head .icon-btn { width: 40px; height: 40px; border: 0; box-shadow: none; background: transparent; }
  /* the sheet reaches near the top so more of it shows, and its last row clears the rounded foot when scrolled down */
  :root .sheet.more { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding-bottom: calc(var(--s6, 24px) + env(safe-area-inset-bottom)); }
  :root .sheet.more::backdrop { background: rgb(10 11 12 / 0.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  :root[data-mode="dark"] .sheet.more::backdrop { background: rgb(0 0 0 / 0.5); }
}
/* the programme's badge stays the ink square it is everywhere else: the sheet's pale icon tile had turned "MR" white on white */
:root .sheet.more .row-ic.prog-ic { background: var(--ink); color: var(--bg); }
/* a section's rule never opens the popover: with nothing above it, it was a stray line under the top edge */
:root .prog-pop > :is(.pp-switch, .pp-all):first-child > .menu-sep:first-child,
:root .prog-pop > .pp-switch[hidden]:first-child + .pp-all > .menu-sep:first-child { display: none; }

/*
 * The same faults as HAL-6005 elsewhere in v3, found by rendering every page at 390px as an MB4, a USMLE and an MRTBN
 * student (16 Nov). Capitals: the reader's "Answer" heading and the board mock page's permit tag and score-history
 * line were still set in capitals; sentence case, as everywhere (founder, 12 Nov).
 */
:root .rd-ans h3, :root .mk4-tag, :root .mk4-doc, :root .mk4-doc > span { text-transform: none; letter-spacing: 0; }
:root .mk4-doc { font-family: inherit; }
/*
 * Names cut to "…" on a phone: subject and topic names on Learn, Syllabus, Intel and Questions, set names on Practice
 * and Review, Progress's subjects and the physio plan's week lines. A name now takes up to two lines and ends there;
 * one-word labels, chips and the reader's title bar keep their single line.
 */
@media (max-width: 767px) {
  :root .lf-row .nm > b, :root .sc-row > span, :root .sb-stop .sb-name, :root .xf-ym-row > b, :root .qc-tile .qc-name,
  :root .row2 .r-t, :root .sv-row .sv-rt > span, :root .rv-lose p > span, :root .tc-row > span,
  :root .px-pl-ot > small {
    white-space: normal; overflow: hidden; text-overflow: clip;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    overflow-wrap: anywhere;
  }
}

/*
 * Moving to another programme (HAL-6005, live.js moving()): a plain screen over the old page while the new one loads,
 * instead of the switcher's rows lying see-through over the old programme's Today.
 */
#v3-moving { position: fixed; inset: 0; z-index: 2147483000; width: auto; height: auto; max-width: none; max-height: none; margin: 0; border: 0; overflow: hidden; opacity: 1; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; background: var(--bg, #fff); color: var(--ink, #111); text-align: center; }
#v3-moving[hidden] { display: none; }
#v3-moving::backdrop { background: var(--bg, #fff); }
#v3-moving p { margin: 0; font-size: 17px; line-height: 1.4; }
#v3-moving .v3-moving-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid color-mix(in oklab, currentColor 18%, transparent); border-top-color: var(--accent, currentColor); animation: v3-moving-spin 0.8s linear infinite; }
@keyframes v3-moving-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #v3-moving .v3-moving-dot { animation: none; } }

/*
 * No monospace anywhere (the founder, 12 Nov 2026; seen again on Today 16 Nov, HAL-6005: "1,153 XP", "0 days", the
 * chart's "goal 50"). The designs set figures and small labels in Geist Mono through --mono, --font-mono and
 * --font-num; every one of them now reads the body font, figures kept in even columns.
 */
/* !important: the pages' type picker writes --mono onto <html> as an inline style, which beats any plain rule */
html:root {
  --mono: var(--font, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif) !important;
  --font-mono: var(--font, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif) !important;
  --font-num: var(--font, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif) !important;
}
/* the two places that name a monospace face outright: a file's name and a group's invite link */
:root .fname, :root .gs-link .inp { font-family: var(--font, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif); }

/*
 * A picker's open list (Today's "From", and every .pick on the designs) sat level with the dock (both z-index 30), so
 * on a phone the dock covered its last rows (HAL-6005: "Surgery papers" under the dock). The open picker now stands
 * above the dock, and a long list scrolls inside itself rather than running off the screen.
 */
:root .pick:has(> .pick-list:not([hidden])) { z-index: 45; }
:root .pick-list { max-height: min(62dvh, 460px); overflow-y: auto; overscroll-behavior: contain; }

/* Build a set: a topic holding none of the picked formats sits after the ones that do, dimmed but still pickable
   (HAL-6103). A picked one keeps its full colour so the choice reads. */
:root .sv-chip[data-empty]:not([aria-pressed="true"]) { opacity: 0.5; }

/*
 * The notes' right side (founder, 18 Nov 2026): the part's figure kept the layout it has in the reading column. A
 * stepper put its art and its words side by side in a panel about 430px wide, so the words ran off the edge, cut
 * ("Cell dam…"). The side is now a container, and its figures take their narrow layout by the side's own width,
 * not the screen's, whatever the screen.
 */
:root .lesson .nw3 > .nw3-side { container: nw3side / inline-size; grid-template-columns: minmax(0, 1fr); }
/* the 19 year ticks share the side's width rather than each keeping its own, which pushed the side 76px wide */
/* each block is a grid of its own: its column too keeps to the side, so one long piece can't widen the block */
:root .nw3-side .nw3-blk, :root .nw3-side .nw3-yrs { min-width: 0; grid-template-columns: minmax(0, 1fr); }
/* a slide citation ("Orimadegun, clinical enzymology · 19, 20") wraps inside the side rather than pushing it wider */
:root .nw3-side .nw3-ask * { max-width: 100%; }
:root .nw3-side .nw3-ask button, :root .nw3-side .nw3-ask a { white-space: normal; overflow-wrap: anywhere; text-align: left; }
:root .nw3-side .nw3-yrs .lc-yrs i { flex: 1 1 0; width: auto; min-width: 0; }
/* a key number beside its words needs room: a narrow side puts the number above them, so nothing runs off */
@container nw3side (max-width: 380px) {
  :root .nw3-side .nw3-nums > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  :root .nw3-side .nw3-nums dt { white-space: normal; }
}
@container nw3side (max-width: 640px) {
  :root .nw3-side .cine-stage { grid-template-columns: minmax(0, 1fr); gap: var(--s4); padding: var(--s4); }
  :root .nw3-side .cine-art { width: min(100%, 168px); justify-self: center; }
  :root .nw3-side .cine-txt h4 { font-size: var(--fs-lead); }
  :root .nw3-side .cine-ctl { grid-template-columns: auto minmax(0, 1fr) auto; }
  :root .nw3-side .cine-ctl .tbtn { grid-column: 1 / -1; justify-self: center; }
  :root .nw3-side .cine-ticks { display: none; }
  :root .nw3-side .nb-mon, :root .nw3-side .vs-head, :root .nw3-side .rx-calc { grid-template-columns: minmax(0, 1fr); }
  :root .nw3-side .z2 { grid-template-columns: 96px minmax(0, 1fr); gap: var(--s3); }
  :root .nw3-side .ph-grid2 { grid-template-columns: 1fr 1fr; }
  :root .nw3-side figure { min-width: 0; max-width: 100%; }
  :root .nw3-side img, :root .nw3-side svg { max-width: 100%; height: auto; }
}

/* Short answers as fill in the gap: the blanks sit in the stem as inputs, then show what was typed, marked right or wrong
   by colour (lime right, indigo wrong; never the accent), with each blank's answer and why underneath. */
:root .v3-gapstem p { line-height: 2.1; }
:root .v3-gap { display: inline-block; min-width: 8ch; max-width: 100%; margin: 0 2px; padding: 2px 8px; border: 0; border-bottom: 2px solid var(--ink-3); border-radius: 6px 6px 0 0; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; line-height: 1.5; vertical-align: baseline; }
:root .v3-gap:focus { outline: none; border-bottom-color: var(--ink); background: var(--surface-2); box-shadow: 0 2px 0 0 var(--focus); }
:root .v3-gaphint { margin-top: var(--s2); }
:root .v3-gapv { display: inline-block; margin: 0 2px; padding: 1px 8px; border-radius: 6px; font-weight: 600; line-height: 1.6; }
:root .v3-gapv.ok { background: color-mix(in srgb, var(--v3-right) 22%, var(--raised)); box-shadow: inset 0 -2px 0 var(--v3-right); }
:root .v3-gapv.no { background: color-mix(in srgb, var(--v3-wrong) 9%, var(--raised)); box-shadow: inset 0 -2px 0 var(--v3-wrong); color: var(--ink-2); }
:root .v3-gaps { margin-top: var(--s4); }
:root .v3-gaplist { display: grid; gap: var(--s2); }
:root .v3-gaprow { display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--raised); cursor: pointer; --od-icon-size: 18px; }
:root .v3-gaprow input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); cursor: pointer; }
:root .v3-gaprow .v3-gn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
:root .v3-gaprow .v3-gt { display: grid; gap: 2px; min-width: 0; }
:root .v3-gaprow .v3-gt b { font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
:root .v3-gaprow .v3-gt small { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
:root .v3-gaprow .v3-gt q { quotes: "\201C" "\201D"; font-weight: 600; color: var(--ink); }
:root .v3-gaprow.ok { border-color: color-mix(in srgb, var(--v3-right) 70%, var(--ink) 10%); background: color-mix(in srgb, var(--v3-right) 14%, var(--raised)); }
:root .v3-gaprow.ok .v3-gn { background: var(--v3-right); color: var(--v3-right-ink); }
:root .v3-gaprow.no { border-color: color-mix(in srgb, var(--v3-wrong) 45%, transparent); background: color-mix(in srgb, var(--v3-wrong) 6%, var(--raised)); }
:root .v3-gaprow.no .v3-gn { background: var(--v3-wrong); color: var(--v3-wrong-ink); }
:root .v3-gaprow .qf-mk.no { color: var(--v3-wrong); }
:root .v3-gaprow:has(input:checked):not(.ok) { border-color: color-mix(in srgb, var(--v3-right) 55%, var(--ink) 10%); }
:root .v3-gapmore { margin-top: var(--s2); }
:root .v3-self [data-suggest] { box-shadow: 0 0 0 2px var(--ink); }
@media (max-width: 520px) {
  :root .v3-gaprow { grid-template-columns: 22px 24px minmax(0, 1fr); }
  :root .v3-gaprow .qf-mk { display: none; }
  :root .v3-gaprow .v3-gn { width: 24px; height: 24px; }
}

/*
 * Clerk on the library's scheme (founder, 5 Nov: "the same level of touch as the other pages"). The Clerk designs
 * (mbprep-it-clerk) were drawn for the desk and squeezed onto the phone: 16 px cards at a retired 20 px radius, a 30 px
 * head, and labels cut to "Hist…", "Pick by co…", "Cli… Acr…" by nowrap + ellipsis. Measured against Practice and Learn
 * on a 390 px phone (24 px radius, 24 px card padding, 32 px between sections, a 36 px head), every rule below brings
 * Clerk to the same scheme. Each is scoped under body.ck-page so no other page changes, and under :root so it outranks
 * the page's own rules (these load first).
 */

/* ---------- the scheme, on every width: radii from the library's scale (8 / 16 / 24 / round) ---------- */
:root body.ck-page .ck-card,
:root body.ck-page .ck-empty { border-radius: 24px; }
:root body.ck-page .ck-bed { border-radius: 16px; }

/* ---------- the summary's missed points, every width ---------- */
/* the design fixed the heading's tag at 84 px for "History"; the API's headings are longer ("History of the
   complaint"), so the tag takes its words' width and the point under it is read whole, never cut to one line */
:root body.ck-page .sm-missed .sm-r { flex-wrap: wrap; align-items: flex-start; row-gap: 6px; }
:root body.ck-page .sm-missed .ck-tag { width: auto; max-width: 100%; height: auto; min-height: 24px; padding-block: 3px; white-space: normal; justify-content: flex-start; }
:root body.ck-page .sm-missed .od-truncate { flex: 1 1 14rem; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45; }

/* ---------- phones ---------- */
@media (max-width: 767px) {
  /* the page: the same gutters and rhythm as Practice */
  :root body.ck-page:not(.ck-focus) main { padding-inline: 20px; }
  :root body.ck-page .ck { gap: var(--s5, 24px); }
  :root body.ck-page .ck-head { gap: var(--s3) var(--s4); }
  :root body.ck-page .ck-head h1 { font-size: 36px; letter-spacing: -0.035em; line-height: 1.06; }
  :root body.ck-page .ck-lead { font-size: var(--fs-body); line-height: 1.45; }
  :root body.ck-page .ck-card { padding: 20px; border-radius: 24px; gap: var(--s3); }
  :root body.ck-page .ck-card-h { flex-wrap: wrap; row-gap: 6px; }
  :root body.ck-page .ck-card-h h2 { white-space: normal; }

  /* words wrap, never cut: every row and tile that truncated its label on a phone */
  :root body.ck-page .ck-lrow b,
  :root body.ck-page .ck-lrow small,
  :root body.ck-page .wd-mode h2,
  :root body.ck-page .wd-mode p,
  :root body.ck-page .opt .od-field b,
  :root body.ck-page .opt .od-field small,
  :root body.ck-page .nw-h h2,
  :root body.ck-page .nw-h small,
  :root body.ck-page .nw-r b,
  :root body.ck-page .mc-kinds b,
  :root body.ck-page .mc-kinds small,
  :root body.ck-page .ps-top b,
  :root body.ck-page .ps-top small,
  :root body.ck-page .lb-row .od-field b,
  :root body.ck-page .lb-row .od-field span,
  :root body.ck-page .cs-pick .t b,
  :root body.ck-page .cs-list button small,
  :root body.ck-page .pg-m .n,
  :root body.ck-page .bl-type b,
  :root body.ck-page .wk-beds b,
  :root body.ck-page .wk-beds small,
  :root body.ck-page .sm-pres .who b {
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word;
  }

  /* a meter's label sits on its own line above the bar, so "Examination" is never "Exa…" */
  :root body.ck-page .ck-meter > span:first-child { white-space: normal; overflow: visible; }
  :root body.ck-page .wd-hero-t .ck-meter { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  :root body.ck-page .wd-hero-t .ck-meter > span:first-child { grid-column: 1 / -1; }

  /* the ward: the case you left reads as a hero, its words first, the bed beside at a size that leaves them room */
  :root body.ck-page .wd-hero, :root body.ck-page .wd-first { grid-template-columns: minmax(0, 1fr) 104px; gap: var(--s3) var(--s4); padding: 20px; }
  :root body.ck-page .wd-hero-t h2 { font-size: 32px; white-space: normal; }
  /* the four ways to clerk: two tiles a row, the icon above its words, both lines whole */
  :root body.ck-page .wd-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 12px; }
  :root body.ck-page .wd-mode { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: var(--s3); padding: 16px; min-height: 112px; }
  :root body.ck-page .wd-mode .od-field { flex: 0 0 auto; width: 100%; }
  :root body.ck-page .wd-low { padding: 20px; }

  /* progress: the six measures as one even two-up grid (no holes), the chart across the top */
  :root body.ck-page .pg-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  :root body.ck-page .pg-top > .pg-col { display: contents; }
  :root body.ck-page .pg-top > .pg-chart { grid-column: 1 / -1; order: -1; }
  :root body.ck-page .pg-m { padding: 16px; }
  :root body.ck-page .pg-m .v { flex-wrap: wrap; white-space: normal; row-gap: 2px; }
  :root body.ck-page .pg-spark text { font-size: 22px; }
  :root body.ck-page .pg-tbl td { font-family: inherit; }

  /* the summary: a missed point's heading tag sits above its words, never across them */
  :root body.ck-page .sm-r { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
  :root body.ck-page .sm-r > * { min-width: 0; }
  :root body.ck-page .sm-r > small { white-space: normal; }

  /* new case: options' names and hints whole, the "how real" sliders' names on their own line */
  /* a half-width choice tile: its icon and words stack, the round tick sits in the corner, so words are never
     crushed a few letters a line beside them */
  :root body.ck-page .opt:has(> .tick) { flex-wrap: wrap; align-items: flex-start; align-content: flex-start; row-gap: var(--s2); padding-right: 44px; }
  :root body.ck-page .opt:has(> .tick) > .od-field { flex: 1 1 100%; min-width: 0; }
  :root body.ck-page .opt > .tick { position: absolute; top: 12px; right: 12px; }
  :root body.ck-page .nw-r .top { flex-wrap: wrap; row-gap: 4px; }
  :root body.ck-page .nw-h { flex-wrap: wrap; row-gap: 4px; }
  /* the session: the room's outer figures overhang its edges on a phone, so their names are anchored inward and stay
     inside the room; the room's place chip is the top bar's own line again, so it gives the names the top of the room */
  :root body.ck-page .rm-stage > .rm-p:first-child .rm-name { left: 36%; translate: 0 -100%; }
  :root body.ck-page .rm-stage > .rm-p:last-child .rm-name { left: auto; right: 36%; translate: 0 -100%; }
  :root body.ck-page .rm > .rm-place { display: none; }
  /* the stage you are on is read whole in the top bar; the case and place under it may shorten */
  :root body.ck-page .se-case { min-width: 0; }
  :root body.ck-page .se-case b { white-space: normal; overflow: visible; text-overflow: clip; font-size: 15px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* ---------- touch: every tappable thing at least 44 px on a phone or tablet ---------- */
@media (pointer: coarse) {
  :root body.ck-page .ck-pill.sm,
  :root body.ck-page .ck-seg button,
  :root body.ck-page .ck-seg a,
  :root body.ck-page .pg-chips button,
  :root body.ck-page .lb-tabs button { min-height: 44px; }
}

/* ---------- portrait tablets (768–1023): the shell keeps its sidebar, so the page has about 520 px, a phone's
   width; the desk's two and three columns left each card under 250 px ("Lear nin…", a heading tag across its point).
   They get the phone's single column, as the library asks of portrait tablets ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  :root body.ck-page .cs-body { grid-template-columns: minmax(0, 1fr); }
  :root body.ck-page .cs-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
  :root body.ck-page .ps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  :root body.ck-page .sm-row, :root body.ck-page .sm-two, :root body.ck-page .sm-replay { grid-template-columns: minmax(0, 1fr); }
  :root body.ck-page .sm-pres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root body.ck-page .sm-model .mr { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  :root body.ck-page .sm-r { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
  :root body.ck-page .sm-r > * { min-width: 0; }
  :root body.ck-page .ck-card { border-radius: 24px; }
}

/* ---------- the desktop audit (HAL-5054): the library's scheme on every width ----------
   Measured with design/od-audit on web-v3's own Clerk pages (5 Nov): the ward 1 gradient and 1 card in a card, blind
   2 gradients, 22 pills and 1 card in a card, patients 6 gradients, 26 pills, 10 cards in cards and 4 hue families.
   Open Design keeps the Clerk designs as they are (not re-approved), so the fixes live here. */

/* No gradients: the bed's striped curtain is one flat tone */
:root body.ck-page .ck-bed .ct { background-image: none; background-color: color-mix(in oklab, var(--ink, #888) 14%, var(--surface, #fff)); }
:root body.ck-page .ck-bed.is-dark .ct { background-color: color-mix(in oklab, #fff 8%, transparent); }

/* Two hue families (the accent, and one for state): a patient's blanket is a quiet neutral, not a colour of its own,
   and a difficulty tag is a plain tag, not indigo */
:root body.ck-page .ck-bed .bk { background: color-mix(in oklab, var(--ink, #888) 26%, var(--surface, #fff)); }
:root body.ck-page .ck-bed.is-dark .bk { background: color-mix(in oklab, #fff 22%, transparent); }
:root body.ck-page .ck-tag.ind { background: var(--surface-2, color-mix(in oklab, var(--ink, #888) 8%, transparent)); color: var(--ink-2, inherit); border-color: transparent; }

/* Pills only where they do something: the bed's number and the mark over the picture, and a case's length, are
   labels; the pillow is drawn on the radius scale */
:root body.ck-page .ck-bed .ck-tag.art { border-radius: 0; background: none; box-shadow: none; border: 0; padding-inline: 0; font-weight: 600; text-shadow: 0 1px 2px rgb(0 0 0 / 0.45); }
:root body.ck-page .cs-pick .f .ck-tag.art { border-radius: 0; background: none; box-shadow: none; border: 0; padding-inline: 0; color: var(--ink-2, inherit); font-weight: 500; }
:root body.ck-page .ck-bed .pl { border-radius: 8px; }
/* the blind case's filters are toggles on the radius scale, not a field of pills */
:root body.ck-page .bl-chips button { border-radius: 8px; }

/* No card inside a card: a case card's bed is its picture, edge to edge across the card's top; the frost over a case
   still being written follows it; a bed drawn on an ink card is drawn straight on the ink */
:root body.ck-page .cs-pick { overflow: hidden; }
:root body.ck-page .cs-pick > .ck-bed { margin: -12px -12px 0; width: calc(100% + 24px); max-width: none; border-radius: 0; }
:root body.ck-page .cs-pick .frost { border-radius: 0; }
:root body.ck-page .ck-card.is-ink .ck-bed.is-dark { background: transparent; border-radius: 0; }
:root body.ck-page .cs-det:has(> .cs-art:first-child) { overflow: hidden; }
:root body.ck-page .cs-det > .cs-art:first-child { margin: -24px -24px 0; width: calc(100% + 48px); max-width: none; border-radius: 0; }
/* the picture's own labels, and the word on a case still being written, are labels too */
:root body.ck-page .cs-art .ck-tag.art { border-radius: 0; background: none; box-shadow: none; border: 0; padding-inline: 0; font-weight: 600; }
:root body.ck-page .cs-pick .frost > span { border-radius: 0; background: none; box-shadow: none; border: 0; font-weight: 600; }

/* No card inside a card, the library's way (the approved Practice "Build a set" page): choices sit on the page under
   their heading, and each choice is the surface. On the desk only; phones keep the HAL-5050 cards. */
@media (min-width: 1024px) {
  :root body.ck-page section.ck-card:has(.opt) { background: transparent; border: 0; box-shadow: none; padding-inline: 0; }
}
/* a place's picture is its tile's top, edge to edge, like a bed on a case card */
:root body.ck-page .opt.nw-p { overflow: hidden; }
:root body.ck-page .opt.nw-p > .bay:first-child { margin: -8px -8px 0; width: calc(100% + 16px); max-width: none; border-radius: 0; }
/* a person's picture on their card, the same */
:root body.ck-page .cs-pick > .cs-art:first-child { margin: -12px -12px 0; width: calc(100% + 24px); max-width: none; border-radius: 0; }
/* inside a card, an empty state and a linked row are part of the card, not boxes of their own */
:root body.ck-page .ck-card .ck-empty { border: 0; background: transparent; }
:root body.ck-page section.ck-card a.ck-card, :root body.ck-page section.ck-card .ck-card { background: transparent; border: 0; box-shadow: none; }

/* The session's room in depth (src/stage, /v3/clerk-stage.js): a three.js room under the room's chips and captions.
   With it on (.rm.is-3d), the flat set pieces and the flat figures' drawings go; the people stay in the page for screen
   readers (their drawings visually hidden, alt text kept) and carry the name chips, which clerk-session.js moves to
   each figure's head. The place, live, badge, light box, finding and caption are untouched. */
:root body.ck-page .rm-3d { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 400ms ease-out; }
:root body.ck-page .rm-3d canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
:root body.ck-page .rm.is-3d .rm-3d { opacity: 1; }
:root body.ck-page .rm.is-3d > .rm-wall2,
:root body.ck-page .rm.is-3d > .rm-floor,
:root body.ck-page .rm.is-3d > .rm-cur,
:root body.ck-page .rm.is-3d > .rm-win,
:root body.ck-page .rm.is-3d > .rm-poster,
:root body.ck-page .rm.is-3d .rm-bed > .hb,
:root body.ck-page .rm.is-3d .rm-bed > .pl,
:root body.ck-page .rm.is-3d .rm-bed > .bk { display: none; }
:root body.ck-page .rm.is-3d .rm-stage { display: block; padding: 0; pointer-events: none; }
:root body.ck-page .rm.is-3d .rm-p,
:root body.ck-page .rm.is-3d .rm-bed { position: absolute; left: 0; top: 0; width: 0; height: 0 !important; aspect-ratio: auto; display: block; transition: none; }
:root body.ck-page .rm.is-3d .rm-p:not([data-at]),
:root body.ck-page .rm.is-3d .rm-bed:not([data-at]) { visibility: hidden; }
:root body.ck-page .rm.is-3d .rm-p.is-speaking { transform: none; }
:root body.ck-page .rm.is-3d .rm-p img,
:root body.ck-page .rm.is-3d .rm-bed img { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
:root body.ck-page .rm.is-3d .rm-p .rm-name,
:root body.ck-page .rm.is-3d .rm-bed .rm-name { top: -6px; left: 0; right: auto; translate: -50% -100%; }
:root body.ck-page .rm.is-3d .rm-p.is-away { filter: none; }

/* ---------- Clerk on white (founder, 13 Nov 2026: "white background", no blue accent on these pages) ----------
   The light theme's tokens, neutral, for every Clerk page: white ground and cards, grey wells, ink for the accent.
   The room keeps the only colour (warm walls, a sand floor, sage curtains, the sky in the window), so the eye goes
   to the patient. Dark mode is untouched. Outranks the theme's own :root[data-tint][data-theme][data-accent]. */
html:root:root[data-theme="light"][data-tint][data-accent]:has(body.ck-page) {
  --bg: oklch(100% 0 0); --raised: oklch(100% 0 0); --surface: oklch(96.6% 0 0); --surface-2: oklch(93.8% 0 0);
  --line: oklch(91.5% 0 0); --ink: oklch(17% 0 0); --ink-2: oklch(36% 0 0); --ink-3: oklch(49% 0 0);
  --bar-muted: oklch(62% 0 0); --focus: oklch(17% 0 0);
  --accent: oklch(17% 0 0); --accent-hover: oklch(27% 0 0); --accent-strong: oklch(10% 0 0); --accent-ink: oklch(100% 0 0);
  --accent-soft: oklch(95.4% 0 0); --accent-line: oklch(86% 0 0); --accent-glass: oklch(17% 0 0 / 0.07);
  --ck-ind: oklch(46% 0 0); --deep: oklch(30% 0 0); --deep-2: oklch(36% 0 0); --deep-raised: oklch(41% 0 0);
  --rm-wall: oklch(96.5% 0.006 85); --rm-wall-2: oklch(93.5% 0.009 85); --rm-floor: oklch(87% 0.014 75);
  --rm-frame: oklch(99% 0 0); --rm-sky: oklch(88% 0.05 225); --rm-curtain-a: oklch(86% 0.035 165); --rm-curtain-b: oklch(91% 0.026 165);
  --rm-bed-head: oklch(74% 0.008 250); --rm-bed: oklch(97.5% 0 0);
}
/* On an ink card the main button is white, never ink on ink; the current step's number likewise. */
html:root[data-theme="light"] body.ck-page .is-ink .mx-lime { background: oklch(100% 0 0); color: oklch(17% 0 0); }
html:root[data-theme="light"] body.ck-page .se-steps [aria-current="step"] i { background: oklch(100% 0 0); color: oklch(17% 0 0); }
/* The dotted fields are drawn in a cobalt fixed in the design's script; on white they are drawn grey. */
html:root[data-theme="light"] body.ck-page canvas.ht { filter: grayscale(1); }

/*
 * Galen's own replies on the Galen pages (HAL-5053). The designs draw a reply as a few short paragraphs; a real reply is
 * markdown with quotes, lists, headings and tables (/v3/galen.js draws it). These give those the design's own type and
 * surfaces, scoped under .gc-text so nothing else changes, and under :root so they outrank the page's rules.
 */
:root .gc-text { gap: var(--s2, 8px); line-height: 1.55; }
:root .gc-text > * { margin: 0; }
:root .gc-text p { margin: 0; }
/* headings: a touch of room above (the grid's gap is below), sized as steps of the reply's own text */
:root .gc-text h2, :root .gc-text h3, :root .gc-text h4 { margin: var(--s2, 8px) 0 0; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
:root .gc-text > :first-child { margin-top: 0; }
:root .gc-text h2 { font-size: 1.2em; }
:root .gc-text h3 { font-size: 1.08em; }
:root .gc-text h4 { font-size: 1em; }
/* lists keep their numbers and bullets; items sit close, a nested list hangs under its item */
:root .gc-text ul, :root .gc-text ol { margin: 0; padding-left: 1.4em; display: grid; gap: 2px; }
:root .gc-text ul { list-style: disc; }
:root .gc-text ol { list-style: decimal; }
:root .gc-text ul ul { list-style: circle; }
:root .gc-text li { display: list-item; padding-left: 2px; }
:root .gc-text li::marker { color: var(--muted, var(--ink-3)); }
:root .gc-text ol > li::marker { font-variant-numeric: tabular-nums; }
:root .gc-text li > ul, :root .gc-text li > ol { margin-top: 2px; }
:root .gc-text b, :root .gc-text strong { font-weight: 600; color: var(--ink); }
:root .gc-text s { color: var(--muted, var(--ink-3)); }
:root .gc-text hr { width: 100%; height: 0; margin: var(--s1, 4px) 0; border: 0; border-top: 1px solid var(--line); }
:root .gc-text .gc-link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; overflow-wrap: anywhere; }
:root .gc-text .gc-quote { display: grid; gap: var(--s1, 4px); margin: 0; padding: var(--s3, 12px) var(--s4, 16px); border-radius: 16px; background: var(--raised, var(--surface)); color: var(--ink); line-height: 1.5; }
:root .gc-text code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.9em; padding: 1px 5px; border-radius: 6px; background: var(--raised, var(--surface)); }
:root .gc-text .gc-pre { margin: 0; padding: var(--s3, 12px) var(--s4, 16px); overflow-x: auto; border-radius: 14px; background: var(--raised, var(--surface)); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.88em; line-height: 1.5; white-space: pre; }
:root .gc-text .gc-pre code { padding: 0; background: none; font-size: inherit; }
:root .gc-text .gc-tbl { overflow-x: auto; margin: 0; border: 1px solid var(--line); border-radius: 16px; }
:root .gc-text table { width: 100%; border-collapse: collapse; font-size: 0.94em; line-height: 1.45; }
:root .gc-text th, :root .gc-text td { padding: 7px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
:root .gc-text thead th { border-top: 0; font-weight: 600; color: var(--ink-2, var(--ink)); background: var(--raised, transparent); }
:root .gc-text .gc-cite { vertical-align: 1px; }
:root .gc-cell .gc-text { line-height: 1.5; }

/* ---------- the live chat (galen-flow): the rail beside the answer, and Galen asking before it acts ---------- */
:root .v3-rail { display: grid; gap: var(--s3, 12px); padding: var(--s5, 24px); border-radius: 24px; }
:root .v3-rail-h { margin: 0; font-size: var(--fs-small, 13px); font-weight: 600; color: var(--muted, var(--dim)); }
:root .v3-rail-l { display: grid; gap: var(--s2, 8px); margin: 0; padding: 0; list-style: none; min-width: 0; }
:root .v3-rail-l .gc-src { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; max-width: 100%; overflow-wrap: anywhere; color: inherit; }
:root .v3-rail-l .gc-src svg { flex: none; width: 16px; height: 16px; }
:root .v3-rail-n { margin: 0; font-size: var(--fs-small, 13px); color: var(--muted, var(--dim)); }
:root .v3-rail-a { display: flex; flex-wrap: wrap; gap: var(--s2, 8px); }
:root .v3-ok { gap: var(--s3, 12px); }
:root .v3-ok-b { display: flex; flex-wrap: wrap; gap: var(--s2, 8px); }
@media (pointer: coarse) { :root .v3-rail-a .it-btn, :root .v3-ok-b .it-btn { min-height: 44px; } }
:root .v3-ok { width: 100%; padding: var(--s4, 16px) var(--s5, 24px); border-radius: 24px; background: var(--surface); }
:root .v3-ok-h { margin: 0; font-size: var(--fs-small, 13px); font-weight: 600; color: var(--muted, var(--dim)); }
:root .v3-ok-l { display: grid; gap: var(--s2, 8px); margin: 0; padding: 0; list-style: none; }
:root .v3-ok-l li { display: grid; gap: 2px; }
:root .v3-ok-l span { color: var(--muted, var(--dim)); line-height: 1.45; }

/* ---------- the quiz card (new-web Quiz): a real question from the bank, answered in the chat ---------- */
:root .v3-quiz { display: grid; gap: var(--s3, 12px); width: 100%; padding: var(--s4, 16px) var(--s5, 24px); border-radius: 24px; background: var(--surface); }
:root .v3-quiz-h { display: flex; align-items: center; gap: var(--s2, 8px); font-size: var(--fs-small, 13px); color: var(--muted, var(--dim)); }
:root .v3-quiz-l { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--raised, var(--surface-2)); color: var(--ink); font-weight: 600; margin-right: auto; }
:root .v3-quiz-s { margin: 0; font-weight: 600; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
:root .v3-quiz-n, :root .v3-quiz-m { margin: 0; font-size: var(--fs-small, 13px); color: var(--muted, var(--dim)); line-height: 1.5; }
:root .v3-quiz-m:empty { display: none; }
:root .v3-quiz-o { display: grid; gap: var(--s2, 8px); }
:root .v3-quiz-o button { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: var(--s3, 12px); min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
:root .v3-quiz-o button b, :root .v3-quiz-row b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--raised, var(--surface-2)); font-family: var(--font-mono, monospace); font-size: 13px; font-weight: 500; }
:root .v3-quiz-o button[aria-pressed="true"] { border-color: var(--ink); }
:root .v3-quiz-o button.is-right { border-color: var(--good, #3fa96b); box-shadow: inset 0 0 0 1px var(--good, #3fa96b); }
:root .v3-quiz-o button.is-wrong { border-color: var(--bad, #d9534f); }
:root .v3-quiz-o button:disabled { cursor: default; }
:root .v3-quiz-t { display: grid; gap: var(--s2, 8px); }
:root .v3-quiz-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 44px 44px; align-items: center; gap: var(--s2, 8px); padding: 6px 8px; border-radius: 16px; }
:root .v3-quiz-row span { min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
:root .v3-quiz-row button { height: 40px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
:root .v3-quiz-row button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
:root .v3-quiz-row.is-right { background: color-mix(in srgb, var(--good, #3fa96b) 12%, transparent); }
:root .v3-quiz-row.is-wrong { background: color-mix(in srgb, var(--bad, #d9534f) 12%, transparent); }
:root .v3-quiz-a { display: flex; flex-wrap: wrap; gap: var(--s2, 8px); }
@media (pointer: coarse) { :root .v3-quiz-a .it-btn { min-height: 44px; } }

/* ---------- Add to this chat on a portrait tablet (768–1023): the shell keeps its sidebar, so the page has about 520 px
   and the design's 300 px tray left the picks a few letters a line ("Respirat ory Tract"). They get the phone's single
   column, as the library asks of portrait tablets; the tray follows the picks and stays in reach at the bottom ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  :root .ad-stage { grid-template-columns: minmax(0, 1fr); }
  :root .ad-pick { min-height: 0; }
  :root .ad-tray { position: sticky; top: auto; bottom: var(--s4); min-height: 0; height: auto; max-height: 50dvh; z-index: 5; box-shadow: var(--shadow); }
}

/* ---------- phones: what the audit found at 360 px ---------- */
@media (max-width: 767px) {
  /* a chat's header: a real chat title is longer than the design's, and the flex row squeezed the Keys button to
     20 px; buttons keep their size and the title gives way */
  :root .th-chat-h > button, :root .th-chat-h > .in-badge { flex: 0 0 auto; }
  :root .th-chat-h > .icon-btn { min-width: 44px; }
  :root .th-chat-h > h1 { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* a ladder: the Climb button carries the topic's name, so beside it the words ran four lines in 69 px; on a phone
     the button takes its own line under them */
  :root .la-belt { grid-template-columns: minmax(0, 1fr); }
  :root .la-belt > .it-go { justify-self: start; max-width: 100%; }
}

/* a true/false row on a phone: beside two 44 px buttons the statement had about 110 px and ran a word a line; the
   statement takes the row and T and F sit under it, still 44 px taps */
@media (max-width: 559px) {
  :root .v3-quiz { padding: var(--s4); }
  :root .v3-quiz-row { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "n s s" ". t f"; row-gap: 8px; align-items: start; padding: 8px; }
  :root .v3-quiz-row > b { grid-area: n; }
  :root .v3-quiz-row > span { grid-area: s; align-self: center; }
  :root .v3-quiz-row > button[data-v="true"] { grid-area: t; height: 44px; }
  :root .v3-quiz-row > button[data-v="false"] { grid-area: f; height: 44px; }
}

/* ---------- what Galen proposes, on a card of its own (HAL-5169): a plan's days, a practice set, revision flags ---------- */
:root .v3-card { display: grid; gap: var(--s3, 12px); width: 100%; padding: var(--s4, 16px) var(--s5, 24px); border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
:root .v3-card[data-tone="on"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent, var(--ink)) 70%, var(--line)); }
:root .v3-card[data-tone="off"] { opacity: .72; }
:root .v3-card-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--s3, 12px); }
:root .v3-card-h .gc-art-i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--raised, var(--surface-2)); color: var(--ink); }
:root .v3-card-h .gc-art-i svg { width: 20px; height: 20px; }
:root .v3-card-tt { display: grid; gap: 2px; min-width: 0; }
:root .v3-card-tt b { font-weight: 600; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
:root .v3-card-tt span { font-size: var(--fs-small, 13px); color: var(--muted, var(--dim)); line-height: 1.45; }
:root .v3-card-s { align-self: center; padding: 2px 10px; border-radius: 999px; background: var(--raised, var(--surface-2)); font-size: var(--fs-small, 13px); font-weight: 600; color: var(--ink-2, var(--ink)); white-space: nowrap; }
:root .v3-card[data-tone="on"] .v3-card-s { background: color-mix(in srgb, var(--accent, var(--ink)) 22%, var(--surface)); color: var(--ink); }
:root .v3-plan { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
:root .v3-plan li { display: grid; grid-template-columns: minmax(84px, 7.5em) minmax(0, 1fr); gap: var(--s3, 12px); padding: 9px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
:root .v3-plan li:last-child { border-bottom: 0; }
:root .v3-plan-d { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
:root .v3-plan-t { min-width: 0; color: var(--ink-2, var(--ink)); overflow-wrap: anywhere; }
:root .v3-plan-t small { color: var(--muted, var(--dim)); font-size: var(--fs-small, 13px); }
:root .v3-card-a { display: flex; flex-wrap: wrap; gap: var(--s2, 8px); }
@media (max-width: 479px) { :root .v3-plan li { grid-template-columns: minmax(0, 1fr); gap: 2px; } :root .v3-card-h { grid-template-columns: auto minmax(0, 1fr); } :root .v3-card-s { grid-column: 2; justify-self: start; } }

/* ---------- under a finished reply: Copy and Save to notes, quiet until wanted ---------- */
:root .v3-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: calc(var(--s2, 8px) * -1); }
:root .v3-act { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted, var(--dim)); font: inherit; font-size: var(--fs-small, 13px); cursor: pointer; }
:root .v3-act svg { width: 16px; height: 16px; }
:root .v3-act:hover:not(:disabled) { background: var(--raised, var(--surface)); color: var(--ink); }
:root .v3-act:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
:root .v3-act:disabled { cursor: default; }
@media (pointer: coarse) { :root .v3-act { min-height: 44px; } :root .v3-card-a .it-btn { min-height: 44px; } }
