/* Vallu site styles: "Highlight" look (light) and graphite (dark).
 * One stylesheet for every page: design tokens first, then components.
 */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Figtree:wght@400;500;600;700&display=swap");

/* Koepöytä design tokens: "Highlight"
 *
 * Bold and playful: ink outlines, offset shadows, and a highlighter-yellow
 * fill for the answer you choose. Light mode is the reference look; dark mode
 * is "graphite": neutral near-black, softer text, desaturated accents, thinner
 * mid-grey outlines, and no large bright fills except the chosen answer.
 *
 * Theme selection: the OS setting by default; data-theme="light" or "dark" on
 * <html> (set by theme.js) overrides it.
 *
 * Contrast (checked): body text, muted text, links and button labels are all
 * at least 4.5:1, and control outlines at least 3:1, in both themes.
 */


:root {
  color-scheme: light;

  /* Surfaces and text */
  --bg: #F4F4FB;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --ink: #15142B;
  --muted: #55546E;

  /* Outlines: bold ink in light mode */
  --bw: 2px;
  --line: #15142B;
  --soft: #8F8EA8;          /* unselected answer options, inputs at rest */
  --shadow: #15142B;        /* hard offset shadow colour */

  /* Brand */
  --primary: #2B36E0;
  --on-primary: #FFFFFF;
  --hl: #FFE45C;            /* highlighter: chosen answer, answered state */
  --on-hl: #15142B;
  --chip: #E6E7FF;

  /* Inverted blocks (selected pill, timer, archive band) */
  --invert-bg: #15142B;
  --invert-fg: #F4F4FB;

  /* Section tints and result colours; text on them is always --on-tint */
  --tint-a: #FFE45C;
  --tint-b: #B8BDFF;
  --tint-c: #FFB3D5;
  --mint: #8DE8C0;
  --pink: #FFB3D5;
  --on-tint: #15142B;
  --danger: #C0262D;

  /* Results score card */
  --score-bg: #FFE45C;
  --score-fg: #15142B;
  --score-num: #15142B;
  --score-btn-bg: #15142B;
  --score-btn-fg: #FFE45C;

  /* Calculator display */
  --screen: #15142B;
  --on-screen: #F4F4FB;

  --focus: #2B36E0;
  --backdrop: rgb(21 20 43 / 0.55);

  /* Type */
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Radius and layout */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --page-max: 1200px;
  --reading: 908px;
  --target: 44px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 160ms;
  --move: 1;
}

