/* Samo SAT Practice — test interface styles */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../vendor/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../vendor/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../vendor/fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../vendor/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../vendor/fonts/source-serif-4-latin-600-italic.woff2") format("woff2");
  font-weight: 600 700; font-style: italic; font-display: swap;
}

:root {
  --paper: #F6F8FB;
  --surface: #FFFFFF;
  --ink: #14213D;
  --ink-soft: #4A5A73;
  --line: #D6DEEA;
  --line-strong: #A9B6CA;
  --sky: #2F6FDB;
  --sky-deep: #1F51A8;
  --sky-wash: #E8F0FC;
  --sun: #E9A23B;
  --sun-deep: #B5741B;
  --good: #1E7D52;
  --good-wash: #E5F4EC;
  --bad: #B83A2B;
  --bad-wash: #FBEAE7;

  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Question content (passages, prompts, choices) is set in a serif that sits well next to KaTeX math. */
  --font-content: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-float: 0 12px 32px rgba(20, 33, 61, 0.18), 0 2px 6px rgba(20, 33, 61, 0.12);
  --bar-h: 76px;
  --foot-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 42px; padding: 0 1.4rem;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 0.95rem;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--sky); color: #fff; }
.btn-primary:hover { background: var(--sky-deep); }
.btn-primary:disabled { background: var(--line-strong); cursor: not-allowed; }
.btn-outline { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--sky-wash); }
.btn-large { min-height: 52px; padding: 0 2rem; font-size: 1.05rem; }

.link-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: none; border: 0; padding: 2px 0;
  font-weight: 700; font-size: 0.9rem; color: var(--ink-soft);
}
.link-btn:hover { color: var(--ink); }
.chev { width: 12px; height: 12px; stroke-width: 2; transition: transform 150ms ease; }
[aria-expanded="true"] > .chev { transform: rotate(180deg); }

.pill-btn {
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 1px 12px; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft);
}
.pill-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.pill-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: none; border: 0; border-radius: var(--radius-s); color: var(--ink-soft);
}
.icon-btn:hover { background: var(--sky-wash); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Screens ---------- */
.screen { min-height: 100%; }

/* Home */
.home { display: grid; place-items: start center; padding: clamp(2rem, 8vh, 6rem) 1rem 3rem; }
.home-inner { width: 100%; max-width: 560px; }
.wordmark {
  display: flex; align-items: center; gap: 0.6rem; margin: 0 0 2.5rem;
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em;
}
.wordmark-mark { width: 30px; height: 30px; stroke-width: 2.2; color: var(--sky); }
.wordmark-mark path:nth-child(2) { stroke: var(--sun); }
.home-title { font-size: clamp(1.75rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 1rem; letter-spacing: -0.01em; }
.home-lede { color: var(--ink-soft); font-size: 1.08rem; line-height: 1.6; margin: 0 0 2.5rem; max-width: 52ch; }

.start-form { display: grid; gap: 0.6rem; }
.start-form > label { font-weight: 700; font-size: 0.95rem; }
.start-form input[type="text"] {
  height: 48px; padding: 0 0.9rem;
  border: 2px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface);
}
.start-form input[type="text"]:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }
.choice-list { display: grid; gap: 1.5rem; margin: 1.25rem 0 0.5rem; }
.choice-group { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.choice-group legend { padding: 0; margin-bottom: 0.6rem; font-weight: 700; font-size: 0.95rem; }
.module-option {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.85rem; align-items: center;
  padding: 0.9rem 1rem; border: 2px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); cursor: pointer;
}
.module-option:hover { border-color: var(--line-strong); }
.module-option:has(input:checked) { border-color: var(--sky); background: var(--sky-wash); }
.module-option input { grid-row: 1; width: 18px; height: 18px; accent-color: var(--sky); margin: 0; }
.module-option > :not(input) { grid-column: 2; }
.module-option strong { font-size: 1rem; }
.module-option span { color: var(--ink-soft); font-size: 0.9rem; }
.module-option .resume-note { color: var(--sun-deep); font-weight: 700; }
.module-option .last-note { color: var(--ink-soft); }
.inline-link { background: none; border: 0; padding: 0; font-weight: 700; color: var(--sky-deep); text-decoration: underline; text-underline-offset: 2px; }
.inline-link:hover { color: var(--ink); }
.loading { color: var(--ink-soft); margin: 0; }
.form-error { color: var(--bad); margin: 0; font-weight: 700; }
.start-form .btn-large { justify-self: start; margin-top: 0.75rem; }

/* ---------- Test layout ---------- */
.test { display: grid; grid-template-rows: var(--bar-h) 1fr var(--foot-h); height: 100vh; height: 100dvh; min-height: 0; }

