/* Plain and high-contrast on purpose: black on white, one accent, no framework. */
:root {
  --ink: #111;
  --paper: #fff;
  --muted: #555;
  --rule: #ccc;
  --accent: #0b4f9c;
  --green: #0a6b2e;
  --yellow: #8a6100;
  --red: #b00020;
  --red-bg: #fde8eb;
  --yellow-bg: #fff4d6;
  --green-bg: #e3f4e8;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
a { color: var(--accent); }
a:focus, summary:focus, button:focus, input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 4px 8px; }
header.site { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
header.site .brand { font-weight: 700; }
header.site nav { display: flex; gap: 16px; flex: 1; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: 8px 0 16px; }
h2 { font-size: 1.25rem; margin: 32px 0 8px; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
h3 { font-size: 1.05rem; margin: 16px 0 4px; }
table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
th, td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
thead th { border-bottom: 2px solid var(--ink); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
tr.disagree td { background: var(--yellow-bg); font-weight: 600; }
.muted { color: var(--muted); font-weight: normal; }
.blank { color: var(--muted); font-style: italic; }
.chip { display: inline-block; padding: 0 6px; border: 1px solid currentColor; border-radius: 3px; font-size: .85rem; font-weight: 600; }
.chip-green { color: var(--green); background: var(--green-bg); }
.chip-yellow { color: var(--yellow); background: var(--yellow-bg); }
.chip-red { color: var(--red); background: var(--red-bg); }
.sev-high { color: var(--red); font-weight: 700; }
.sev-medium { color: var(--yellow); font-weight: 700; }
.box { border: 2px solid var(--ink); padding: 8px 16px; margin: 16px 0; }
.box.ok { border-color: var(--green); }
.box.warn { border-color: var(--red); }
.box h2 { border: 0; margin: 8px 0; }
.error { color: var(--red); font-weight: 600; border-left: 4px solid var(--red); padding-left: 8px; }
.ok-text { color: var(--green); font-weight: 600; }
.fact, .question { border-top: 1px solid var(--rule); padding: 8px 0; }
form.stack { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
form.inline { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input, select, textarea, button { font: inherit; padding: 6px 8px; border: 1px solid var(--ink); border-radius: 2px; }
button { background: var(--ink); color: var(--paper); cursor: pointer; }
header.site button { background: var(--paper); color: var(--ink); }
code.secret { word-break: break-all; font-size: 1rem; }
.qr svg { width: 240px; height: 240px; }
ul.history { padding-left: 20px; }
@media (max-width: 700px) { table { display: block; overflow-x: auto; } }
th.final, td.final { border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); font-weight: 700; }
table.narrow { width: auto; min-width: 320px; }
tr.total th, tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }
details { margin: 2px 0; }
summary { cursor: pointer; color: var(--accent); text-decoration: underline; }
ol.calcs { margin: 4px 0 8px; padding-left: 20px; }
.err-text { color: var(--red); }
.token { font-family: ui-monospace, monospace; font-weight: 600; }
/* Runs: stage bars. Filled steps are solid ink; failed and unavailable are hatched, and always named in text. */
.bar { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 6px; }
.bar .step { display: inline-block; width: 18px; height: 12px; border: 1px solid var(--ink); background: var(--paper); }
.bar .step.filled { background: var(--ink); }
.bar-failed .step { border-color: var(--red); background: repeating-linear-gradient(45deg, var(--red) 0 2px, var(--red-bg) 2px 5px); }
.bar-unavailable .step { border: 1px dashed var(--muted); background: repeating-linear-gradient(-45deg, var(--muted) 0 1px, var(--paper) 1px 5px); }
.stage { font-weight: 700; }
.stage-done { color: var(--green); }
.stage-failed { color: var(--red); }
.stage-unavailable { color: var(--muted); }
.run-active { color: var(--accent); }
td.cell { min-width: 180px; font-size: .9rem; }
caption { text-align: left; color: var(--muted); padding-bottom: 4px; }
.sr-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) {
  table.stack-table, table.stack-table tbody, table.stack-table tfoot, table.stack-table tr,
  table.stack-table td, table.stack-table th { display: block; width: 100%; }
  table.stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack-table tr { border-bottom: 2px solid var(--ink); padding: 8px 0; }
  table.stack-table td { border: 0; padding: 4px 0; text-align: left; }
  table.stack-table td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; }
  td.cell { min-width: 0; }
}
ol.steps, ol.deviations { margin: 4px 0 8px; padding-left: 20px; }
/* Lessons and authorities */
ul.authorities { list-style: none; padding-left: 0; margin: 4px 0; }
ul.authorities li { margin: 6px 0; }
blockquote { margin: 4px 0 8px; padding: 4px 12px; border-left: 4px solid var(--ink); font-style: italic; }
.badge { display: inline-block; padding: 0 6px; border: 1px solid currentColor; border-radius: 3px; font-size: .85rem; font-weight: 700; font-style: normal; }
.badge-ok { color: var(--green); background: var(--green-bg); }
.badge-warn { color: var(--red); background: var(--red-bg); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button.secondary { background: var(--paper); color: var(--ink); }
ul.inline-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
h4 { margin: 8px 0 2px; font-size: 1rem; }
/* Confidence: words first; colour and symbol only reinforce them. */
.conf { display: inline-block; padding: 0 6px; border: 2px solid currentColor; border-radius: 3px; font-weight: 700; font-size: .9rem; }
.conf-high { color: var(--green); background: var(--green-bg); }
.conf-medium { color: var(--yellow); background: var(--yellow-bg); }
.conf-low { color: var(--red); background: var(--red-bg); }
ul.legend { list-style: none; padding-left: 0; }
ul.legend li { margin: 4px 0; }
.subsection { border-left: 3px solid var(--rule); padding-left: 12px; margin: 12px 0; }
.warn-text { color: var(--red); background: var(--red-bg); padding: 0 4px; }
.box.key ul { margin: 4px 0; padding-left: 20px; }
/* Source review: the document on the left, the prepared return on the right; words always beside colour. */
.sr-tally { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sr-pill { border: 1px solid var(--rule); border-radius: 999px; padding: 2px 10px; font-size: .9rem; }
.sr-pill b { font-variant-numeric: tabular-nums; }
.sr-pill.sr-ok { border-color: var(--green); color: var(--green); }
.sr-pill.sr-bad { border-color: var(--red); color: var(--red); background: var(--red-bg); font-weight: 600; }
ul.sr-issues { margin: 4px 0; padding-left: 20px; }
.sr-desk { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .sr-desk { grid-template-columns: minmax(0, 1fr); } }
.sr-col { min-width: 0; }
.sr-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sr-tabs a { border: 1px solid var(--ink); padding: 4px 8px; text-decoration: none; color: var(--ink); }
.sr-tabs a.sr-current { background: var(--ink); color: var(--paper); }
.sr-page { position: relative; margin: 8px 0; border: 1px solid var(--ink); background: #fff; max-width: 100%; }
.sr-page img { display: block; width: 100%; height: auto; }
.sr-page figcaption { position: absolute; right: 4px; bottom: 2px; font-size: .8rem; background: var(--paper); padding: 0 4px; }
.sr-box, .sr-unread { position: absolute; display: block; border: 3px solid var(--ink); border-radius: 3px; }
.sr-box:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
/* The boxes sit on the white page image, so their colours are fixed (dark on a light tint), in any theme. */
.sr-box.sr-used { border-color: #0b6b35; background: rgba(11, 107, 53, .10); }
.sr-box.sr-explained { border-color: #9a5b00; border-style: dashed; background: rgba(154, 91, 0, .08); }
.sr-box.sr-unexplained, .sr-box.sr-red { border-color: #c4140a; background: rgba(196, 20, 10, .16); }
.sr-box.sr-sel { border-color: #1f4fd1; border-style: solid; background: rgba(31, 79, 209, .18); box-shadow: 0 0 0 3px rgba(31, 79, 209, .35); z-index: 1; }
.sr-tag { position: absolute; left: -3px; bottom: calc(100% + 3px); font: 600 12px/1.25 system-ui, sans-serif; background: #1f4fd1; color: #fff; padding: 3px 6px; border-radius: 4px; white-space: nowrap; z-index: 2; text-align: left; }
.sr-unread { border: 2px dotted #666; pointer-events: none; }
.sr-unread-tag { position: absolute; left: -2px; top: -15px; font-size: 10px; line-height: 1; background: #666; color: #fff; padding: 1px 3px; white-space: nowrap; }
.sr-withheld { border: 2px solid var(--red); background: var(--red-bg); padding: 8px; font-weight: 600; }
ul.sr-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; font-size: .9rem; color: var(--muted); }
.sr-sw { display: inline-block; width: 16px; height: 11px; border: 3px solid; margin-right: 6px; vertical-align: -1px; }
.sr-sw.sr-used { border-color: #0b6b35; background: rgba(11, 107, 53, .10); }
.sr-sw.sr-explained { border-color: #9a5b00; border-style: dashed; background: rgba(154, 91, 0, .08); }
.sr-sw.sr-unexplained { border-color: #c4140a; background: rgba(196, 20, 10, .16); }
.sr-sw.sr-unread-sw { border: 2px dotted #666; }
dl.sr-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
dl.sr-kv dt { color: var(--muted); }
dl.sr-kv dd { margin: 0; }
.sr-amber { color: var(--yellow); background: var(--yellow-bg); padding: 4px 8px; font-weight: 600; }
.sr-scroll { overflow-x: auto; }
table.sr-lines td, table.sr-lines th { padding: 4px 6px; }
tr.sr-formhead th { background: #eee; }
tr.sr-selrow td { background: #dbe6f5; }
tr.sr-hl td { background: #edf2fa; }
tr.sr-problem td:first-child, tr.sr-problem td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.sr-ln { font-family: ui-monospace, monospace; font-weight: 700; white-space: nowrap; }
.sr-chip { display: inline-block; margin: 1px 4px 1px 0; padding: 0 6px; border: 1px solid currentColor; border-radius: 3px; font-size: .85rem; text-decoration: none; }
.sr-calc { display: block; color: var(--muted); font-size: .85rem; }
.sr-flag { display: block; color: var(--red); font-weight: 600; font-size: .9rem; }
.sr-ac { display: block; font-size: .8rem; white-space: nowrap; color: var(--green); }
.sr-ac-bad { color: var(--red); font-weight: 700; white-space: normal; }
.sr-ac-later { color: var(--muted); }
.sr-auto { color: var(--green); font-weight: 600; border: 1px dashed var(--green); padding: 0 4px; }
.sr-missed { border: 2px solid var(--red); background: var(--red-bg); padding: 4px 8px; margin: 8px 0; }
.sr-missed h3 { margin: 4px 0; }
.sr-missed ul { margin: 4px 0; padding-left: 18px; }
form.sr-missed-form { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0; }
form.sr-missed-form label { flex-basis: 100%; font-size: .85rem; }
.sr-sw.sr-selsw { border-color: #1f4fd1; background: rgba(31, 79, 209, .18); box-shadow: 0 0 0 2px rgba(31, 79, 209, .35); }
/* Return review: questions, disagreements, differences, line by line. Words beside every colour. */
.rr-nav { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0; }
ol.rr-questions > li { margin: 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.rr-done > p:first-child { color: var(--muted); }
a.rr-fact { display: inline-block; padding: 0 5px; border: 2px solid currentColor; border-radius: 3px; font: 600 .85rem/1.5 ui-monospace, monospace; text-decoration: none; }
a.rr-fact.chip-green { color: var(--green); } a.rr-fact.chip-yellow { color: var(--yellow); } a.rr-fact.chip-red { color: var(--red); }
table.rr-facts { width: auto; min-width: 60%; font-size: .9rem; }
dl.rr-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
dl.rr-kv dt { color: var(--muted); } dl.rr-kv dd { margin: 0; }
@media (max-width: 700px) { dl.rr-kv { grid-template-columns: 1fr; } }
article.rr-root { border: 2px solid var(--ink); padding: 8px 14px; margin: 12px 0; }
ul.rr-choices { margin: 4px 0; padding-left: 18px; }
.rr-ln { font-family: ui-monospace, monospace; font-weight: 700; white-space: nowrap; }
tr.rr-sel td { background: #dbe6f5; }
.rr-panel { border-color: var(--accent); }
.rr-path { border-bottom: 1px dotted var(--muted); }
details.rr-raw summary { font-size: .85rem; color: var(--muted); }
/* Client journey board */
ul.journey-counts { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 12px 0; }
ul.pieces { margin: 4px 0; padding-left: 20px; }
form.journey-pick fieldset { border: 0; padding: 0; margin: 6px 0; }
form.journey-pick legend { font-weight: 700; padding: 0; }
.overdue { color: var(--red); }
