/* Hallmark · shape: app screen · genre: modern-minimal · theme: Dose (by request) · redesign: full
 * nav: kept (side list on wide screens, five-tab bar on phones) · signature: the question sheet with its source record · states: loading, empty, error, full · dose: white, night for dark
 * axes: light/grotesk-sans/chromatic-green · posture: committed · modes: light+dark · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V3 · weakest: V, one theme serves every screen by design; answers are keys, records are ruled rows and figures are a hairline row so screens do not repeat one card */
/* Hallmark · dismissed 23 · the busy bar is a 2px loading line across the top edge, far under the accent footprint */
/* Hallmark · answered F7 · every text field shares one recipe on purpose so inputs, selects and notes read as the same control */
/* Hallmark · answered F4 · the secondary button is Dose's clear key in the sheet colour with a grey rim, the green key stays the only filled primary */
/* Hallmark · waive 1 · system faces stand in on every screen · the app's content policy blocks outside font hosts, so the Dose faces load only once self-hosted */
:root {
  color-scheme: light;
  /* Raw colours used by the dark navigation bar and the accent themes, named once here. */
  --hue-1d5ca6: #1D5CA6; --hue-164a87: #164A87; --hue-e3ecf7: #E3ECF7; --hue-2f74c4: #2F74C4; --hue-8db8ec: #8DB8EC; --hue-abcbf2: #ABCBF2; --hue-172b45: #172B45; --hue-06121f: #06121F; --hue-a9cbf2: #A9CBF2; --hue-0e2d52: #0E2D52; --hue-1a3e68: #1A3E68; --hue-9cc2f0: #9CC2F0; --hue-00666a: #00666A; --hue-00514f: #00514F; --hue-ddefef: #DDEFEF; --hue-138a8e: #138A8E; --hue-7ccbcb: #7CCBCB; --hue-9ddada: #9DDADA; --hue-133434: #133434; --hue-031414: #031414; --hue-003638: #003638; --hue-0b4a4c: #0B4A4C; --hue-8fd3d3: #8FD3D3; --hue-5a3a8b: #5A3A8B; --hue-482c70: #482C70; --hue-ece5f5: #ECE5F5; --hue-7550ae: #7550AE; --hue-bfa6e6: #BFA6E6; --hue-d2bff0: #D2BFF0; --hue-2b2140: #2B2140; --hue-120a1f: #120A1F; --hue-2c1e47: #2C1E47; --hue-3d2b5e: #3D2B5E; --hue-cdb8f0: #CDB8F0; --hue-002f26: #002F26; --white-86: rgb(255 255 255 / 0.86); --white-64: rgb(255 255 255 / 0.64); --white-14: rgb(255 255 255 / 0.14); --white-28: rgb(255 255 255 / 0.28); --white-10: rgb(255 255 255 / 0.10); --white: #FFFFFF; --hue-ffb4ab: #FFB4AB; --tone-42: rgb(255 120 100 / 0.18); --white-12: rgb(255 255 255 / 0.12); --white-08: rgb(255 255 255 / 0.08); --classic-bar: #1B3A66; --classic-bar-2: #274C82; --classic-ink: #FFFFFF; --classic-rail: #E8ECF2; --classic-rail-2: #D9DFE8; --classic-now: #9FD4F7; --classic-rule: #9AA6B8;
  --swatch-light: #FFFFFF; --swatch-dark: #111315;
  --tint-white: oklch(98.4% 0.002 95); --tint-white-2: oklch(96.4% 0.003 95); --tint-white-3: oklch(94% 0.004 95); --tint-grey: oklch(85.5% 0.004 250); --tint-grey-2: oklch(82% 0.005 250); --tint-grey-3: oklch(78.5% 0.006 250); --tint-cream: oklch(93.2% 0.034 88); --tint-cream-2: oklch(90.6% 0.038 88); --tint-cream-3: oklch(88% 0.042 88); --tint-black: oklch(5.5% 0.003 250); --tint-black-2: oklch(8.5% 0.004 250); --tint-black-3: oklch(14% 0.005 250);
  --sheet-white: oklch(99.7% 0.002 95); --sheet-white-2: oklch(96.5% 0.004 95); --sheet-grey: oklch(89% 0.004 250); --sheet-grey-2: oklch(84.5% 0.005 250); --sheet-cream: oklch(95.5% 0.035 88); --sheet-cream-2: oklch(92% 0.04 88); --sheet-black: oklch(11% 0.004 250); --sheet-black-2: oklch(17% 0.006 250); --sheet-grey-rule: oklch(76% 0.006 250); --sheet-grey-muted: oklch(40% 0.012 200);
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.2rem; --text-xl: 1.44rem; --text-2xl: 1.728rem; --text-3xl: 2.074rem;
  --text-display-s: 1.44rem; --text-display: 1.728rem; --text-section: 1.2rem; --text-title: 1rem; --text-lead: 1rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
  --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
  --color-paper: #F3F4F6; --color-paper-2: #ECEEF1; --color-paper-3: #E2E5E9;
  --color-sheet: #FFFFFF; --color-sheet-2: #F5F6F8;
  --color-ink: #16191C; --color-ink-2: #2B2F34; --color-muted: #5D646D;
  --color-rule: #E1E4E8; --color-rule-2: #C4C9D0;
  --color-accent: var(--acc-l); --color-accent-2: var(--acc-l-2); --color-accent-soft: var(--acc-l-soft); --color-accent-ink: #FFFFFF; --color-focus: var(--acc-l-focus);
  --color-glint: #FFFFFF;
  --color-logo: #002F26; --color-logo-page: #FAFAF8;
  --color-error: #B42318; --color-error-bg: #FDECEA; --color-error-rule: #F0A39B;
  --color-success: #17694D; --color-success-bg: #E2F2EA; --color-success-rule: #7DBEA2;
  --color-warn: #8A4B08; --color-warn-bg: #FDF1E3; --color-mark: #FFE98A;
  --color-scrim: rgb(16 20 24 / 0.5); --color-viewer: oklch(13% 0.01 170); --color-viewer-ink: oklch(96% 0.01 160); --color-viewer-chip: oklch(30% 0.02 170);
  --shadow-card: 0 1px 2px rgb(16 24 40 / 0.06), 0 1px 3px rgb(16 24 40 / 0.08);
  --shadow-key: 0 0 0 1px var(--color-rule-2);
  --shadow-key-primary: 0 0 0 1px var(--color-accent);
  --shadow-ring: 0 0 0 1px var(--color-rule);
  --font-display: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --font-outlier: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-card: 12px; --radius-input: 8px; --radius-tag: 999px; --rule-hair: 1px; --rule-bar: 1px;
  --tracking-display: -0.01em; --display-weight: 650;
  --control: 40px; --control-s: 32px; --hit: 44px; --tab: 60px; --banner-height: 0px; --page: 1020px; --read: 760px; --side: 236px;
  --bg: var(--color-paper);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --color-paper: #111315; --color-paper-2: #171A1D; --color-paper-3: #21252A;
  --color-sheet: #1A1D21; --color-sheet-2: #23272C;
  --color-ink: #F2F4F6; --color-ink-2: #D9DDE1; --color-muted: #A0A7AF;
  --color-rule: #2F3439; --color-rule-2: #474D54;
  --color-accent: var(--acc-d); --color-accent-2: var(--acc-d-2); --color-accent-soft: var(--acc-d-soft); --color-accent-ink: var(--acc-d-ink); --color-focus: var(--acc-d-focus);
  --color-glint: #2A2F34;
  --color-error: #F4A097; --color-error-bg: #3B1B18; --color-error-rule: #7A3A33;
  --color-success: #86CFAE; --color-success-bg: #163A2C; --color-success-rule: #4E9C7B;
  --color-warn: #F2B877; --color-warn-bg: #3A2A15; --color-mark: #6B5A12;
  --color-scrim: rgb(4 6 8 / 0.7);
  --shadow-card: inset 0 0 0 1px var(--color-rule);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) {
  color-scheme: dark;
  --color-paper: #111315; --color-paper-2: #171A1D; --color-paper-3: #21252A;
  --color-sheet: #1A1D21; --color-sheet-2: #23272C;
  --color-ink: #F2F4F6; --color-ink-2: #D9DDE1; --color-muted: #A0A7AF;
  --color-rule: #2F3439; --color-rule-2: #474D54;
  --color-accent: var(--acc-d); --color-accent-2: var(--acc-d-2); --color-accent-soft: var(--acc-d-soft); --color-accent-ink: var(--acc-d-ink); --color-focus: var(--acc-d-focus);
  --color-glint: #2A2F34;
  --color-error: #F4A097; --color-error-bg: #3B1B18; --color-error-rule: #7A3A33;
  --color-success: #86CFAE; --color-success-bg: #163A2C; --color-success-rule: #4E9C7B;
  --color-warn: #F2B877; --color-warn-bg: #3A2A15; --color-mark: #6B5A12;
  --color-scrim: rgb(4 6 8 / 0.7);
  --shadow-card: inset 0 0 0 1px var(--color-rule);
} }
:root[data-text=small] { font-size: 93.75%; }
:root[data-text=large] { font-size: 112.5%; }
:root[data-text=xlarge] { font-size: 125%; }

/* base */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--color-paper); color: var(--color-ink-2); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.5; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: var(--color-ink); text-decoration-color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 0.16em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; color: var(--color-ink); overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { font-size: var(--text-display); margin-bottom: var(--space-md); }
h2 { font-size: var(--text-section); margin-bottom: var(--space-sm); }
h3 { font-size: var(--text-title); line-height: 1.2; margin-bottom: var(--space-2xs); }
h4 { font: 500 var(--text-sm)/1.3 var(--font-body); letter-spacing: 0; color: var(--color-muted); margin: var(--space-md) 0 var(--space-2xs); }
p { margin: 0 0 var(--space-sm); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
img, video { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, summary, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, .disabled { opacity: 0.55; cursor: not-allowed; color: var(--color-muted); }
textarea { resize: vertical; }
details summary { cursor: pointer; overflow-wrap: anywhere; }
mark { background: var(--color-mark); color: inherit; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.25em; }
.muted { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
.center { text-align: center; }
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); }
.skip:focus { top: var(--space-xs); }
body.busy::before { content: ""; position: fixed; inset: 0 0 auto 0; height: var(--rule-bar); z-index: var(--z-toast); background: var(--color-accent); transform-origin: left; animation: busy 1s var(--ease-in-out) infinite alternate; }
@keyframes busy { from { transform: scaleX(0.1); } to { transform: scaleX(1); } }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }

/* shell */
.layout { min-height: 100dvh; padding-inline-start: var(--side); }
.sidebar { background: var(--color-paper-2); border-inline-end: var(--rule-hair) solid var(--color-rule); padding: var(--space-lg) var(--space-sm) var(--space-md); display: flex; flex-direction: column; gap: var(--space-lg); position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); overflow-y: auto; }
.brand { font: 600 var(--text-md)/1.2 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); white-space: nowrap; display: flex; gap: var(--space-xs); align-items: center; padding-inline: var(--space-xs); }
.logo { width: 28px; height: 28px; flex: none; }
.logo .l-bg { fill: var(--color-logo); }
.logo .l-page { fill: var(--color-logo-page); }
.logo .l-cut { fill: none; stroke: var(--color-logo); }
.sidebar nav { display: grid; gap: var(--space-3xs); }
.sidebar a, .sidebar .signout { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--control); padding: 0 var(--space-sm); border: 0; border-radius: var(--radius-input); background: transparent; color: var(--color-ink-2); font: 500 var(--text-sm)/1.2 var(--font-body); text-decoration: none; text-align: start; }
.sidebar a .icon, .sidebar .signout .icon { color: var(--color-muted); }
.sidebar a:hover, .sidebar .signout:hover { background: var(--color-paper-3); }
.sidebar a[aria-current] { background: var(--color-sheet); box-shadow: var(--shadow-ring); color: var(--color-ink); }
.sidebar a[aria-current] .icon { color: var(--color-accent); }
.sidebar .signout { color: var(--color-muted); }
.sidebar .sidecount { margin-top: auto; height: auto; min-height: 0; padding: var(--space-sm); gap: var(--space-sm); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-ring); background: var(--color-sheet); color: var(--color-muted); font: 400 var(--text-xs)/1.35 var(--font-body); }
.sidecount strong { font: 700 var(--text-2xl)/1 var(--font-display); font-variant-numeric: tabular-nums lining-nums; color: var(--color-ink); letter-spacing: var(--tracking-display); }
.tabbar { display: none; }
.page { width: min(var(--page), 100%); padding: var(--space-xl) var(--space-xl) var(--space-2xl); margin-inline: auto; min-width: 0; }
.stack { display: grid; gap: var(--space-md); }
.stack > * { min-width: 0; }
.narrow { max-width: var(--read); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.columns { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: var(--space-md); margin-bottom: var(--space-md); }

/* surfaces */
.card { background: var(--color-sheet); color: var(--color-ink-2); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--space-lg); min-width: 0; }
.notice { background: var(--color-warn-bg); color: var(--color-ink); border-radius: var(--radius-input); padding: var(--space-sm) var(--space-md); margin: var(--space-sm) 0; }
.loading { color: var(--color-muted); }
.callout { background: var(--color-sheet-2); border-radius: var(--radius-input); padding: var(--space-sm) var(--space-md); margin: var(--space-md) 0; }
.callout h3 { font: 500 var(--text-sm)/1.3 var(--font-body); letter-spacing: 0; color: var(--color-muted); margin-bottom: var(--space-2xs); }
.callout.key { background: var(--color-accent-soft); color: var(--color-ink); }
.callout.warn { background: var(--color-warn-bg); color: var(--color-ink); }
.callout.warn h3 { color: var(--color-warn); }

/* controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--control); padding: 0 var(--space-md); border: 0; border-radius: var(--radius-input); background: var(--color-sheet); box-shadow: var(--shadow-key); color: var(--color-ink); font: 500 var(--text-sm)/1.2 var(--font-body); text-decoration: none; white-space: nowrap; transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); max-width: 100%; min-width: 0; }
.button:hover:not(:disabled):not(.disabled) { background: var(--color-paper-2); }
.button:active:not(:disabled):not(.disabled) { transform: translateY(2px); }
.button:disabled, .button.disabled { box-shadow: var(--shadow-ring); }
.button.primary { background: var(--color-accent); box-shadow: var(--shadow-key-primary); color: var(--color-accent-ink); }
.button.primary:hover:not(:disabled) { background: var(--color-accent-2); }
.button.primary:disabled { background: var(--color-paper-3); box-shadow: var(--shadow-ring); color: var(--color-muted); }
.button.big { min-height: var(--hit); padding: 0 var(--space-lg); font-size: var(--text-md); }
.button.small { min-height: var(--control-s); padding: 0 var(--space-sm); }
.button.quiet { background: transparent; box-shadow: none; min-width: var(--control); padding: 0 var(--space-xs); }
.button.chip { min-width: var(--hit); font-variant-numeric: tabular-nums; }
.button.grow { flex: 1; }
.button.ghost { background: transparent; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }
.field { display: grid; gap: var(--space-2xs); font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-ink); align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea, #note, #libnote, .searchbar input { width: 100%; min-height: var(--control); padding: var(--space-xs) var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: 400 var(--text-md)/1.4 var(--font-body); outline: 2px solid transparent; outline-offset: -3px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, #note:focus-visible, #libnote:focus-visible, .searchbar input:focus-visible { outline-color: var(--color-focus); }
.field input[type=date], .field input[type=time] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: start; }
.field input[type=date]::-webkit-date-and-time-value, .field input[type=time]::-webkit-date-and-time-value { text-align: start; }
.field input.count { width: 6.5rem; flex: none; font-variant-numeric: tabular-nums; }
.hint { min-height: 1lh; font-weight: 400; font-size: var(--text-xs); color: var(--color-muted); }
.check { display: flex; align-items: center; gap: var(--space-xs); min-height: var(--control); align-self: end; font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-ink); }
.check input { width: 18px; height: 18px; accent-color: var(--color-accent); }
.badge, .pill, .countpill { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: 0 var(--space-xs); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-tag); color: var(--color-muted); font: 500 var(--text-xs)/1.6 var(--font-body); white-space: nowrap; }
.pill { white-space: normal; }
.badge .icon { width: 1em; height: 1em; }
.badge.ok { color: var(--color-success); border-color: var(--color-success-rule); background: var(--color-success-bg); }
.badge.bad { color: var(--color-error); border-color: var(--color-error-rule); background: var(--color-error-bg); }
.badge.warn { color: var(--color-warn); background: var(--color-warn-bg); }
.badge.hot { color: var(--color-ink); border-color: var(--color-accent-soft); background: var(--color-accent-soft); }
.badge.rebuilt { color: var(--color-ink); border-color: var(--color-rule-2); background: var(--color-paper-2); }
.countpill { font-variant-numeric: tabular-nums; vertical-align: middle; }
.bar { display: block; height: var(--space-2xs); border-radius: var(--radius-tag); background: var(--color-rule); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 100%; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-long) var(--ease-out); }
[dir=rtl] .bar > span { transform-origin: right; }
.bar.ok > span { background: var(--color-success); }
.bar.warn > span { background: var(--color-muted); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: start; padding: var(--space-xs) var(--space-sm); overflow-wrap: anywhere; vertical-align: top; }
.table th { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-muted); border-bottom: var(--rule-bar) solid var(--color-rule-2); white-space: nowrap; }
.table td { border-top: var(--rule-hair) solid var(--color-rule); }
.overflow { overflow-x: auto; margin: var(--space-sm) 0; }
.segmented { display: inline-flex; max-width: 100%; margin-bottom: var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); overflow: hidden; }
.segmented .button { border-radius: 0; box-shadow: none; flex: 1; font-weight: 500; }
.segmented .button + .button { border-inline-start: var(--rule-hair) solid var(--color-rule); }
.segmented [aria-pressed=true] { background: var(--color-accent-soft); color: var(--color-ink); }
.segmented [aria-pressed=true]:hover:not(:disabled) { background: var(--color-accent-soft); }

/* today and results */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-xl); margin-bottom: var(--space-md); padding: var(--space-lg); background: var(--color-sheet); color: var(--color-ink-2); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.hero h1, .hero h2 { font-size: var(--text-display); margin-bottom: var(--space-xs); }
.hero p { max-width: 52ch; margin-bottom: var(--space-md); }
.dateline { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-muted); margin-bottom: var(--space-xs) !important; }
.ring { position: relative; width: 160px; height: 160px; flex: none; }
.ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--color-rule); }
.ring .arc { stroke: var(--color-accent); }
.ring.ok .arc { stroke: var(--color-success); }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: var(--space-3xs); padding: var(--space-lg); }
.ring strong { font: 700 var(--text-3xl)/1 var(--font-display); font-variant-numeric: tabular-nums lining-nums; letter-spacing: var(--tracking-display); color: var(--color-ink); }
.ring span { font-size: var(--text-xs); color: var(--color-muted); line-height: 1.25; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--space-md); border-block: var(--rule-hair) solid var(--color-rule); }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.stats .stat { display: grid; gap: var(--space-2xs); align-content: start; padding: var(--space-md); background: transparent; border: 0; border-radius: 0; box-shadow: none; border-inline-start: var(--rule-hair) solid var(--color-rule); }
.stats .stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stat > span:first-child { font: 500 var(--text-sm)/1.3 var(--font-body); white-space: nowrap; }
.stat strong { font: 700 var(--text-3xl)/1.05 var(--font-display); font-variant-numeric: tabular-nums lining-nums; letter-spacing: var(--tracking-display); color: var(--color-ink); }
.stat.ok strong { color: var(--color-success); }
.stat.bad strong { color: var(--color-error); }
.actions { display: grid; grid-template-columns: minmax(0, 1fr); border-top: var(--rule-hair) solid var(--color-rule); }
.button.tile { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); justify-content: stretch; align-items: baseline; gap: var(--space-md); min-height: var(--hit); padding: var(--space-sm) 0; border: 0; border-bottom: var(--rule-hair) solid var(--color-rule); border-radius: 0; background: transparent; box-shadow: none; text-align: start; white-space: normal; }
.button.tile:hover:not(:disabled) { background: var(--color-sheet-2); }
.button.tile:active:not(:disabled) { transform: none; }
.button.tile:disabled { box-shadow: none; }
.tile b { font-weight: 600; }
.tile span { font: 400 var(--text-sm)/1.4 var(--font-body); color: var(--color-muted); }
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.meters li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-sm); align-items: baseline; }
.meters li > span:first-child { overflow-wrap: anywhere; }
.meters b, .meters small { font-variant-numeric: tabular-nums; font-weight: 500; }
.meters .bar { grid-column: 1 / -1; }
.meters.wide li { grid-template-columns: minmax(0, 1fr) auto auto; }
.meters.wide small { min-width: 8.5rem; text-align: end; font-size: var(--text-xs); }

/* practice */
.modes { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-sm); }
.modes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modes .poolnote { grid-column: 1 / -1; margin: 0; }
.modes legend { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-ink); margin-bottom: var(--space-xs); padding: 0; }
.mode { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.mode input { margin-top: var(--space-2xs); width: 18px; height: 18px; accent-color: var(--color-accent); flex: none; }
.mode span { font-size: var(--text-sm); color: var(--color-muted); }
.mode b { display: block; font: 600 var(--text-md)/1.3 var(--font-body); color: var(--color-ink); }
.mode:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.mode:has(input:checked) span { color: var(--color-ink-2); }
.mode:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.opts { border: 0; margin: 0; padding: 0; min-width: 0; }
.opts legend, .picks legend { display: flex; align-items: center; gap: var(--space-2xs); width: 100%; }
.pickacts { margin-inline-start: auto; display: inline-flex; gap: var(--space-sm); }
.textbtn { border: 0; padding: var(--space-2xs) 0; background: none; color: var(--color-accent); font: 500 var(--text-sm)/1.3 var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.textbtn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.formend { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
form:not(.wizard) .formend .grow { flex: 0 1 auto; }
.stepat { margin: 0; text-align: center; }
.opts legend { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-ink); margin-bottom: var(--space-xs); padding: 0; }
.opts .segmented { display: flex; margin: 0; }
.opts .segmented .button { flex: 1 1 0; min-width: 0; min-height: var(--control); padding: var(--space-2xs) var(--space-xs); text-align: center; white-space: normal; line-height: 1.2; flex-wrap: wrap; }
.segmented label.button { position: relative; cursor: pointer; }
.segmented label.button input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.step { display: grid; gap: var(--space-md); min-width: 0; }
.optrow { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); }
.toggle { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control); font: 500 var(--text-md)/1.2 var(--font-body); color: var(--color-ink); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { position: relative; flex: none; width: 44px; height: 26px; border-radius: var(--radius-input); background: var(--color-rule-2); transition: background-color var(--dur-short) var(--ease-out); }
.toggle .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: calc(var(--radius-input) - 3px); background: var(--color-sheet); box-shadow: var(--shadow-card); transition: transform var(--dur-short) var(--ease-out); }
.toggle input:checked + .track { background: var(--color-accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wizonly { display: none; }
.wizard .step:not(.on) { display: none; }
.wizard .wizonly { display: inline-flex; }
.wizard .laststep { display: none; }
.wizard[data-at="4"] .laststep { display: inline-flex; }
.wizard[data-at="4"] #stepnext { display: none; }
.wizard { gap: var(--space-sm); padding: var(--space-md); }
.wizard .step { gap: var(--space-sm); }
.wizard .pickgrid, .wizard .pickgrid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2xs); margin: 0; }
.wizard .pick { min-height: 32px; padding: var(--space-3xs) var(--space-xs); line-height: 1.15; font-size: var(--text-xs); }
.wizard .pick b { font-size: var(--text-xs); }
body:has(.wizard) h1 { margin-bottom: var(--space-xs); }
.wizard .wizonly.stepat { display: block; }
.wizard[data-at="1"] #stepback { display: none; }
.wizard .morefilters summary { margin-bottom: 0; }
.wizard .morefilters[open] summary { margin-bottom: var(--space-sm); }
@media (max-width: 480px) { .pickgrid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.match { background: var(--color-sheet-2); border-radius: var(--radius-input); padding: var(--space-xs) var(--space-sm); margin: 0; font-size: var(--text-sm); }
.match b { font-variant-numeric: tabular-nums; font-weight: 600; }
.match.empty { background: var(--color-warn-bg); color: var(--color-ink); }
.handoff { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); align-items: center; justify-content: space-between; margin: 0; }