.test-bar {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 0 1.5rem; background: var(--surface);
}
.bar-left { min-width: 0; }
.module-title { margin: 0 0 2px; font-size: 1rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-center { display: grid; justify-items: center; gap: 4px; }
.timer { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; min-width: 5ch; text-align: center; }
.timer.is-hidden { color: var(--ink-soft); }
.timer.is-hidden svg { width: 24px; height: 24px; display: block; }
.timer.is-warning { color: var(--bad); }
.bar-right { display: flex; justify-content: flex-end; gap: 0.25rem; }
.tool-btn {
  display: grid; justify-items: center; gap: 2px;
  background: none; border: 0; border-radius: var(--radius-s);
  padding: 6px 10px; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft);
}
.tool-btn svg { width: 24px; height: 24px; }
.tool-btn:hover { color: var(--ink); background: var(--paper); }
.tool-btn[aria-pressed="true"] { color: var(--sky-deep); background: var(--sky-wash); }

/* The horizon: elapsed time, from morning sky to dusk */
.horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--line); overflow: hidden; }
.horizon-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #A9CDF5 0%, var(--sky) 55%, #6B5BB8 82%, var(--sun) 100%);
  background-size: 100vw 100%; background-repeat: no-repeat;
  transition: width 1s linear;
}

/* Question content is sized in em, so the zoom setting (--zoom) scales it without touching the toolbars. */
.question-area { overflow: auto; min-height: 0; background: var(--surface); outline: none; font-size: calc(1rem * var(--zoom, 1)); }

.test-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 0 1.5rem; background: var(--surface); border-top: 1.5px solid var(--line);
}
.student-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--ink); color: #fff; border: 0; border-radius: var(--radius-s);
  padding: 8px 16px; font-weight: 700; font-size: 0.95rem;
}
.nav-btn:hover { background: #22325A; }
.foot-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

/* ---------- Question ---------- */
.q-wrap { max-width: 47.5em; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
/* Two panes (passage | question) with a draggable divider */
.split { --split: 50%; display: grid; grid-template-columns: var(--split) 12px minmax(0, 1fr); height: 100%; min-height: 0; }
.split.is-resizing { user-select: none; cursor: col-resize; }
.pane { overflow: auto; min-height: 0; min-width: 0; }
.pane-left { background: var(--surface); }
.split .q-wrap { margin: 0; max-width: 42.5em; padding: 2rem 2rem 3rem; }
.divider { position: relative; background: var(--line); cursor: col-resize; touch-action: none; outline-offset: -3px; }
.divider:hover, .split.is-resizing .divider { background: var(--line-strong); }
.divider-grip {
  position: absolute; top: 50%; left: 50%; width: 22px; height: 44px; transform: translate(-50%, -50%);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px;
  background-image: radial-gradient(circle, var(--ink-soft) 1.3px, transparent 1.6px);
  background-size: 6px 8px; background-position: center; background-repeat: repeat-y;
}
.spr-directions { padding: 2rem 2rem 3rem; }

/* Reading and Writing passages */
.passage-wrap { padding: 2rem 2.25rem 3rem; max-width: 47.5em; margin-left: auto; }
.passage { line-height: 1.75; }
.passage p { margin: 0 0 1em; }
.passage-heading { font-size: 0.9em; margin: 1.25em 0 0.4em; }
.passage-heading:first-child { margin-top: 0; }
.passage-list { margin: 0 0 1rem; padding-left: 1.3rem; }
.passage-list li { margin-bottom: 0.5rem; }
.passage .q-figure, .passage .q-table-wrap { margin-top: 1.25rem; }
.blank { display: inline-block; width: 4.5em; height: 1.1em; margin: 0 0.15em; border-bottom: 1.5px solid var(--ink); vertical-align: baseline; }
.passage u, .q-prompt u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

mark.hl { color: inherit; border-radius: 2px; cursor: pointer; padding: 0.05em 0; }
mark.hl-yellow { background: #FBE39A; }
mark.hl-blue { background: #CFE2FB; }
mark.hl-pink { background: #F8D2E2; }
mark.hl-underline { background: none; text-decoration: underline; text-decoration-color: var(--sky); text-decoration-thickness: 2.5px; text-underline-offset: 4px; }
mark.hl.is-editing { box-shadow: 0 0 0 2px var(--ink); }
mark.hl:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
mark.hl-has-note::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 2px; border-radius: 50%;
  background: var(--sun-deep); vertical-align: super;
}

/* Note editor */
.note-drawer {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: var(--foot-h);
  background: var(--surface); border-top: 3px solid var(--ink); box-shadow: 0 -10px 28px rgba(20, 33, 61, 0.14);
  padding: 0.75rem 1.5rem 1rem;
}
.note-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.6rem; }
.note-title { font-size: 1rem; margin: 0; flex: none; }
.note-quote { flex: 1; min-width: 0; color: var(--ink-soft); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-body { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem 1.25rem; align-items: start; }
.note-style-row { display: grid; gap: 0.35rem; }
.note-label { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.note-styles { display: flex; gap: 0.5rem; }
.style-swatch { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong); padding: 0; position: relative; }
.swatch-yellow { background: #FBE39A; }
.swatch-blue { background: #CFE2FB; }
.swatch-pink { background: #F8D2E2; }
.swatch-underline { background: var(--surface); }
.swatch-underline::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 9px; height: 2.5px; background: var(--sky); border-radius: 2px; }
.style-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.note-text {
  width: 100%; min-height: 72px; max-height: 26vh; resize: vertical; padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-s); font: inherit; line-height: 1.45;
}
.note-text:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-wash); }
.note-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.q-head {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--paper); border-bottom: 2px dotted var(--line-strong);
  padding-right: 0.5rem; margin-bottom: 1.5rem;
}
.q-num {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px;
  background: var(--ink); color: #fff; font-weight: 700;
}
.flag-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 0; padding: 6px 4px; font-size: 0.9rem; font-weight: 700; color: var(--ink-soft);
}
.flag-btn svg { width: 20px; height: 20px; }
.flag-btn:hover { color: var(--ink); }
.flag-btn[aria-pressed="true"] { color: var(--ink); }
.flag-btn[aria-pressed="true"] svg { fill: var(--sun); stroke: var(--sun-deep); }

.elim-toggle {
  margin-left: auto;
  display: inline-grid; place-items: center; height: 30px; padding: 0 8px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; position: relative; color: var(--ink-soft);
}
.elim-toggle::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-12deg);
}
.elim-toggle:hover { border-color: var(--ink); color: var(--ink); }
.elim-toggle[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); color: #fff; }

