/*
  PUNCRM staff site. Colours from nsw.newcollege.com.au (ink top bar, navy gradient, menu blue, footer indigo, logo red).
  One idea carries the look: link status drawn as OMR answer bubbles, echoing the scanned answer sheets the reports start from.
  No inline styles anywhere (CSP). Tokens and rules: docs/design/DESIGN.md.
*/

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #0a0c28;
  --ink-2: #161a45;
  --navy: #091777;
  --blue: #008eec;
  --blue-press: #0076c6;
  --indigo: #2e3393;
  --red: #b60615;
  --orange: #f6921e;
  --green: #1f8a4c;
  --paper: #f8f8fa;
  --panel: #ffffff;
  --rule: #e2e4ee;
  --rule-strong: #c9ccdb;
  --text: #1b1e3a;
  --text-2: #5a5f7d;
  --text-3: #8a8ea8;
  --focus: 0 0 0 3px rgb(0 142 236 / 35%);

  --r-control: 6px;
  --r-panel: 10px;

  --fs-xs: 12px;
  --fs-s: 13px;
  --fs-m: 15px;
  --fs-l: 20px;
  --fs-xl: 28px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 var(--fs-m) / 1.5 "Inter", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
}

a { color: var(--indigo); text-underline-offset: 2px; }
a:hover { color: var(--navy); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-control); }

