:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1c2330; --muted: #5d6879; --line: #e2e6ec;
  --accent: #2456c7; --accent-ink: #ffffff; --row-hover: #f0f4fb; --row-sel: #e3ebfa;
  --ok: #1d7a46; --ok-bg: #e3f4ea; --warn: #8a5a00; --warn-bg: #fdf1d8;
  --bad: #b3261e; --bad-bg: #fbe5e3; --info: #3d4d66; --info-bg: #eaeef4;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1a1e26; --ink: #e5e8ee; --muted: #9aa4b5; --line: #2b313c;
    --accent: #6f9bff; --accent-ink: #0d1424; --row-hover: #20262f; --row-sel: #233150;
    --ok: #6fd39a; --ok-bg: #173826; --warn: #f1c06b; --warn-bg: #3a2e14;
    --bad: #ff8a80; --bad-bg: #3d1c1a; --info: #b9c5d8; --info-bg: #252c38;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); }
.shell { display: grid; grid-template-columns: 190px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; margin: 0 6px 18px; }
.brand small { display: block; color: var(--muted); font-weight: 400; }
.side nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.side nav a.on { background: var(--row-sel); font-weight: 600; }
.side nav a:hover { background: var(--row-hover); text-decoration: none; }
.side .foot { position: absolute; bottom: 14px; left: 18px; right: 12px; font-size: 12px;
  color: var(--muted); }
main { padding: 18px 24px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap; }
.ctx { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left;
  vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
th a { color: inherit; }
tbody tr:hover { background: var(--row-hover); }
tr.sel, tr.sel:hover { background: var(--row-sel); }
table.kv th { width: 42%; font-weight: 500; color: var(--muted); }
.chip { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11.5px;
  font-weight: 600; background: var(--info-bg); color: var(--info); margin: 0 3px 2px 0;
  white-space: nowrap; }
.chip.ok, .chip.confirmed, .chip.shortlisted, .chip.done { background: var(--ok-bg); color: var(--ok); }
.chip.warn, .chip.weakened, .chip.deferred, .chip.queued, .chip.running, .chip.skipped {
  background: var(--warn-bg); color: var(--warn); }
.chip.bad, .chip.rejected, .chip.failed { background: var(--bad-bg); color: var(--bad); }
.chip.screen { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); padding: 5px 11px; border-radius: 6px; font: inherit; cursor: pointer;
  white-space: nowrap; }
.btn:hover { background: var(--row-hover); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; }
select[multiple] { min-height: 70px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted);
  gap: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
  margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.messages { list-style: none; padding: 0; margin: 0 0 12px; }
.messages li { padding: 8px 12px; border-radius: 6px; margin-bottom: 6px;
  background: var(--info-bg); }
.messages li.success { background: var(--ok-bg); color: var(--ok); }
.messages li.error { background: var(--bad-bg); color: var(--bad); }
.messages li.warning { background: var(--warn-bg); color: var(--warn); }
#map { height: 300px; border-radius: 6px; border: 1px solid var(--line); }
.sv { width: 100%; height: 220px; border: 0; border-radius: 6px; margin-top: 10px; }
.evidence { margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.evidence li { display: flex; justify-content: space-between; gap: 10px;
  border-bottom: 1px dashed var(--line); padding: 2px 0; }
.evidence li span:first-child { color: var(--muted); }
.check { border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 10px; }
.check form .row { display: grid; grid-template-columns: 1fr 160px; gap: 8px; margin: 4px 0;
  align-items: center; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
details > summary { cursor: pointer; color: var(--muted); }
.htmx-request { opacity: .6; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; width: 80px;
  display: inline-block; vertical-align: middle; }
.bar > i { display: block; height: 100%; background: var(--accent); }
#queue td.mono, #queue td:nth-child(4) { white-space: nowrap; }
.peer-dialog { width: min(1100px, 94vw); border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); padding: 14px 16px; }
.peer-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.peer-map { height: 68vh; border-radius: 6px; border: 1px solid var(--line); margin-top: 8px; }
.peer-tip { min-width: 190px; }
.peer-tip table { border-collapse: collapse; margin: 4px 0; width: 100%; }
.peer-tip th, .peer-tip td { border: 0; font-size: inherit; }
.peer-tip th { text-align: left; font-weight: normal; color: var(--muted); padding: 1px 12px 1px 0; white-space: nowrap; }
.peer-tip td { text-align: right; font-variant-numeric: tabular-nums; padding: 1px 0; white-space: nowrap; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.legend i.subject { border: 3px solid #ffcc00; width: 14px; height: 14px; }
.peer-list { margin-top: 8px; max-height: 30vh; overflow: auto; }
.peer-list tr.subject td { background: var(--row-sel); }
