/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--bg-top), var(--bg) 20rem) no-repeat, var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--surface); color: var(--ink); padding: .6rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-control); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1 { font-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; margin: 2rem 0 .75rem; }
p, li { max-width: 68ch; }
.lead { font-size: 1.1rem; color: var(--ink-2); }
.hint { color: var(--ink-2); margin: .25rem 0 .5rem; font-size: .925rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Public frame (candidate site, signed-out staff pages) ---------- */
header.site { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem clamp(1rem, 3vw, 2rem); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
/* A 44px hit area. Only the icon-only and header brands centre their content; the sidebar brand stays left-aligned. */
a.brand { min-height: 2.75rem; min-width: 2.75rem; }
.topbar-brand, header.site a.brand { justify-content: center; }
.brand img { border-radius: 6px; }
/* The mark is solid black: invert it to white on the dark themes (the print block below undoes this). */
:root[data-theme="dark"] .brand img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .brand img { filter: invert(1); }
}
.wordmark { letter-spacing: .28em; font-weight: 700; font-size: .85rem; }
.brand-sub { color: var(--ink-2); font-size: .85rem; font-weight: 500; }
.site-tools { display: flex; align-items: center; gap: .75rem; }
main { max-width: 46rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 4rem; }
main.wide { max-width: 90rem; }
footer.site { padding: 1.25rem clamp(1rem, 3vw, 2rem) 2rem; color: var(--ink-2); font-size: .85rem; }
footer.site p { margin: .2rem 0; }

/* ---------- Cards and page heads ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); padding: 1.25rem 1.4rem; margin: 1rem 0; }
.card > :first-child, .panel > :first-child { margin-top: 0; }
.card > :last-child, .panel > :last-child { margin-bottom: 0; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
.mail-preview { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .4rem 0 0; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Buttons ---------- */
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .6rem 1.15rem; font: inherit; font-weight: 600; line-height: 1.2; border-radius: var(--r-control); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; user-select: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: transform var(--dur-press) var(--ease-out); }
.button:active { transform: scale(0.97); }
.button:hover { border-color: var(--control-border); }
.button.primary { background: linear-gradient(180deg, var(--sheen-top), var(--accent)); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { color: var(--accent-text); }
.button.danger { color: var(--critical); border-color: var(--critical); }
.button.link { padding: .25rem .1rem; border: none; background: none; box-shadow: none; color: var(--accent-text); text-decoration: underline; text-underline-offset: .18em; font-weight: 500; }
.button.link:active { transform: none; }
/* Nothing animates on any candidate test page: no press shrink, no dialog pop. */
#part-form .button:active, #gate-form .button:active, .test-bar .button:active, .test-review .button:active, .test-overview .button:active, #qmap-dialog .button:active { transform: none; }
#qmap-dialog[open] { animation: none; }
.button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.25rem 0 0; }
.secondary-action { margin-top: 1rem; }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
.field { margin: 1.25rem 0; }
.gate-check dt { font-weight: 600; margin-top: .75rem; }
.gate-check dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
fieldset { min-width: 0; }
fieldset.field { border: 1px solid var(--line); border-radius: var(--r-card); padding: 1rem 1.25rem; margin: 1.25rem 0; background: var(--surface); }
legend { font-weight: 650; padding: 0 .35rem; }
label { font-weight: 550; }
.field > label { display: block; margin-bottom: .35rem; }
.field > label.choice { display: flex; margin: .4rem 0; }
.choice { display: flex; align-items: flex-start; gap: .7rem; margin: .4rem 0; padding: .7rem .85rem; min-height: 2.75rem; border: 1px solid var(--line-table); border-radius: var(--r-control); background: var(--surface); font-weight: 400; cursor: pointer; }
.choice:hover { border-color: var(--control-border); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin: .2rem 0 0; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.rating-scale .choice { display: inline-flex; min-width: 4.5rem; margin: .4rem .5rem .4rem 0; }
input[type=url], input[type=text], input[type=email], input[type=file], .code-input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); padding: .6rem .75rem; min-height: 2.75rem; border: 1px solid var(--control-border); border-radius: var(--r-control); width: 100%; max-width: 32rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; max-width: 12rem; }
.has-error { border-left: 3px solid var(--critical); padding-left: .9rem; }
fieldset.has-error { border-color: var(--critical); }
.error { color: var(--critical); font-weight: 600; margin: .25rem 0 .5rem; }
.error:empty { display: none; }