/* library */
.searchbar { position: relative; margin-bottom: var(--space-sm); }
.searchbar .icon { position: absolute; inset-inline-start: var(--space-sm); top: 50%; transform: translateY(-50%); color: var(--color-muted); }
.searchbar input { min-height: var(--hit); padding-inline-start: var(--space-xl); }
.filters { margin-bottom: var(--space-sm); }
.filters summary { display: none; }
.resultbar { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); min-height: var(--control); }
.resultbar b { font-variant-numeric: tabular-nums; font-weight: 600; }
#results { gap: 0; background: var(--color-sheet); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
#results > p.card { box-shadow: none; }
#results > .center { padding: var(--space-md); }
.qrow { display: grid; gap: var(--space-xs); padding: var(--space-md) var(--space-lg); border: 0; border-bottom: var(--rule-hair) solid var(--color-rule); background: transparent; color: var(--color-ink); text-decoration: none; transition: background-color var(--dur-short) var(--ease-out); }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--color-sheet-2); }
.qrow.q-ok { border-inline-start: var(--rule-bar) solid var(--color-success); }
.qrow.q-bad { border-inline-start: var(--rule-bar) solid var(--color-error); }
.qstem { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.qmeta { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-xs); align-items: center; font-size: var(--text-sm); color: var(--color-muted); }
.detailbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); margin-bottom: var(--space-md); max-width: var(--read); }
.detailbar .button { flex: none; }
.detailbar > .row { flex-wrap: nowrap; flex: none; gap: var(--space-2xs); }
.detailbar > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* question sheet */
.question .qmeta { margin-bottom: var(--space-sm); }
.topic { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
.reading { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.stem { font-size: var(--text-lg); line-height: 1.6; color: var(--color-ink); }
.media { display: block; position: relative; margin: var(--space-md) 0; padding: 0; border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-viewer-ink); overflow: hidden; max-width: 100%; cursor: zoom-in; }
.media img { max-height: 420px; object-fit: contain; margin: auto; }
.zoomhint { position: absolute; inset-inline-end: var(--space-xs); bottom: var(--space-xs); display: flex; gap: var(--space-2xs); align-items: center; padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-tag); background: var(--color-viewer); color: var(--color-viewer-ink); font: 500 var(--text-xs)/1.5 var(--font-body); }
.media.broken { cursor: default; padding: var(--space-sm); color: var(--color-muted); background: var(--color-sheet-2); }
.media.broken img, .media.broken .zoomhint { display: none; }
.media.broken::after { content: "Image unavailable"; }
.options { display: grid; gap: var(--space-xs); margin: var(--space-md) 0 var(--space-sm); }
.option { position: relative; display: flex; align-items: stretch; border-radius: var(--radius-input); background: var(--color-sheet); box-shadow: var(--shadow-key); overflow: hidden; transition: background-color var(--dur-short) var(--ease-out); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.option label { flex: 1; display: flex; gap: var(--space-sm); align-items: flex-start; min-height: var(--hit); min-width: 0; padding: var(--space-xs) var(--space-sm); cursor: pointer; }
.letter { flex: none; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-tag); font: 700 var(--text-sm)/1 var(--font-display); color: var(--color-ink); }
.otext { flex: 1; min-width: 0; display: grid; gap: var(--space-3xs); padding-top: var(--space-3xs); overflow-wrap: anywhere; color: var(--color-ink); }
.option:hover:not(.correct):not(.wrong):not(.dim) { background: var(--color-sheet-2); }
.option:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.option:has(input:checked):not(.correct):not(.wrong) { background: var(--color-accent-soft); box-shadow: var(--shadow-key-primary); }
.option:has(input:checked):not(.correct):not(.wrong) .letter { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.option.struck .otext > span:first-child { text-decoration: line-through; color: var(--color-muted); }
.option.correct { background: var(--color-sheet); box-shadow: var(--shadow-key-primary); }
.option.correct .letter { background: var(--color-success); border-color: var(--color-success); color: var(--color-success-bg); }
.option.wrong { background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-error-rule); }
.option.wrong .letter { background: var(--color-error); border-color: var(--color-error); color: var(--color-error-bg); }
.option.dim { box-shadow: var(--shadow-ring); }
.option.struck { box-shadow: var(--shadow-ring); background: var(--color-paper-2); }
.option.dim label, .option.correct label, .option.wrong label { cursor: default; }
.tag { display: inline-flex; align-items: center; gap: var(--space-2xs); font: 600 var(--text-xs)/1.4 var(--font-body); }
.tag.ok { color: var(--color-success); }
.tag.bad { color: var(--color-error); }
.tag.changed { justify-self: start; max-width: 100%; padding: 0 var(--space-2xs); border-radius: var(--radius-input); background: var(--color-mark); color: var(--color-ink); }
.tag .icon { width: 1.1em; height: 1.1em; stroke-width: 2.4; }
.why { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.5; }
.option.correct .why, .option.wrong .why { color: var(--color-ink-2); }
.strikebtn { flex: none; width: var(--hit); display: grid; place-items: center; border: 0; border-inline-start: var(--rule-hair) solid var(--color-rule); background: transparent; color: var(--color-muted); }
.strikebtn:hover, .strikebtn[aria-pressed=true] { background: var(--color-sheet-2); color: var(--color-ink); }
.variant { margin: var(--space-xs) 0; padding-inline-start: var(--space-lg); list-style: upper-alpha; display: grid; gap: var(--space-2xs); }
.verdict { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-2xs) var(--space-sm); margin-bottom: var(--space-sm); border-radius: var(--radius-input); font: 500 var(--text-sm)/1.4 var(--font-body); }
.verdict span { margin-inline-start: auto; font: 400 var(--text-xs)/1.4 var(--font-body); font-variant-numeric: tabular-nums; color: var(--color-muted); }
.verdict.ok { background: var(--color-success-bg); color: var(--color-success); }
.verdict.bad { background: var(--color-error-bg); color: var(--color-error); }
.verdict.skipped { background: var(--color-sheet-2); color: var(--color-muted); }
.tools { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.tools #saved { margin-inline-start: auto; }
.qhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); margin-bottom: var(--space-sm); }
.qhead .wording { margin: 0; }
.qhead .qmeta { margin: 0; }
.toolrow { flex-wrap: nowrap; }
.toolrow > .button, .moretools > summary { flex: 1 1 0; min-width: 0; padding-inline: var(--space-xs); white-space: nowrap; }
.moretools { position: relative; flex: 1 1 0; min-width: 0; }
.moretools > summary { width: 100%; list-style: none; }
.moretools > summary::-webkit-details-marker { display: none; }
.moretools .menu { position: absolute; inset-inline-end: 0; bottom: calc(100% + var(--space-2xs)); z-index: var(--z-dropdown); display: grid; gap: var(--space-2xs); min-width: 12rem; padding: var(--space-xs); background: var(--color-sheet); border-radius: var(--radius-input); box-shadow: var(--shadow-card), var(--shadow-ring); }
.moretools .menu .button { justify-content: flex-start; box-shadow: none; }
.toolrow #saved:empty, #saved:empty { display: none; }
.examtop .moretools { flex: none; }
.examtop .moretools > summary { flex: none; width: auto; padding: 0 var(--space-xs); }
.examtop .moretools .menu { top: calc(100% + var(--space-2xs)); bottom: auto; background: var(--color-chrome); box-shadow: var(--shadow-ring); }
.examtop .moretools .menu .button { background: transparent; }
.examtop .moretools .menu .button:hover:not(:disabled) { background: var(--white-12); }
@media (max-width: 480px) { .toolrow { gap: var(--space-2xs); } .toolrow .button .icon { display: none; } }
.wording { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); align-items: center; margin-bottom: var(--space-sm); }
.wording .segmented { margin: 0; }
.wording .segmented .button { min-height: var(--control-s); padding: 0 var(--space-sm); }
mark.added { background: var(--color-accent-soft); color: var(--color-ink); text-decoration: underline dotted var(--color-accent); text-underline-offset: 0.2em; }
.studynote dl { margin: 0; display: grid; gap: var(--space-2xs); }
.studynote dt { font: 600 var(--text-sm)/1.4 var(--font-body); color: var(--color-ink); margin-top: var(--space-xs); }
.studynote dd { margin: 0; }
.addtag { display: inline-block; margin-inline-end: var(--space-2xs); padding: 0 var(--space-2xs); border-radius: var(--radius-input); background: var(--color-mark); color: var(--color-ink); font: 600 var(--text-xs)/1.5 var(--font-body); letter-spacing: 0.02em; text-decoration: none; vertical-align: 0.1em; user-select: none; }
.confrow { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); align-items: center; margin-bottom: var(--space-sm); }
.confrow .segmented { margin: 0; }
.confrow .segmented .button { min-height: var(--control-s); padding: 0 var(--space-sm); }
.confnote { background: var(--color-sheet-2); border-radius: var(--radius-input); padding: var(--space-xs) var(--space-sm); margin: 0 0 var(--space-sm); }

/* explanation and source record */
.review h2 { margin-bottom: var(--space-sm); }
.answerline { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-sm); border-radius: var(--radius-input); background: var(--color-success-bg); color: var(--color-ink); font-size: var(--text-lg); }
.answerline .letter { background: var(--color-success); border-color: var(--color-success); color: var(--color-success-bg); }
.review > h3 { margin-top: var(--space-lg); }
.refs { list-style: none; margin: 0 0 var(--space-2xs); padding: 0; display: grid; gap: var(--space-xs); }
.refs li { display: flex; gap: var(--space-xs); align-items: flex-start; }
.refs .icon { flex: none; margin-top: 0.2em; color: var(--color-accent); }
.trust { margin-top: var(--space-sm); }
.sources { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.sources > .button { margin-top: var(--space-sm); }
.source { border-bottom: var(--rule-hair) solid var(--color-rule); }
.source summary { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--space-3xs) var(--space-md); align-items: baseline; position: relative; list-style: none; min-height: var(--hit); padding: var(--space-xs) 0 var(--space-xs) var(--space-lg); }
.source summary::-webkit-details-marker { display: none; }
.source summary::before { content: ""; position: absolute; inset-inline-start: var(--space-2xs); top: var(--space-md); width: 7px; height: 7px; border-inline-end: 1.5px solid var(--color-muted); border-bottom: 1.5px solid var(--color-muted); transform: rotate(-45deg); transition: transform var(--dur-micro) var(--ease-out); }
.source[open] summary::before { transform: rotate(45deg); }
.s-label { font: 600 var(--text-sm)/1.4 var(--font-body); color: var(--color-ink); }
.s-loc { font: 400 var(--text-xs)/1.5 var(--font-outlier); color: var(--color-muted); }
.s-ans { grid-column: 1 / -1; font-size: var(--text-sm); color: var(--color-muted); }
.s-body { padding: 0 0 var(--space-md) var(--space-lg); }
.s-body .media img { max-height: 300px; }
.variants { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.variants summary { min-height: var(--control-s); }
.variantitem { background: var(--color-sheet-2); border-radius: var(--radius-input); padding: var(--space-sm) var(--space-md); margin-top: var(--space-xs); }
.variantitem p { margin-bottom: var(--space-2xs); }

/* progress, sources, more */
.sessions { list-style: none; margin: 0; padding: 0; }
.sessions li { display: flex; gap: var(--space-sm); align-items: center; justify-content: space-between; padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.sessions li:last-child { border: 0; padding-bottom: 0; }
.sourcecard h2 { margin: 0; font-size: var(--text-title); }
.sourcecard p { margin: var(--space-2xs) 0 0; }
.linkcard { display: flex; align-items: center; gap: var(--space-md); width: 100%; border: 0; color: var(--color-ink); font: inherit; text-decoration: none; text-align: start; }
.linkcard span { flex: 1; display: grid; }
.linkcard b { font: 600 var(--text-md)/1.3 var(--font-body); }
.linkcard > .icon:first-child { width: 1.5em; height: 1.5em; color: var(--color-accent); }
.linkcard > .icon:last-child { color: var(--color-muted); }
.pagehead { flex-wrap: wrap; align-items: center; margin-bottom: var(--space-sm); }
.pagehead h1 { margin-bottom: 0; }
.pagehead > .row { flex: none; }
.journal article { padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.journal article:first-of-type { border-top: 0; padding-top: var(--space-2xs); }
.journal article p { margin-bottom: var(--space-2xs); }
.chart { display: block; height: 180px; max-width: 100%; }
.chart text { font: 500 11px var(--font-body); fill: var(--color-ink); }
.chart .c-axis { fill: var(--color-muted); }
.chart .c-ok { fill: var(--color-success); }
.chart .c-bad { fill: var(--color-error-rule); }
.pwform { margin-top: var(--space-sm); }
.access { margin-bottom: var(--space-md); background: var(--color-accent-soft); color: var(--color-ink); box-shadow: none; }
.access p { max-width: 60ch; }
.redeem { align-items: flex-end; }
.redeem .field { flex: 1; min-width: 12rem; max-width: 22rem; }
.reportrow { margin-top: var(--space-sm); }
.pick { font-size: var(--text-xs); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--color-muted); }
.statsnote { margin: 0 0 var(--space-sm); }
.drill { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); align-items: center; margin-top: var(--space-md); }
.figure { font-variant-numeric: tabular-nums; }
.labscroll { max-height: 52vh; overflow: auto; margin-bottom: var(--space-xs); }
dialog.labs { width: min(680px, calc(100% - 24px)); }
.labtabs { display: flex; width: 100%; }
.labtabs .button { min-height: var(--control-s); padding: 0 var(--space-xs); font-size: var(--text-sm); }
.labtable { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.labtable th, .labtable td { padding: var(--space-2xs) var(--space-xs); text-align: start; vertical-align: top; border-bottom: var(--rule-hair) solid var(--color-rule); font-weight: 400; overflow-wrap: anywhere; }
.labtable thead th { color: var(--color-muted); font-weight: 500; }
.labtable th[scope=row] { color: var(--color-ink); }
.labtable .inside th[scope=row] { padding-inline-start: var(--space-lg); }
.labtable .labhead th { color: var(--color-ink); font-weight: 600; border-bottom: 0; }
.labtable .labtab th { padding-top: var(--space-sm); color: var(--color-accent); font-weight: 600; }
dialog.calc { width: min(340px, calc(100% - 24px)); }
.calcscreen { width: 100%; min-height: var(--hit); padding: var(--space-xs) var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: 500 var(--text-lg)/1.2 var(--font-outlier); text-align: end; }
.calcout { margin: var(--space-2xs) 0 var(--space-sm); min-height: 1.5em; text-align: end; font: 600 var(--text-lg)/1.3 var(--font-outlier); color: var(--color-ink); }
.calcout.bad { font: 400 var(--text-sm)/1.5 var(--font-body); color: var(--color-error); }
.calckeys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); margin-bottom: var(--space-sm); }
.calckeys .button { min-height: var(--hit); font-size: var(--text-md); padding: 0; }
#selbar { position: fixed; z-index: var(--z-tooltip); display: flex; gap: var(--space-2xs); padding: var(--space-2xs); background: var(--color-sheet); border-radius: var(--radius-input); box-shadow: var(--shadow-card), var(--shadow-key); }
#selbar[hidden] { display: none; }
@media (max-width: 480px) { #selbar .button .icon { display: none; } }
#selbar .button { box-shadow: none; padding-inline: var(--space-xs); white-space: nowrap; }
.itembox { display: none; }
.segmented label.button:has(input:checked) { background: var(--color-accent-soft); color: var(--color-ink); }
.segmented label.button:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: -2px; }
#appearance select { text-transform: capitalize; }