/* Graphite dark: same values in both blocks so the OS setting and the toggle agree. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131315; --surface: #1C1C1F; --raised: #26262A; --ink: #DADADE; --muted: #A2A2AA;
    --bw: 1.5px; --line: #6E6E78; --soft: #6E6E78; --shadow: #0A0A0B;
    --primary: #8890E6; --on-primary: #11121F; --hl: #DDC45A; --on-hl: #15142B; --chip: #26262A;
    --invert-bg: #313136; --invert-fg: #DADADE;
    --tint-a: #DDC45A; --tint-b: #9EA3E0; --tint-c: #D99BBB; --mint: #86C9A8; --pink: #D99BBB; --on-tint: #15142B; --danger: #F09A9A;
    --score-bg: #26262A; --score-fg: #DADADE; --score-num: #DDC45A; --score-btn-bg: #DDC45A; --score-btn-fg: #15142B;
    --screen: #0E0E10; --on-screen: #DDC45A;
    --focus: #DDC45A; --backdrop: rgb(0 0 0 / 0.65);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131315; --surface: #1C1C1F; --raised: #26262A; --ink: #DADADE; --muted: #A2A2AA;
  --bw: 1.5px; --line: #6E6E78; --soft: #6E6E78; --shadow: #0A0A0B;
  --primary: #8890E6; --on-primary: #11121F; --hl: #DDC45A; --on-hl: #15142B; --chip: #26262A;
  --invert-bg: #313136; --invert-fg: #DADADE;
  --tint-a: #DDC45A; --tint-b: #9EA3E0; --tint-c: #D99BBB; --mint: #86C9A8; --pink: #D99BBB; --on-tint: #15142B; --danger: #F09A9A;
  --score-bg: #26262A; --score-fg: #DADADE; --score-num: #DDC45A; --score-btn-bg: #DDC45A; --score-btn-fg: #15142B;
  --screen: #0E0E10; --on-screen: #DDC45A;
  --focus: #DDC45A; --backdrop: rgb(0 0 0 / 0.65);
}

@media (prefers-reduced-motion: reduce) {
  :root { --move: 0; --duration: 100ms; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px / 1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  accent-color: var(--primary);
  caret-color: var(--primary);
  scrollbar-color: var(--soft) transparent;
}
body { margin: 0; background: var(--bg); color: var(--ink); }
::selection { background: var(--hl); color: var(--on-hl); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
a { color: var(--primary); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0 0 16px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -0.04em; }
h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 22px; letter-spacing: -0.02em; }
p { max-width: 68ch; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: var(--bw) solid var(--line); }
.bar { max-width: var(--page-max); margin: 0 auto; padding: 0 max(16px, 2.5rem); min-height: 72px; display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 24px / 1 var(--font-display); letter-spacing: -0.03em; }
/* Vallu wordmark, drawn in the current text colour so it follows the theme. */
.brand-logo, .brand-mark { display: block; flex: none; background: currentColor; -webkit-mask: url("../img/vallu-logo.82189e962599.svg") no-repeat left center / contain; mask: url("../img/vallu-logo.82189e962599.svg") no-repeat left center / contain; }
.brand-logo { width: 96px; height: 37px; }
.brand-mark { width: 72px; height: 28px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex-grow: 1; }
.nav a { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a[aria-current="page"] { background: var(--chip); color: var(--ink); font-weight: 700; }
.theme-toggle { min-height: 40px; padding: 0 14px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 14px var(--font-body); cursor: pointer; }
.theme-toggle:hover { background: var(--chip); }

main { max-width: var(--page-max); margin: 0 auto; padding: 56px max(16px, 2.5rem) 96px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: var(--bw) solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font: 700 16px / 1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
}
.btn:hover { background: var(--chip); color: var(--ink); }
.btn:active { transform: translate(calc(2px * var(--move)), calc(2px * var(--move))); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 4px 4px 0 var(--shadow); }
.btn.primary:hover { background: var(--primary); color: var(--on-primary); box-shadow: 2px 2px 0 var(--shadow); transform: translate(calc(2px * var(--move)), calc(2px * var(--move))); }
.btn.primary:active { box-shadow: 0 0 0 var(--shadow); transform: translate(calc(4px * var(--move)), calc(4px * var(--move))); }
.btn.invert { background: var(--bg); color: var(--ink); }
.btn.lg { min-height: 56px; padding: 0 28px; font-size: 18px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Home ---------- */
#setup { display: flex; flex-direction: column; gap: 72px; }
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-copy { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-copy h1 { margin: 0; line-height: 0.98; }
.lead { margin: 0; font-size: 20px; color: var(--muted); max-width: 34em; }
.hero-art { flex: 1 1 380px; min-width: 0; position: relative; padding: 32px 12px 44px 0; }
.hero-card { display: flex; flex-direction: column; gap: 12px; padding: 28px; border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 8px 8px 0 var(--shadow); transform: rotate(calc(-1.5deg * var(--move))); }
.hero-card-head { display: flex; justify-content: space-between; align-items: center; }
.hero-card-head b { font: 800 20px var(--font-display); }
.hero-card p { margin: 0; font-weight: 600; font-size: 18px; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--chip); font-weight: 700; font-size: 14px; }
.hero-option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: var(--bw) solid var(--soft); border-radius: 12px; }
.hero-option i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.hero-option.is-chosen { background: var(--hl); color: var(--on-hl); border-color: var(--line); font-weight: 700; }
.hero-option.is-chosen i { border-color: var(--on-hl); background: var(--on-hl); box-shadow: inset 0 0 0 3px var(--hl); }
.hero-timer, .hero-badge { position: absolute; padding: 8px 16px; border: var(--bw) solid var(--line); border-radius: 999px; font-weight: 800; }
.hero-timer { left: -8px; top: 0; background: var(--surface); font-variant-numeric: tabular-nums; }
.hero-badge { right: 0; bottom: 0; background: var(--invert-bg); color: var(--invert-fg); font-family: var(--font-display); font-size: 20px; transform: rotate(calc(3deg * var(--move))); }

.block { display: flex; flex-direction: column; gap: 24px; }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 24px; flex-wrap: wrap; }
.block-head h2, .block-head p { margin: 0; }
.block-head p { color: var(--muted); }
.section-form { display: contents; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.section-card {
  display: flex; flex-direction: column; gap: 14px; padding: 24px; text-align: left;
  border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer; transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.section-card:hover { transform: translate(calc(-2px * var(--move)), calc(-2px * var(--move))); box-shadow: 6px 6px 0 var(--shadow); }
.section-top { display: flex; justify-content: space-between; align-items: center; }
.section-code { width: 48px; height: 48px; display: grid; place-items: center; border: var(--bw) solid var(--line); border-radius: var(--r-md); color: var(--on-tint); font: 800 20px var(--font-display); }
.tint-a { background: var(--tint-a); } .tint-b { background: var(--tint-b); } .tint-c { background: var(--tint-c); }
.section-meta { font-weight: 700; font-size: 14px; color: var(--muted); }
.section-name { font: 800 26px / 1.1 var(--font-display); letter-spacing: -0.02em; }
.section-desc { color: var(--muted); }
.section-go { margin-top: auto; font-weight: 700; color: var(--primary); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.panel { display: flex; flex-direction: column; gap: 16px; padding: 28px; border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.panel h2 { margin: 0; font-size: 28px; }
.panel p { margin: 0; }
.panel > .btn { align-self: flex-start; }
.panel.dashed { border-style: dashed; background: transparent; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 15px; }
.pills { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
.pills label { position: relative; display: inline-flex; align-items: center; min-height: var(--target); padding: 0 18px; border: var(--bw) solid var(--line); border-radius: 999px; font-weight: 700; cursor: pointer; }
.pills input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pills label:has(input:checked) { background: var(--invert-bg); color: var(--invert-fg); }
.pills label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.dropzone { position: relative; flex-grow: 1; min-height: 150px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 24px; border-radius: var(--r-md); background: var(--chip); font-weight: 700; cursor: pointer; text-align: center; }
.dropzone svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
#error:empty { display: none; }
#error { color: var(--danger); font-weight: 700; }

.band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 40px; border: var(--bw) solid var(--line); border-radius: var(--r-xl); background: var(--invert-bg); color: var(--invert-fg); }
.band h2 { margin: 0 0 8px; }
.band p { margin: 0; opacity: 0.85; }

/* ---------- Form controls ---------- */
button, select, input, textarea { font: inherit; color: inherit; }
select, input:not([type=radio], [type=checkbox], [type=file]), textarea {
  min-height: 48px; max-width: 100%; padding: 8px 14px;
  border: var(--bw) solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
}
select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
select:focus, input:not([type=radio], [type=checkbox], [type=file]):focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--hl); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { width: 100%; min-height: 8rem; resize: vertical; line-height: 1.55; }
input[type=radio], input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--primary); }
button:not(.btn, .section-card, .theme-toggle) { min-height: var(--target); padding: 0 16px; border: var(--bw) solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; cursor: pointer; }
button:not(.btn, .section-card, .theme-toggle):hover { background: var(--chip); }
summary { cursor: pointer; font-weight: 700; }
output { display: block; font-weight: 700; }

/* ---------- Exam ---------- */
body:has(#exam:not([hidden])) > .site-header { display: none; }
main:has(#exam:not([hidden])) { max-width: none; padding: 0; }
#exam { font-size: 18px; }
.exam-bar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: var(--bw) solid var(--line); }
.exam-bar-inner { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 12px max(16px, 2rem); }
.brand-mark { display: flex; }
.exam-meta { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#exam-name { font: 800 20px / 1.2 var(--font-display); letter-spacing: -0.02em; }
.progress { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.progress-track { width: 160px; height: 12px; border: var(--bw) solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
#progress-fill { display: block; height: 100%; width: 0; background: var(--hl); transition: width var(--duration) var(--ease); }
.timer { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 18px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--invert-bg); color: var(--invert-fg); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 17px; }
.timer[data-state="warning"] { background: var(--hl); color: var(--on-hl); }
.timer[data-state="critical"] { background: var(--pink); color: var(--on-tint); animation: kp-blink 1.2s steps(2, jump-none) infinite; }
@keyframes kp-blink { 50% { box-shadow: 0 0 0 4px var(--pink); } }
@media (prefers-reduced-motion: reduce) { .timer[data-state="critical"] { animation: none; box-shadow: 0 0 0 4px var(--pink); } }
.exam-bar .btn { min-height: var(--target); font-size: 16px; }

.examhead { max-width: var(--reading); margin: 0 auto; padding: 40px max(16px, 2rem) 8px; }
#exam h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 12px; }
#exam-guide { color: var(--muted); font-size: 17px; }
#materials { font-weight: 700; }

.layout { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, var(--reading)) minmax(260px, 320px); justify-content: center; gap: 32px; padding: 24px max(16px, 2rem) 96px; align-items: start; }
.rail, .tools { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; }
.rail .panel, .tools .panel { padding: 18px; gap: 12px; }
.rail summary, .tools summary { font: 800 18px var(--font-display); list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.rail summary::-webkit-details-marker, .tools summary::-webkit-details-marker { display: none; }
.rail summary::after, .tools summary::after { content: "+"; font-size: 22px; line-height: 1; }
.rail details[open] summary::after, .tools details[open] summary::after { content: "−"; }
#contents { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
#contents a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: var(--target); padding: 4px 6px; border: var(--bw) solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 14px; line-height: 1.2; text-decoration: none; font-variant-numeric: tabular-nums; }
#contents a:hover { background: var(--chip); }
#contents a.answered { background: var(--hl); color: var(--on-hl); }
#exam.archive-exam #contents { grid-template-columns: 1fr; }
#exam.archive-exam #contents a { justify-content: flex-start; text-align: left; padding: 8px 12px; }

.exam-main { min-width: 0; }
#exam fieldset { border: 0; padding: 0 0 32px; margin: 0 0 32px; border-bottom: var(--bw) dashed var(--soft); scroll-margin-top: 110px; min-width: 0; }
#exam .group-body { border: 0; padding: 0; margin: 0; }
#exam legend { padding: 0; margin: 0 0 12px; font: 800 26px / 1.1 var(--font-display); letter-spacing: -0.02em; }
#exam legend + p { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--chip); font-size: 15px; font-weight: 700; }
#exam .task-group { scroll-margin-top: 110px; margin: 16px 0 56px; }
#exam .task-group > h2 { font-size: clamp(28px, 3vw, 36px); margin-bottom: 20px; }
#exam .task-group > label { display: inline-flex; align-items: center; gap: 10px; min-height: var(--target); padding: 0 18px; margin-bottom: 20px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--chip); font-weight: 700; cursor: pointer; }
#exam .task-group > label:has(input:checked) { background: var(--hl); color: var(--on-hl); }
.multipart { margin-bottom: 32px; }
.multipart h3 { font-size: 24px; }
#exam .multipart fieldset { margin-bottom: 16px; padding-bottom: 16px; }
#exam .multipart legend { font-size: 20px; }
.prompt { font-weight: 600; font-size: 21px; line-height: 1.45; }
.prompt, .response { white-space: pre-wrap; overflow-wrap: anywhere; }
#exam .task-figure { display: block; max-width: 100%; max-height: 28rem; object-fit: contain; margin: 12px 0 18px; border: var(--bw) solid var(--line); border-radius: var(--r-md); background: #fff; }
#questions details:not(.symbols) > summary { font-size: 15px; color: var(--primary); }

/* Answer options: the chosen one gets the highlighter */
.choice { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 18px; margin-bottom: 10px; border: var(--bw) solid var(--soft); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
.choice:hover { border-color: var(--line); }
.choice:has(input:checked) { background: var(--hl); color: var(--on-hl); border-color: var(--line); font-weight: 700; box-shadow: 4px 4px 0 var(--shadow); }
.choice:has(input:checked) input { accent-color: var(--on-hl); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.choice:has(input:disabled) { cursor: default; }
.choice img { max-width: calc(100% - 3rem); max-height: 13rem; border-radius: var(--r-sm); background: #fff; }
.choice.optional { width: fit-content; background: var(--chip); border-color: var(--line); font-weight: 700; }

.gap { display: block; margin-bottom: 12px; white-space: pre-wrap; line-height: 2.4; max-width: 68ch; font-size: 20px; }
.gap input, .gap select { margin: 0 4px; min-height: 40px; vertical-align: baseline; }
.gap input { width: 9ch; }
fieldset:has(> div:not([hidden])) > .gap-copy { display: none; }

.symbols { margin: 12px 0 16px; }
.symbols summary { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.symbols button { min-width: var(--target); margin: 0 6px 6px 0; padding: 0 8px; font-weight: 600; }

#finish { margin-top: 8px; }
#status { color: var(--muted); font-size: 15px; margin: 16px 0; }
#status:empty { display: none; }
#download { margin-top: 8px; font-size: 15px; min-height: var(--target); }

/* Calculator */
#calc { display: grid; gap: 10px; }
#calc label { font-size: 13px; color: var(--muted); font-weight: 600; }
#expression, #value { width: 100%; min-height: 0; border: 0; border-radius: 0; background: var(--screen); color: var(--on-screen); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#expression { padding: 12px 14px 2px; border-radius: 12px 12px 0 0; font-size: 15px; opacity: 0.9; }
#expression:focus { box-shadow: none; outline: 3px solid var(--focus); outline-offset: 2px; }
#value { min-height: 48px; margin-top: -10px; padding: 0 14px 10px; border-radius: 0 0 12px 12px; font: 800 28px / 48px var(--font-display); }
#keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
#keys button { min-height: var(--target); padding: 0; border: var(--bw) solid var(--soft); border-radius: var(--r-sm); background: var(--surface); font-size: 15px; }
#keys button:hover { background: var(--chip); }
/* Key order from calculator.js: 15 function keys, digits/operators, last row ⌫ AC = */
#keys button:nth-child(-n+15), #keys button:nth-child(19), #keys button:nth-child(20) { background: var(--chip); border-color: transparent; }
#keys button:nth-child(24), #keys button:nth-child(25), #keys button:nth-child(29), #keys button:nth-child(30) { background: var(--hl); color: var(--on-hl); border-color: transparent; }
#keys button:nth-last-child(2), #keys button:nth-last-child(3) { background: var(--pink); color: var(--on-tint); border-color: transparent; }
#keys button:last-child { grid-column: 5; background: var(--primary); color: var(--on-primary); border-color: var(--line); }
#keys button:disabled { opacity: 0.4; }

/* Formula editor answer field */
.math-answer { min-height: 8rem; padding: 12px 14px; margin-bottom: 8px; border: var(--bw) solid var(--line); border-radius: 12px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; }
.math-answer:focus { outline: none; box-shadow: 0 0 0 3px var(--hl); }
.math-chip { display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: middle; margin: 0 0.12em; padding: 2px 6px; border-radius: 6px; background: var(--chip); color: var(--ink); }
.math-chip[role=button] { cursor: pointer; }
.math-chip[role=button]:hover { background: var(--hl); color: var(--on-hl); }
.math-answer math, .response math { font-size: 1.2em; }

/* ---------- Results ---------- */
#result { display: flex; flex-direction: column; gap: 32px; max-width: 960px; margin: 0 auto; }
.score-card { display: flex; flex-direction: column; gap: 8px; padding: 36px; border: var(--bw) solid var(--line); border-radius: var(--r-xl); background: var(--score-bg); color: var(--score-fg); box-shadow: 8px 8px 0 var(--shadow); }
.score-card h1 { margin: 0; color: var(--score-num); }
.overline { font-weight: 700; }
#score { margin: 8px 0 16px; font: 800 clamp(24px, 3vw, 32px) / 1.2 var(--font-display); letter-spacing: -0.02em; max-width: none; }
.score-btn { background: var(--score-btn-bg); color: var(--score-btn-fg); border-color: var(--score-btn-bg); }
.score-btn:hover { background: var(--score-btn-bg); color: var(--score-btn-fg); opacity: 0.9; }
#review { display: flex; flex-direction: column; gap: 16px; }
#review > a { align-self: flex-start; font-weight: 700; }
#review .card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
#review .card::before { align-self: flex-start; padding: 4px 12px; margin-bottom: 6px; border: var(--bw) solid var(--line); border-radius: var(--r-sm); color: var(--on-tint); font-weight: 800; font-size: 14px; }
#review .card.is-correct::before { content: "Correct"; background: var(--mint); }
#review .card.is-wrong::before { content: "Wrong"; background: var(--pink); }
#review .card.is-empty::before { content: "Unanswered"; background: var(--chip); color: var(--ink); }
#review .card.is-essay::before { content: "Self-assess"; background: var(--tint-b); }
#review .card h2 { margin: 0; font-size: 20px; }
#review .card > p { margin: 0; color: var(--muted); }
#review .card > .response { color: var(--ink); font-weight: 700; padding: 10px 14px; border-radius: 12px; background: var(--chip); }
#review .card > strong { position: absolute; top: 22px; right: 24px; font: 800 22px var(--font-display); font-variant-numeric: tabular-nums; }
#review .card > label { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 700; margin-top: 6px; }
#review .task-figure { display: inline-block; max-width: 45%; max-height: 12rem; margin: 4px 12px 4px 0; border-radius: var(--r-sm); background: #fff; }

/* ---------- Dialogs ---------- */
dialog { max-width: calc(100vw - 32px); padding: 28px; border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 8px 8px 0 var(--shadow); }
dialog::backdrop { background: var(--backdrop); }
dialog h2 { font-size: 28px; }
dialog .actions { margin-top: 20px; justify-content: flex-end; }
#confirm { width: min(30rem, calc(100vw - 32px)); }
#confirm p { color: var(--muted); }
#formula { width: min(42rem, calc(100vw - 32px)); max-height: 90vh; overflow: auto; }
#formula label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
#formula textarea { min-height: 3rem; font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
#templates { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
#templates button { min-height: 40px; padding: 0 12px; font-size: 15px; }
#math-view { padding: 16px; min-height: 4.5rem; margin: 12px 0; overflow-x: auto; font-size: 1.7rem; border-radius: 12px; background: var(--chip); }
#math-view [data-start] { cursor: pointer; border-radius: 4px; }
#math-view [data-start]:hover { background: var(--hl); color: var(--on-hl); }
#math-hint { font-size: 14px; color: var(--muted); margin: 8px 0; }
#math-error { font-size: 14px; color: var(--danger); font-weight: 700; margin: 8px 0; }
#math-error:empty { display: none; }
#part-label:not([hidden]) { display: grid; gap: 8px; margin: 12px 0; }

/* ---------- Exam archive ---------- */
.archive-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 24px; }
.archive-head h1 { margin: 0 0 12px; }
.archive-head p { margin: 0; color: var(--muted); font-size: 18px; }
.archive-search { display: flex; flex-direction: column; gap: 8px; flex: 0 1 26rem; font-weight: 700; font-size: 15px; }
#archive-query { width: 100%; }
#count { color: var(--muted); font-weight: 600; margin: 16px 0 24px; }
details.card { margin-bottom: 14px; border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
details.card > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; padding: 12px 24px; list-style: none; font: 800 22px var(--font-display); letter-spacing: -0.02em; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: var(--bw) solid var(--line); border-radius: 50%; font-size: 20px; }
details.card[open] > summary { border-bottom: var(--bw) dashed var(--soft); }
details.card[open] > summary::after { content: "−"; background: var(--hl); color: var(--on-hl); }
details.card > :not(summary) { margin-inline: 24px; }
details.card > h3 { margin-top: 18px; margin-bottom: 6px; font-size: 18px; }
details.card > ul { margin: 0; padding-left: 20px; }
details.card > ul li { padding-block: 4px; }
details.card > a:last-child { display: inline-block; margin-block: 12px 20px; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: repeat(2, minmax(0, calc(var(--reading) / 2))); grid-template-areas: "rail tools" "main main"; gap: 16px 24px; }
  .rail { grid-area: rail; } .tools { grid-area: tools; } .exam-main { grid-area: main; margin-top: 16px; }
  .rail, .tools { position: static; max-height: none; }
  #contents { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
@media (max-width: 720px) {
  main { padding-top: 32px; }
  #setup { gap: 48px; }
  .hero-art { padding-right: 0; }
  .panel, .band, .score-card { padding: 22px; }
  .exam-bar-inner { gap: 10px; }
  .progress-track { width: 96px; }
  #exam { font-size: 17px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "rail" "tools" "main"; }
  .prompt { font-size: 19px; }
  #review .card > strong { position: static; }
}

/* ---------- Sign-in pages: /login/, /register/, /auth/verify-magic-link/ ---------- */
.head-cta { margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
form.htmx-request .btn[type="submit"] { cursor: progress; opacity: 1; box-shadow: 1px 1px 0 var(--shadow); transform: translate(calc(3px * var(--move)), calc(3px * var(--move))); }
.btn .idle { display: inline-flex; align-items: center; gap: 10px; }
.spin, .busy { display: none; }
form.htmx-request .spin { display: block; }
form.htmx-request .busy { display: inline; }
form.htmx-request .idle { display: none; }
.spin { width: 18px; height: 18px; flex: none; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
button.linkish, .linkish { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
button.linkish:hover, .linkish:hover { background: none; color: var(--ink); }

body:has(> main > .auth, > main > .center > .solo) { display: flex; flex-direction: column; min-height: 100dvh; }
main:has(> .auth, > .center > .solo) { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: center; padding-block: 48px; }
main:has(> .auth, > .center > .solo) > .messages, main:has(> .center > .solo) > .center { width: 100%; padding-top: 0; }
.auth { width: 100%; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 64px; align-items: center; max-width: 1120px; margin: 0 auto; }
.auth-card { display: flex; flex-direction: column; gap: 22px; padding: 36px; border: var(--bw) solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: 6px 6px 0 var(--shadow); min-width: 0; }
.auth-card h1 { margin: 0; font-size: 40px; letter-spacing: -0.035em; }
.auth-card p { margin: 0; }
.card-top { display: flex; flex-direction: column; gap: 10px; }
.auth-card .overline { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 13px; letter-spacing: 0.02em; }
.auth-card .sub { color: var(--muted); }
.auth-foot { padding-top: 18px; border-top: var(--bw) dashed var(--soft); color: var(--muted); font-size: 15px; text-align: center; }
.auth-foot p + p { margin-top: 6px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0; padding: 4px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--bg); }
.tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 15px; text-decoration: none; }
.tabs svg { width: 18px; height: 18px; flex: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--invert-bg); color: var(--invert-fg); }

form.stack { display: flex; flex-direction: column; gap: 18px; }
.auth-card .field { gap: 8px; font-weight: 400; font-size: 16px; min-width: 0; }
.auth-card .field > label { font-weight: 700; font-size: 15px; }
.opt { font-weight: 500; color: var(--muted); }
.field-link { align-self: flex-end; font-size: 14px; font-weight: 600; }
.auth-card .field input { width: 100%; min-height: 50px; transition: box-shadow var(--duration) var(--ease); }
.auth-card .field input:disabled { background: var(--bg); color: var(--muted); }
.auth-card .field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--pink); }
.hint { font-size: 14px; color: var(--muted); }
.msg { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 600; color: var(--danger); }
.ok { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 600; color: var(--ink); }
.msg svg, .ok svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.ok svg { background: var(--mint); color: var(--on-tint); border-radius: 50%; padding: 2px; }
.msg:empty, .ok:empty { display: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw button { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--chip); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.pw button:hover { background: var(--hl); color: var(--on-hl); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: var(--target); font-weight: 600; font-size: 15px; cursor: pointer; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: var(--bw) solid var(--line); border-radius: var(--r-md); background: var(--pink); color: var(--on-tint); font-size: 15px; }
.alert.good { background: var(--mint); }
.alert .ic { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--on-tint); color: var(--pink); font: 800 14px var(--font-display); }
.alert.good .ic { color: var(--mint); }
.alert b { display: block; }
.alert .linkish, .alert a { color: var(--on-tint); }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.meter i { height: 8px; border-radius: 99px; border: 1.5px solid var(--line); transition: background var(--duration) var(--ease); }
.meter[data-score="1"] i:nth-child(-n+1) { background: var(--pink); }
.meter[data-score="2"] i:nth-child(-n+2) { background: var(--hl); }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--tint-b); }
.meter[data-score="4"] i { background: var(--mint); }
.meter-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.meter-row b { color: var(--ink); }

.badge { display: grid; place-items: center; width: 76px; height: 76px; border: var(--bw) solid var(--line); border-radius: 22px; box-shadow: 4px 4px 0 var(--shadow); color: var(--on-tint); }
.badge svg { width: 36px; height: 36px; }
.badge.hl { background: var(--hl); transform: rotate(-4deg); }
.badge.mint { background: var(--mint); border-radius: 50%; }
.badge.pink { background: var(--pink); border-radius: 50%; }
mark.who { background: var(--hl); color: var(--on-hl); padding: 1px 6px; border-radius: 6px; font-weight: 700; overflow-wrap: anywhere; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; counter-increment: s; }
.steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: var(--bw) solid var(--line); border-radius: 50%; font: 800 14px var(--font-display); background: var(--surface); }
.messages { display: flex; flex-direction: column; gap: 8px; max-width: 760px; margin: 0 auto 24px; }
.code-input { font: 700 24px / 1 ui-monospace, Menlo, monospace; letter-spacing: 0.2em; text-transform: uppercase; }
.allauth-page form, .allauth-page ul { display: flex; flex-direction: column; gap: 14px; text-align: left; width: 100%; }
.solo { width: 100%; max-width: 520px; }
.solo > form, .solo > .auth-foot { width: 100%; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--pink); color: var(--on-tint); }
.chip.good { background: var(--mint); color: var(--on-tint); }
.chip.warn { background: var(--pink); color: var(--on-tint); }
.email-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.email-list legend { margin-bottom: 8px; padding: 0; font-weight: 700; font-size: 15px; }
.email-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border: var(--bw) solid var(--soft); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.email-row:has(input:checked) { border-color: var(--line); box-shadow: 3px 3px 0 var(--shadow); }
.email-row input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.email-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.email-addr { flex: 1 1 10rem; min-width: 0; font-weight: 700; overflow-wrap: break-word; }
.email-row .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.email-row .chip { font-size: 12px; padding: 2px 10px; }
.add-email { padding-top: 18px; border-top: var(--bw) dashed var(--soft); }
.add-email .btn { align-self: flex-start; }
.alt-actions { justify-content: center; margin-top: 10px; }
.resend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg); font-size: 15px; color: var(--muted); }