/* ---------- Notices ---------- */
.error-summary { border: 1px solid var(--critical); background: var(--critical-soft); border-radius: var(--r-card); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.error-summary h2 { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--critical); }
.error-summary a { color: var(--critical); }
.notice, .phone-note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); box-shadow: var(--shadow-1); border-radius: var(--r-control); padding: .8rem 1rem; }
.notice.warning { border-left-color: var(--warning); }
.phone-note { display: none; }

/* ---------- Tables: crisp, 8px corners, shaded uppercase header ---------- */
/* position: relative keeps absolutely positioned cell content (sr-only text) inside the scrolling frame. */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line-table); border-radius: var(--r-table); background: var(--surface); margin: 1rem 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0; }
.table-wrap table.data { margin: 0; }
table.data th, table.data td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--line-table); vertical-align: top; }
table.data thead th { background: var(--raised); color: var(--ink-2); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
table.data tbody tr:last-child > * { border-bottom: none; }
table.data tbody th { font-weight: 600; }
table.data .num { text-align: right; }

/* ---------- Pills, statuses, stats, empty states ---------- */
.pill, .status { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .6rem; border-radius: var(--r-pill); font-size: .8rem; font-weight: 600; line-height: 1.6; background: var(--raised); color: var(--ink-2); white-space: nowrap; }
.pill[data-tone="accent"] { background: var(--accent-soft); color: var(--accent-text); }
.pill[data-tone="ok"], .status.ok { background: var(--ok-soft); color: var(--ok); }
.pill[data-tone="warning"] { background: var(--warning-soft); color: var(--warning); }
.pill[data-tone="critical"], .status.bad { background: var(--critical-soft); color: var(--critical); }
.pass { color: var(--ok); font-weight: 600; }
.fail { color: var(--critical); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); padding: 1rem 1.2rem; }
.stat-value { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.stat-label { color: var(--ink-2); font-size: .875rem; }
.empty { display: grid; justify-items: center; gap: .3rem; text-align: center; padding: 2.5rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--r-card); color: var(--ink-2); }
.empty strong { color: var(--ink); }
.one-time { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .2em; }

/* ---------- Menus (details), dialogs, theme switch ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; gap: .5rem; min-height: 2.75rem; padding: .35rem .6rem; border-radius: var(--r-control); user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover { background: var(--raised); }
.menu-panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; min-width: 14rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-2); padding: .5rem; transform-origin: top right; }
details.menu[open] > .menu-panel { animation: pop var(--dur-pop) var(--ease-out); }
.menu-panel a, .menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.75rem; padding: .5rem .7rem; border-radius: var(--r-control); color: var(--ink); text-decoration: none; font: inherit; background: none; border: none; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-item:hover { background: var(--raised); }
dialog { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); padding: 1.25rem 1.4rem; max-width: min(32rem, calc(100vw - 2rem)); }
dialog[open] { animation: pop var(--dur-dialog) var(--ease-out); }
dialog::backdrop { background: var(--backdrop); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.theme-switch { display: inline-flex; gap: 8px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.theme-switch button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2rem; border: none; border-radius: var(--r-pill); background: none; color: var(--ink-2); cursor: pointer; }
.theme-switch button::after { content: ''; position: absolute; inset: -6px -4px; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--control-border); }
.theme-swap, .theme-swap *, .theme-swap *::before, .theme-swap *::after { transition: none !important; animation: none !important; }

/* ---------- Candidate test (the v2 layout is added in Task 7) ---------- */
.prose p { white-space: pre-line; margin: 0 0 .8rem; }
pre.code { font-family: var(--mono); font-size: .875rem; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-control); padding: .75rem 1rem; overflow-x: auto; white-space: pre; }
/* Code colours, from src/shared/highlight.ts (on the server). Plain code keeps --ink. */
pre.code .tok-keyword { color: var(--code-keyword); }
pre.code .tok-string { color: var(--code-string); }
pre.code .tok-comment { color: var(--code-comment); font-style: italic; }
pre.code .tok-number { color: var(--code-number); }
pre.code .tok-key { color: var(--code-key); }
.test-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 0; margin-bottom: 1rem; background: var(--bg-top); border-bottom: 1px solid var(--line); }
.part-label { margin: 0; font-weight: 600; }
.timer { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--mono); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); border-radius: var(--r-pill); padding: .35rem .85rem; }
.timer-label { font-family: var(--font); color: var(--ink-2); font-size: .875rem; }
.timer-value { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
fieldset.question { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); padding: 1.25rem 1.4rem; margin: 0 0 1.25rem; }
.section { margin: 0 0 2rem; }
.section.with-scenario { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.scenario { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--raised); padding: 1rem 1.25rem; }
.statements { margin: .5rem 0 .75rem 1.25rem; }
.q-number { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); }
.save-state { min-height: 1.3rem; color: var(--ink-2); font-size: .875rem; margin: 0 0 .5rem; }
.next-note { color: var(--ink-2); }
/* Closed-book sections: question text, statements, options and the scenario cannot be selected (candidate.js also blocks
   copy, cut, the context menu and dragging). The controls themselves stay fully usable; screen readers still read it all. */