/* test */
.exam { min-height: 100dvh; display: flex; flex-direction: column; }
.examtop { position: sticky; top: var(--banner-height); z-index: var(--z-sticky-nav); display: flex; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs) var(--space-md); padding-top: max(var(--space-2xs), env(safe-area-inset-top)); background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-rule); }
.examtitle { flex: 1; display: grid; line-height: 1.2; padding-inline: var(--space-2xs); min-width: 0; }
.examtitle b { font: 700 var(--text-xl)/1.1 var(--font-display); font-variant-numeric: tabular-nums lining-nums; letter-spacing: var(--tracking-display); color: var(--color-ink); }
.examtitle b .muted { font-weight: 400; }
.examtitle > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#qtime.over { color: var(--color-error); font-weight: 600; }
.clockpill { min-height: var(--control-s); padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: 500 var(--text-md)/1 var(--font-outlier); font-variant-numeric: tabular-nums; }
.clockpill.low { background: var(--color-error-bg); border-color: var(--color-error); color: var(--color-error); }
.flagbtn[aria-pressed=true] { color: var(--color-accent); }
.flagbtn[aria-pressed=true] .icon { fill: currentColor; }
.examprogress .bar { height: var(--space-3xs); background: transparent; }
.exambody { flex: 1; display: grid; grid-template-columns: minmax(0, var(--read)); justify-content: center; gap: var(--space-lg); width: 100%; padding: var(--space-lg) var(--space-lg) var(--space-md); }
.exambody main { align-content: start; }
.rail { display: none; }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: var(--space-2xs); }
.navgrid a { position: relative; display: grid; place-items: center; height: 42px; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: 500 var(--text-sm)/1 var(--font-body); font-variant-numeric: tabular-nums; text-decoration: none; }
.navgrid a.done { background: var(--color-paper-3); border-color: var(--color-paper-3); }
.navgrid a.ok { background: var(--color-success-bg); border-color: var(--color-success-rule); color: var(--color-success); }
.navgrid a.bad { background: var(--color-error-bg); border-color: var(--color-error-rule); color: var(--color-error); }
.navgrid a[aria-current] { outline: 2px solid var(--color-ink); outline-offset: 1px; }
.navgrid a.flagged::after { content: ""; position: absolute; top: var(--space-2xs); inset-inline-end: var(--space-2xs); width: 6px; height: 6px; border-radius: var(--radius-tag); background: var(--color-accent); }
.navgrid.large { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.navgrid.large a { height: 48px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2xs); align-items: center; margin: var(--space-sm) 0 0; }
.lk { display: inline-block; width: 12px; height: 12px; border-radius: var(--space-2xs); border: var(--rule-hair) solid var(--color-rule-2); margin-inline-start: var(--space-xs); }
.lk:first-child { margin-inline-start: 0; }
.lk.done { background: var(--color-paper-3); border-color: var(--color-paper-3); }
.lk.ok { background: var(--color-success-bg); border-color: var(--color-success-rule); }
.lk.bad { background: var(--color-error-bg); border-color: var(--color-error-rule); }
.lk.flagged { background: var(--color-accent); border-color: var(--color-accent); width: 8px; height: 8px; }
.notes summary { min-height: var(--control-s); }
.notes #note, .notes #libnote { margin-top: var(--space-sm); display: block; }
.shortcuts { display: none; margin: 0; text-align: center; }
.actionbar { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: var(--z-sticky); display: flex; gap: var(--space-xs); margin-top: var(--space-2xs); padding: var(--space-xs); background: var(--color-sheet); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }

/* dialogs, toast, sign-in */
dialog { border: 0; border-radius: var(--radius-card); padding: var(--space-lg); background: var(--color-sheet); color: var(--color-ink-2); width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: var(--color-scrim); }
dialog.sheet .navgrid { max-height: 50vh; overflow: auto; padding: var(--space-2xs); }
dialog.sheet .row.end { margin-top: var(--space-lg); }
dialog.lightbox { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; padding: 0; background: var(--color-viewer); color: var(--color-viewer-ink); overflow: hidden; }
.lightbox .zoomwrap { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; padding: var(--space-2xl) var(--space-xs) var(--space-xl); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; background: var(--color-viewer-ink); }
.lightbox.actual .zoomwrap { place-items: start; }
.lightbox.actual img { max-width: none; max-height: none; width: max(160vw, 900px); cursor: zoom-out; }
.lightbox .close { position: fixed; top: max(10px, env(safe-area-inset-top)); inset-inline-end: var(--space-xs); z-index: var(--z-raised); min-width: var(--hit); min-height: var(--hit); padding: 0; box-shadow: none; background: var(--color-viewer-chip); color: var(--color-viewer-ink); }
.lightbox p { position: fixed; bottom: max(10px, env(safe-area-inset-bottom)); inset-inline: 0; text-align: center; margin: 0; pointer-events: none; }
#toast { position: fixed; inset-inline: var(--space-md); bottom: var(--space-lg); z-index: var(--z-toast); width: fit-content; max-width: min(430px, calc(100% - 32px)); margin: 0 auto; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-input); background: var(--color-ink); color: var(--color-paper); font: 500 var(--text-sm)/1.4 var(--font-body); }
.login { max-width: 420px; margin: 0 auto; padding: var(--space-3xl) var(--space-md) var(--space-lg); }
.login .brand { margin-bottom: var(--space-lg); padding: 0; }
.login .switch { margin-top: var(--space-md); display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.watermark { position: fixed; inset: -30vmax; z-index: var(--z-raised); pointer-events: none; -webkit-user-select: none; user-select: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 120px; place-items: center; transform: rotate(-24deg); color: var(--color-ink); opacity: 0.055; font: 600 var(--text-sm)/1 var(--font-display); white-space: nowrap; overflow: hidden; }

@media (min-width: 1000px) {
  .exambody.split { grid-template-columns: minmax(0, 1320px); }
  .exambody.split .rail { display: none; }
  .exam:has(.split) .railhide { display: inline-flex; }
  .exambody.split main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: var(--space-md); }
  .split main > .question { grid-column: 1; grid-row: 1; }
  .split main > .review { grid-column: 2; grid-row: 1 / 4; }
  .split main > .notes { grid-column: 1; grid-row: 2; }
  .split main > .shortcuts { grid-column: 1; grid-row: 3; align-self: start; }
  .split main > .actionbar { grid-column: 1 / -1; grid-row: 4; }
}
@media (min-width: 1080px) {
  .exambody { grid-template-columns: minmax(0, var(--read)) 300px; }
  .rail { display: block; }
  .rail .card { position: sticky; top: calc(var(--banner-height) + var(--space-3xl)); max-height: calc(100dvh - 120px); overflow: auto; }
  .railhide { display: none; }
}
@media (hover: hover) and (pointer: fine) { .shortcuts { display: block; } }
@media (pointer: coarse) { .button { min-height: var(--hit); } .button.small { min-height: var(--control); } }
@media (max-width: 859px) {
  .layout { padding-inline-start: 0; }
  .sidebar { display: none; }
  .page { padding: var(--space-lg) var(--space-md) calc(var(--tab) + var(--hit) + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset: auto var(--space-sm) max(10px, env(safe-area-inset-bottom)) var(--space-sm); z-index: var(--z-sticky); background: var(--color-sheet); border-radius: var(--radius-card); box-shadow: var(--shadow-card), var(--shadow-ring); overflow: hidden; }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: var(--space-3xs); min-height: var(--tab); padding: var(--space-2xs) var(--space-3xs); color: var(--color-muted); font: 500 var(--text-xs)/1.2 var(--font-body); text-decoration: none; }
  .tabbar a .icon { width: 24px; height: 24px; }
  .tabbar a[aria-current] { color: var(--color-accent); }
  #toast { bottom: calc(var(--tab) + 28px + env(safe-area-inset-bottom)); }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .wideonly { display: none; }
  .filters summary { display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 var(--space-md); margin-bottom: var(--space-sm); border-radius: var(--radius-input); background: var(--color-sheet); box-shadow: var(--shadow-key); font: 500 var(--text-sm)/1.2 var(--font-body); color: var(--color-ink); list-style: none; }
  .filters summary::-webkit-details-marker { display: none; }
  .filters[open] summary { background: var(--color-accent-soft); }
}
@media (max-width: 600px) {
  .card, .hero { padding: var(--space-md); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .stats .stat:nth-child(n+3) { border-top: var(--rule-hair) solid var(--color-rule); }
  .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats.three .stat { padding: var(--space-sm); border-top: 0; border-inline-start: var(--rule-hair) solid var(--color-rule); }
  .stats.three .stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
  .stats.three .stat > span:first-child { white-space: normal; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); justify-items: center; }
  .hero > div:first-child { justify-self: stretch; }
  .hero.result .ring { order: -1; }
  .hero .row .button { flex: 1 1 100%; }
  .ring { width: 140px; height: 140px; }
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom)); animation: sheet var(--dur-long) var(--ease-out); }
  .modes, .modes.three { grid-template-columns: minmax(0, 1fr); }
  .button.tile { grid-template-columns: minmax(0, 1fr); gap: var(--space-3xs); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .segmented { display: flex; }
  .meters.wide li { grid-template-columns: minmax(0, 1fr) auto; }
  .meters.wide small { grid-column: 1 / -1; text-align: start; order: 3; }
  .source summary { grid-template-columns: minmax(0, 1fr); }
  .exambody { padding: var(--space-sm) var(--space-sm) var(--space-md); }
  .media img { max-height: 320px; }
  .tools #saved { flex-basis: 100%; margin: 0; }
  .field input, .field select, .field textarea, #note, #libnote, .searchbar input { min-height: var(--hit); }
}
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
@media print { .sidebar, .tabbar, .examtop, .actionbar, .rail, #toast, .noprint { display: none !important; } .journal article { break-inside: avoid; } .layout { padding-inline-start: 0; } }

.refcode { font-family: var(--font-outlier); font-weight: 500; letter-spacing: 0.06em; user-select: all; }
.flash .reading { white-space: pre-wrap; }
.flash hr { width: 100%; border: 0; border-top: var(--rule-hair) solid var(--color-rule); margin: 0; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); }
.grades .button { display: grid; gap: 0; padding-inline: var(--space-xs); justify-items: center; }
.grades .button span { font: 400 var(--text-xs)/1.3 var(--font-outlier); }
.cardlist li > div { min-width: 0; }
.cardlist b { font-weight: 500; overflow-wrap: anywhere; }
.chart .c-line { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linejoin: round; }
.chart .c-dot { fill: var(--color-accent); }
.chart .c-target { stroke: var(--color-muted); stroke-width: 1; stroke-dasharray: 4 4; }
.lk.line { background: var(--color-accent); border-color: var(--color-accent); height: 3px; width: 16px; }
.lk.dash { background: transparent; border: 0; border-top: var(--rule-hair) dashed var(--color-muted); height: 0; width: 16px; }
.weekdays { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); }
.weekdays .check { min-height: 0; }
.notebody { white-space: pre-wrap; margin: var(--space-2xs) 0; }
.notelist li { align-items: flex-start; }
.assess { margin-top: var(--space-md); }
.planline { font: 500 var(--text-lg)/1.35 var(--font-body); margin: 0; }
.planline b { font-family: var(--font-display); font-weight: 700; color: var(--color-accent-deep); }
.weekstrip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2xs); }
.weekstrip li { display: grid; gap: var(--space-3xs); justify-items: center; text-align: center; padding: var(--space-xs) var(--space-3xs); border-radius: var(--radius-input); border: var(--rule-hair) solid var(--color-rule); }
.weekstrip .wd { font-size: var(--text-xs); color: var(--color-muted); }
.weekstrip b { font: 700 var(--text-lg)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.weekstrip small { font-size: var(--text-xs); line-height: 1.25; color: var(--color-ink-2); }
.weekstrip .past, .weekstrip .rest, .weekstrip .off { background: var(--color-paper-2); border-color: transparent; }
.weekstrip .past b, .weekstrip .rest b, .weekstrip .past small, .weekstrip .rest small { color: var(--color-muted); font-weight: 500; }
.weekstrip .met { background: var(--color-success-bg); border-color: var(--color-success-rule); }
.weekstrip .today { background: var(--color-accent-soft); border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.weekstrip .examday, .mgrid .examday { background: var(--color-ink); border-color: var(--color-ink); }
.weekstrip .examday * { color: var(--color-paper); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-lg); }
.month h3 { font: 600 var(--text-sm)/1.3 var(--font-body); margin: 0 0 var(--space-xs); }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2xs); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.mgrid i { font-style: normal; text-align: center; color: var(--color-muted); padding-bottom: var(--space-3xs); }
.mgrid > span { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius-tag); }
.mgrid .study { background: var(--color-paper-2); }
.mgrid .rest, .mgrid .past, .mgrid .off { color: var(--color-muted); opacity: 0.6; }
.mgrid .met { background: var(--color-success-bg); box-shadow: inset 0 0 0 1px var(--color-success-rule); }
.mgrid .today { background: var(--color-accent); color: var(--color-accent-ink); font-weight: 700; }
.mgrid .examday { color: var(--color-paper); font-weight: 700; }
.lk.today { background: var(--color-accent); border-color: var(--color-accent); }
.lk.rest { background: transparent; border-style: dashed; }
.lk.examday { background: var(--color-ink); border-color: var(--color-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.examclock { font: 500 var(--text-lg)/1 var(--font-outlier); font-variant-numeric: tabular-nums; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-input); background: var(--color-paper-3); }
.examclock.over { background: var(--color-ink); color: var(--color-paper); }
.result { display: flex; flex-wrap: wrap; gap: var(--space-lg); align-items: center; }
.result > .stack { flex: 1; min-width: 240px; }
.examreview { border-top: var(--rule-hair) solid var(--color-rule); padding: var(--space-sm) 0; }
.examreview summary { cursor: pointer; font-weight: 500; }
.examreview[open] summary { margin-bottom: var(--space-sm); }
.picks { border: 0; margin: 0; padding: 0; min-width: 0; }
.picks legend { font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-ink); margin-bottom: var(--space-xs); padding: 0; }
.pickhead { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin-bottom: var(--space-xs); }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2xs) var(--space-md); }
.pickgrid.five { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: var(--space-xs); }
.pick { display: flex; align-items: center; gap: var(--space-xs); min-height: var(--control); padding: var(--space-2xs) var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); cursor: pointer; font-size: var(--text-sm); }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pick > span { flex: 1; min-width: 0; overflow-wrap: break-word; }
.pick small { display: block; font-size: var(--text-xs); }
.pick b { font: 500 var(--text-xs)/1 var(--font-outlier); font-variant-numeric: tabular-nums; color: var(--color-muted); }
.pick:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pick:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pick.none { opacity: 0.55; }
.morefilters summary { cursor: pointer; font: 500 var(--text-sm)/1.3 var(--font-body); margin-bottom: var(--space-sm); }