.auth-aside { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.auth-aside h2 { margin: 0; font-size: clamp(32px, 3.6vw, 48px); letter-spacing: -0.04em; max-width: 14ch; }
.auth-aside h2 mark { background: var(--hl); color: var(--on-hl); padding: 0 0.1em; border-radius: 6px; }
.auth-aside > p { margin: 0; color: var(--muted); font-size: 17px; max-width: 46ch; }
.art { position: relative; padding: 8px 40px 32px 0; }
.stat { padding: 22px 24px; border: var(--bw) solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 6px 6px 0 var(--shadow); transform: rotate(-1.5deg); max-width: 420px; }
.stat-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.stat-head .when { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.code { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: var(--bw) solid var(--line); border-radius: 10px; font: 800 16px var(--font-display); color: var(--on-tint); }
.stat-num { margin: 14px 0 10px; font: 800 52px / 1 var(--font-display); letter-spacing: -0.04em; }
.stat-num small { font-size: 22px; color: var(--muted); letter-spacing: -0.02em; }
.track { height: 14px; border: var(--bw) solid var(--line); border-radius: 99px; overflow: hidden; background: var(--bg); }
.track i { display: block; height: 100%; background: var(--hl); border-right: var(--bw) solid var(--line); }
.sticker { position: absolute; right: 0; bottom: 6px; padding: 8px 14px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--mint); color: var(--on-tint); font: 800 15px var(--font-display); transform: rotate(4deg); box-shadow: 3px 3px 0 var(--shadow); }
.mini { display: flex; gap: 10px; flex-wrap: wrap; }
.mini span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: var(--bw) solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 14px; }
.mini span i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); }
.perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.perks li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: var(--bw) solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.perks li:nth-child(2) { margin-left: 28px; }
.perks li:nth-child(3) { margin-left: 56px; }
.perks b { display: block; }
.perks span { color: var(--muted); font-size: 15px; }
.tint-a-bg { background: var(--tint-a); } .tint-b-bg { background: var(--tint-b); } .tint-c-bg { background: var(--tint-c); }