#part-form .question, #part-form .question *, #part-form .scenario, #part-form .scenario * { -webkit-user-select: none; user-select: none; }
.leave-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 1rem; }
.leave-notice p { margin: 0; }
.print-only { display: none; }

/* ---------- Staff app shell ---------- */
.app-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.1rem .8rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar .brand { padding: .25rem .6rem; min-height: 2.75rem; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-list li { max-width: none; }
.nav-list a { display: flex; align-items: center; gap: .65rem; min-height: 2.75rem; padding: .45rem .7rem; border-radius: var(--r-control); border: 1px solid transparent; color: var(--ink-2); text-decoration: none; font-weight: 550; }
.nav-list a:hover { color: var(--ink); background: var(--raised); }
.nav-list a[aria-current="page"] { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1); }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem; padding: .6rem clamp(1rem, 3vw, 2rem); background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-section { margin: 0; font-weight: 600; color: var(--ink-2); }
.topbar-brand { display: none; min-height: 2.75rem; align-items: center; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.nav-menu { display: none; }
.nav-menu .menu-panel { left: 0; right: auto; transform-origin: top left; }
.app-main main { max-width: 72rem; width: 100%; margin: 0; padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; }
.app-main main.wide { max-width: 90rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 700; }
.menu-meta { display: grid; gap: .1rem; padding: .5rem .7rem .7rem; margin: 0 0 .35rem; border-bottom: 1px solid var(--line); font-size: .875rem; color: var(--ink-2); }
.menu-meta strong { color: var(--ink); }

/* ---------- Interview kit and result page ---------- */
.kit-item + .kit-item { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.back-link a { display: inline-flex; align-items: center; gap: .25rem; min-height: 2.75rem; }

/* ---------- Interview mode (interview library spec 6): the question card beside a slim side panel; stacked when narrow ---------- */
.mode-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 0 1.5rem; align-items: start; }
.mode-main, .mode-side { min-width: 0; }
.mode-side .card { padding: 1rem 1.1rem; }
.mode-meta { margin: 0 0 .5rem; color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.mode-ask { margin: 0 0 1rem; max-width: none; font-size: 1.35rem; line-height: 1.4; font-weight: 650; }
.mode-context { margin: 0 0 1rem; max-width: none; color: var(--ink-2); font-size: .95rem; font-weight: 400; }
.mode-list { margin: .25rem 0 .5rem; padding-left: 1.1rem; }
.mode-list li { margin: .2rem 0; }
.mode-change { margin-top: .75rem; }
.mode-change > summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent-text); font-weight: 550; }
@media (max-width: 900px) {
  .mode-layout { grid-template-columns: minmax(0, 1fr); }
}
/* The split question screen (interview day design 2): the question card has one column of tick lines and side-by-side
   probes; the score card (first in the side column) has one row per factor (the label and a segmented 1-4 / Not seen
   control on one line, the hint as one small line under them, its full text in a tooltip), the note toggle and Save
   score on one row, and the moves under a thin divider. Scoped to mode-* classes, so the shared .choice and
   .rating-scale styles elsewhere do not change. */
