/* App UI: one centred column, tables for lists, chips for severity and status. */
@font-face { font-family: "Archivo"; src: url("/assets/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
:root {
  --paper: #fbfbfa; --ink: #101113; --muted: #55585e; --rule: #d6d7da; --panel: #eff0f2; --accent: #2340c8; --accent-ink: #ffffff;
  --critical: #b42318; --serious: #b93815; --moderate: #7a5600; --minor: #475467; --ok: #067647; --chip-ink: #ffffff;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #111214; --ink: #ededef; --muted: #a6a9af; --rule: #2d2f34; --panel: #1b1d21; --accent: #93a5ff; --accent-ink: #0c0e19;
    --critical: #ff8b80; --serious: #ffa47e; --moderate: #f2c65c; --minor: #b9c0cc; --ok: #6ee7a8; --chip-ink: #111214; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.55; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 10; border-radius: 4px; }
.skip:focus { top: 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
header.top { border-bottom: 1px solid var(--rule); }
header.top .wrap { display: flex; align-items: center; gap: 16px 28px; padding-block: 14px; flex-wrap: wrap; }
.brand { font-stretch: 125%; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
header.top nav { flex: 1; }
header.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
header.top nav a { color: var(--ink); text-decoration: none; font-weight: 550; padding-block: 4px; }
header.top nav a[aria-current="page"] { border-bottom: 2px solid var(--ink); }
header.top nav a:hover { text-decoration: underline; }
.who { font-size: 0.9rem; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
main { padding-block: 32px 80px; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-stretch: 118%; font-weight: 780; font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -0.01em; }
h2 { font-stretch: 112%; font-weight: 720; font-size: 1.3rem; margin-top: 40px; }
h3 { font-weight: 680; font-size: 1.05rem; margin-top: 24px; }
p { margin: 10px 0 0; max-width: 72ch; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { font-size: 0.9rem; margin-bottom: 8px; }
.notice { border-left: 4px solid var(--accent); background: var(--panel); padding: 12px 16px; margin-top: 20px; }
.notice.error { border-left-color: var(--critical); }
.btn, button { font: inherit; font-weight: 650; display: inline-block; padding: 10px 16px; border-radius: 4px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn.secondary, button.secondary { background: transparent; color: var(--ink); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn:hover, button:not(.link):hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { background: transparent; color: var(--critical); border-color: var(--critical); }
form.inline { display: inline; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
thead th { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; color: var(--muted); border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.has-critical { color: var(--critical); font-weight: 700; } td.has-serious { color: var(--serious); font-weight: 700; }
td.has-moderate { color: var(--moderate); font-weight: 700; } td.has-minor { color: var(--minor); font-weight: 700; }
.chip { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; background: var(--minor); color: var(--chip-ink); white-space: nowrap; }
.chip.critical { background: var(--critical); } .chip.serious { background: var(--serious); } .chip.moderate { background: var(--moderate); } .chip.minor { background: var(--minor); }
.chip.pass, .chip.done, .chip.fixed { background: var(--ok); } .chip.error, .chip.failed { background: var(--critical); }
.chip.running, .chip.queued { background: var(--accent); } .chip.open { background: var(--serious); } .chip.accepted, .chip.cancelled { background: var(--minor); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 20px; }
.stats div { background: var(--paper); padding: 14px 16px; }
.stats .v { font-stretch: 115%; font-weight: 760; font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats .l { font-size: 0.85rem; color: var(--muted); }
.stats .chip { white-space: normal; font-size: 0.78rem; line-height: 1.3; }
.stats .v.critical { color: var(--critical); } .stats .v.serious { color: var(--serious); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.card { border: 1px solid var(--rule); padding: 18px 20px; margin-top: 16px; }
.empty { border: 1px dashed var(--rule); padding: 32px; text-align: center; margin-top: 20px; }
.empty p { margin-inline: auto; }
form.stack { display: grid; gap: 18px; max-width: 640px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 650; }
.field .hint { font-size: 0.9rem; color: var(--muted); margin: 0; }
.field .err { color: var(--critical); font-weight: 600; margin: 0; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--muted); border-radius: 4px; padding: 9px 11px; width: 100%; max-width: 100%;
}
input[aria-invalid=true] { border-color: var(--critical); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; }
.radio input { margin-top: 5px; width: 18px; height: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.progress { margin-top: 20px; }
progress { width: 100%; max-width: 520px; height: 14px; accent-color: var(--accent); }
.finding { border: 1px solid var(--rule); border-left: 4px solid var(--ink); padding: 14px 16px; margin-top: 12px; }
.finding h3 { margin: 0; font-size: 1rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.finding dl { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 6px 14px; margin: 10px 0 0; font-size: 0.95rem; }
.finding dt { font-weight: 650; } .finding dd { margin: 0; }
.finding pre { white-space: pre-wrap; word-break: break-all; background: var(--panel); padding: 8px 10px; font-size: 0.8rem; margin: 6px 0 0; }
@media (max-width: 560px) { .finding dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .finding dd { margin-bottom: 8px; } }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; }
.chart svg { width: 100%; height: auto; max-width: 640px; display: block; }
.chart .axis { stroke: var(--rule); } .chart .lbl { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .line-all { stroke: var(--ink); } .chart .line-sev { stroke: var(--critical); } .chart .dot-all { fill: var(--ink); } .chart .dot-sev { fill: var(--critical); }
.legend { display: flex; gap: 18px; font-size: 0.88rem; margin-top: 6px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; background: var(--ink); }
.legend .sev::before { background: var(--critical); }
.code-box { font-family: var(--mono); background: var(--panel); padding: 10px 12px; word-break: break-all; font-size: 0.88rem; }
.login { max-width: 420px; margin: 8vh auto 0; }
footer.bottom { border-top: 1px solid var(--rule); padding-block: 20px 40px; font-size: 0.85rem; color: var(--muted); }

/* Manual audit review */
.toc ul { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-block: 12px; }
.review-section { border-top: 2px solid var(--ink); margin-top: 40px; padding-top: 4px; scroll-margin-top: 16px; }
.evidence { border: 1px solid var(--rule); background: var(--panel); padding: 12px 16px; margin-top: 16px; }
.evidence > summary { font-weight: 700; cursor: pointer; }
.evidence h3 { font-size: 1rem; margin-top: 18px; }
.evidence-img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; margin-top: 10px; }
.crops { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 10px; }
.crops.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.crops figure { margin: 0; } .crops figcaption { font-size: 0.85rem; margin-top: 6px; }
.crops.wide .evidence-img { max-height: 520px; object-fit: cover; object-position: top; }
.thumb { max-width: 120px; max-height: 80px; height: auto; display: block; background: #fff; }
.outline { list-style: none; padding: 0; margin: 6px 0 0; font-size: 0.92rem; }
.cols { columns: 2 220px; font-size: 0.9rem; }
.check-row { border: 1px solid var(--rule); border-left: 4px solid var(--rule); padding: 12px 16px 14px; margin-top: 14px; display: grid; gap: 10px; }
.check-row.failed { border-left-color: var(--serious); }
.check-row legend { font-weight: 650; padding: 0 4px; }
.check-row .q { font-weight: 650; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.choices .sev { display: flex; gap: 8px; align-items: center; }
.choices .sev select { width: auto; padding: 4px 8px; }
.check-row textarea { min-height: 2.6em; }
.hint-box { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--panel); font-size: 0.92rem; }
.hint-box::before { content: "From the evidence: "; font-weight: 700; }
.save-row { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.map-scroll { max-height: 560px; overflow: auto; border: 1px solid var(--rule); margin-top: 10px; }
.map-scroll .evidence-img { margin-top: 0; border: 0; }