.center { display: grid; place-items: center; padding-top: 16px; }
.verify { width: 100%; max-width: 540px; align-items: center; text-align: center; }
.verify .card-top { align-items: center; }
.verify .sub { max-width: 40ch; }
.verify .actions { justify-content: center; }
.redirect { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.redirect .track i { width: 0; animation: fill 2s linear forwards; }
@keyframes fill { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .redirect .track i { animation-timing-function: steps(4); } }
.redirect-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.redirect-row b { color: var(--ink); }
.dev { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: var(--bw) dashed var(--soft); border-radius: var(--r-md); background: var(--bg); text-align: left; }
.dev-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.dev-tag { padding: 2px 8px; border-radius: 6px; background: var(--invert-bg); color: var(--invert-fg); font: 700 12px ui-monospace, Menlo, monospace; letter-spacing: 0.04em; }
.tok { display: grid; gap: 4px; }
.tok code { font: 600 12px ui-monospace, Menlo, monospace; color: var(--muted); }
.tok output { font: 500 13px ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: all; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--soft); }
.why { width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg); font-size: 15px; color: var(--muted); }
.why b { color: var(--ink); }
.why ul { margin: 8px 0 0; padding-left: 20px; }
.err-code { font: 500 12px ui-monospace, Menlo, monospace; color: var(--muted); }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .auth-aside { display: none; }
}
@media (max-width: 720px) {
  .auth-card { padding: 24px 20px; box-shadow: 4px 4px 0 var(--shadow); }
  .auth-card h1 { font-size: 32px; }
  .site-header .nav { display: none; }
  .bar, main { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .bar { min-height: 64px; gap: 8px; }
  .theme-toggle { margin-left: auto; }
  .head-cta { margin-left: 0; }
  .verify .actions .btn { width: 100%; }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .tabs a { padding: 0 6px; font-size: 13px; }
  .auth-card { padding: 20px 16px; }
  .brand-logo { width: 80px; height: 31px; }
  .theme-toggle, .head-cta.btn, .head-cta .btn { padding: 0 12px; font-size: 13px; }
  .tabs svg { display: none; }
}

@media print {
  :root, body { background: #fff; color: #000; }
  .site-header, .exam-bar, .rail, .tools, .symbols, #download, #finish, #status { display: none !important; }
  .layout { display: block; }
  .choice { border-color: #999; background: none !important; box-shadow: none !important; break-inside: avoid; }
}
