/* RoadSweep admin. Direction A, Bold Adventure (the monorepo's design/guidebook), in a working tool's
   density: the paper ground, ink type, the orange accent, DM Sans and Barlow Condensed headings. */
@font-face { font-family: 'DM Sans'; src: url('fonts/DMSans-Variable.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('fonts/BarlowCondensed-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #201c19; --paper: #f4f0e9; --surface: #ffffff; --soft: #e7e1d7;
  --muted: #6a625b; --line: #d8d0c5; --accent: #ff824a; --accent-text: #a83f14;
  --error: #a6322b; --ok: #2f6b3a; --focus: #2865c7;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f0e9; --paper: #171615; --surface: #282522; --soft: #34302c;
    --muted: #c0b8b0; --line: #4a433d; --accent-text: #ff824a; --error: #ffaaa0; --ok: #9fd3a8;
    --focus: #8fb4ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--body); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
h1, h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 34px; line-height: 1; }
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
.quiet { color: var(--muted); }

.bar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: #201c19; color: #f4f0e9; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand span { font-family: var(--display); text-transform: uppercase; font-size: 18px; color: #ff824a; }
.bar nav { display: flex; gap: 6px; }
.bar nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.bar nav a.active { background: #ff824a; color: #201c19; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who button { background: transparent; color: inherit; border: 1px solid #f4f0e966; border-radius: var(--radius); padding: 6px 12px; font: inherit; cursor: pointer; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; }
/* Focused by script after each change of section, for screen readers; no ring for that. */
main:focus-visible { outline: none; }
.heading { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 8px 0 16px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.scroll { overflow-x: auto; border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.list a { font-weight: 700; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--soft); white-space: nowrap; }
.status-received, .status-needs_info { background: #ffe3d5; color: #7a2e0e; }
.status-investigating { background: #dde8fb; color: #1d3f78; }
.status-accepted, .status-resolved { background: #dcefdf; color: #24522d; }
.status-rejected, .status-duplicate { background: var(--soft); color: var(--muted); }

.columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
@media (max-width: 820px) { .columns, .grid { grid-template-columns: 1fr; } }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; }
@media (max-width: 520px) {
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd + dt { margin-top: 10px; }
}
.note { white-space: pre-wrap; }

form.action, div.action { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 12px; display: grid; gap: 8px; }
form.action label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
button { font: inherit; cursor: pointer; border-radius: var(--radius); padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); justify-self: start; }
button.primary { background: var(--accent); border-color: var(--accent); color: #201c19; font-weight: 700; }
button:disabled { opacity: 0.6; cursor: progress; }
button[data-armed] { border-color: var(--error); color: var(--error); }
.pending { border: 2px solid var(--accent); border-radius: var(--radius); padding: 4px 14px 12px; margin-bottom: 12px; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

ol.history { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.when { color: var(--muted); font-variant-numeric: tabular-nums; }

.big { font-family: var(--display); font-size: 44px; line-height: 1; margin-bottom: 8px; }
.unit { font-size: 18px; color: var(--muted); }
figure.chart { margin: 8px 0; }
figure.chart figcaption { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
svg.bars { width: 100%; height: 120px; display: block; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
svg.bars rect { fill: var(--accent); }
.split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
table.figures { width: 100%; border-collapse: collapse; }
table.figures th { text-align: left; font-weight: 400; color: var(--muted); padding: 4px 0; }
table.figures td { text-align: right; font-variant-numeric: tabular-nums; padding: 4px 0; }
ul.health { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
ul.health .ok { color: var(--ok); }
ul.health .down { color: var(--error); font-weight: 700; }

.error { color: var(--error); font-weight: 600; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
#toast.shown { opacity: 1; }