/* Option notes and teaching pictures in the explanation */
.choices { display: grid; gap: var(--space-sm); margin: var(--space-md) 0 var(--space-xs); }
.choices p { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.choices .right b { color: var(--color-success); }
.review h3 { margin-top: var(--space-lg); font-size: var(--text-md); }
.review .callout h3, .review .sources h3 { margin-top: 0; }
.objective { margin: 0; }
.qfacts { display: grid; gap: var(--space-sm); margin: var(--space-lg) 0 0; padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.qfacts div { display: grid; gap: var(--space-3xs); }
.qfacts dd { margin: 0; color: var(--color-ink); }
.qfacts dt { font-size: var(--text-sm); color: var(--color-muted); }
.art { margin: var(--space-md) 0; }
.art .media { margin-bottom: var(--space-xs); }
.art figcaption { display: grid; gap: var(--space-2xs); }

.button.danger { background: var(--color-error); border-color: var(--color-error); color: var(--color-error-bg); }

/* Progress tabs, reports, graphs, recommendations, plan settings and help */
.nowrap { white-space: nowrap; }
.tabs { display: flex; gap: var(--space-md); margin-bottom: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 var(--space-2xs); color: var(--color-muted); font: 500 var(--text-md)/1.2 var(--font-body); text-decoration: none; white-space: nowrap; border-bottom: var(--space-3xs) solid transparent; }
.tabs a:hover { color: var(--color-ink); }
.tabs a[aria-current=page] { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.rings { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg) var(--space-xl); }
.rings > p { flex: 1; min-width: 12rem; margin: 0; }
.figgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); align-items: start; }
.figures { margin: 0; display: grid; }
.figures > div { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.figures > div:first-child { border-top: 0; }
.figures dt { color: var(--color-ink-2); }
.figures dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-ink); }
.report, .recs { display: grid; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.rline { display: grid; grid-template-columns: minmax(0, 3fr) repeat(5, minmax(0, 1fr)) 5.5rem; gap: var(--space-sm); align-items: center; padding: var(--space-xs) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.rhead { color: var(--color-muted); font-weight: 500; border-top: 0; border-bottom: var(--rule-bar) solid var(--color-rule-2); }
.rhead + details > .rline, .recline:first-child { border-top: 0; }
.report summary { list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report summary .rname > span:first-child::before { content: "+"; display: inline-block; width: var(--space-md); color: var(--color-muted); font-weight: 600; }
.report details[open] > summary .rname > span:first-child::before { content: "\2212"; }
.report details[open] > summary { font-weight: 600; }
.rname { display: grid; gap: var(--space-2xs); min-width: 0; overflow-wrap: anywhere; }
.rline.sub { color: var(--color-ink-2); }
.rline.sub .rname { padding-inline-start: var(--space-md); }
.rline .ract { justify-self: end; min-width: 5.5rem; text-align: end; }
.recline { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-md); align-items: center; padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.recline > b { grid-row: 1 / span 2; align-self: start; font: 700 var(--text-lg)/1.2 var(--font-display); }
.recline > span:nth-child(2) { grid-column: 2 / 4; display: grid; gap: var(--space-2xs); color: var(--color-ink); font-weight: 600; }
.recline .ract { grid-column: 4; grid-row: 1 / span 2; }
.recline [data-label], .tests [data-label] { display: grid; font-weight: 600; }
.recline [data-label]::before, .tests [data-label]::before { content: attr(data-label); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.tests { list-style: none; margin: 0 0 var(--space-sm); padding: 0; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.tests li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 5rem 6.5rem 5.5rem; gap: var(--space-2xs) var(--space-md); align-items: center; padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.tests li:first-child { border-top: 0; padding-top: 0; }
.tests li > b { font: 700 var(--text-lg)/1.2 var(--font-display); }
.tests li > div { display: grid; gap: var(--space-3xs); min-width: 0; }
.tests li > div > span { color: var(--color-ink); font-weight: 600; font-size: var(--text-md); }
.tests .button { justify-self: end; }
.chart.tall { height: auto; width: 100%; }
.chart .c-grid { stroke: var(--color-rule); stroke-width: 1; }
.lk.dot { background: var(--color-accent); border-color: var(--color-accent); border-radius: var(--radius-tag); }
.lk.catch { background: var(--color-warn-bg); border-color: var(--color-warn); }
.weekstrip .catch { background: var(--color-warn-bg); border-color: transparent; }
.mgrid .catch { background: var(--color-warn-bg); box-shadow: inset 0 0 0 1px var(--color-warn); }
fieldset.plain { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-xs); min-width: 0; }
fieldset.plain legend { padding: 0; font: 600 var(--text-md)/1.3 var(--font-body); color: var(--color-ink); }
fieldset.plain p { margin: 0; }
#offdate { min-height: var(--control); padding: var(--space-xs) var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: inherit; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.chips li { display: inline-flex; align-items: center; gap: var(--space-2xs); padding-inline-start: var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-tag); font: 500 var(--text-sm)/1 var(--font-body); color: var(--color-ink); }
.chipx { display: inline-grid; place-items: center; width: var(--control-s); height: var(--control-s); border: 0; border-radius: var(--radius-tag); background: transparent; color: var(--color-muted); cursor: pointer; }
.chipx:hover { color: var(--color-ink); background: var(--color-sheet-2); }
.chipx .icon { width: 1em; height: 1em; }
.narrowfield { max-width: 22rem; }
.faq { border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-sm); }
.faq:first-of-type { border-top: 0; padding-top: 0; }
.faq summary { font: 600 var(--text-md)/1.35 var(--font-body); color: var(--color-ink); }
.faq[open] summary { margin-bottom: var(--space-xs); }
.faq p { margin: 0; }
@media (max-width: 859px) {
  .figgrid { grid-template-columns: minmax(0, 1fr); }
  .rings { justify-content: center; }
  .rhead { display: none; }
  .rline { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2xs) var(--space-xs); }
  .rline .rname { grid-column: 1 / -2; }
  .rline .ract { grid-column: -2 / -1; grid-row: 1; }
  .rline [data-label] { display: grid; font-weight: 600; }
  .rline [data-label]::before { content: attr(data-label); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
  .rhead + details > .rline { border-top: 0; }
  .tests li { grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) auto; }
  .tests li > b { grid-row: 1 / span 2; align-self: start; }
  .tests li > div { grid-column: 2 / -1; }
  .tests li > [data-label="Answered"] { grid-column: 2; }
}

/* Notebook sub-pages, flashcard decks and the first-visit tour */
.notelist .subnote { padding-inline-start: var(--space-lg); border-inline-start: var(--space-3xs) solid var(--color-rule); }
#tour { position: fixed; z-index: var(--z-tooltip); width: min(20rem, calc(100% - var(--space-lg))); padding: var(--space-md); background: var(--color-sheet); color: var(--color-ink-2); border-radius: var(--radius-card); box-shadow: var(--shadow-card), 0 0 0 1px var(--color-rule-2); display: grid; gap: var(--space-xs); }
#tour h2 { margin: 0; padding-inline-end: var(--space-xl); font: 600 var(--text-md)/1.3 var(--font-body); color: var(--color-ink); }
#tour p { margin: 0; font-size: var(--text-sm); }
#tour > .chipx { position: absolute; inset-block-start: var(--space-xs); inset-inline-end: var(--space-xs); }
.tourmark { outline: var(--space-3xs) solid var(--color-accent); outline-offset: var(--space-3xs); border-radius: var(--radius-input); }
.counts { display: inline-flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); font-size: var(--text-sm); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.counts b { color: var(--color-ink); font-weight: 700; }
.blank { color: var(--color-accent); font-weight: 600; }
.inline { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--color-ink-2); }
.inline select, .inline input { min-height: var(--control-s); padding: 0 var(--space-xs); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: inherit; max-width: 12rem; }
.grow { flex: 1; min-width: 12rem; }
.forecast { list-style: none; margin: 0 0 var(--space-sm); padding: 0; display: grid; gap: var(--space-xs); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.forecast li { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 2.5rem; gap: var(--space-sm); align-items: center; }
.forecast b { text-align: end; }
.button.disabled { opacity: 0.5; pointer-events: none; }
#ankiin input[type=file] { max-width: 100%; font: inherit; color: var(--color-ink-2); }
.ankibox > summary { min-height: var(--control-s); }
.ankibox[open] > summary { margin-bottom: var(--space-md); }
@media (max-width: 600px) {
  .decks li, #cardrows .cardlist li { flex-direction: column; align-items: stretch; gap: var(--space-xs); }
  .decks li .row, #cardrows .cardlist li .row { flex-wrap: wrap; }
}
.swatches { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.swatch { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--hit); padding: var(--space-2xs) var(--space-sm) var(--space-2xs) var(--space-2xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); font: 500 var(--text-sm)/1.2 var(--font-body); color: var(--color-ink); cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:checked) { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); background: var(--color-accent-soft); }
.swatch:has(input:focus-visible) { outline: var(--space-3xs) solid var(--color-focus); outline-offset: var(--space-3xs); }
.swatch .dot { width: var(--control-s); height: var(--control-s); border-radius: var(--radius-tag); border: var(--rule-hair) solid var(--color-muted); background: var(--swatch-light); }
.swatch .dot.dark { background: var(--swatch-dark); color: var(--swatch-light); }
.swatch .dot.system { background: linear-gradient(90deg, var(--swatch-light) 50%, var(--swatch-dark) 50%); }
.sizeword { min-width: 7rem; text-align: center; font-weight: 600; color: var(--color-ink); }

/* Question background: the student's choice of page colour for the question sheet, whatever the app theme. Each choice carries a full set of
   text and rule colours so contrast holds; it takes the light or the dark set defined just below. */
/* Copies of the light and dark colour sets under their own names, so the question sheet can wear either one whatever the app theme.
   Keep them equal to the two theme blocks above. */
:root {
  --l-color-paper: #F3F4F6; --l-color-paper-2: #ECEEF1; --l-color-paper-3: #E2E5E9; --l-color-sheet: #FFFFFF; --l-color-sheet-2: #F5F6F8; --l-color-ink: #16191C; --l-color-ink-2: #2B2F34; --l-color-muted: #5D646D; --l-color-rule: #E1E4E8; --l-color-rule-2: #C4C9D0; --l-color-accent: var(--acc-l); --l-color-accent-2: var(--acc-l-2); --l-color-accent-soft: var(--acc-l-soft); --l-color-accent-ink: #FFFFFF; --l-color-focus: var(--acc-l-focus); --l-color-glint: #FFFFFF; --l-color-error: #B42318; --l-color-error-bg: #FDECEA; --l-color-error-rule: #F0A39B; --l-color-success: #17694D; --l-color-success-bg: #E2F2EA; --l-color-success-rule: #7DBEA2; --l-color-warn: #8A4B08; --l-color-warn-bg: #FDF1E3; --l-color-mark: #FFE98A; --l-color-scrim: rgb(16 20 24 / 0.5); --l-shadow-card: 0 1px 2px rgb(16 24 40 / 0.06), 0 1px 3px rgb(16 24 40 / 0.08); --l-shadow-key: 0 0 0 1px var(--color-rule-2); --l-shadow-key-primary: 0 0 0 1px var(--color-accent); --l-shadow-ring: 0 0 0 1px var(--color-rule);
  --d-color-paper: #111315; --d-color-paper-2: #171A1D; --d-color-paper-3: #21252A; --d-color-sheet: #1A1D21; --d-color-sheet-2: #23272C; --d-color-ink: #F2F4F6; --d-color-ink-2: #D9DDE1; --d-color-muted: #A0A7AF; --d-color-rule: #2F3439; --d-color-rule-2: #474D54; --d-color-accent: var(--acc-d); --d-color-accent-2: var(--acc-d-2); --d-color-accent-soft: var(--acc-d-soft); --d-color-accent-ink: var(--acc-d-ink); --d-color-focus: var(--acc-d-focus); --d-color-glint: #2A2F34; --d-color-error: #F4A097; --d-color-error-bg: #3B1B18; --d-color-error-rule: #7A3A33; --d-color-success: #86CFAE; --d-color-success-bg: #163A2C; --d-color-success-rule: #4E9C7B; --d-color-warn: #F2B877; --d-color-warn-bg: #3A2A15; --d-color-mark: #6B5A12; --d-color-scrim: rgb(4 6 8 / 0.7); --d-shadow-card: inset 0 0 0 1px var(--color-rule);
}
:root[data-qbg=white] .qsheet, :root[data-qbg=grey] .qsheet, :root[data-qbg=cream] .qsheet { color-scheme: light; --color-paper: var(--l-color-paper); --color-paper-2: var(--l-color-paper-2); --color-paper-3: var(--l-color-paper-3); --color-sheet: var(--l-color-sheet); --color-sheet-2: var(--l-color-sheet-2); --color-ink: var(--l-color-ink); --color-ink-2: var(--l-color-ink-2); --color-muted: var(--l-color-muted); --color-rule: var(--l-color-rule); --color-rule-2: var(--l-color-rule-2); --color-accent: var(--l-color-accent); --color-accent-2: var(--l-color-accent-2); --color-accent-soft: var(--l-color-accent-soft); --color-accent-ink: var(--l-color-accent-ink); --color-focus: var(--l-color-focus); --color-glint: var(--l-color-glint); --color-error: var(--l-color-error); --color-error-bg: var(--l-color-error-bg); --color-error-rule: var(--l-color-error-rule); --color-success: var(--l-color-success); --color-success-bg: var(--l-color-success-bg); --color-success-rule: var(--l-color-success-rule); --color-warn: var(--l-color-warn); --color-warn-bg: var(--l-color-warn-bg); --color-mark: var(--l-color-mark); --color-scrim: var(--l-color-scrim); --shadow-card: var(--l-shadow-card); --shadow-key: var(--l-shadow-key); --shadow-key-primary: var(--l-shadow-key-primary); --shadow-ring: var(--l-shadow-ring); }
:root[data-qbg=black] .qsheet { color-scheme: dark; --color-paper: var(--d-color-paper); --color-paper-2: var(--d-color-paper-2); --color-paper-3: var(--d-color-paper-3); --color-sheet: var(--d-color-sheet); --color-sheet-2: var(--d-color-sheet-2); --color-ink: var(--d-color-ink); --color-ink-2: var(--d-color-ink-2); --color-muted: var(--d-color-muted); --color-rule: var(--d-color-rule); --color-rule-2: var(--d-color-rule-2); --color-accent: var(--d-color-accent); --color-accent-2: var(--d-color-accent-2); --color-accent-soft: var(--d-color-accent-soft); --color-accent-ink: var(--d-color-accent-ink); --color-focus: var(--d-color-focus); --color-glint: var(--d-color-glint); --color-error: var(--d-color-error); --color-error-bg: var(--d-color-error-bg); --color-error-rule: var(--d-color-error-rule); --color-success: var(--d-color-success); --color-success-bg: var(--d-color-success-bg); --color-success-rule: var(--d-color-success-rule); --color-warn: var(--d-color-warn); --color-warn-bg: var(--d-color-warn-bg); --color-mark: var(--d-color-mark); --color-scrim: var(--d-color-scrim); --shadow-card: var(--d-shadow-card); }
:root[data-qbg=white] .qsheet { --color-sheet: var(--sheet-white); --color-sheet-2: var(--sheet-white-2); }
:root[data-qbg=grey] .qsheet { --color-sheet: var(--sheet-grey); --color-sheet-2: var(--sheet-grey-2); }
:root[data-qbg=cream] .qsheet { --color-sheet: var(--sheet-cream); --color-sheet-2: var(--sheet-cream-2); }
:root[data-qbg=black] .qsheet { --color-sheet: var(--sheet-black); --color-sheet-2: var(--sheet-black-2); }
:root[data-qbg=grey] .qsheet { --color-rule: var(--sheet-grey-rule); --color-muted: var(--sheet-grey-muted); }
:root[data-qbg] .qsheet { background: var(--color-sheet); color: var(--color-ink-2); }
.swatch .dot.q-white { background: var(--sheet-white); }
.swatch .dot.q-grey { background: var(--sheet-grey); }
.swatch .dot.q-cream { background: var(--sheet-cream); }
.swatch .dot.q-black { background: var(--sheet-black); }
.swatch .dot.q-black { color: var(--sheet-white); }
.swatch .dot.q-theme { background: var(--color-sheet); }

/* App colour: white, grey and cream sit on the light theme, black on the dark theme. Only the page and card colours change. */
:root[data-theme=light][data-tint=white] { --color-paper: var(--tint-white); --color-paper-2: var(--tint-white-2); --color-paper-3: var(--tint-white-3); --color-sheet: var(--sheet-white); --color-sheet-2: var(--sheet-white-2); }
:root[data-theme=light][data-tint=grey] { --color-paper: var(--tint-grey); --color-paper-2: var(--tint-grey-2); --color-paper-3: var(--tint-grey-3); --color-sheet: var(--sheet-grey); --color-sheet-2: var(--sheet-grey-2); --color-rule: var(--sheet-grey-rule); --color-muted: var(--sheet-grey-muted); }
:root[data-theme=light][data-tint=cream] { --color-paper: var(--tint-cream); --color-paper-2: var(--tint-cream-2); --color-paper-3: var(--tint-cream-3); --color-sheet: var(--sheet-cream); --color-sheet-2: var(--sheet-cream-2); }
:root[data-theme=dark][data-tint=black] { --color-paper: var(--tint-black); --color-paper-2: var(--tint-black-2); --color-paper-3: var(--tint-black-3); --color-sheet: var(--sheet-black); --color-sheet-2: var(--sheet-black-2); }

/* Rebuilt questions: an "i" that explains how they were made, on hover, keyboard focus or tap. */
.tip { position: relative; display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; margin-inline-start: var(--space-2xs); border-radius: 50%; border: 1px solid var(--color-rule-2); background: var(--color-paper); color: var(--color-ink); font: 600 var(--text-xs)/1 var(--font-body); font-style: italic; cursor: help; vertical-align: 0.05em; text-transform: none; letter-spacing: 0; }
.tip:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tip .tipbox { white-space: pre-line; display: none; position: absolute; z-index: 30; top: calc(100% + 6px); inset-inline-start: -0.5em; width: 22rem; max-width: 90vw; padding: var(--space-sm); border-radius: var(--radius-input); border: 1px solid var(--color-rule-2); background: var(--color-paper); color: var(--color-ink); box-shadow: var(--shadow-card); font: 400 var(--text-sm)/1.5 var(--font-body); font-style: normal; text-align: start; white-space: normal; cursor: auto; }
.tip:hover .tipbox, .tip:focus .tipbox, .tip:focus-within .tipbox { display: block; }
.badge .tip { width: 1.25em; height: 1.25em; }
.rebuiltbar { display: block; }
.rebuiltbar > .small { display: block; }
.asrecalled { margin-top: var(--space-2xs); }
.asrecalled summary { cursor: pointer; color: var(--color-ink-2, inherit); }
.asrecalled .reading { margin: var(--space-2xs) 0; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-input); background: var(--color-paper-2); white-space: pre-wrap; }
@media (max-width: 640px) { .tip .tipbox { position: fixed; inset-inline: var(--space-md, 16px); top: auto; bottom: var(--space-md, 16px); width: auto; } }

