/* SPN tax return platform: one stylesheet, no build step, no external fonts.
   Staff screens are dense and desktop-first; the client portal is large-type,
   single-column and works from 360 px. Contrast is WCAG AA or better. */

:root {
  --ink: #1b2430;
  --ink-soft: #4a5565;
  --muted: #5f6b7a;
  --line: #d6dbe1;
  --line-soft: #e8ebef;
  --paper: #ffffff;
  --page: #f4f5f2;
  --brand: #12395b;
  --brand-ink: #ffffff;
  --accent: #0d5c8f;
  --accent-soft: #e3eef7;
  --ok: #1f6b3a;
  --ok-soft: #e1f1e6;
  --warn: #8a4b00;
  --warn-soft: #fbeedb;
  --bad: #a12222;
  --bad-soft: #f8e1e1;
  --info: #1e4f86;
  --info-soft: #e2ebf7;
  --focus: #f2b01e;
  --radius: 6px;
  --gap: 1rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--page); line-height: 1.45; font-size: 16px; }
body.portal { font-size: 19px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
.portal h1 { font-size: 1.75rem; }
.portal h2 { font-size: 1.3rem; }
.portal h3 { font-size: 1.1rem; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .9em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }
.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; }

/* ---------------------------------------------------------------- frame */
.wrap { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.portal .wrap { max-width: 760px; }
main.wrap { min-height: 70vh; }
main:focus { outline: none; }

.top { background: var(--brand); color: var(--brand-ink); }
.top-inner { max-width: 1280px; margin: 0 auto; padding: .5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.portal .top-inner { max-width: 760px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.brand:hover { color: var(--brand-ink); }
.brand-mark { display: inline-block; padding: .15rem .45rem; border: 2px solid var(--brand-ink); border-radius: 4px; letter-spacing: .08em; font-size: .85rem; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.nav a { color: var(--brand-ink); text-decoration: none; padding: .4rem .65rem; border-radius: var(--radius); }
.nav a:hover { background: rgba(255,255,255,.12); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.2); font-weight: 600; }
.who { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.who .quiet-link, .who .btn-quiet { color: var(--brand-ink); }
.who .btn-quiet { border-color: rgba(255,255,255,.5); background: transparent; }
.who .btn-quiet:hover { background: rgba(255,255,255,.12); color: var(--brand-ink); }
.foot { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); margin-top: 2rem; }

.page-head { margin: .5rem 0 1rem; }
.lede { color: var(--ink-soft); font-size: 1.05em; max-width: 70ch; }
.crumbs { font-size: .9rem; margin: .25rem 0 .75rem; color: var(--muted); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin: 0 0 1rem; }
.card.narrow { max-width: 30rem; margin: 2rem auto; }
.card.empty { text-align: center; color: var(--ink-soft); padding: 2rem 1rem; }
.card.highlight { border: 2px solid var(--accent); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--gap); align-items: start; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--gap); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: var(--gap); }
.tile { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile h2 { color: var(--accent); }

/* ---------------------------------------------------------------- text bits */
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hint { color: var(--muted); font-size: .85em; font-weight: normal; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.notice { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: .5rem .75rem; border-radius: 0 var(--radius) var(--radius) 0; }
.reply { background: var(--info-soft); border-left: 4px solid var(--info); padding: .5rem .75rem; border-radius: 0 var(--radius) var(--radius) 0; }
blockquote { margin: .25rem 0 .5rem; padding: .25rem .75rem; border-left: 3px solid var(--line); color: var(--ink-soft); }
pre.letter { white-space: pre-wrap; font-family: var(--font); background: var(--page); padding: 1rem; border-radius: var(--radius); }
.secret { font-size: 1.4rem; padding: .25rem .5rem; background: var(--accent-soft); border-radius: 4px; user-select: all; }

/* ---------------------------------------------------------------- messages */
.messages { margin: 0 0 1rem; }
.msg { border-radius: var(--radius); padding: .65rem .9rem; margin-bottom: .5rem; border: 1px solid; }
.msg p { margin: 0; }
.msg ul { margin: .35rem 0 0; padding-left: 1.25rem; }
.msg-ok { background: var(--ok-soft); border-color: #a9d4b5; }
.msg-info { background: var(--info-soft); border-color: #b5cbe7; }
.msg-error { background: var(--bad-soft); border-color: #e3a9a9; color: #5c1010; }
.msg-ack { background: var(--ok-soft); border: 2px solid var(--ok); font-size: 1.05em; }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--line-soft); color: var(--ink); white-space: nowrap; border: 1px solid transparent; }
.portal .chip { font-size: .9rem; padding: .2rem .65rem; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: #a9d4b5; }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-muted { background: var(--line-soft); color: var(--muted); }
.chip-soft { background: var(--accent-soft); color: var(--accent); }
.chip-todo { background: var(--paper); color: var(--ink); border-color: var(--ink-soft); }
.chip-flag { background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.chip-flag-assessment_differs, .chip-flag-promise_passed { background: var(--bad-soft); color: var(--bad); }
.chip-state { background: var(--accent-soft); color: var(--brand); }
.chip-on_hold, .chip-sars_query { background: var(--warn-soft); color: var(--warn); }
.chip-assessed, .chip-approved, .chip-submitted { background: var(--ok-soft); color: var(--ok); }
.chip-closed_no_return { background: var(--line-soft); color: var(--muted); }
.chip-ready_for_review { background: #efe5f7; color: #5a2a85; }
.chip-st-filed, .chip-st-not_required { background: var(--ok-soft); color: var(--ok); }
.chip-st-held, .chip-st-escalated { background: var(--info-soft); color: var(--info); }
.chip-st-outstanding { background: var(--paper); border-color: var(--ink-soft); }
.chip-st-promised, .chip-st-on_its_way, .chip-st-in_progress { background: var(--accent-soft); color: var(--accent); }
.chip-dec-file { background: var(--ok-soft); color: var(--ok); }
.chip-dec-flag { background: var(--warn-soft); color: var(--warn); }
.chip-dec-hold, .chip-dec-block { background: var(--info-soft); color: var(--info); }
.chip-rule-approved { background: var(--ok-soft); color: var(--ok); }
.chip-rule-proposed { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------------------------- forms */
label, .label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .2rem; }
.portal label { font-size: 1rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input:not([type]), input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: .45rem .55rem; border: 1px solid #9aa4b1; border-radius: 4px; background: var(--paper); min-height: 2.4rem; }
.portal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .portal select, .portal textarea { min-height: 3rem; padding: .6rem .7rem; }
input[type="file"] { max-width: 100%; padding: .4rem 0; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; vertical-align: middle; margin-right: .35rem; }
.portal input[type="checkbox"], .portal input[type="radio"] { width: 1.4rem; height: 1.4rem; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .85rem .75rem; margin: 0 0 .75rem; }
legend { font-weight: 600; padding: 0 .25rem; }
fieldset.choices label { font-weight: normal; display: block; margin: .3rem 0; }
.stack > * + * { margin-top: .5rem; }
.stack > label { margin-top: .75rem; }
.stack.compact > label { margin-top: .4rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; margin: .5rem 0; }
.row > div { min-width: 9rem; }
.row > .grow { flex: 1 1 14rem; }
.row.compact { margin: .25rem 0; }
.row-go { min-width: 0 !important; }
.inline { display: inline-block; margin: .15rem .25rem .15rem 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .85rem; margin-bottom: 1rem; }
.filters > div { min-width: 9rem; }
.filters-go { min-width: 0 !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .45rem .9rem; min-height: 2.4rem; border: 1px solid var(--accent); background: var(--paper); color: var(--accent); border-radius: 4px; cursor: pointer; text-decoration: none; font-weight: 600; line-height: 1.2; }
.btn:hover { background: var(--accent-soft); color: var(--brand); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--brand); color: #fff; }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-quiet { border-color: var(--line); color: var(--ink-soft); font-weight: 500; }
.btn-small { padding: .25rem .6rem; min-height: 2rem; font-size: .875rem; }
.btn-big { min-height: 3rem; padding: .6rem 1.2rem; font-size: 1.05rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.quiet-link { color: var(--ink-soft); font-size: .9rem; }
details > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: .35rem 0; }
details[open] > summary { margin-bottom: .35rem; }
.inline-details { display: inline-block; }
.inline-details > summary { display: inline-flex; list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] { display: block; background: var(--page); padding: .5rem; border-radius: var(--radius); margin-top: .25rem; }
.inline-h { display: inline; font-size: 1.2rem; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin: .5rem 0 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: .45rem .6rem; border-bottom: 1px solid var(--line-soft); }
.table thead th { background: #eef1f4; position: sticky; top: 0; z-index: 1; font-size: .82rem; text-transform: none; color: var(--ink-soft); white-space: nowrap; }
.table thead th a { color: inherit; text-decoration: none; }
.table thead th a:hover { text-decoration: underline; }
.table tbody tr:hover { background: #fafbfc; }
.table-dense th, .table-dense td { padding: .3rem .5rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.table caption { text-align: left; font-weight: 600; padding: .25rem 0; }
.table tr.superseded td { color: var(--muted); text-decoration: line-through; }
.table tr.refused td { background: #fff7f7; }
.clerks input { min-width: 6rem; }

/* ---------------------------------------------------------------- case page */
.case-head { display: grid; gap: .5rem; }
.case-title h1 { margin-bottom: .25rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: .5rem 1rem; margin: .25rem 0; }
.facts dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.facts dd { margin: 0; font-weight: 600; }
.moves { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: .75rem; }
.move { border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .8rem; }
.move.ready { border-left: 4px solid var(--ok); }
.move.blocked { border-left: 4px solid var(--warn); }
.move-head { margin-bottom: .25rem; }
.blockers { margin: 0 0 .5rem; padding-left: 1.1rem; font-size: .9rem; color: var(--warn); }
.action { border-top: 1px solid var(--line-soft); padding: .75rem 0; }
.action:first-of-type { border-top: 0; }
.checks { list-style: none; padding: 0; }
.checks li { margin: .25rem 0; }
.variance { border-left: 3px solid var(--line); padding-left: .75rem; margin: .5rem 0; }
.escalations, .comments { list-style: none; padding: 0; margin: 0; }
.escalation { border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .8rem; margin-bottom: .6rem; }
.escalation.open { border-left: 4px solid var(--warn); }
.comments li { border-bottom: 1px solid var(--line-soft); padding: .4rem 0; }
.comments p { margin: .15rem 0 0; }
.versions { padding-left: 1.2rem; }
.versions li { margin: .5rem 0; }
.sentences dt { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.sentences dd { margin: 0 0 .25rem; }
.inline-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.rows { list-style: none; padding: 0; margin: 0 0 .75rem; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-bottom: 1px solid var(--line-soft); padding: .3rem 0; }
.doc-actions { display: flex; flex-wrap: wrap; gap: .25rem; align-items: flex-start; }
.item-status { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.item-status select, .item-status input { width: auto; min-height: 2rem; padding: .2rem .4rem; }
.bulk { margin-top: .5rem; }

/* ---------------------------------------------------------------- progress (D-11: 90 + 10) */
.progress-wrap { margin: .5rem 0 1rem; }
.progress { position: relative; display: flex; height: 1rem; background: var(--line-soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.portal .progress { height: 1.4rem; }
.progress-client { display: block; height: 100%; background: var(--accent); }
.progress-spn { display: block; height: 100%; background: var(--ok); }
.progress-mark { position: absolute; left: 90%; top: 0; bottom: 0; width: 2px; background: var(--paper); }
.progress-text { margin: .35rem 0 0; font-size: .92rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- portal */
.returns { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.return-card { display: grid; gap: .25rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; color: var(--ink); text-decoration: none; }
.return-card:hover { border-color: var(--accent); color: var(--ink); }
.return-year { font-size: 1.3rem; font-weight: 700; color: var(--brand); }
.return-msg { color: var(--ink-soft); }
.return-progress { font-weight: 600; }
.items { list-style: none; padding: 0; margin: 0; }
.item-card { border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; margin: 0 0 .75rem; background: var(--paper); }
.item-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .35rem .75rem; margin-bottom: .35rem; }
.item-head h3 { margin: 0; }
.attention { background: var(--warn-soft); border: 1px solid #e8c48e; border-radius: var(--radius); padding: .6rem .8rem; margin: .5rem 0; }
.attention ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.checking { margin: .35rem 0; }
.choices-client { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; margin: .5rem 0; }
.choices-client details { flex-basis: 100%; }
.upload-client { display: grid; gap: .4rem; margin: .5rem 0; padding: .75rem; background: var(--page); border-radius: var(--radius); }
.file-label { font-weight: 600; }
.help { margin-top: .5rem; }

@media (max-width: 640px) {
  .wrap { padding: .75rem; }
  .card { padding: .85rem .9rem; }
  .top-inner { padding: .5rem .75rem; }
  .who { width: 100%; justify-content: space-between; }
  /* On a phone the menu is one row that scrolls sideways, so it does not push the page down (phone-width check, 19 November 2026) */
  .nav { flex: 1 1 100%; order: 3; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.75rem; padding: 0 .75rem .25rem; }
  .nav a { white-space: nowrap; flex: 0 0 auto; }
  .who { order: 2; width: auto; flex: 1; justify-content: flex-end; }
  .row > div, .filters > div { min-width: 100%; }
  .row-go .btn, .portal .btn-big { width: 100%; }
  .choices-client > form, .choices-client .btn { width: 100%; }
  h1 { font-size: 1.4rem; }
  .portal h1 { font-size: 1.5rem; }
}

@media print {
  .top, .foot, form, details > summary { display: none !important; }
  .card { border: 0; }
}

.later { margin-top: .35rem; }
.later > summary, .help > summary { font-size: .95em; }

/* ---------------------------------------------------------------- daily digest (D-37): one column, phone first */
.digest { max-width: 40rem; margin: 0 auto; }
.digest .card { margin-bottom: .75rem; }
.digest-list { list-style: none; padding: 0; margin: 0; }
.digest-list li { padding: .55rem 0; border-bottom: 1px solid var(--line-soft); line-height: 1.4; }
.digest-list li:last-child { border-bottom: 0; }
.digest-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .85rem; background: var(--page); padding: .75rem; border-radius: var(--radius); }

/* ---------------------------------------------------------------- work list and setup page (increment 3, brief 1) */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-line { padding: .65rem 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.work-line:last-child { border-bottom: 0; }
.work-line.is-late { border-left: 4px solid var(--warn); padding-left: .6rem; }
.work-line.is-closed { color: var(--muted); }
.work-main { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.work-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .25rem; align-items: center; }
.work-note { margin: .35rem 0 0; background: var(--page); border-radius: var(--radius); padding: .35rem .6rem; }
.work-act { margin-top: .4rem; }
.work-act form { margin: .4rem 0; }
/* case alerts grouped by reason, and the standing card on the case page (increment 3, brief 2) */
.work-group > details > summary { cursor: pointer; }
.work-group-cases { margin: .5rem 0 0 .25rem; padding-left: .6rem; border-left: 2px solid var(--line-soft); }
.work-group-close { margin-top: .6rem; }
.alert-card { margin-top: .75rem; padding-top: .5rem; border-top: 1px solid var(--line-soft); }
.alert-card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.standing-reasons { margin: .35rem 0 .5rem 1.1rem; padding: 0; }
.hint { font-weight: normal; color: var(--muted); font-size: .85em; }
.pinned { border-left: 4px solid var(--accent); }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: .9rem 1.25rem; }
.setting { min-width: 0; }
.setting.is-pending { background: var(--warn-soft); border-radius: var(--radius); padding: .4rem .5rem; }
.setting .small { margin: .2rem 0 0; }
.setting-value { margin: 0; font-weight: 600; }
label.check { font-weight: normal; display: block; margin: .6rem 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .5rem 1rem; margin: 0; }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.print-view { background: #fff; }
.print-page { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.print-page table.plain { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 1rem; }
.print-page table.plain th, .print-page table.plain td { text-align: left; vertical-align: top; border-bottom: 1px solid #bbb; padding: .3rem .4rem; overflow-wrap: anywhere; }
@media print {
  .no-print { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .print-page table.plain { font-size: 10pt; }
  .print-page tr { break-inside: avoid; }
}

/* a table that becomes a list of cards at phone width, so the page never scrolls sideways */
@media (max-width: 640px) {
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .5rem .6rem; border-bottom: 1px solid var(--line-soft); }
  .table-stack td { border: 0; padding: .1rem 0; text-align: left; overflow-wrap: anywhere; }
  .table-stack td.num { text-align: left; }
  .table-stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); }
  .table-stack td:empty { display: none; }
}

/* The board and the approval queue (increment 3, brief 2b) */
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: .5rem 0 .75rem; }
.board-stat { display: flex; flex-direction: column; gap: .15rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; text-decoration: none; color: var(--ink); background: var(--paper); overflow-wrap: anywhere; }
a.board-stat:hover { border-color: var(--accent); }
.board-num { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.load-line { margin: 0 0 .5rem; }
.label-reasons { margin: .25rem 0 0; padding-left: 1.1rem; }

/* Increment 3, brief 4: the pre-check. Lists, not tables, so nothing scrolls sideways on a phone. */
.plain-list { list-style: none; margin: 0; padding: 0; }
.precheck-line { padding: .45rem 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.precheck-line ul, .precheck-failed, .precheck-could-not, .precheck-todo { margin: .25rem 0 .25rem 1.1rem; padding: 0; }
.precheck-failed li { color: var(--bad); }

/* The Figures screen (increment 3, brief 5): desktop. A figure beside the page it was read from. */
.figure-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 1rem; align-items: start; }
.figure.is-flagged { border-left: 4px solid var(--warn); }
.figure-value { font-size: 1.25rem; margin: .25rem 0; }
.source-page { width: 100%; height: 22rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-soft); object-fit: contain; }
.source-group { border-top: 1px solid var(--line-soft); padding-top: .5rem; margin-top: .5rem; }
@media (max-width: 60rem) { .figure-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- the testing tools (UAT_TOOLS_ENABLED): Practice, Report, Observer */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.uat-ex .tick { font-weight: 600; }
.uat-steps, .uat-timeline { padding-left: 1.2rem; }
.uat-report { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; max-width: min(30rem, calc(100vw - 2rem)); }
.uat-report > summary { list-style: none; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.uat-report > summary::-webkit-details-marker { display: none; }
.uat-report[open] > summary { margin-bottom: .4rem; }
.uat-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); max-height: 75vh; overflow: auto; }
@media print { .uat-report { display: none; } }