.q-prompt { line-height: 1.65; margin: 0 0 1.5em; }
.q-prompt .katex-display { margin: 0.75rem 0 1rem; text-align: left; }
.q-prompt .katex-display > .katex { text-align: left; }
.katex { font-size: 1.08em; }

.q-figure { margin: 0 0 1.5rem; display: grid; justify-items: center; gap: 0.5rem; }
.q-figure img { display: block; max-width: 100%; height: auto; }
.q-figure figcaption { font-size: 0.9em; color: var(--ink-soft); font-style: italic; }
.figure-missing { margin: 0; padding: 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-s); color: var(--ink-soft); }
.q-table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
.q-table { border-collapse: collapse; margin: 0 auto; font-size: 1em; font-variant-numeric: tabular-nums; }
.q-table caption { font-weight: 700; margin-bottom: 0.5rem; }
.q-table th, .q-table td { border: 1.5px solid var(--ink); padding: 0.45rem 1.1rem; text-align: center; }
.q-table th { background: var(--paper); font-weight: 700; }

.choices { display: grid; gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.choice-row { display: flex; align-items: center; gap: 0.6rem; }
.choice {
  flex: 1; display: flex; align-items: center; gap: 0.9rem; text-align: left;
  min-height: 2.9em; padding: 0.5em 1rem 0.5em 0.6rem;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-m);
  font-size: 1.125em; line-height: 1.45; position: relative;
}
.choice:hover { border-color: var(--ink); }
.choice-letter {
  flex: none; display: grid; place-items: center; width: 1.7em; height: 1.7em;
  border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 700; font-size: 0.8em; font-family: var(--font);
}
.choice[aria-checked="true"] { border: 3px solid var(--sky); padding-left: calc(0.6rem - 1.5px); background: var(--sky-wash); }
.choice[aria-checked="true"] .choice-letter { background: var(--sky); border-color: var(--sky); color: #fff; }

.choice-row.is-crossed .choice { color: var(--ink-soft); border-color: var(--line); background: var(--paper); }
.choice-row.is-crossed .choice-text,
.choice-row.is-crossed .choice-letter { opacity: 0.55; }
.choice-row.is-crossed .choice::after {
  content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 2px; background: var(--ink); opacity: 0.75;
}

.strike-btn {
  flex: none; width: 34px; height: 34px; position: relative;
  border: 1.5px solid var(--ink-soft); border-radius: 50%; background: var(--surface);
  font-size: 0.8rem; font-weight: 700; color: var(--ink-soft);
}
.strike-btn::after { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 1.5px; background: currentColor; }
.strike-btn:hover { color: var(--ink); border-color: var(--ink); }
.strike-btn.is-undo { width: auto; border: 0; border-radius: var(--radius-s); padding: 0 6px; text-decoration: underline; font-size: 0.85rem; }
.strike-btn.is-undo::after { display: none; }
.question-area:not(.elim-mode) .strike-btn { display: none; }

/* Student-produced response */
.spr-directions h2 { font-size: 1.05em; margin: 0 0 0.75em; }
.spr-directions ul { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.spr-directions li { margin-bottom: 0.45em; font-size: 0.95em; line-height: 1.5; }
.spr-examples { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.spr-examples caption { text-align: left; font-weight: 700; margin-bottom: 0.4rem; }
.spr-examples th, .spr-examples td { border: 1px solid var(--line-strong); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.spr-examples th { background: var(--paper); }

.spr-field { display: grid; gap: 0.4rem; max-width: 16em; }
.spr-input {
  height: 2.5em; padding: 0 0.65em; font-size: 1.4em; font-weight: 700; letter-spacing: 0.04em;
  border: 2px solid var(--ink-soft); border-radius: var(--radius-s); background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.spr-input:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }
.spr-preview { font-size: 0.95em; color: var(--ink-soft); min-height: 2.5em; display: flex; align-items: center; gap: 0.5rem; }
.spr-preview .katex { font-size: 1.3em; color: var(--ink); }
.spr-hint { font-size: 0.85em; color: var(--bad); min-height: 1.2em; margin: 0; }

/* Check your work */
.review-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; text-align: center; }
.review-wrap h2 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.review-wrap > p { color: var(--ink-soft); margin: 0 0 2rem; }
.review-card { border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 1.25rem 1.5rem 1.5rem; text-align: left; background: var(--surface); }
.review-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 0.9rem; border-bottom: 1.5px solid var(--line); }
.review-card-head h3 { margin: 0; font-size: 1rem; }

/* Navigator grid (shared by popover and review page) */
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.legend-icon svg { width: 18px; height: 18px; }
.legend-unanswered { border: 1.5px dashed var(--ink-soft); border-radius: 3px; width: 16px; height: 16px; }
.flag-icon svg { fill: var(--sun); stroke: var(--sun-deep); }
.pin-icon { color: var(--ink); }

.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 0.9rem 0.7rem; padding: 1.2rem 0.2rem 0.3rem; }
.nav-cell {
  position: relative; height: 42px; display: grid; place-items: center;
  border: 1.5px dashed var(--ink-soft); border-radius: var(--radius-s); background: var(--surface);
  font-weight: 700; color: var(--sky-deep);
}
.nav-cell:hover { background: var(--sky-wash); }
.nav-cell.is-answered { background: var(--sky); border: 1.5px solid var(--sky); color: #fff; }
.nav-cell.is-answered:hover { background: var(--sky-deep); }
.nav-cell .cell-flag { position: absolute; top: -8px; right: -7px; width: 16px; height: 16px; fill: var(--sun); stroke: var(--sun-deep); stroke-width: 1.6; }
.nav-cell .cell-pin { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; color: var(--ink); fill: var(--surface); }

/* ---------- Popovers ---------- */
.popover {
  position: fixed; z-index: 40; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-float);
}
.directions-pop { top: calc(var(--bar-h) + 6px); left: 1.5rem; width: min(640px, calc(100vw - 3rem)); max-height: calc(100vh - var(--bar-h) - var(--foot-h) - 2rem); display: flex; flex-direction: column; }
.directions-pop .popover-body { padding: 1.5rem 1.75rem 0.5rem; overflow: auto; }
.popover-actions { display: flex; justify-content: flex-end; padding: 1rem 1.5rem 1.25rem; }
.popover-actions.center { justify-content: center; }
.nav-pop {
  bottom: calc(var(--foot-h) + 12px); left: 50%; transform: translateX(-50%);
  width: min(520px, calc(100vw - 2rem)); padding: 1.1rem 1.4rem 0.2rem;
}
.nav-pop::after {
  content: ""; position: absolute; bottom: -9px; left: 50%; width: 16px; height: 16px; margin-left: -8px;
  background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg);
}
.nav-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1.5px solid var(--line); }
.nav-pop-head h2 { font-size: 1rem; margin: 0; }