/* 20 Nov 2026 restyle: clean white reading sheet on a light grey page, the logo's midnight green as the main colour,
   system sans type, small radii and flat keys, a dark side menu and dark test toolbar.
   Accent colour (Settings › Reading): green is the default; blue, teal and plum are the other choices.
   Each accent sets a light-theme set (--acc-l*), a dark-theme set (--acc-d*) and the chrome colour of the menu and toolbar. */
:root {
  --acc-l: #002F26; --acc-l-2: #00473A; --acc-l-soft: #E1EEE8; --acc-l-focus: #1F7A5F;
  --acc-d: #8CC7AE; --acc-d-2: #A9D8C3; --acc-d-soft: #183329; --acc-d-ink: #03130E; --acc-d-focus: #A5D6C1;
  --color-chrome: #002F26; --color-chrome-2: #0C4236; --color-chrome-ink: #FFFFFF; --color-chrome-accent: #A5C8B8;
}
:root[data-accent=blue] {
  --acc-l: var(--hue-1d5ca6); --acc-l-2: var(--hue-164a87); --acc-l-soft: var(--hue-e3ecf7); --acc-l-focus: var(--hue-2f74c4);
  --acc-d: var(--hue-8db8ec); --acc-d-2: var(--hue-abcbf2); --acc-d-soft: var(--hue-172b45); --acc-d-ink: var(--hue-06121f); --acc-d-focus: var(--hue-a9cbf2);
  --color-chrome: var(--hue-0e2d52); --color-chrome-2: var(--hue-1a3e68); --color-chrome-accent: var(--hue-9cc2f0);
}
:root[data-accent=teal] {
  --acc-l: var(--hue-00666a); --acc-l-2: var(--hue-00514f); --acc-l-soft: var(--hue-ddefef); --acc-l-focus: var(--hue-138a8e);
  --acc-d: var(--hue-7ccbcb); --acc-d-2: var(--hue-9ddada); --acc-d-soft: var(--hue-133434); --acc-d-ink: var(--hue-031414); --acc-d-focus: var(--hue-9ddada);
  --color-chrome: var(--hue-003638); --color-chrome-2: var(--hue-0b4a4c); --color-chrome-accent: var(--hue-8fd3d3);
}
:root[data-accent=plum] {
  --acc-l: var(--hue-5a3a8b); --acc-l-2: var(--hue-482c70); --acc-l-soft: var(--hue-ece5f5); --acc-l-focus: var(--hue-7550ae);
  --acc-d: var(--hue-bfa6e6); --acc-d-2: var(--hue-d2bff0); --acc-d-soft: var(--hue-2b2140); --acc-d-ink: var(--hue-120a1f); --acc-d-focus: var(--hue-d2bff0);
  --color-chrome: var(--hue-2c1e47); --color-chrome-2: var(--hue-3d2b5e); --color-chrome-accent: var(--hue-cdb8f0);
}
.swatch .dot.a-green { background: var(--hue-002f26); border-color: var(--hue-002f26); }
.swatch .dot.a-blue { background: var(--hue-1d5ca6); border-color: var(--hue-1d5ca6); }
.swatch .dot.a-teal { background: var(--hue-00666a); border-color: var(--hue-00666a); }
.swatch .dot.a-plum { background: var(--hue-5a3a8b); border-color: var(--hue-5a3a8b); }

/* Dark chrome: the side menu and the test toolbar carry their own light-on-dark colour set. */
.sidebar, .examtop {
  color-scheme: dark;
  --color-ink: var(--color-chrome-ink); --color-ink-2: var(--white-86); --color-muted: var(--white-64);
  --color-rule: var(--white-14); --color-rule-2: var(--white-28);
  --color-sheet: var(--white-10); --color-sheet-2: var(--white-14);
  --color-paper: var(--color-chrome); --color-paper-2: var(--color-chrome-2); --color-paper-3: var(--white-10);
  --color-accent: var(--color-chrome-accent); --color-accent-2: var(--color-chrome-accent); --color-accent-soft: var(--white-14); --color-accent-ink: var(--color-chrome);
  --color-focus: var(--color-chrome-accent); --color-logo: var(--color-chrome); --color-logo-page: var(--white);
  --color-error: var(--hue-ffb4ab); --color-error-bg: var(--tone-42);
  --shadow-ring: 0 0 0 1px var(--white-14); --shadow-key: 0 0 0 1px var(--white-28);
  background: var(--color-chrome); color: var(--color-ink-2);
}
.sidebar { border-inline-end: 0; }
.sidebar .logo .l-bg { fill: var(--white); } .sidebar .logo .l-page { fill: var(--color-chrome); } .sidebar .logo .l-cut { stroke: var(--white); }
.sidebar a[aria-current] { background: var(--white-12); box-shadow: inset 3px 0 0 var(--color-chrome-accent); }
.sidebar .sidecount { background: var(--white-08); box-shadow: none; }
.examtop { border-bottom: 0; }
.examtop .button:hover:not(:disabled) { background: var(--white-12); }

