:root {
  --bg: #f7f7f5; --surface: #ffffff; --surface-2: #f0f0ec; --fg: #1b1c1e; --muted: #65676b;
  --rule: #e2e2dc; --accent: #2f5d8a; --accent-ink: #ffffff; --accent-soft: #e5eef7;
  --pass: #1f7a4d; --pass-soft: #e3f3ea; --fail: #b3261e; --fail-soft: #fbe9e7;
  --warn: #8a5a00; --warn-soft: #fbf0d9; --none: #8b8d91; --none-soft: #ececea;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315; --surface: #1a1b1e; --surface-2: #222327; --fg: #e7e7e4; --muted: #a2a4a8;
    --rule: #2e2f33; --accent: #7fb0e0; --accent-ink: #0f1a24; --accent-soft: #1d2a37;
    --pass: #5fc28f; --pass-soft: #17291f; --fail: #f28b82; --fail-soft: #2d1a19;
    --warn: #e2b55a; --warn-soft: #2b2416; --none: #85878b; --none-soft: #26272a;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --surface: #1a1b1e; --surface-2: #222327; --fg: #e7e7e4; --muted: #a2a4a8;
  --rule: #2e2f33; --accent: #7fb0e0; --accent-ink: #0f1a24; --accent-soft: #1d2a37;
  --pass: #5fc28f; --pass-soft: #17291f; --fail: #f28b82; --fail-soft: #2d1a19;
  --warn: #e2b55a; --warn-soft: #2b2416; --none: #85878b; --none-soft: #26272a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 7px; font-size: 14px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--fg); }
.nav a.on { color: var(--fg); background: var(--surface-2); font-weight: 600; }
.search { margin-left: auto; flex: 1 1 260px; max-width: 380px; }
.search input { width: 100%; font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg); color: var(--fg); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

main { padding-top: 24px; padding-bottom: 40px; min-height: 60vh; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 6px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12.5px; }
.tile .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile .v.small { font-size: 15px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-h h2 { margin: 0; }
.card-h a { font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.kv { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 0; font-size: 14px; }
.kv > div { padding: 7px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.kv > div:nth-child(odd) { color: var(--muted); padding-right: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.hash { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.trunc { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.muted { color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.pass { color: var(--pass); background: var(--pass-soft); }
.pill.fail { color: var(--fail); background: var(--fail-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.none { color: var(--none); background: var(--none-soft); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); margin-right: 4px; white-space: nowrap; }

.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--pass); border-radius: 999px; }
.gates { list-style: none; margin: 0; padding: 0; counter-reset: g; }
.gates li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule); counter-increment: g; }
.gates li:last-child { border-bottom: 0; }
.gates li::before { content: counter(g); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--none-soft); color: var(--none); }
.gates li.done::before { content: "✓"; background: var(--pass-soft); color: var(--pass); }
.gates li.failed::before { content: "!"; background: var(--fail-soft); color: var(--fail); }
.gates .d { color: var(--muted); font-size: 13px; }

.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.cell { display: inline-block; min-width: 76px; font-size: 12px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.cell.pass { color: var(--pass); background: var(--pass-soft); }
.cell.fail { color: var(--fail); background: var(--fail-soft); }
.cell.stale { color: var(--warn); background: var(--warn-soft); }
.cell.none { color: var(--none); background: var(--none-soft); }
.cell small { display: block; font-weight: 400; opacity: .85; }

.hist { display: inline-flex; gap: 3px; vertical-align: middle; }
.hist i { width: 9px; height: 16px; border-radius: 2px; background: var(--none-soft); }
.hist i.pass { background: var(--pass); }
.hist i.fail { background: var(--fail); }

.forks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.fork { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; font-size: 13.5px; }
.fork .mono { color: var(--muted); font-size: 12px; }

.io { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.io-row { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.io-row:last-child { border-bottom: 0; }
.io-row .amt { float: right; font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 8px; }
.asset-amt { color: var(--accent); }

pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font: 12.5px/1.5 var(--mono); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.btn { display: inline-block; font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.pager { display: flex; gap: 8px; margin-top: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--muted); cursor: pointer; }
.filters button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.error { background: var(--fail-soft); color: var(--fail); padding: 12px 14px; border-radius: 8px; }
.loading { color: var(--muted); padding: 30px 0; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--rule); }

.hero { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 32px 28px; margin-bottom: 20px; }
.hero-k { color: var(--accent); font-size: 13px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; }
.hero-h { font-size: 32px; line-height: 1.15; margin: 8px 0 10px; letter-spacing: -0.02em; }
.hero-p { color: var(--muted); font-size: 16.5px; max-width: 760px; margin: 0 0 20px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.feats { display: grid; gap: 12px; }
.feat { border: 1px solid var(--rule); border-radius: 9px; padding: 12px 14px; }
.feat-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.feat p { margin: 6px 0 6px; font-size: 14px; }
.feat-d { font-size: 12.5px; color: var(--accent); font-weight: 600; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 6px 0; }
ol.steps { margin: 0; padding-left: 20px; }
ol.steps li { margin: 0 0 14px; }
ol.steps pre { margin-top: 8px; }

@media (max-width: 720px) {
  .hero { padding: 22px 18px; }
  .hero-h { font-size: 25px; }
  .io { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; font-size: 12.5px; }
  .search { max-width: none; order: 3; flex-basis: 100%; }
  .hide-sm { display: none; }
}
