:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --border: #dcdad5;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --error-bg: #fdecea;
  --error-text: #8a1c12;
  --notice-bg: #e8f1fd;
  --notice-text: #133d78;
  --warn-bg: #fdf3dc;
  --warn-text: #7a5300;
  --ok-bg: #e3f4e6;
  --ok-text: #1d6230;
  --away-yellow: #ffd23f;
  --away-yellow-text: #3d2c00;
  --away-red: #d7263d;
  --away-red-text: #ffffff;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --surface: #212124;
    --text: #ececee;
    --muted: #a0a0a6;
    --border: #3a3a3f;
    --accent: #6ea2f0;
    --accent-text: #0d1a2e;
    --error-bg: #3d1a17;
    --error-text: #f6b7ae;
    --notice-bg: #172a45;
    --notice-text: #bcd4f7;
    --warn-bg: #3d2f12;
    --warn-text: #f3d48c;
    --ok-bg: #173b21;
    --ok-text: #a8e2b5;
    --away-yellow: #e8b800;
    --away-yellow-text: #1d1500;
    --away-red: #e5484d;
    --away-red-text: #ffffff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout classes must not unhide elements */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar nav { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }

main { margin: 2rem auto; padding: 0 1rem; }
main.narrow { max-width: 30rem; }
main.wide { max-width: 64rem; }

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 400; }
small, .muted { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.mono, .recovery-key { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

button, .button {
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
button.secondary, .button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
button.link {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
}
.button.disabled { opacity: 0.4; cursor: not-allowed; }
form.inline { display: inline; }

.error, .notice { padding: 0.7rem 0.9rem; border-radius: var(--radius); }
.error { background: var(--error-bg); color: var(--error-text); }
.notice { background: var(--notice-bg); color: var(--notice-text); }

.recovery-key {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  word-break: break-word;
}

.status { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

textarea { resize: vertical; font-family: inherit; field-sizing: content; min-height: 3.2em; }
label.file { font-weight: 400; color: var(--muted); }

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.title-row h1 { margin-bottom: 0.5rem; }
h2 { margin-top: 2rem; }
.card h2 { margin-top: 0; }
.card .button { display: inline-block; margin-top: 0.5rem; }

.rows { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--border); }
.rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.rows .actions { display: flex; align-items: center; gap: 1rem; }
.row { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.row input { flex: 1; min-width: 0; }

details.inline-edit summary { cursor: pointer; color: var(--accent); list-style: none; text-decoration: underline; }
details.inline-edit summary::-webkit-details-marker { display: none; }
details.inline-edit[open] { flex-basis: 100%; }
.rows li:has(details[open]) .actions { flex-basis: 100%; flex-wrap: wrap; }

.danger-zone { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.button-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
}
.badge.draft { background: var(--warn-bg); color: var(--warn-text); }
.badge.ready { background: var(--ok-bg); color: var(--ok-text); }
.warnings { margin: 0.3rem 0 0.5rem; padding-left: 1.2rem; }
.error ul, .notice ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.error p, .notice p { margin: 0; }

/* quiz editor */
fieldset { margin: 0; min-width: 0; }
fieldset.card { display: flex; flex-direction: column; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; }
.item-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.item-tools { margin-left: auto; display: flex; gap: 0.9rem; align-items: center; }
.short-input { width: 4.5rem; }
label.inline-label { flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; }
.radio-row { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.option-row { display: flex; gap: 0.6rem; align-items: center; }
.option-row input[type="text"] { flex: 1; min-width: 0; }
input[type="radio"], .choice input[type="checkbox"], .option-row input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
label.source { font-weight: 400; color: var(--muted); }
.item:not([data-type="tf"]) .for-tf,
.item:not([data-type="mc"]) .for-mc,
.item:not([data-type="short"]) .for-short,
.item:not([data-type="gap"]) .for-gap,
.item:not([data-type="vocab"]) .for-vocab,
.item[data-type="gap"] .not-for-gap,
.item[data-type="vocab"] .not-for-vocab,
.item[data-type="mc"][data-multi] .not-for-multi,
.item:not([data-type="mc"][data-multi]) .for-multi { display: none; }
.mono-ish { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.95em; }
.item.has-problem { border-color: var(--error-text); }
.item-problem { margin: 0; color: var(--error-text); font-size: 0.95rem; }
button.link.danger { color: var(--error-text); }
button.danger:not(.link) { background: transparent; color: var(--error-text); border: 1px solid var(--error-text); }
button.danger:not(.link):hover { background: var(--error-bg); }
/* quiz folders and drag handles */
.new-folder { max-width: 30rem; margin: 0.5rem 0 0.25rem; }
.small-print { font-size: 0.9rem; margin: 0 0 1rem; }
.folder { margin-bottom: 1.25rem; }
.folder-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.5rem 0 0.4rem; }
.folder-head h2 { margin: 0; font-size: 1.1rem; }
.folder-count { font-size: 0.9rem; }
.folder-tools { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.handle {
  background: none;
  color: var(--muted);
  padding: 0.1rem 0.35rem;
  font-size: 1.15rem;
  line-height: 1;
  cursor: grab;
  touch-action: none; /* a drag on the handle must not scroll the page on touch screens */
  border-radius: 6px;
}
.handle:hover, .handle:focus-visible { color: var(--text); background: var(--surface); }
.quiz-name { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; margin-bottom: 0.6rem; font-size: 0.95rem; }
.crumbs a, .crumbs [aria-current] { padding: 0.15rem 0.45rem; border-radius: 6px; }
.crumbs [aria-current] { font-weight: 600; }
.crumb-sep { color: var(--muted); }
.folder-row .folder-link { font-weight: 600; text-decoration: none; color: var(--text); }
.folder-row .folder-link:hover { text-decoration: underline; }
.row-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.button.small { padding: 0.3rem 0.75rem; font-size: 0.95rem; }
.rows li:has(details[open]) .row-actions { flex-basis: 100%; }
.drop-into { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--notice-bg); border-radius: 6px; }
.folder-actions { display: flex; flex-direction: column; gap: 0.75rem; max-width: 36rem; }
.folder-actions h2 { margin: 0; font-size: 1.05rem; }
.dragging { background: var(--notice-bg); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); border-radius: var(--radius); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.sort-bar { display: flex; gap: 0.9rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.6rem; }
.sort-link { text-decoration: none; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--border); }
.sort-link.active { background: var(--notice-bg); color: var(--notice-text); border-color: transparent; font-weight: 600; }
button.link:disabled { opacity: 0.3; cursor: default; }
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.enter-default { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* projector */
main.projector { max-width: none; margin: 0.5rem auto; padding: 0 2rem; }
.p-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.p-head h1 { font-size: clamp(1.6rem, 3vw, 2.6rem); margin: 0; }
.p-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.state-ended .p-grid { grid-template-columns: 1fr; }
.p-join { text-align: center; }
.qr { background: #fff; padding: 0.75rem; border-radius: var(--radius); max-width: min(67vh, 100%); margin: 0 auto; }
.qr svg { display: block; width: 100%; height: auto; }
.state-running .qr { max-width: min(38vh, 72%); }
.join-url { font-size: clamp(1.2rem, 2.4vw, 2.1rem); font-weight: 700; word-break: break-all; margin: 0.4rem 0 0; }
.timer {
  font-size: clamp(4rem, 13vw, 11rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.timer.urgent { color: var(--error-text); }
.p-status { font-size: clamp(1.2rem, 2.2vw, 1.8rem); font-weight: 600; margin: 0.5rem 0 1rem; }
.p-controls { margin-bottom: 1.25rem; }
.p-controls form { display: flex; gap: 0.5rem; }
button.big { font-size: 1.4rem; padding: 0.9rem 1.6rem; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}
.chip.done { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
/* Left the quiz page (strong colours: projectors wash out pastels); wins over "done". */
.chip.away-yellow { background: var(--away-yellow); color: var(--away-yellow-text); border-color: transparent; }
.chip.away-red { background: var(--away-red); color: var(--away-red-text); border-color: transparent; }
.chip.away-yellow .chip-x, .chip.away-red .chip-x { color: inherit; }
.chip-x {
  background: none;
  color: var(--muted);
  padding: 0 0.45rem;
  font-size: 1.1em;
  line-height: 1;
  font-weight: 400;
  border-radius: 999px;
}
.chip-x:hover { color: var(--error-text); }
@media (max-width: 800px) { .p-grid { grid-template-columns: 1fr; } }

/* student */
main.student { margin-top: 1rem; }
.s-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.s-name { font-weight: 700; }
.s-timer { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.s-timer.urgent { color: var(--error-text); }
.away-rule { color: var(--muted); font-size: 0.9rem; }
.away-note { padding: 0.6rem 0.9rem; border-radius: var(--radius); font-weight: 600; }
.away-note.yellow { background: var(--away-yellow); color: var(--away-yellow-text); }
.away-note.red { background: var(--away-red); color: var(--away-red-text); }
.s-save { font-size: 0.9rem; min-width: 6.5rem; text-align: right; }
.s-item legend { font-size: 0.9rem; color: var(--muted); font-weight: 600; padding: 0 0.3rem; }
.s-item { padding-top: 0.5rem; }
.s-prompt { margin: 0; font-size: 1.1rem; }
.s-hint { margin: 0; font-size: 0.9rem; color: var(--muted); }
.choices { display: flex; flex-direction: column; gap: 0.5rem; }
.choices.two { flex-direction: row; }
.choices.two .choice { flex: 1; justify-content: center; }
.choice {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
}
.gap-text { margin: 0; font-size: 1.1rem; line-height: 2.4; }
input.gap {
  width: 8.5em;
  max-width: 100%;
  padding: 0.25rem 0.45rem;
  margin: 0 0.15rem;
  line-height: 1.3;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-weight: 400;
  background: var(--surface);
  color: var(--text);
}
input.gap:focus { border-color: var(--accent); outline: none; }
.gap-results { margin: 0.2rem 0 0; padding-left: 1.4rem; }
.gap-results .right .mark { color: var(--ok-text); }
.gap-results .wrong .mark { color: var(--error-text); }
.word-list { display: flex; flex-direction: column; gap: 0.5rem; }
label.word-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0.6rem;
  align-items: center; font-weight: 400; }
.word-shown { font-weight: 600; overflow-wrap: anywhere; }
.word-results { list-style: none; padding: 0; margin: 0.2rem 0 0; display: flex; flex-direction: column; gap: 0.35rem; }
.word-results li { display: flex; flex-wrap: wrap; gap: 0 0.5rem; align-items: baseline; }
.word-results .word-shown::after { content: " →"; font-weight: 400; color: var(--muted); }
.word-results .right .mark { color: var(--ok-text); }
.word-results .slip .mark { color: var(--warn-text); font-weight: 700; }
.word-results .wrong .mark { color: var(--error-text); }
.word-note { flex-basis: 100%; font-size: 0.9rem; font-style: italic; color: var(--muted); }
.mc-results { list-style: none; padding-left: 0; }
.mc-results .wrong span:first-child { text-decoration: line-through; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--notice-bg); }
.choice input { flex: none; }
.submit-area { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.5rem 0 3rem; }
.submit-area > button, .submit-area .button-row button { padding: 0.9rem; font-size: 1.1rem; flex: 1; }
.name-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.name-button {
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  font-size: 1.1rem;
  padding: 0.85rem 1rem;
}
.name-button:hover:not(:disabled) { border-color: var(--accent); }
.name-button:disabled { opacity: 0.5; cursor: not-allowed; }
.name-button small { font-weight: 400; margin-left: 0.4rem; }
.code-input { font-size: 1.6rem; letter-spacing: 0.15em; text-transform: uppercase; text-align: center; }
.live-card { margin-bottom: 1rem; }

/* results */
.p-ended { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.p-ended h2 { margin-top: 0; font-size: clamp(1.3rem, 2.2vw, 1.9rem); }
.key-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.key-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.15rem 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
}
.key-label { grid-row: span 2; font-weight: 800; color: var(--muted); }
.key-answer { color: var(--ok-text); }
.key-words { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.1rem 1rem; }
.key-words div { display: contents; }
.key-words dt { margin: 0; }
.key-words dd { margin: 0; color: var(--ok-text); font-weight: 700; }
.podium { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }
.podium li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1rem;
  align-items: baseline;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.podium .rank { grid-row: span 2; font-size: clamp(2.2rem, 4.5vw, 3.8rem); font-weight: 800; line-height: 1; }
.podium .names { font-size: clamp(1.4rem, 2.6vw, 2.3rem); font-weight: 700; }
.podium .score { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.35rem); }
.podium .place-1 { background: var(--warn-bg); border-color: transparent; }
.podium .place-1 .rank { color: var(--warn-text); }
@media (max-width: 800px) { .p-ended { grid-template-columns: 1fr; } }

.result { gap: 0.4rem; display: flex; flex-direction: column; border-left-width: 5px; }
.result.full { border-left-color: var(--ok-text); }
.result.partial { border-left-color: var(--warn-text); }
.result.zero { border-left-color: var(--error-text); }
.result-head { display: flex; justify-content: space-between; gap: 1rem; }
.result-line { margin: 0; }
.result-reason { margin: 0; font-style: italic; color: var(--muted); }

.print-only { display: none; }
@media print {
  .topbar, .no-print { display: none; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
}

/* review */
.subnav { display: flex; gap: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.subnav a { padding: 0.4rem 0; text-decoration: none; color: var(--muted); }
.subnav a[aria-current] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
.table-scroll { overflow-x: auto; margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.results { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.results th, table.results td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.results thead th { font-size: 0.85rem; color: var(--muted); font-weight: 600; background: var(--bg); position: sticky; top: 0; }
table.results tbody tr:last-child > * { border-bottom: none; }
table.results tbody th { font-weight: 600; position: sticky; left: 0; background: var(--surface); }
table.results tbody th a { color: var(--text); }
table.results .num { text-align: right; }
table.results td a { color: inherit; text-decoration: none; display: block; }
table.results td a:hover { text-decoration: underline; }
table.results .np strong { font-size: 1.05rem; }
td.cell-teacher { background: var(--warn-bg); color: var(--warn-text); font-weight: 700; }
td.cell-pending, td.cell-missing { color: var(--muted); }
td.cell-teacher-set { box-shadow: inset 0 -2px 0 var(--accent); }
tr.absent th { color: var(--muted); font-weight: 400; }
.away { padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.away.yellow { background: var(--away-yellow); color: var(--away-yellow-text); }
.away.red { background: var(--away-red); color: var(--away-red-text); }
.todo { margin-bottom: 2rem; }
.todo-item { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.todo-prompt, .todo-expect { margin: 0; }
.todo-answer { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.todo-text { flex: 1 1 18rem; min-width: 0; }
.todo-name { font-weight: 600; }
.todo-text blockquote { margin: 0.25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.grade-fields { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.grade-fields input[type="text"] { flex: 1 1 12rem; min-width: 0; }
.review-item { margin-bottom: 0.75rem; }
.review-item .result-line { overflow-wrap: anywhere; }
.word-table { width: 100%; border-collapse: collapse; margin: 0.4rem 0; font-size: 0.95rem; table-layout: fixed; }
.word-table th, .word-table td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border);
  vertical-align: top; overflow-wrap: break-word; }
.word-table thead th:first-child { width: 36%; }
.word-table thead th:last-child { width: 7rem; }
.word-table tr.has-note > * { border-bottom: none; padding-bottom: 0; }
.word-note-row td { font-style: italic; padding-top: 0.1rem; }
.word-table thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.word-table .num { text-align: right; font-weight: 700; }
.word-table tr.right .num { color: var(--ok-text); }
.word-table tr.slip .num { color: var(--warn-text); }
.word-table tr.wrong .num { color: var(--error-text); }
.word-table tr.open .num { color: var(--muted); }
.review-item details.inline-edit { margin-top: 0.25rem; }
.review-item details.inline-edit form { margin-top: 0.5rem; }
.summary { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0 0 1rem; }
.summary dt { font-size: 0.85rem; color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; font-size: 1.15rem; }
.small { font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
.scheme { margin-bottom: 1.25rem; }
.scheme-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; }
.scheme-table { border-collapse: collapse; }
.scheme-table th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600; padding: 0 0.5rem 0.2rem 0; }
.scheme-table td { padding: 0.15rem 0.75rem 0.15rem 0; }
.scheme-table input { width: 5.5rem; }
.scheme-table tr.spare input { border-style: dashed; }
.scheme-row { flex-wrap: wrap; align-items: center; }
[data-grading-watch] { margin-bottom: 1rem; }

/* teacher decisions that apply to the whole run */
.pt-buttons { display: inline-flex; gap: 0.2rem; margin: 0; }
.pt-buttons button { padding: 0.1rem 0.45rem; min-width: 1.9rem; font-weight: 700; background: var(--surface);
  color: var(--muted); border: 1px solid var(--border); }
.pt-buttons button.current { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.word-table td.num { white-space: nowrap; }
.decided { margin-left: 0.3rem; font-size: 0.8rem; padding: 0 0.4rem; border-radius: 999px;
  background: var(--notice-bg); color: var(--notice-text); white-space: nowrap; }
.same-check { flex-basis: 100%; font-weight: 400; font-size: 0.95rem; margin: 0; }
.decision-notice { margin: 0.5rem 0; }
.decision-notice p { margin: 0; }
.decision-notice ul { margin: 0.3rem 0 0; }
.decision-log { padding-left: 1.2rem; display: grid; gap: 0.5rem; }

/* AI costs and problems */
.warn-dot { display: inline-block; min-width: 1.1rem; padding: 0 0.3rem; border-radius: 999px; background: var(--error-text);
  color: var(--surface); font-size: 0.75rem; font-weight: 800; line-height: 1.1rem; text-align: center; text-decoration: none; }
.api-warning p { margin: 0.25rem 0; }
.api-message { overflow-wrap: anywhere; opacity: 0.85; }
.ok-notice { background: var(--ok-bg); color: var(--ok-text); }
table.ai-usage tfoot th, table.ai-usage tfoot td { border-top: 2px solid var(--border); }
.subnav a { white-space: nowrap; }
table.ai-usage thead th, table.ai-usage th[scope="row"] { white-space: normal; }
table.ai-usage th[scope="row"] { font-weight: 500; }