/* Flat keys: no press-down travel; buttons and answers are outlined, the primary is a solid accent. */
.button:active:not(:disabled):not(.disabled) { transform: none; filter: brightness(0.96); }
.button.primary { box-shadow: none; }
.option.wrong { box-shadow: 0 0 0 1.5px var(--color-error); }
.option:has(input:checked):not(.correct):not(.wrong), .option.correct { box-shadow: 0 0 0 1.5px var(--color-accent); }
.option.correct { box-shadow: 0 0 0 1.5px var(--color-success); }
/* Phones: the test's bottom bar is a solid strip along the bottom edge. */
@media (max-width: 859px) { .actionbar { bottom: 0; margin-inline: calc(-1 * var(--space-sm)); padding: var(--space-xs) var(--space-sm) max(var(--space-xs), env(safe-area-inset-bottom)); border-radius: 0; box-shadow: none; border-top: var(--rule-hair) solid var(--color-rule); } .exambody { padding-bottom: 0; } .actionbar .grow { min-width: 0; } .actionbar .button.big { padding-inline: var(--space-md); } }

/* Classic exam look for the test screen (Settings, Reading): a numbered list down the left, flat dark bars with an item
   box, square edges and plain answer rows. The same markup as the Study Bank screen, restyled. */
:root[data-exam=classic] .examtop { --color-chrome: var(--classic-bar); --color-chrome-2: var(--classic-bar-2); background: var(--classic-bar); color: var(--classic-ink); }
:root[data-exam=classic] .itembox { display: grid; padding: var(--space-3xs) var(--space-xs); border: var(--rule-hair) solid var(--classic-ink); color: var(--classic-ink); font: 600 var(--text-sm)/1.35 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
:root[data-exam=classic] .examtitle b { display: none; }
:root[data-exam=classic] .exam .card, :root[data-exam=classic] .exam .option, :root[data-exam=classic] .exam .button, :root[data-exam=classic] .exam .answerline, :root[data-exam=classic] .exam .verdict { border-radius: 0; }
:root[data-exam=classic] .exam .card { box-shadow: none; }
:root[data-exam=classic] .exam .option { box-shadow: none; background: transparent; }
:root[data-exam=classic] .exam .option label { min-height: var(--control-s); padding: var(--space-2xs) 0; }
:root[data-exam=classic] .exam .option.correct, :root[data-exam=classic] .exam .option.wrong, :root[data-exam=classic] .exam .option:has(input:checked):not(.correct):not(.wrong) { box-shadow: none; }
:root[data-exam=classic] .exam .option.correct .otext > span:first-child { color: var(--color-success); font-weight: 600; }
:root[data-exam=classic] .exam .option.wrong .otext > span:first-child { color: var(--color-error); }
:root[data-exam=classic] .exam .strikebtn { border: 0; }
:root[data-exam=classic] .actionbar { background: var(--classic-bar); border-radius: 0; box-shadow: none; }
:root[data-exam=classic] .actionbar .button:not(.primary) { background: transparent; color: var(--classic-ink); box-shadow: 0 0 0 1px var(--classic-ink); }
:root[data-exam=classic] .actionbar .button.primary { background: var(--classic-ink); color: var(--classic-bar); }
:root[data-exam=classic] .actionbar .button.primary:disabled { background: var(--classic-bar-2); color: var(--classic-rail-2); cursor: not-allowed; }
@media (min-width: 700px) {
  :root[data-exam=classic] .exambody, :root[data-exam=classic] .exambody.split { grid-template-columns: 64px minmax(0, 1fr); justify-content: stretch; gap: 0; padding: 0; }
  :root[data-exam=classic] .exambody main { padding: var(--space-md) var(--space-lg); max-width: 1320px; }
  :root[data-exam=classic] .rail, :root[data-exam=classic] .exambody.split .rail { display: block; order: -1; background: var(--classic-rail); border-inline-end: var(--rule-hair) solid var(--classic-rule); }
  :root[data-exam=classic] .rail .card { position: sticky; top: calc(var(--banner-height) + 52px); max-height: calc(100dvh - 52px); overflow: auto; padding: 0; background: transparent; }
  :root[data-exam=classic] .rail h2, :root[data-exam=classic] .rail .legend, :root[data-exam=classic] .railhide { display: none; }
  :root[data-exam=classic] .rail .navgrid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  :root[data-exam=classic] .rail .navgrid a { height: 30px; border: 0; border-radius: 0; background: transparent; color: var(--color-ink); }
  :root[data-exam=classic] .rail .navgrid a:nth-child(even) { background: var(--classic-rail-2); }
  :root[data-exam=classic] .rail .navgrid a.ok { color: var(--color-success); font-weight: 700; }
  :root[data-exam=classic] .rail .navgrid a.bad { color: var(--color-error); font-weight: 700; }
  :root[data-exam=classic] .rail .navgrid a:not(.done):not(.ok):not(.bad)::before { content: ""; position: absolute; inset-inline-start: var(--space-xs); width: 6px; height: 6px; border-radius: var(--radius-tag); background: var(--color-ink); }
  :root[data-exam=classic] .rail .navgrid a[aria-current] { background: var(--classic-now); outline: 0; }
}
@media (max-width: 859px) {
  /* Phones: the test counter is one short line, with no cut-off text under it. */
  .examtitle > span { display: none; }
  .shortcuts { display: none; }
  .examtitle b { font-size: var(--text-lg); }
  .examtop { gap: 0; padding-inline: var(--space-xs); }
  /* The floating tab bar stays; a band in the page colour under and beside it keeps page text from showing around it. */
  .tabbar { box-shadow: var(--shadow-card), var(--shadow-ring), 0 26px 0 14px var(--bg); }
}

/* 21 Nov 2026 usability pass: clearer chosen states, aligned control groups, roomier touch targets, tidier phone layouts.
   Additive overrides only; no colour, type or radius token changes. */
/* Segmented controls: each choice is as wide as its label needs, so a long word no longer touches the dividers. */
.segmented .button { flex: 1 1 auto; }
.libtabs { margin-bottom: var(--space-sm); }
/* Create test: "All" or "3 chosen" beside each group title, because nothing ticked means everything is included. */
.pickstate { margin-inline-start: var(--space-xs); font: 400 var(--text-xs)/1.3 var(--font-body); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.pickstate.on { color: var(--color-accent); font-weight: 600; }
/* Colour choices sit in two even columns; an odd one out (Match device, Same as theme) takes the full first row. */
.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.swatch { display: flex; min-width: 0; }
.swatch:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
/* The file picker matches the other buttons. */
input[type=file] { max-width: 100%; font: 400 var(--text-sm)/1.3 var(--font-body); color: var(--color-muted); }
input[type=file]::file-selector-button { min-height: var(--control); margin-inline-end: var(--space-sm); padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-sheet); color: var(--color-ink); font: 500 var(--text-sm)/1.2 var(--font-body); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--color-paper-2); }
/* Results: the score ring sits at the end of the card, as it does on Today. */
.hero.result > div:first-child { flex: 1 1 280px; min-width: 0; }
/* Calendar: past and rest days stay quieter than study days but remain readable. */
.mgrid .rest, .mgrid .past, .mgrid .off { opacity: 0.8; }
/* Test toolbar on wide screens: the counter and its caption get room above and below. */
@media (min-width: 860px) {
  .examtop { padding-block: var(--space-xs); }
  .examtitle { gap: var(--space-3xs); }
  .examtitle b { font-size: var(--text-lg); }
}
/* Touch: disclosure rows, text actions and the "i" tips are easier to hit. */
@media (max-width: 859px), (pointer: coarse) {
  .faq summary, .morefilters summary, .card > details:not([class]) > summary { padding-block: var(--space-sm); }
  .notes summary, .ankibox > summary, .variants summary { min-height: var(--hit); align-content: center; }
  .textbtn { padding-block: var(--space-sm); }
  .tip::before { content: ""; position: absolute; inset: calc(-1 * var(--space-sm)); }
}
@media (max-width: 600px) {
  /* Number of questions: the box and its four presets share one row. */
  .field .row:has(> .count) { flex-wrap: nowrap; }
  .field .row:has(> .count) .chip { flex: 1 1 0; min-width: 0; padding-inline: 0; }
  .field .row:has(> .count) input.count { width: 4.5rem; }
  /* Start test and Mock exam are full-width, one under the other. */
  form:not(.wizard) .formend .button { flex: 1 1 100%; }
  /* Progress: the two rings share a row instead of filling the first screen. */
  .rings { gap: var(--space-md); }
  .rings .ring { width: 128px; height: 128px; }
  .rings .ring > div { padding: var(--space-md); }
  .rings > p { flex-basis: 100%; text-align: center; }
  /* Study recommendations: Score and Exam share stay on one line each. */
  .recline { grid-template-columns: 1.5rem minmax(5.75rem, auto) minmax(0, 1fr) auto; column-gap: var(--space-sm); }
  .recline [data-label] { white-space: nowrap; }
}

/* 21 Nov 2026 motion and distill pass. Motion explains a change and then stops: one short entrance when the page
   changes, sheets that arrive and leave the way an iPhone sheet does, a press that answers the finger at once.
   Nothing loops, and moving between questions in a test stays instant. Under reduced motion all of it ends at once. */
:root { --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); --dur-sheet: 380ms; --rise: 6px; }

/* Page change: the sections fade up in reading order, 35ms apart. */
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } }
.layout.enter > .page > * { animation: rise var(--dur-short) var(--ease-out) backwards; }
.layout.enter > .page > :nth-child(2) { animation-delay: 35ms; }
.layout.enter > .page > :nth-child(3) { animation-delay: 70ms; }
.layout.enter > .page > :nth-child(4) { animation-delay: 105ms; }
.layout.enter > .page > :nth-child(n+5) { animation-delay: 140ms; }
/* The ring and the bars fill to their value once the page has settled, so the figure is read as a result. */
@keyframes ringfill { from { stroke-dasharray: 0.01 100; } }
@keyframes barfill { from { transform: scaleX(0); } }
.layout.enter .ring .arc { animation: ringfill 600ms var(--ease-out) 120ms backwards; }
.layout.enter .bar > span { animation: barfill 600ms var(--ease-out) 120ms backwards; }