h1, h2 { color: var(--navy); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; }
h2 { font-size: var(--fs-l); font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
p { margin: 0 0 12px; }
small { font-size: var(--fs-xs); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; background: var(--paper); padding: 1px 4px; border-radius: 4px; }

.muted { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num, td.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.shell.bare { grid-template-columns: 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--ink); color: #c9cce4;
  padding: 18px 12px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 18px; margin-bottom: 8px;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  color: #fff; text-decoration: none;
}
.brand img { border-radius: 4px; background: #fff; padding: 2px; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: var(--fs-m); line-height: 1.2; }
.brand-text small { font-weight: 400; color: #8f94bf; font-size: var(--fs-xs); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-control);
  color: #c9cce4; text-decoration: none; font-size: var(--fs-s); font-weight: 500;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--blue); color: #fff; }
.nav-icon { display: inline-flex; width: 18px; height: 18px; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-group { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.nav-group.first { margin-top: 0; }
.nav-heading { padding: 0 10px 4px; color: #6f74a3; font-size: var(--fs-xs); font-weight: 600; }

.account {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 8px 2px; border-top: 1px solid rgb(255 255 255 / 8%);
}
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--navy); color: #fff; font-weight: 600; font-size: var(--fs-s);
}
.who { display: flex; flex-direction: column; min-width: 0; }
.who strong { color: #fff; font-size: var(--fs-s); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who form { margin: 0; }
.who .link { color: #8f94bf; font-size: var(--fs-xs); }
.who .link:hover { color: #fff; }
.who .link svg { width: 12px; height: 12px; vertical-align: -2px; }

.content { padding: 28px 28px 48px; max-width: 1280px; width: 100%; }

/* ---------- Page heading ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.lede { color: var(--text-2); max-width: 70ch; margin-bottom: 20px; }
p > a.with-icon:only-child { font-size: var(--fs-s); color: var(--text-2); text-decoration: none; }
p > a.with-icon:only-child:hover { color: var(--navy); }
.content > h1 { margin-bottom: 18px; }

.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.with-icon svg, .ic svg { width: 16px; height: 16px; flex: none; }

.grade-chip {
  display: inline-block; vertical-align: middle;
  padding: 2px 8px; border-radius: 999px;
  background: #e8ebff; color: var(--navy);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
h1 .grade-chip { font-size: var(--fs-s); margin-left: 8px; vertical-align: 6px; }
a.grade-chip { text-decoration: none; margin: 2px 4px 2px 0; }
a.grade-chip:hover { background: var(--navy); color: #fff; }
.stats dd.test-ids { font-size: var(--fs-s); font-weight: 600; }

/* ---------- Panels ---------- */

.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); margin-bottom: 20px; }
.card .body { padding: 18px 20px; }
.card .body > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 420px; }
.test-card { padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

.stats { display: flex; gap: 32px; margin: 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { color: var(--text-2); font-size: var(--fs-xs); }
.stats dd { margin: 0; font-size: var(--fs-l); font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }

.actions-row, .btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-group form { margin: 0; }

/* ---------- Messages ---------- */

.notice, .error {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-control); margin-bottom: 16px;
  font-size: var(--fs-s);
}
.notice { background: #e6f4fd; color: #064a78; border-left: 3px solid var(--blue); }
.error { background: #fbeaec; color: #7d0410; border-left: 3px solid var(--red); }
.notice svg, .error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- Controls ---------- */

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-control);
  background: var(--panel); color: var(--text);
  font: 500 var(--fs-s) / 1 "Inter", system-ui, sans-serif;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
button:hover, .button:hover { border-color: var(--navy); color: var(--navy); }
button.primary, .button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--blue-press); border-color: var(--blue-press); color: #fff; }
button.danger, .button.danger { color: var(--red); border-color: #e9b8bd; background: var(--panel); }
button.danger:hover, .button.danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
button.small, .button.small { min-height: 28px; padding: 0 10px; font-size: var(--fs-xs); }
button.link { min-height: 0; padding: 0; border: 0; background: none; }
/* Former colour-coded buttons read as one quiet secondary style. */
.c-blue, .c-green, .c-purple, .c-teal { color: var(--text); }

label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-s); font-weight: 500; color: var(--text-2); margin-bottom: 12px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--r-control); padding: 10px 14px; margin: 0 0 14px; }
fieldset label { flex-direction: row; align-items: center; gap: 8px; margin: 4px 0; color: var(--text); font-weight: 400; }
legend { font-size: var(--fs-s); font-weight: 600; color: var(--text-2); padding: 0 4px; }

input, select, textarea {
  min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-control);
  background: var(--panel); color: var(--text);
  font: 400 var(--fs-s) / 1.4 "Inter", system-ui, sans-serif;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; accent-color: var(--blue); }
textarea { width: 100%; resize: vertical; }

.search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.search input[name="q"] { flex: 1 1 260px; }
.search input[type="number"] { width: 110px; }

form.inline { display: inline; margin: 0; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); }
table.grid { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.grid th {
  position: sticky; top: 0;
  text-align: left; font-weight: 600; color: var(--text-2); font-size: var(--fs-xs);
  padding: 10px 10px; background: #fbfbfd; border-bottom: 1px solid var(--rule);
}
.grid td { padding: 11px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #f6f8ff; }
.grid td strong { font-weight: 600; color: var(--text); }
.grid td.actions { text-align: right; white-space: nowrap; }
.grid td.num { color: var(--text-2); }

/* ---------- Status ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.badge.ok { color: var(--green); }
.badge.warn { color: #9a5200; }
.badge.none { color: var(--text-3); }

/* OMR bubbles: the link state of one report, as on a scanned answer sheet. */
.bubble {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border-radius: 50%; border: 1.5px solid var(--navy); background: transparent;
}
.bubble.issued { background: linear-gradient(90deg, var(--navy) 50%, transparent 50%); }
.bubble.opened { background: var(--navy); }
.bubble.expired { border-color: var(--orange); background: repeating-linear-gradient(45deg, transparent 0 3px, rgb(246 146 30 / 45%) 3px 5px); }
.bubble.none { border-color: var(--rule-strong); border-style: dashed; }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin: -4px 0 14px; font-size: var(--fs-xs); color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* One report kind per line in the students table, with its buttons. */
.kind-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; white-space: nowrap; }
.kind-row > strong { width: 64px; flex: none; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.kind-row .kind-state { width: 108px; flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-xs); }
.kind-row .btn-group, .kind-row .kind-admin { display: inline-flex; flex-wrap: nowrap; gap: 6px; }
.kind-row .kind-admin { padding-left: 6px; border-left: 1px solid var(--rule); }
.grid td:last-child:has(.kind-row) { min-width: 470px; }

/* ---------- Sign in ---------- */

.shell.bare .content {
  display: grid; place-items: center; min-height: 100vh; max-width: none; padding: 24px;
  background: linear-gradient(110deg, #050e4e 0%, #091777 45%, #057ccb 100%);
}
.login { width: 100%; }
.login .head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--rule);
}
.login .head div { display: flex; flex-direction: column; line-height: 1.25; }
.login .head strong { color: var(--navy); font-size: var(--fs-m); }
.login .head span { color: var(--text-2); font-size: var(--fs-xs); }
.login .body { padding: 22px 24px 24px; }
.login h1 { font-size: var(--fs-l); margin-bottom: 16px; }
.login input { width: 100%; }
.login button.primary { width: 100%; margin-top: 4px; }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
  .brand { border: 0; padding: 0; margin: 0; }
  .nav { flex-direction: row; flex-wrap: nowrap; flex: 1 1 100%; overflow-x: auto; }
  .nav a { flex: none; }
  .nav-group { flex-direction: row; margin: 0; }
  .nav-heading { display: none; }
  .account { border: 0; padding: 0; margin-left: auto; }
  .content { padding: 20px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Scan screens ---------- */

.grid.compact th, .grid.compact td { padding: 6px 10px; }
.grid.compact td.num, .grid.compact th.num { text-align: right; }
/* Wide count tables: a line between columns keeps each number under its heading. */
.grid.ruled th + th, .grid.ruled td + td { border-left: 1px solid var(--rule); }
.grid.ruled tbody tr:hover td { background: #f6f8fd; }
.inline-field { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; color: var(--text-2); font-size: var(--fs-s); font-weight: 400; }
.search .inline-field input[type="number"] { width: 76px; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.grade-grid .card { margin-bottom: 0; }
.grade-grid + p { margin-top: 20px; }
input.scan-id { width: 76px; }

/* Scan import preview */
.import-options { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 4px 0 16px; }
.inline-field.check { gap: 8px; color: var(--text); }
.scan-file-head { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 10px; }
.scan-file-head select, .scan-file-head input[type="number"] { min-height: 30px; padding: 2px 8px; }
.scan-file-head input[type="number"] { width: 84px; }
.scan-rows td.marks, td.marks { font-family: var(--font-mono, ui-monospace, monospace); white-space: pre; letter-spacing: 0.5px; }
.scan-rows tr.warn td { background: #fff7e6; }
.actions-row { display: flex; gap: 10px; margin-top: 16px; }
.saved-list { margin: 0 0 16px 18px; font-size: var(--fs-s); }
p.pre { white-space: pre-wrap; }

/* Scan files and Student IDs */
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.change-form fieldset { display: flex; flex-wrap: wrap; gap: 6px 18px; border: 0; padding: 0; margin: 0 0 12px; }
.change-form legend { font-size: var(--fs-s); color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.change-choices { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.change-choices input[type="number"] { width: 110px; }
.search input.wide, .change-choices input.wide { width: 130px; }
.grid tr.current td { background: #eef5fd; }
.scan-rows input.sheet-id { width: 96px; min-height: 28px; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.scan-rows tr.removed td { color: var(--text-3); background: #f4f4f7; }
.scan-rows tr.removed td.marks { text-decoration: line-through; }
.grid td.center { text-align: center; }

/* Scan import: each file's header, the test it was read as on the left and where it is saved on the right */
.scan-file-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--rule); }
.scan-file-head .file-pick { flex: 1 1 100%; margin: 0; font-size: var(--fs-m); }
.file-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.file-facts > div { display: flex; flex-direction: column; gap: 2px; }
.file-facts dt { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.file-facts dd { margin: 0; font-weight: 600; color: var(--text); }
.file-facts dd .muted { font-weight: 400; margin-left: 6px; font-size: var(--fs-xs); }
.save-to { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 12px; border-radius: 8px; background: var(--page-bg, #f5f6fa); }
.save-to-label { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.save-to select, .save-to input[type="number"] { min-height: 30px; padding: 2px 8px; }
.save-to input[type="number"] { width: 84px; }
.scan-file .error { margin-top: 0; }

/* The scan preview and lists hold inputs and checkboxes: every cell sits on the middle line. */
.scan-rows td { vertical-align: middle; }


/* Test Manager and Comments: the list on the left, the open test on the right */
.setup-layout { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.6fr); gap: 20px; align-items: start; }
.setup-list .table-wrap { max-height: 60vh; overflow: auto; }
.setup-detail h3 { font-size: var(--fs-m); margin: 22px 0 8px; }
.setup-detail h2 .muted { font-size: var(--fs-s); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; }
.form-grid label { margin: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid > p { margin: 0; }
details.card { padding: 12px 16px; }
details > summary { cursor: pointer; font-weight: 600; color: var(--navy); margin: 6px 0 10px; }
.period-grid { display: flex; flex-direction: column; gap: 8px; }
.period-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.period-row strong { width: 72px; }
.period-row input { min-height: 32px; padding: 2px 8px; }
.danger-zone.stacked { flex-direction: column; align-items: stretch; }
.danger-zone.stacked form { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
@media (max-width: 1100px) { .setup-layout { grid-template-columns: 1fr; } }

.comment-table td { white-space: normal; }
.comment-table td:nth-child(5), .comment-table td:nth-child(6) { min-width: 260px; }


/* Test Manager, reworked: the found tests fold away once a test is open; subjects are tabs; questions are edited in the table */
.found-tests > summary, .more-actions > summary, .edit-test > summary { font-weight: 600; color: var(--navy); }
.found-tests .table-wrap { max-height: 46vh; overflow: auto; margin-bottom: 10px; }
.test-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 24px; }
.test-head h2 { margin: 0; }
.edit-test { margin: 12px 0 4px; }
.subject-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 18px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.subject-tabs > a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); text-decoration: none; color: var(--text); font-weight: 500; }
.subject-tabs > a:hover { border-color: var(--blue); }
.subject-tabs > a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.subject-tabs .count { margin-left: 6px; font-size: var(--fs-xs); opacity: .7; }
.subject-tabs .add-subject { margin-left: 4px; }
.subject-tabs .add-subject > summary { list-style: none; padding: 6px 12px; border: 1px dashed var(--rule); border-radius: 999px; color: var(--blue); margin: 0; }
.subject-tabs .add-subject[open] { flex-basis: 100%; }
.subject-settings { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 10px; }
.subject-settings label { margin: 0; }
.subject-settings input[type="number"] { width: 84px; }
.dummy-count { width: 72px; }
.th-note { font-weight: 400; font-size: 0.85em; }
/* A score with its percent: the percent smaller, lighter and in brackets. */
.pct { margin-left: 3px; font-size: var(--fs-xs); color: var(--text-2); }
.subject-settings .grow { flex: 1 1 220px; }
.periods { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; background: var(--page-bg, #f5f6fa); }
.periods-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.periods .period-row strong { width: auto; font-size: var(--fs-s); }
.question-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 6px 0 8px; }
.question-head h3 { margin: 0; }
.question-head [data-save-changes] { margin-left: auto; }
.questions input { min-height: 28px; padding: 2px 6px; }
.questions .cell-answer { width: 54px; text-align: center; }
.questions .cell-cat { width: 64px; }
.questions .cat-name { margin-left: 6px; color: var(--text-2); font-size: var(--fs-xs); }
.questions .cell-desc { width: 100%; min-width: 220px; }
.questions select { min-height: 28px; padding: 2px 6px; }
.questions th.scn, .questions td.scn { background: #f7f8fb; color: var(--text-2); }
.questions td.diff, .questions td.scn.diff { background: #fde2e4; color: #9b1c27; font-weight: 600; }
.questions tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.legend-diff { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.legend-diff .swatch { width: 12px; height: 12px; border-radius: 3px; background: #fde2e4; border: 1px solid #f1aab1; }
.add-question { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 12px 0; padding: 10px 12px; border: 1px dashed var(--rule); border-radius: 8px; }
.add-question label { margin: 0; }
.add-question .grow { flex: 1 1 220px; }
.add-question strong { align-self: center; font-size: var(--fs-s); }
.more-actions { margin-top: 16px; }
.answer-preview { margin-top: 12px; }

/* Test Manager: the three online periods in one table, the online test copy beside the test period */
.periods { display: block; padding: 10px 12px; }
.period-table { border-collapse: collapse; width: 100%; }
.period-table th, .period-table td { padding: 4px 10px 4px 0; text-align: left; vertical-align: middle; font-size: var(--fs-s); }
.period-table thead th { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.period-table tbody th { width: 90px; font-weight: 600; }
.period-table input { min-height: 32px; padding: 2px 8px; width: 210px; }
.period-table td.diff { color: #9b1c27; font-weight: 600; }
.period-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: flex-end; margin-top: 8px; }

/* Fields shown together only for some choices of the form (data-show-when). */
.field-group { display: contents; }
.field-group[hidden] { display: none; }
/* Send list: the exclude list opens from a button above the list. */
.exclude-list { margin: 0 0 16px; }
.exclude-list > summary.button { display: inline-flex; list-style: none; margin: 0 0 10px; }
.exclude-list > summary::-webkit-details-marker { display: none; }
/* Class scan IDs: boxes filled from last term, not saved yet. */
input.scan-id.copied { background: rgb(246 146 30 / 12%); border-color: var(--orange); }
.search label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.search.copy-form { margin-bottom: 4px; }
/* Scan count: year levels head their columns, a rule between them. */
.scan-count th.year-group { text-align: center; }
.scan-count .group-start { border-left: 1px solid var(--rule-strong); }