.mode-question .mode-ask { margin-bottom: .6rem; }
.mode-question .mode-context { margin-bottom: .6rem; }
.mode-question h3 { margin: 0 0 .25rem; font-size: .9rem; font-weight: 650; color: var(--ink-2); }
.mode-look { border: 0; padding: 0; margin: .5rem 0 .6rem; }
.mode-look > legend { padding: 0; margin-bottom: .2rem; font-size: .9rem; color: var(--ink-2); }
.mode-ticks { display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem 0; }
.mode-tick { display: flex; align-items: flex-start; gap: .5rem; padding: .2rem 0; font-size: .95rem; font-weight: 400; line-height: 1.4; cursor: pointer; }
.mode-tick input { margin: .2rem 0 0; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.mode-probes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; margin: 0 0 .6rem; font-size: .9rem; }
.mode-probes ul { margin: 0; padding-left: 1.1rem; }
.mode-probes li { margin: .1rem 0; max-width: none; }
.mode-scores-hint { margin: 0 0 .3rem; font-size: .8rem; }
.mode-factor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .1rem .5rem; border: 0; border-top: 1px solid var(--line); padding: .25rem 0; margin: 0; }
.mode-factor > legend { float: left; grid-column: 1; grid-row: 1; padding: 0; font-size: .9rem; font-weight: 600; }
.mode-factor-hint { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: .75rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-segs { grid-column: 2; grid-row: 1; justify-self: end; display: inline-flex; border: 1px solid var(--control-border); border-radius: var(--r-control); overflow: hidden; }
.mode-seg { position: relative; display: inline-flex; font-weight: 500; cursor: pointer; }
.mode-seg + .mode-seg { border-left: 1px solid var(--control-border); }
.mode-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* Direct children only: Not seen's segment holds two inner spans (the dash and its screen-reader name). */
.mode-seg > span { display: inline-flex; align-items: center; justify-content: center; min-width: 1.85rem; min-height: 2.1rem; padding: 0 .35rem; font-size: .9rem; background: var(--surface); color: var(--ink); }
.mode-seg:hover > span { background: var(--accent-soft); }
.mode-seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.mode-seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -3px; }
.mode-note { flex: 1 1 auto; margin: 0; }
.mode-note[open] { flex-basis: 100%; }
.mode-note > summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 2.25rem; color: var(--accent-text); font-weight: 550; font-size: .9rem; }
.mode-note > .field { margin: .25rem 0 .5rem; }
.mode-save { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: .35rem 0 0; }
.mode-save .button { min-height: 2rem; padding: .2rem .75rem; font-size: .85rem; }
.mode-save .save-state { margin: 0; }
.mode-moves { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .5rem; }
.mode-moves .actions { gap: .4rem; margin-top: .4rem; }
.mode-moves .button { min-height: 2.25rem; padding: .3rem .8rem; font-size: .9rem; }
/* Interview mode keeps the page head small, so the question and the score card start high on a laptop screen. */
.mode-head { margin-bottom: .75rem; }
.mode-head h1 { font-size: 1.6rem; }
.mode-head p { margin-top: .15rem; }
.mode-moves .hint { margin: .25rem 0 0; }
.mode-score h3 { margin: 0 0 .25rem; font-size: .9rem; font-weight: 650; }
.mode-score h3.mode-lead, .mode-question h3.mode-lead { color: var(--ink); font-size: .95rem; }
.mode-side .mode-score .card-title { margin-bottom: .35rem; }
@media (max-width: 48rem) {
  .mode-probes { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- Candidate test v2 ---------- */
[hidden] { display: none !important; }
.overview-list { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; gap: .6rem; }
.overview-list li { max-width: none; display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); padding: .9rem 1.1rem; }
.overview-step { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--raised); font-family: var(--mono); font-weight: 600; }
.rules li { margin: .35rem 0; }
.test-bar-tools { display: flex; align-items: center; gap: .6rem; }
.test-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.qmap { position: sticky; top: 5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); padding: 1rem; }
dialog .qmap { position: static; box-shadow: none; border: none; padding: 0; }
.qmap-title { margin: 0 0 .6rem; font-weight: 700; font-size: .9rem; }
.qmap-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: .35rem; }
.qmap-item { position: relative; display: flex; align-items: center; justify-content: center; min-height: 2.75rem; border: 1px solid var(--line-table); border-radius: var(--r-control); color: var(--ink); background: var(--surface); text-decoration: none; font-family: var(--mono); font-weight: 600; }
.qmap-item[data-answered="yes"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.qmap-item[data-flagged="yes"] { border-color: var(--warning); }
.qmap-item[data-flagged="yes"]::after { content: ''; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 2px var(--surface); }
.qmap-item[aria-current="step"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.qmap-legend { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .25rem; font-size: .8rem; color: var(--ink-2); }
.qmap-legend li { display: flex; align-items: center; gap: .45rem; }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; border: 1px solid var(--line-table); }
.swatch.answered { background: var(--accent); border-color: var(--accent); }
.swatch.flagged { background: var(--warning); border-color: var(--warning); border-radius: 50%; }
.swatch.current { outline: 2px solid var(--ink); outline-offset: 1px; }
.qmap-open { display: none; }
.options { display: grid; margin-top: .75rem; }
.flag-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin-top: .75rem; padding: .35rem .75rem; border-radius: var(--r-pill); color: var(--ink-2); font-weight: 550; cursor: pointer; user-select: none; }
.flag-toggle:hover { color: var(--ink); background: var(--raised); }
.flag-toggle input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--warning); }
.flag-toggle:has(input:checked) { color: var(--warning); background: var(--warning-soft); }
.test-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.test-actions-gap { flex: 1; }
.timer-off { display: none; font-family: var(--font); color: var(--ink-2); font-size: .875rem; }
.timer[data-hidden="yes"] .timer-value { display: none; }
.timer[data-hidden="yes"] .timer-off { display: inline; }
.timer[data-hidden="yes"][data-warn] .timer-value { display: inline; }
.timer[data-hidden="yes"][data-warn] .timer-off { display: none; }
.timer[data-warn="warning"] { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.timer[data-warn="critical"] { border-color: var(--critical); background: var(--critical-soft); color: var(--critical); }
.timer-toggle { position: relative; font: inherit; font-family: var(--font); font-size: .8rem; color: var(--accent-text); background: none; border: none; text-decoration: underline; cursor: pointer; padding: .25rem; }
.timer-toggle::after { content: ''; position: absolute; inset: -10px -4px; }
.review-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.review-list a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .3rem .8rem; border: 1px solid var(--line-table); border-radius: var(--r-control); text-decoration: none; }
.timeline { list-style: none; margin: .5rem 0 0; padding: 0; border-left: 2px solid var(--line-table); }
.timeline li { max-width: none; margin: 0 0 .6rem; padding-left: .9rem; }
.timeline time { display: block; font-family: var(--mono); font-size: .8rem; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.chips a { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .3rem .85rem; border: 1px solid var(--line-table); border-radius: var(--r-pill); text-decoration: none; color: var(--ink); }
.chips a[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem 1.5rem; margin: 0; }
.profile-grid dt { font-size: .8rem; color: var(--ink-2); }
.profile-grid dd { margin: 0; }
/* Menus inside an action row open to the right, so they stay within their card. */
.actions details.menu .menu-panel { left: 0; right: auto; transform-origin: top left; }

/* ---------- Candidate list at scale (milestone 5): view chips, filter toolbar, dense sortable table, pager ---------- */
.views { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .25rem 0 .75rem; padding: 0; list-style: none; }
.views li { max-width: none; }
.views a, .views details.view-save > summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .3rem .8rem; border: 1px solid var(--line-table); border-radius: var(--r-pill); color: var(--ink); text-decoration: none; font-weight: 550; font-size: .9rem; background: var(--surface); }
.views a .n { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); }
.views a[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.views a[aria-current="true"] .n { color: var(--accent-text); }
.views details.view-save > summary { color: var(--accent-text); border-style: dashed; }
.views details.view-save .menu-panel { left: 0; right: auto; transform-origin: top left; min-width: 18rem; padding: .75rem 1rem; }
.views details.view-save .field { margin: 0 0 .75rem; }
.views .view-saved { display: inline-flex; align-items: center; gap: .1rem; }
.views .view-delete { min-height: 2.75rem; padding: .25rem .5rem; font-size: .85rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin: .5rem 0 .25rem; }
.toolbar .field { margin: 0; }
.toolbar label { display: block; font-size: .8rem; color: var(--ink-2); font-weight: 600; margin-bottom: .2rem; }
.toolbar select, .toolbar input[type=search] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--r-control); min-height: 2.75rem; padding: .45rem .65rem; width: auto; min-width: 10rem; max-width: none; }
.toolbar input[type=search] { min-width: 16rem; width: 100%; }
.toolbar .grow { flex: 1; }
.toolbar-actions { display: flex; align-items: center; gap: .75rem; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--ink-2); font-size: .9rem; margin: .75rem 0 .5rem; max-width: none; }
table.data.dense th, table.data.dense td { padding: .5rem .7rem; }
table.data.dense tbody tr:hover { background: var(--accent-soft); }
table.data th .sort { display: inline-flex; align-items: center; gap: .2rem; min-height: 1.5rem; color: inherit; text-decoration: none; }
table.data th .sort:hover { color: var(--ink); text-decoration: underline; }
table.data th .sort .icon { width: 12px; height: 12px; }
.cell-name a { font-weight: 600; color: var(--ink); text-decoration: none; }
.cell-name a:hover { color: var(--accent-text); text-decoration: underline; }
.cell-sub { display: block; color: var(--ink-2); font-size: .8rem; }
.pill .icon { width: 14px; height: 14px; }
td.num .pill { font-family: var(--font); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .75rem 0 0; color: var(--ink-2); font-size: .9rem; }
.pager .actions { margin: 0; }
/* Bulk actions (milestone 5 spec 4): the tick column, and the bar that holds the bulk form's buttons. */
table.data td.sel, table.data th.sel { width: 2.5rem; padding-right: 0; }
.bulk-bar { position: sticky; bottom: 1rem; z-index: 6; margin: 1rem 0 0; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--shadow-2); }
.bulk-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; }
.bulk-bar .count { font-weight: 700; margin-right: .4rem; }
.bulk-bar .button { min-height: 2.5rem; padding: .45rem .9rem; }
.bulk-bar .spacer { flex: 1; }
.export-form { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; margin: 0; max-width: 28rem; text-align: right; }
.export-form .button.link { min-height: 2.75rem; }
.export-form .hint { margin: 0; font-size: .8rem; }
/* Candidate page: Applications at a glance, with a step tracker (milestone 5 spec 5). */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .25rem; }
.card-head .card-title { margin: 0; }
.card-head .hint { margin: 0; font-size: .875rem; }
.card-sub { color: var(--ink-2); font-size: .875rem; margin: 0 0 .75rem; }
.app-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.app-list > li { max-width: none; border: 1px solid var(--line-table); border-radius: var(--r-card); padding: .9rem 1.1rem; background: var(--surface); }
.app-list > li[data-state="closed"] { background: var(--bg-top); }
.app-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; flex-wrap: wrap; }
.app-row h3 { margin: 0; font-size: 1rem; }
.app-row h3 a { color: var(--ink); text-decoration: none; }
.app-row h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.app-meta { color: var(--ink-2); font-size: .85rem; margin: .15rem 0 0; }
.app-next { margin: .6rem 0 0; font-size: .9rem; max-width: none; }
.app-next strong { font-weight: 650; }
.stepper { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: .9rem 0 .2rem; padding: 0; }
.stepper li { max-width: none; position: relative; display: grid; justify-items: center; gap: .3rem; text-align: center; font-size: .78rem; color: var(--ink-2); }
.stepper li::before { content: ''; position: absolute; top: .7rem; left: -50%; right: 50%; height: 2px; background: var(--line-table); }
.stepper li:first-child::before { display: none; }
.stepper li[data-s="done"]::before, .stepper li[data-s="current"]::before, .stepper li[data-s="stopped"]::before { background: var(--accent); }
.stepper .dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.stepper .dot .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.stepper li[data-s="done"] .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepper li[data-s="current"] .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper li[data-s="current"] .dot::after { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }
.stepper li[data-s="stopped"] .dot { background: var(--critical-soft); border-color: var(--critical); color: var(--critical); }
.stepper li[data-s="current"], .stepper li[data-s="stopped"] { color: var(--ink); font-weight: 650; }
.stepper .when { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); font-weight: 400; }
/* Opening page: the pipeline strip (milestone 5 spec 6). */
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .5rem; margin: .5rem 0 .5rem; padding: 0; }
.pipeline li { max-width: none; }
.pipeline a { display: grid; align-content: start; gap: .1rem; padding: .7rem .85rem; border: 1px solid var(--line-table); border-radius: var(--r-control); background: var(--surface); color: var(--ink); text-decoration: none; min-height: 4.75rem; }
.pipeline a:hover { border-color: var(--control-border); }
.pipeline a[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pipeline .n { font-family: var(--mono); font-size: 1.35rem; font-weight: 600; }
.pipeline .s { font-size: .82rem; color: var(--ink-2); font-weight: 550; }
.pipeline .o { font-size: .75rem; color: var(--warning); font-weight: 650; display: inline-flex; align-items: center; gap: .25rem; }
.pipeline .o .icon { width: 12px; height: 12px; }
/* Home (milestone 5 spec 7): key-number tiles that are links, the ranked to-do list, Coming up, two columns. */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 0 1.25rem; align-items: start; }
/* A wide table scrolls inside its frame; it never widens the column or the page. */
.grid-2 > * { min-width: 0; }
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--line-strong); }
a.stat:hover .stat-label { color: var(--ink); text-decoration: underline; }
.stat-delta { display: block; font-size: .8rem; color: var(--ink-2); margin-top: .15rem; }
.stat-delta .up { color: var(--ok); font-weight: 600; }
.stat-delta .down { color: var(--critical); font-weight: 600; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { max-width: none; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line); }
.todo.plain li { grid-template-columns: minmax(0, 1fr) auto; }
.todo li:first-child { border-top: none; padding-top: .2rem; }
.todo .count { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.15rem; text-align: right; }
.todo .what { min-width: 0; }
.todo .what a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; }
.todo .what a:hover { color: var(--accent-text); text-decoration: underline; }
.todo .why { display: block; color: var(--ink-2); font-size: .85rem; }
.todo-done { color: var(--ink-2); display: flex; align-items: center; gap: .5rem; margin: .25rem 0 0; }
.notices { list-style: none; margin: .75rem 0 0; padding: .5rem 0 0; border-top: 1px solid var(--line); }
.notices li { max-width: none; }
.notices a { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; }
.notices a:hover { color: var(--accent-text); text-decoration: underline; }
/* Scheduling a Teams interview (milestone 6, schedule.html): the availability grid from free/busy (free or busy only),
   the suggested times and the Microsoft 365 badge. The grid is a table, so it fits any length of working hours. */