/* Press: keys answer on touch-down with a small step in, and let go quickly. */
.button:active:not(:disabled):not(.disabled):not(.tile) { transform: scale(0.97); }
.tabbar a { transition: transform var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.tabbar a:active { transform: scale(0.94); }

/* Dialogs: a small step forward on wide screens. They leave the way they came. */
dialog { opacity: 0; transform: scale(0.96); transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), overlay var(--dur-short) allow-discrete, display var(--dur-short) allow-discrete; }
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: scale(0.96); } }
dialog::backdrop { opacity: 0; transition: opacity var(--dur-short) var(--ease-out), overlay var(--dur-short) allow-discrete, display var(--dur-short) allow-discrete; }
dialog[open]::backdrop { opacity: 1; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
dialog.lightbox, dialog.lightbox[open] { transform: none; }
@media (max-width: 600px) {
  /* Phone sheets rise from the bottom edge on the iOS drawer curve, fast at first and slow to rest, and drop back the same way. */
  dialog.sheet { animation: none; opacity: 1; transform: translateY(100%); transition: transform var(--dur-sheet) var(--ease-drawer), overlay var(--dur-sheet) allow-discrete, display var(--dur-sheet) allow-discrete; }
  dialog.sheet[open] { transform: none; }
  @starting-style { dialog.sheet[open] { opacity: 1; transform: translateY(100%); } }
  dialog.sheet::backdrop { transition-duration: var(--dur-sheet); }
}

/* Toast: rises a few pixels into place and sinks back. Transitions, so a second message never restarts it. */
#toast { transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), display var(--dur-short) allow-discrete; }
#toast[hidden] { display: none; opacity: 0; transform: translateY(var(--rise)); }
@starting-style { #toast:not([hidden]) { opacity: 0; transform: translateY(var(--rise)); } }

/* The test's tool menu opens from its button. */
@keyframes menuin { from { opacity: 0; transform: scale(0.97); } }
.moretools .menu { transform-origin: bottom right; animation: menuin 150ms var(--ease-out); }
.examtop .moretools .menu { transform-origin: top right; }

/* Study recommendations, distilled: the subject, one line of figures, one action. */
ol.recs { list-style: none; margin: 0; padding: 0; }
.recline { grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: var(--space-md); align-items: center; }
.recline > b { grid-row: auto; align-self: center; font: 600 var(--text-md)/1.2 var(--font-display); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.recline > span.rname { grid-column: auto; display: grid; gap: var(--space-3xs); min-width: 0; color: var(--color-ink); font-weight: 600; }
.recline > span.rname small { font-size: var(--text-xs); font-weight: 400; color: var(--color-muted); }
.recline .ract { grid-column: auto; grid-row: auto; }

/* 21 Nov 2026 tour previews: each step of the first-visit tour opens with a small picture of what that page does.
   One short change plays when the step appears, then it rests on the finished state, which is also what reduced motion shows. */
#tour { gap: var(--space-sm); }
#tour > .chipx { background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-rule); }
.tourpic { height: 116px; padding: var(--space-sm); border-radius: var(--radius-input); background: var(--color-paper-2); overflow: hidden; display: grid; align-content: center; gap: 6px; font: 500 var(--text-xs)/1.2 var(--font-body); color: var(--color-ink-2); }
.tourpic .icon { width: 14px; height: 14px; flex: none; color: var(--color-muted); }
.tourpic .tb { display: block; height: 6px; max-width: 100%; border-radius: 3px; background: var(--color-rule-2); }
.tourpic .w4 { width: 40%; } .tourpic .w5 { width: 50%; } .tourpic .w6 { width: 60%; } .tourpic .w7 { width: 70%; } .tourpic .w8 { width: 80%; } .tourpic .w9 { width: 90%; }
@keyframes tp-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes tp-fade { from { opacity: 0; } }
.tourpic .trow { display: flex; align-items: center; gap: var(--space-xs); min-height: 26px; padding: 0 var(--space-xs); border-radius: 6px; background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-rule); animation: tp-rise 420ms var(--ease-out) backwards; }
.tourpic .trow .tb { flex: 0 1 auto; }
.tourpic .trow:nth-child(2) { animation-delay: 110ms; }
.tourpic .trow:nth-child(3) { animation-delay: 220ms; }
.tourpic .ttag { flex: none; min-width: 3.4rem; padding: 3px 6px; border-radius: var(--radius-tag); background: var(--color-accent-soft); color: var(--color-accent); font-size: 11px; text-align: center; }
.tourpic .ttag.new { background: var(--color-paper-3); color: var(--color-muted); }
/* practice: two subjects are ticked, then Tutor switches on */
.tourpic .tchips { display: flex; align-items: center; gap: 6px; }
.tourpic .tchip { padding: 6px 9px; border-radius: 6px; background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-rule-2); white-space: nowrap; }
@keyframes tp-chip { from { background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-rule-2); color: var(--color-ink-2); } }
.tourpic .tchip.on { background: var(--color-accent-soft); box-shadow: 0 0 0 1px var(--color-accent); color: var(--color-accent); animation: tp-chip 260ms var(--ease-out) 450ms backwards; }
.tourpic .tchip.on.late { animation-delay: 900ms; }
.tourpic .ttoggle { width: 30px; height: 18px; padding: 2px; border-radius: 9px; background: var(--color-accent); animation: tp-track 260ms var(--ease-out) 1400ms backwards; }
.tourpic .ttoggle i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--color-sheet); transform: translateX(12px); animation: tp-knob 260ms var(--ease-out) 1400ms backwards; }
@keyframes tp-track { from { background: var(--color-rule-2); } }
@keyframes tp-knob { from { transform: none; } }
/* library: a word is typed, two questions are found */
.tourpic .tsearch { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 var(--space-xs); border-radius: 6px; background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-accent); }
.tourpic .ttype { display: inline-block; width: 6ch; overflow: hidden; white-space: nowrap; font: 400 var(--text-xs)/1.4 var(--font-outlier); animation: tp-type 700ms steps(6, end) 300ms backwards; }
@keyframes tp-type { from { width: 0; } }
.tourpic .tnum { flex: none; font: 400 11px/1 var(--font-outlier); color: var(--color-muted); }
.tourpic .trow.found { animation-delay: 1100ms; }
.tourpic .trow.found + .found { animation-delay: 1200ms; }
/* progress: a bar for each subject grows to its score */
.tourpic .tline { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); align-items: center; gap: var(--space-xs); min-height: 24px; }
.tourpic .tmeter { height: 8px; border-radius: 4px; background: var(--color-rule); overflow: hidden; }
.tourpic .tmeter i { display: block; height: 100%; border-radius: 4px; background: var(--color-accent); transform-origin: left; animation: tp-grow 800ms var(--ease-out) 250ms backwards; }
.tourpic .tline:nth-child(2) i { animation-delay: 360ms; }
.tourpic .tline:nth-child(3) i { animation-delay: 470ms; }
@keyframes tp-grow { from { transform: scaleX(0); } }
/* study plan: a week of daily targets with one day off */
.tourpic .tweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tourpic .tday { display: grid; justify-items: center; gap: 4px; padding: 8px 0; border-radius: 6px; background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-rule); font: 500 12px/1 var(--font-body); font-variant-numeric: tabular-nums; animation: tp-rise 380ms var(--ease-out) backwards; }
.tourpic .tday small { font-size: 10px; font-weight: 400; color: var(--color-muted); }
.tourpic .tday.off { background: transparent; box-shadow: 0 0 0 1px var(--color-rule-2); color: var(--color-muted); font-weight: 400; }
.tourpic .tday:nth-child(2) { animation-delay: 50ms; } .tourpic .tday:nth-child(3) { animation-delay: 100ms; } .tourpic .tday:nth-child(4) { animation-delay: 150ms; }
.tourpic .tday:nth-child(5) { animation-delay: 200ms; } .tourpic .tday:nth-child(6) { animation-delay: 250ms; } .tourpic .tday:nth-child(7) { animation-delay: 300ms; }
/* flashcards: the card turns over to its answer */
.tourpic .tflip { position: relative; height: 84px; perspective: 700px; }
.tourpic .tflip > div { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(180deg); animation: tp-flip 750ms var(--ease-in-out) 800ms backwards; }
@keyframes tp-flip { from { transform: none; } }
.tourpic .tface { position: absolute; inset: 0; display: grid; align-content: center; gap: 7px; padding: var(--space-sm); border-radius: 8px; background: var(--color-sheet); box-shadow: 0 0 0 1px var(--color-rule-2); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tourpic .tface small { font-size: 11px; color: var(--color-muted); }
.tourpic .tface.back { transform: rotateX(180deg); background: var(--color-accent-soft); box-shadow: 0 0 0 1px var(--color-accent); }
.tourpic .tface.back small { color: var(--color-accent); }
.tourpic .tface.back .tb { background: var(--color-accent); opacity: 0.35; }
/* help: a question opens to its answer */
.tourpic .trow.open .icon { transform: rotate(90deg); animation: tp-turn 300ms var(--ease-out) 600ms backwards; }
@keyframes tp-turn { from { transform: none; } }
.tourpic .tans { display: grid; gap: 6px; padding-inline: var(--space-lg) var(--space-xs); animation: tp-fade 400ms var(--ease-out) 750ms backwards; }

/* 21 Nov 2026 empty pages: a faint outline of what the page will hold, a plain title, one line and a way forward.
   The picture is drawn from the page's own shapes in the rule colours, with one touch of the accent. It does not move. */
.blank { display: flex; align-items: center; gap: var(--space-lg); }
.blank.card { padding: var(--space-lg); }
.blanktext { display: grid; gap: var(--space-2xs); justify-items: start; min-width: 0; }
.blanktext b { font: 600 var(--text-md)/1.3 var(--font-body); color: var(--color-ink); }
.blanktext p { margin: 0; max-width: 46ch; }
.blanktext .button { margin-top: var(--space-xs); }
.blankpic { position: relative; flex: none; width: 168px; height: 96px; display: grid; align-content: center; gap: 6px; }
.blankpic i { display: block; height: 6px; border-radius: 3px; background: var(--color-rule-2); }
.blankpic .w5 { width: 50%; } .blankpic .w6 { width: 60%; } .blankpic .w7 { width: 70%; } .blankpic .w8 { width: 80%; } .blankpic .w9 { width: 90%; }
.blankpic .pill { width: 34px; height: 14px; border-radius: 7px; background: var(--color-accent-soft); }
.blankpic .mint { background: var(--color-accent); opacity: 0.45; }
.blankpic .mark { box-shadow: 0 0 0 4px var(--color-accent-soft); background: var(--color-accent); opacity: 0.45; }
.blankpic .gbox { display: grid; gap: 8px; align-content: center; height: 96px; padding: var(--space-sm) var(--space-md); border: 1.5px dashed var(--color-rule-2); border-radius: var(--radius-input); background: var(--color-sheet); }
.blankpic hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--color-rule); }
.bp-cards .gbox { position: absolute; inset: 14px 0 0 22px; height: auto; }
.bp-cards .gbox.behind { inset: 0 22px 14px 0; background: var(--color-paper-2); }
.blankpic .grow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); height: 26px; padding: 0 var(--space-sm); border: 1.5px dashed var(--color-rule-2); border-radius: 6px; background: var(--color-sheet); }
.blankpic .grow i:first-child { flex: 0 1 auto; }
.blankpic .grow .pill { flex: none; }
.blankpic svg { width: 168px; height: 96px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.blankpic .axis { stroke: var(--color-rule-2); stroke-width: 1.5; }
.blankpic .line { stroke: var(--color-rule-2); stroke-width: 2; stroke-dasharray: 3 5; }
.blankpic circle { fill: var(--color-accent); opacity: 0.55; }
@media (max-width: 600px) {
  .blank { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .blank.card { padding: var(--space-md); }
}

/* 21 Nov 2026 phone feel. A revealed answer and a shown flashcard answer fade in over 180ms so the page does not jump.
   Phone sheets carry a grabber and can be dragged down by their top strip to close (the tracking is in app.js). */
.exam.justrevealed .verdict, .exam.justrevealed .card.review { animation: tp-fade 180ms var(--ease-out) backwards; }
.flash.justshown hr, .flash.justshown hr ~ * { animation: tp-fade 180ms var(--ease-out) backwards; }
@media (max-width: 600px) {
  dialog.sheet::before { content: ""; position: absolute; top: var(--space-xs); left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--color-rule-2); }
  dialog.sheet > :first-child { touch-action: none; }
}

/* 21 Nov 2026 small-phone fix (320px): the Anki import form no longer runs off the right edge.
   The file picker and the deck box shrink to the column, and the deck box drops under its label when there is no room. */
.ankibox fieldset.plain { grid-template-columns: minmax(0, 1fr); }
.ankibox .row > *, .ankibox fieldset.plain > * { min-width: 0; max-width: 100%; }
.ankibox input[type=file] { width: 100%; }
.ankibox .inline { flex-wrap: wrap; }
.ankibox .inline input { flex: 1 1 9rem; min-width: 0; }

/* 21 Nov 2026 Owner view and Student view. In Student view the server sends no owner material; these rules only
   remove the empty controls that pointed at it. */
:root[data-view=student] .owneronly { display: none !important; }

/* 22 Nov 2026: the owner's own check of a question (Owner view only) */
.checkbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin: 0 0 var(--space-sm); }
.checkbar .segmented { margin-bottom: 0; }
.checkbar .segmented .button { min-height: 44px; padding-inline: var(--space-md); }
.checkbar [data-action="check:ok"][aria-pressed=true] { background: var(--color-success-bg); color: var(--color-success); }
.checkbar [data-action="check:wrong"][aria-pressed=true] { background: var(--color-error-bg); color: var(--color-error); }
.checkbar [data-action="check:unsure"][aria-pressed=true] { background: var(--color-warn-bg); color: var(--color-warn); }
.checkbar .checknote { flex-basis: 100%; margin: 0; color: var(--color-muted); }
/* Owner's review: the marking bar sits above the floating tab bar on phones and reads as part of the page on wide screens. */
.reviewbar .button[aria-pressed=true]:not(.primary) { background: var(--color-accent-soft); box-shadow: var(--shadow-key-primary); }
.reviewbar .button.primary[aria-pressed=true] { box-shadow: 0 0 0 2px var(--color-sheet), 0 0 0 4px var(--color-accent); }
@media (max-width: 859px) {
  .reviewbar { bottom: calc(var(--tab) + max(10px, env(safe-area-inset-bottom)) + var(--space-xs)); margin-inline: 0; padding: var(--space-xs); border-top: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-card), var(--shadow-ring); }
  .reviewbar .button { padding-inline: var(--space-xs); }
}
/* Owner's improvement ideas */
.ideabox { margin: 0 0 var(--space-sm); padding: var(--space-sm) var(--space-md); }
.ideabox > summary { cursor: pointer; }
.ideabox[open] > summary { margin-bottom: var(--space-sm); }
.idealist { list-style: none; margin: 0 0 var(--space-sm); padding: 0; display: grid; gap: var(--space-2xs); }
.idealist li { display: flex; gap: var(--space-xs); align-items: flex-start; padding: var(--space-2xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.idealist .ideatext { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.idealist .badge { flex: none; margin-top: var(--space-3xs); }
#idea textarea { min-height: 4.5rem; }
/* Second-generation explanations */
.review h4 { margin: var(--space-md) 0 var(--space-2xs); font: 600 var(--text-md)/1.3 var(--font-body); letter-spacing: 0; color: var(--color-ink); }
.review .pearls { margin: var(--space-xs) 0; padding-inline-start: var(--space-lg); display: grid; gap: var(--space-xs); line-height: 1.6; }
.review .pearls li { overflow-wrap: anywhere; }
.review .reading + .reading { margin-top: var(--space-xs); }
.tag.origin { justify-self: start; padding: 0 var(--space-2xs); border-radius: var(--radius-input); background: var(--color-paper-2); color: var(--color-muted); font-weight: 500; }