.prose h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
.prose h3 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }
.prose p, .prose li { line-height: 1.6; }
.prose p { margin: 0 0 0.8rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 0.8rem; }

/* ---------- Floating tools ---------- */
.float-panel {
  position: fixed; z-index: 30; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  box-shadow: var(--shadow-float); overflow: hidden; min-width: 280px; min-height: 240px;
}
.float-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  height: 44px; padding: 0 0.4rem 0 1rem; background: var(--ink); color: #fff;
  cursor: grab; user-select: none; touch-action: none; flex: none;
}
.float-head:active { cursor: grabbing; }
.float-title { font-weight: 700; font-size: 0.95rem; }
.float-head .icon-btn { color: #C9D4E6; }
.float-head .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.float-head-actions { display: flex; gap: 2px; }
/* Wide enough that Desmos shows its expression list beside the graph, as in the real test. */
.calc-panel { top: calc(var(--bar-h) + 12px); left: 16px; width: min(600px, calc(100vw - 32px)); height: calc(100vh - var(--bar-h) - var(--foot-h) - 24px); max-height: 720px; }
.calc-panel.is-expanded { width: min(1000px, calc(100vw - 32px)) !important; height: calc(100vh - var(--bar-h) - var(--foot-h) - 24px) !important; max-height: none; }
.calc-body { flex: 1; min-height: 0; position: relative; }
.calc-status { margin: 0; padding: 1.25rem; color: var(--ink-soft); line-height: 1.55; }
.ref-panel { top: calc(var(--bar-h) + 12px); right: 16px; width: 440px; height: 520px; }
.ref-body { flex: 1; overflow: auto; padding: 1rem 1.25rem 1.5rem; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.ref-item { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.6rem 0.75rem; }
.ref-item h3 { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 0.3rem; }
.ref-item .katex { font-size: 1.05em; }
.ref-facts { font-size: 0.92rem; }
.resize-grip {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--line-strong) 50%, var(--line-strong) 58%, transparent 58%, transparent 70%, var(--line-strong) 70%, var(--line-strong) 78%, transparent 78%);
}