/* Quarter-hour columns (interview day spec, 2026-11-12): a faint 1px gap between quarters and a wide gap before each
   :00 column (q0), so four blocks read as one hour. The gaps are transparent borders, so they suit both themes. */
.avail { width: 100%; min-width: 46rem; table-layout: fixed; border-collapse: separate; border-spacing: 0 2px; font-size: .78rem; margin: 0; }
.avail th { text-align: left; font-weight: 400; }
.avail thead th { color: var(--ink-2); font-family: var(--mono); font-size: .72rem; padding: .2rem 0 0 .1rem; white-space: nowrap; overflow: visible; }
.avail thead th.q0 { border-left: 1px solid var(--line-strong); padding-left: .2rem; }
.avail td.q0, .avail td.q1, .avail td.q2, .avail td.q3 { border-left: 1px solid transparent; background-clip: padding-box; }
.avail td.q0 { border-left-width: 4px; }
.avail thead th:first-child, .avail tbody th { width: 9rem; }
.avail tbody th { font-weight: 600; font-size: .85rem; padding: 0 .5rem; overflow-wrap: anywhere; }
.avail td { border-radius: 2px; background: var(--raised); height: 2.25rem; padding: 0; }
.avail td.busy { background: var(--line-strong); }
.avail td.free-all { background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.avail td.not-all { background: none; }
.avail td.unavailable { background: none; color: var(--ink-2); padding: 0 .5rem; font-size: .85rem; }
.avail tr.everyone th { color: var(--ink-2); font-weight: 400; font-size: .8rem; }
.avail-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .8rem; color: var(--ink-2); margin: 1rem 0 .5rem; padding: 0; list-style: none; }
.avail-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.sw { display: inline-block; width: 1rem; height: .8rem; border-radius: 3px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-table); }
.sw.busy { background: var(--line-strong); box-shadow: none; }
.sw.free-all { background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.slots { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.slots .choice { margin: 0; min-width: 11rem; }
.ms-badge { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--ink-2); border: 1px solid var(--line-table); border-radius: var(--r-pill); padding: .2rem .7rem; }
.ms-badge .sq { display: inline-grid; grid-template-columns: 6px 6px; gap: 1px; }
.ms-badge .sq i { width: 6px; height: 6px; background: var(--ink-2); }
.up-day { margin: 1rem 0 .1rem; color: var(--ink-2); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.up-list { list-style: none; margin: 0; padding: 0; }
.up-list li { max-width: none; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .65rem 0; border-top: 1px solid var(--line); }
.up-list li:first-child { border-top: none; padding-top: .2rem; }
.up-list time { font-family: var(--mono); font-size: .85rem; font-weight: 600; }
.up-list .who a { font-weight: 600; color: var(--ink); text-decoration: none; }
.up-list .who a:hover { color: var(--accent-text); text-decoration: underline; }
.up-list .meta { display: block; color: var(--ink-2); font-size: .82rem; }
.up-list .join { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.row-actions .button, td > .button { min-height: 2.5rem; padding: .4rem .85rem; }
.card-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
a.pill-link { display: inline-flex; text-decoration: none; }
a.pill-link:hover .pill { text-decoration: underline; }
.strip-note { margin: 0; font-size: .875rem; }
.strip-note a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.card-head + .notices { margin-top: .25rem; padding-top: 0; border-top: none; }
/* Insights (milestone 5 spec 8): one series in the accent, amber only for over target, text in the text tokens. SVGs are
   sized by their attributes; these rules only colour them. */
.report-form { margin: 0; }
.chart-box { overflow-x: auto; }
.chart { display: block; width: 100%; height: auto; min-width: 30rem; overflow: visible; }
.chart .bar, .hb-bar .bar, .minibar .bar { fill: var(--accent); }
.chart .track, .hb-bar .track, .minibar .track { fill: var(--raised); }
.hb-bar .bar-warn { fill: var(--warning); }
.chart .grid { stroke: var(--line-table); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .target, .hb-bar .target { stroke: var(--ink); stroke-width: 2; }
.chart .target-halo, .hb-bar .target-halo { stroke: var(--surface); stroke-width: 6; }
.chart text { fill: var(--ink-2); font-family: var(--font); font-size: 12px; }
.chart .tick { font-family: var(--mono); font-size: 11px; }
.chart .note { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
.chart rect.bar:hover, .hbars li:hover .bar, tr:hover .minibar .bar { fill: var(--accent-hover); }
/* Dark themes: --accent-hover is close to the track, so a hovered bar uses the lighter accent text colour (over 3:1). */
:root[data-theme="dark"] .chart rect.bar:hover, :root[data-theme="dark"] .hbars li:hover .bar, :root[data-theme="dark"] tr:hover .minibar .bar { fill: var(--accent-text); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .chart rect.bar:hover, :root[data-theme="system"] .hbars li:hover .bar, :root[data-theme="system"] tr:hover .minibar .bar { fill: var(--accent-text); }
}
.hbars { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .55rem; }
.hbars li { max-width: none; display: grid; grid-template-columns: 10.5rem minmax(5rem, 1fr) 3.75rem minmax(7rem, 11rem); align-items: center; gap: .65rem; }
.hb-label { font-size: .875rem; font-weight: 550; }
.hb-bar svg { display: block; overflow: visible; }
.hb-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: .875rem; text-align: right; }
.hb-note { font-size: .8rem; color: var(--ink-2); }
.hb-more { display: block; }
.hb-note a { display: inline-flex; align-items: center; min-height: 1.75rem; }
.minibar { display: inline-block; vertical-align: middle; }
details.table-view { margin-top: .75rem; }
details.table-view > summary { cursor: pointer; color: var(--accent-text); font-size: .875rem; font-weight: 550; min-height: 2.75rem; display: inline-flex; align-items: center; }
details.table-view .table-wrap { margin: .25rem 0 0; }
.howto { display: flex; gap: .5rem; align-items: flex-start; max-width: none; color: var(--ink-2); font-size: .85rem; background: var(--raised); border-radius: var(--r-control); padding: .5rem .7rem; margin: .75rem 0 0; }
.howto .icon { margin-top: .15rem; }
.howto strong { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .hbars li { grid-template-columns: 1fr 3.5rem; }
  .hb-bar { grid-column: 1 / -1; grid-row: 2; }
  .hb-note { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .toolbar select, .toolbar input[type=search] { min-width: 0; width: 100%; }
  .toolbar .field { flex: 1 1 100%; }
  .stepper { grid-auto-flow: row; grid-auto-columns: auto; gap: .6rem; }
  .stepper li { grid-template-columns: 1.45rem auto 1fr; justify-items: start; text-align: left; align-items: center; gap: .6rem; }
  .stepper .when { justify-self: end; }
  .stepper li::before { display: none; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .up-list li { grid-template-columns: 1fr; gap: .2rem; }
}

@media (max-width: 900px) {
  .avail thead th:first-child, .avail tbody th { width: 6.5rem; }
  .todo li { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .todo.plain li { grid-template-columns: minmax(0, 1fr); }
  .todo li > .pill { grid-column: 2; justify-self: start; }
  .todo.plain li > .pill { grid-column: 1; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .nav-menu { display: block; }
  .topbar-brand { display: inline-flex; }
  .account-name { display: none; }
  .section.with-scenario { grid-template-columns: 1fr; }
  .scenario { position: static; max-height: none; }
  .test-layout { grid-template-columns: 1fr; }
  .js .qmap-home { display: none; }
  .js .qmap-open { display: inline-flex; }
}
@media (max-width: 720px) {
  .phone-note { display: block; }
}
@media (max-width: 420px) {
  .topbar-section { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .button:active { transform: none; }
  @keyframes pop { from { opacity: 0; } }
}
@media print {
  .app-main main, .app-main main.wide { max-width: none; padding: 0; }
  .sidebar, .topbar { display: none !important; }
  :root[data-theme] .brand img { filter: none; }
  .app-shell { display: block; }
  header.site, footer.site, .no-print, .button, .theme-switch { display: none !important; }
  body { background: #fff; color: #000; }
  main, main.wide { max-width: none; padding: 0; }
  .card, .panel, .stat, fieldset.question, .table-wrap { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  table.data thead th { background: #eee; color: #000; }
  h2 { break-after: avoid; }
  .kit-item { break-inside: avoid; }
  .card:has(.kit-item) { break-inside: auto; }
  /* A test section prints only this line: everything after it in main (the questions, the map, the notice) is hidden. */
  .print-only, .print-only[hidden] { display: block !important; }
  .print-only ~ *, .phone-note { display: none !important; }
}
.auth-card { max-width: 28rem; margin: 2rem auto; }
.auth-card h1 { font-size: 1.75rem; }
