:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1c2330; --muted: #5b6575; --line: #e2e6ec;
  --accent: #2f5bd3; --accent-ink: #ffffff; --ok: #1f8a4c; --warn: #b7791f; --bad: #c0392b;
  --ok-bg: #e7f5ec; --warn-bg: #fdf3e1; --bad-bg: #fbe9e7; --bar: #2f5bd3; --bar-bg: #e9edf5;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --panel: #1a2029; --ink: #e6e9ef; --muted: #9aa4b2; --line: #2b3340;
    --accent: #6d8ff0; --accent-ink: #0b0e13; --ok-bg: #16301f; --warn-bg: #33280f; --bad-bg: #3a1c19;
    --bar: #6d8ff0; --bar-bg: #262e3a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header.top .brand { font-weight: 700; letter-spacing: .3px; }
header.top nav { display: flex; gap: 14px; flex-wrap: wrap; }
header.top nav a { color: var(--muted); padding: 4px 2px; }
header.top nav a.on { color: var(--ink); border-bottom: 2px solid var(--accent); }
header.top .me { margin-left: auto; color: var(--muted); display: flex; gap: 10px; align-items: center; }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; overflow-x: auto; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tile .n { font-size: 24px; font-weight: 700; }
.tile .l { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: var(--bar-bg); white-space: nowrap; }
.badge.ok, .s-found, .s-done, .s-approved, .s-auto_pass { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .s-partial, .s-not_yet_published, .s-needs_review, .s-generated, .s-queued, .s-claimed { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .s-failed, .s-fetch_failed, .s-auto_reject, .s-rejected, .s-blank { background: var(--bad-bg); color: var(--bad); }
.bar { background: var(--bar-bg); border-radius: 4px; height: 12px; min-width: 120px; position: relative; }
.bar > span { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.bars td:first-child { width: 160px; }
.flash { padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
form.inline { display: inline; }
button, .btn { font: inherit; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); cursor: pointer; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--bad); }
input, select, textarea { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--ink); }
textarea { width: 100%; min-height: 110px; font-family: var(--mono); font-size: 13px; }
pre, code { font-family: var(--mono); font-size: 12.5px; }
pre { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 0; }
.login { max-width: 360px; margin: 10vh auto; }
.login input { width: 100%; margin-bottom: 10px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--panel); }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.chips span { display: inline-block; margin: 2px 4px 2px 0; }
.dim { opacity: .55; }
@media (max-width: 640px) { main { padding: 12px; } th, td { padding: 5px; } }

/* build status page (/status): the flow chart and the scope bar */
.flow { display: block; min-width: 860px; width: 100%; height: auto; color: var(--ink); }
.flow text { fill: currentColor; }
.flow a { text-decoration: none; }
.flow .name { font-weight: 700; font-size: 17px; }
.flow .role { font-size: 12.5px; fill: var(--muted); }
.flow .lbl { font-family: var(--mono); font-size: 11.5px; fill: var(--muted); }
.flow .box { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.flow .box.agent { fill: var(--panel); stroke: currentColor; }
.flow .box.stopped { stroke: var(--bad); stroke-width: 2.5; }
.flow .wire { stroke: currentColor; stroke-width: 1.5; fill: none; }
.flow .head { fill: currentColor; }
.flow .pill-ok { fill: var(--ok-bg); } .flow .t-ok { fill: var(--ok); }
.flow .pill-warn { fill: var(--warn-bg); } .flow .t-warn { fill: var(--warn); }
.flow .pill-bad { fill: var(--bad-bg); } .flow .t-bad { fill: var(--bad); }
.flow .pt { font-size: 11.5px; font-weight: 600; }
.scope { display: flex; height: 28px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.scope span { display: block; min-width: 0; }
.seg-read { background: var(--ok); } .seg-queue { background: var(--accent); } .seg-park { background: var(--bar-bg); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; border: 1px solid var(--line); }
.flow { --f-ok: var(--ok); --f-warn: var(--warn); --f-bad: var(--bad); }
@media (prefers-color-scheme: dark) { .flow { --f-ok: #7ddba6; --f-warn: #f0c463; --f-bad: #ff9a92; } }
.flow .t-ok { fill: var(--f-ok); } .flow .t-warn { fill: var(--f-warn); } .flow .t-bad { fill: var(--f-bad); }
.flow .box.stopped { stroke: var(--f-bad); }
.flow .zone { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 5; }
/* build status page: what was built, in order (a dated line, oldest first) */
.history { list-style: none; margin: 0; padding: 0; }
.history > li { display: grid; grid-template-columns: 96px 1fr; column-gap: 22px; position: relative; padding-bottom: 18px; }
.history > li:last-child { padding-bottom: 0; }
.history .when { text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.history .what { min-width: 0; border-left: 2px solid var(--line); padding-left: 22px; position: relative; }
.history .what::before { content: ""; position: absolute; left: -7px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--panel); }
.history > li:not(:last-child) .what { padding-bottom: 4px; }
.history h3 { margin: 0 0 6px; font-size: 15px; }
.history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.history ul li { display: grid; grid-template-columns: 92px 1fr; column-gap: 10px; align-items: start; }
.badge.area { text-align: center; background: var(--bar-bg); color: var(--ink); }
.badge.a-leo, .badge.a-ava, .badge.a-eli { background: var(--accent); color: var(--accent-ink); }
.badge.a-safety { background: var(--ok-bg); color: var(--f-ok, var(--ok)); }
.badge.a-people, .badge.a-tools { background: var(--warn-bg); color: var(--f-warn, var(--warn)); }
@media (prefers-color-scheme: dark) { .history { --f-ok: #7ddba6; --f-warn: #f0c463; } }
@media (max-width: 640px) { .history > li { grid-template-columns: 1fr; } .history .when { text-align: left; padding-bottom: 4px; }
  .history ul li { grid-template-columns: 1fr; } }
.s-parked, .s-held { background: var(--bar-bg); color: var(--muted); }
.s-page_missing, .s-not_found, .s-skipped { background: var(--bar-bg); color: var(--muted); }
.bars th { white-space: normal; }
.flash { font-size: 15px; font-weight: 600; border: 1px solid var(--line); position: sticky; top: 8px; z-index: 5; }
.tile.big .n { font-size: 32px; color: var(--accent); }
/* What is missing: every column must fit a laptop screen. On 8 Oct the answer column (and its Confirm button) sat
   off the right edge on anything narrower than ~1400px and the team reported the button as missing. */
table.missing { table-layout: fixed; width: 100%; }
table.missing th:nth-child(1) { width: 19%; } table.missing th:nth-child(2) { width: 8%; } table.missing th:nth-child(3) { width: 14%; }
table.missing th:nth-child(4) { width: 20%; } table.missing th:nth-child(5) { width: 15%; } table.missing th:nth-child(6) { width: 24%; }
table.missing td { overflow-wrap: anywhere; }
table.missing td.answer input, table.missing td.answer select { max-width: 100%; }