/* ---------- Toast & dialog ---------- */
.toast {
  position: fixed; z-index: 60; top: calc(var(--bar-h) + 14px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 0.7rem 1.2rem; border-radius: var(--radius-m);
  font-weight: 700; box-shadow: var(--shadow-float); max-width: calc(100vw - 2rem);
}
.dialog {
  border: 0; border-radius: var(--radius-m); padding: 1.5rem 1.75rem; max-width: 440px; width: calc(100vw - 2rem);
  box-shadow: var(--shadow-float); color: var(--ink);
}
.dialog::backdrop { background: rgba(20, 33, 61, 0.45); }
.dialog h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.dialog p { margin: 0 0 1.25rem; color: var(--ink-soft); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- Results ---------- */
.results { padding: 2.5rem 1rem 4rem; }
.results-inner { max-width: 820px; margin: 0 auto; }
.results-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.results-head h1 { margin: 0 0 0.35rem; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.2; }
.results-head p { margin: 0; color: var(--ink-soft); }
.score-line { display: flex; align-items: baseline; gap: 0.5rem; }
.score-line strong { font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.score-line span { color: var(--ink-soft); font-size: 1.05rem; }
.results-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 2.5rem; }

.domain-table, .answer-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.domain-table { margin-bottom: 2.5rem; }
.results h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.domain-table th, .domain-table td, .answer-table th, .answer-table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
.domain-table th, .answer-table th { font-size: 0.85rem; color: var(--ink-soft); background: var(--paper); }
.domain-table td:last-child, .domain-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { display: block; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar-track span { display: block; height: 100%; background: var(--sky); }

.answer-row { cursor: pointer; }
.answer-row:hover td { background: var(--paper); }
.answer-row td:first-child { font-weight: 700; width: 3.5rem; }
.answer-row button { background: none; border: 0; padding: 0; font-weight: 700; color: var(--sky-deep); text-decoration: underline; }
.result-tag { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.result-tag.is-correct { background: var(--good-wash); color: var(--good); }
.result-tag.is-wrong { background: var(--bad-wash); color: var(--bad); }
.result-tag.is-blank { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
.detail-row td { background: var(--paper); padding: 1.1rem 1.25rem 1.4rem; }
.detail-row .q-prompt { margin-bottom: 0.9rem; }
.detail-choices { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.35rem; }
.detail-choices li { padding: 0.35rem 0.6rem; border-radius: var(--radius-s); }
.detail-choices li.is-key { background: var(--good-wash); }
.detail-choices li.is-picked-wrong { background: var(--bad-wash); }
.detail-explain { border-left: 4px solid var(--sky); padding: 0.2rem 0 0.2rem 0.9rem; margin: 0; line-height: 1.6; }

/* ---------- Between modules ---------- */
.transition, .break { display: grid; place-items: center; padding: 3rem 1rem; min-height: 100vh; min-height: 100dvh; }
.transition-inner { width: 100%; max-width: 720px; text-align: center; }
.transition-inner h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 0.6rem; }
.transition-text { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; max-width: 52ch; margin: 0 auto 2.5rem; }
.transition-next { font-weight: 700; margin: 2rem 0 1rem; min-height: 1.5em; }
.transition-progress { height: 5px; max-width: 320px; margin: 0 auto; background: var(--line); border-radius: 3px; overflow: hidden; }
.transition-progress span { display: block; height: 100%; width: 0; background: var(--sky); }
#transition-btn { margin-top: 1rem; }

.step-track { list-style: none; padding: 0; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.step { position: relative; display: grid; justify-items: center; gap: 0.6rem; padding: 0 0.25rem; font-size: 0.85rem; color: var(--ink-soft); }
.step::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-next::before { background: var(--sky); }
.step-dot { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.step.is-done .step-dot { background: var(--sky); border-color: var(--sky); }
.step.is-done .step-dot::after { content: ""; position: absolute; left: 6px; top: 2px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.step.is-next .step-dot { border-color: var(--sky); box-shadow: 0 0 0 4px var(--sky-wash); }
.step.is-next .step-label { color: var(--ink); font-weight: 700; }
.step.is-break .step-dot { border-style: dashed; }
.step-label { line-height: 1.3; }

/* ---------- Break ---------- */
.break-inner { width: 100%; max-width: 900px; display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 3rem; align-items: center; }
.break-clock-card { background: var(--ink); color: #fff; border-radius: var(--radius-m); padding: 2rem 1.75rem 1.75rem; text-align: center; }
.break-clock-label { margin: 0 0 0.5rem; color: #C9D4E6; font-weight: 700; font-size: 0.95rem; }
.break-clock { margin: 0 0 1.5rem; font-size: clamp(3rem, 9vw, 4.5rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.break-horizon { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.break-text h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 1rem; }
.break-text p { color: var(--ink-soft); line-height: 1.65; margin: 0 0 0.9rem; max-width: 56ch; }
.break-text .break-next { color: var(--ink); font-weight: 700; margin: 1.5rem 0 1.5rem; }

/* Results: sections and modules */
.section-scores { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: -0.75rem 0 1.5rem; }
.section-score { display: grid; gap: 0.15rem; padding: 0.8rem 1.1rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-m); min-width: 220px; }
.section-score-name { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }
.section-score-value strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.results-section { margin-bottom: 3rem; }
.results-section-title { font-size: 1.35rem !important; margin: 0 0 1rem !important; padding-bottom: 0.5rem; border-bottom: 2px solid var(--ink); }
.results-module-title { font-size: 1.05rem; margin: 2rem 0 0.75rem; }
.answer-wrap, .domain-wrap { overflow-x: auto; }
.skill-cell { color: var(--ink-soft); font-size: 0.9rem; }
.detail-row .passage { font-size: 1rem; margin-bottom: 1rem; max-width: 70ch; }

/* Content typography */
.passage, .q-prompt, .choice-text, .q-table, .detail-explain, .detail-choices { font-family: var(--font-content); }
.passage, .q-prompt { font-size: 1.125em; }
.q-table th { font-family: var(--font-content); font-weight: 600; }
.passage-heading { font-family: var(--font); }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  :root { --bar-h: 64px; --foot-h: 64px; }
  .test-bar, .test-foot { padding: 0 0.75rem; gap: 0.5rem; }
  .tool-btn span { display: none; }
  .module-title { font-size: 0.85rem; }
  .split { grid-template-columns: 1fr; height: auto; }
  .divider { display: none; }
  .pane { overflow: visible; }
  .pane-left { border-bottom: 4px solid var(--line); }
  .spr-directions, .passage-wrap { padding: 1.25rem 1rem; }
  .split .q-wrap, .q-wrap { padding: 1.25rem 1rem 2rem; }
  .note-drawer { padding: 0.75rem 1rem; }
  .note-body { grid-template-columns: 1fr; }
  .note-actions { flex-direction: row; justify-content: flex-end; }
  .student-name { display: none; }
  .test-foot { grid-template-columns: auto 1fr; }
  .nav-btn { justify-self: start; padding: 8px 10px; font-size: 0.85rem; }
  .btn { padding: 0 1rem; }
  .calc-panel, .ref-panel { left: 8px !important; right: 8px; width: auto !important; top: calc(var(--bar-h) + 8px) !important; height: 60vh !important; }
  .resize-grip { display: none; }
}
@media (max-width: 480px) {
  .timer-actions .pill-btn { padding-inline: 0.5rem; }
  #btn-pause span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .test-bar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .bar-left { overflow: hidden; }
}

@media (max-width: 700px) {
  .break-inner { grid-template-columns: 1fr; gap: 2rem; }
  .step-track { grid-auto-flow: row; grid-auto-columns: auto; gap: 0.9rem; justify-content: start; text-align: left; }
  .step { grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
  .step::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.break-horizon .horizon-fill { background: var(--sun); }
.routing-note { margin: -0.25rem 0 1.25rem; padding: 0.75rem 1rem; background: var(--sky-wash); border-left: 4px solid var(--sky); border-radius: 0 var(--radius-s) var(--radius-s) 0; line-height: 1.55; max-width: 72ch; }

/* Estimated score */
.score-estimate { display: grid; justify-items: end; gap: 0.15rem; text-align: right; }
.score-estimate-label { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.score-estimate strong { font-size: 3.4rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.score-estimate-range { color: var(--ink-soft); font-size: 0.95rem; }
.section-score-raw { font-size: 0.85rem; color: var(--ink-soft); }
.estimate-note { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.55; max-width: 72ch; margin: 0 0 1.5rem; }
@media (max-width: 600px) { .score-estimate { justify-items: start; text-align: left; } }
.score-estimate strong, .section-score-value strong, .score-line strong { font-family: var(--font-content); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Test integrity ---------- */
.start-note { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.88rem; line-height: 1.5; max-width: 52ch; }
.integrity-note { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0 0 1.5rem; padding: 0.8rem 1rem; border-radius: var(--radius-m); border: 1.5px solid var(--line); background: var(--surface); max-width: 72ch; }
.integrity-note strong { display: block; font-size: 0.9rem; }
.integrity-note p { margin: 0.15rem 0 0; line-height: 1.5; }
.integrity-note ul { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5; }
.integrity-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 0.4rem; background: var(--good); }
.integrity-note.is-flagged { border-color: #F0C9A0; background: #FFF8EF; }
.integrity-note.is-flagged .integrity-dot { background: var(--sun-deep); }

.integrity-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem;
  background: rgba(20, 33, 61, 0.88);
}
.integrity-card {
  width: min(480px, 100%); background: var(--surface); border-radius: 14px; padding: 2rem 2rem 1.75rem;
  box-shadow: var(--shadow-float); text-align: center;
}
.integrity-icon { width: 52px; height: 52px; color: var(--sky); stroke-width: 2.4; margin-bottom: 0.5rem; }
.integrity-overlay[data-kind="returned"] .integrity-icon,
.integrity-overlay[data-kind="fullscreen"] .integrity-icon { color: var(--sun-deep); }
.integrity-card h2 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.integrity-card p { margin: 0 0 1rem; color: var(--ink-soft); line-height: 1.55; }
.integrity-card .integrity-count { color: var(--ink); font-weight: 700; background: var(--paper); border-radius: var(--radius-s); padding: 0.6rem 0.8rem; }
.integrity-card .btn { margin-top: 0.5rem; }

/* ---------- More menu, shortcuts, line reader ---------- */
.more-pop { top: calc(var(--bar-h) + 6px); right: 1rem; width: 280px; padding: 0.5rem; }
.more-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0.6rem 0.65rem; border-bottom: 1.5px solid var(--line); margin-bottom: 0.35rem; }
.more-label { font-weight: 700; font-size: 0.95rem; }
.zoom-controls { display: flex; align-items: center; gap: 0.25rem; }
.zoom-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); }
.zoom-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.zoom-btn:hover:not(:disabled) { border-color: var(--ink); }
.zoom-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.zoom-level { min-width: 4.2ch; border: 0; background: none; font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px; border-radius: var(--radius-s); }
.zoom-level:hover { background: var(--sky-wash); }
.more-item { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.6rem; border: 0; background: none; border-radius: var(--radius-s); text-align: left; font-weight: 700; font-size: 0.95rem; }
.more-item:hover { background: var(--sky-wash); }
.more-item svg { width: 22px; height: 22px; color: var(--ink-soft); flex: none; }
.more-item span:first-of-type { flex: 1; }
.more-state { font-size: 0.82rem; color: var(--ink-soft); }
.more-item[aria-checked="true"] .more-state { color: var(--sky-deep); }
kbd {
  display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; padding: 0 0.45em;
  border: 1.5px solid var(--line-strong); border-bottom-width: 3px; border-radius: 5px; background: var(--surface);
  font: 700 0.8rem/1 var(--font); color: var(--ink);
}
.shortcuts-pop { top: calc(var(--bar-h) + 6px); left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - var(--bar-h) - var(--foot-h) - 1.5rem); overflow: auto; padding: 1.1rem 1.4rem 1.2rem; }
.shortcuts-note { margin: 0 0 0.9rem; color: var(--ink-soft); font-size: 0.9rem; }
.shortcuts-list { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1.1rem; margin: 0; align-items: center; }
.shortcuts-list dt { display: flex; gap: 0.25rem; align-items: center; white-space: nowrap; font-size: 0.85rem; color: var(--ink-soft); }
.shortcuts-list dd { margin: 0; font-size: 0.95rem; }

.line-reader { position: fixed; left: 0; right: 0; top: var(--bar-h); bottom: var(--foot-h); z-index: 22; overflow: hidden; pointer-events: none; }
.lr-window {
  position: absolute; left: 0; right: 0; top: 35%; height: 70px;
  box-shadow: 0 0 0 200vh rgba(20, 33, 61, 0.55);
  border-top: 2px solid var(--sky); border-bottom: 2px solid var(--sky);
}
.lr-tab {
  position: absolute; right: 1.25rem; bottom: 100%; display: flex; align-items: center; gap: 2px;
  padding: 3px 4px; background: var(--sky); border-radius: 8px 8px 0 0; pointer-events: auto;
}
.lr-grip { display: grid; place-items: center; width: 34px; height: 28px; color: #fff; cursor: ns-resize; touch-action: none; border-radius: 6px; }
.lr-grip svg { width: 18px; height: 18px; stroke-width: 2.2; }
.lr-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #fff; }
.lr-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.lr-btn:hover:not(:disabled), .lr-grip:hover { background: rgba(255, 255, 255, 0.18); }
.lr-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.lr-grip:focus-visible, .lr-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* ---------- Before you begin ---------- */
.ready { display: grid; place-items: start center; padding: clamp(2rem, 7vh, 5rem) 1rem 3rem; }
.ready-inner { width: 100%; max-width: 600px; }
.ready-back { margin-bottom: 1.75rem; }
.ready-title { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.2; margin: 0 0 0.4rem; }
.ready-meta { color: var(--ink-soft); margin: 0 0 2rem; line-height: 1.5; }
.mode-picker { border: 0; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.6rem; }
.mode-picker legend { padding: 0; margin-bottom: 0.6rem; font-weight: 700; font-size: 0.95rem; }
.mode-option span { line-height: 1.5; }
.mode-locked { margin: 0 0 2rem; padding: 0.8rem 1rem; border-left: 4px solid var(--sky); background: var(--sky-wash); border-radius: 0 var(--radius-s) var(--radius-s) 0; line-height: 1.5; }
.checklist { margin: 0 0 2rem; padding: 1.25rem 1.4rem 0.5rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-m); }
.checklist h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.checklist ol { margin: 0; padding-left: 1.25rem; }
.checklist li { margin-bottom: 0.9rem; line-height: 1.55; padding-left: 0.2rem; }
.checklist li::marker { font-weight: 700; color: var(--sky-deep); }
.dnd-steps { display: block; margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.92rem; }
#btn-begin { min-width: 180px; }

/* ---------- Pause (practice mode) ---------- */
.timer-actions { display: flex; gap: 0.35rem; }
#btn-pause { display: inline-flex; align-items: center; gap: 0.25rem; }
#btn-pause[hidden] { display: none; }
#btn-pause svg { width: 12px; height: 12px; stroke-width: 3; }
.pause-overlay { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 1.5rem; background: var(--paper); }
.pause-inner { width: min(520px, 100%); text-align: center; }
.pause-label { margin: 0 0 0.25rem; color: var(--ink-soft); font-weight: 700; font-size: 0.9rem; }
.pause-clock { margin: 0 0 1.5rem; font-family: var(--font-content); font-weight: 600; font-size: clamp(3rem, 10vw, 4.5rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.pause-inner h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.pause-text { margin: 0 0 1.75rem; color: var(--ink-soft); line-height: 1.55; }
.pause-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.pause-note { margin: 0; color: var(--ink-soft); font-size: 0.88rem; line-height: 1.5; }
.integrity-note .integrity-mode { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Class tests (joined with a code) ---------- */
.btn-small { min-height: 36px; padding: 0 1rem; font-size: 0.88rem; }
.text-input {
  width: 100%; height: 48px; padding: 0 0.9rem;
  border: 2px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface);
}
.text-input:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }
.join-card { margin: 0 0 2.75rem; padding: 1.25rem 1.4rem 1.35rem; background: var(--surface); border: 2px solid var(--sky); border-radius: var(--radius-m); }
.join-card h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.code-form { display: grid; gap: 0.5rem; }
.code-form label { font-weight: 700; font-size: 0.95rem; }
.code-row { display: flex; gap: 0.6rem; }
.code-row input {
  flex: 1; min-width: 0; height: 52px; padding: 0 1rem;
  border: 2px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface);
  font-size: 1.4rem; font-weight: 700; letter-spacing: 0.12em; font-variant-numeric: tabular-nums;
}
.code-row input:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }
.code-row .btn { min-height: 52px; }
.my-tests { list-style: none; margin: 1.1rem 0 0; padding: 1rem 0 0; border-top: 1.5px solid var(--line); display: grid; gap: 0.6rem; }
.my-tests li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.my-test-text { display: grid; min-width: 0; }
.my-test-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-test-text span { color: var(--ink-soft); font-size: 0.88rem; }
.practice-heading { font-size: 1.1rem; margin: 0 0 1rem; }

.join-form { display: grid; gap: 1.25rem; margin-top: 0.5rem; }
.join-form .btn-large { justify-self: start; margin-top: 0.25rem; }
.join-field { display: grid; gap: 0.4rem; }
.join-field > label { font-weight: 700; font-size: 0.95rem; }
.field-hint { margin: 0; color: var(--ink-soft); font-size: 0.88rem; line-height: 1.5; }
.pin-input { max-width: 10rem; font-size: 1.4rem; letter-spacing: 0.4em; font-weight: 700; }
.roster { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.roster legend { padding: 0; margin-bottom: 0.6rem; font-weight: 700; font-size: 0.95rem; }
.roster-list { display: grid; gap: 0.5rem; max-height: 46vh; overflow: auto; padding: 2px; }
.roster-option { padding: 0.7rem 1rem; }
.roster-new { border-style: dashed; }
.join-toggle { justify-self: start; }

.lobby-who { margin: 0 0 0.35rem; font-weight: 700; color: var(--sky-deep); font-size: 0.92rem; }
.id-card { margin: 0 0 2rem; padding: 0.9rem 1.1rem; border-radius: var(--radius-m); background: #FFF8EF; border: 1.5px solid #F0C9A0; line-height: 1.55; }
.id-card strong { font-size: 1.15rem; letter-spacing: 0.04em; }
.lobby-status { margin: 0 0 1rem; font-weight: 700; line-height: 1.5; }
.lobby-status.is-waiting { color: var(--ink-soft); display: flex; align-items: center; gap: 0.6rem; }
.lobby-status.is-waiting::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); flex: none;
  animation: lobby-pulse 1.6s ease-in-out infinite;
}
.lobby-status.is-ready { color: var(--good); }
@keyframes lobby-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
#btn-lobby-begin { min-width: 180px; }

.score-card { display: grid; justify-items: start; gap: 0.2rem; margin: 1.5rem 0; padding: 1.4rem 1.5rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-m); }
.score-big { font-family: var(--font-content); font-weight: 600; font-size: 3.4rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.score-sections { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.score-sections li { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding: 0.75rem 1rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-m); }
.score-sections li strong { font-family: var(--font-content); font-size: 1.3rem; grid-row: span 2; align-self: center; }
.score-sections li span:last-child:not(:first-child) { color: var(--ink-soft); font-size: 0.85rem; }
.score-wait { color: var(--ink-soft); line-height: 1.55; margin: 0 0 1.25rem; max-width: 60ch; }

.sync-state {
  position: fixed; left: 12px; bottom: calc(var(--foot-h) + 10px); z-index: 30; max-width: min(420px, calc(100vw - 24px));
  margin: 0; padding: 0.5rem 0.8rem; border-radius: var(--radius-s); background: #FFF8EF; border: 1.5px solid #F0C9A0;
  color: var(--ink); font-size: 0.85rem; line-height: 1.4; box-shadow: 0 2px 6px rgba(20, 33, 61, 0.1);
}
body:has(#screen-test[hidden]) .sync-state { bottom: 12px; }

/* Lines of a poem in a passage */
.passage-poem { line-height: 1.75; padding-left: 1.25em; }
.choice-fold { margin-top: -0.75rem; }
.choice-fold summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; padding: 0.35rem 0; color: var(--ink); }
.choice-fold summary::marker { color: var(--sky-deep); }
.choice-fold[open] summary { margin-bottom: 0.6rem; }
