:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;

  /* sequential blue (fidelity %) */
  --seq-0: #cde2fb; --seq-1: #b7d3f6; --seq-2: #9ec5f4; --seq-3: #86b6ef; --seq-4: #5598e7;
  --seq-5: #2a78d6; --seq-6: #1c5cab; --seq-7: #104281; --seq-8: #0d366b;

  /* operation status */
  --op-tested: #2a78d6;
  --op-untested: #9ec5f4;
  --op-stub: #eb6834;
  --op-none: #c3c2b7;

  /* status (pass/fail) — always paired with a label */
  --good: #0ca30c; --good-ink: #006300;
  --warn: #fab219; --warn-ink: #7a5200;
  --serious: #ec835a; --serious-ink: #9a3d17;
  --critical: #d03b3b; --critical-ink: #a32727;

  --hatch: repeating-linear-gradient(45deg, transparent 0 4px, rgba(11,11,11,.08) 4px 5px);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10);
    --accent: #3987e5; --accent-ink: #86b6ef;
    --seq-0: #16263b; --seq-1: #18304f; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #256abf;
    --seq-5: #3987e5; --seq-6: #5598e7; --seq-7: #86b6ef; --seq-8: #b7d3f6;
    --op-tested: #3987e5; --op-untested: #1c4a80; --op-stub: #d95926; --op-none: #4a4a46;
    --good-ink: #0ca30c; --warn-ink: #fab219; --serious-ink: #ec835a; --critical-ink: #e66767;
    --hatch: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.07) 4px 5px);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10);
  --accent: #3987e5; --accent-ink: #86b6ef;
  --seq-0: #16263b; --seq-1: #18304f; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #256abf;
  --seq-5: #3987e5; --seq-6: #5598e7; --seq-7: #86b6ef; --seq-8: #b7d3f6;
  --op-tested: #3987e5; --op-untested: #1c4a80; --op-stub: #d95926; --op-none: #4a4a46;
  --good-ink: #0ca30c; --warn-ink: #fab219; --serious-ink: #ec835a; --critical-ink: #e66767;
  --hatch: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.07) 4px 5px);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--grid); }
.top-in { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: var(--ink-2); padding: 6px 12px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.theme { border: 1px solid var(--grid); background: var(--surface); color: var(--ink-2); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: none; }
.theme:hover { color: var(--ink); }

/* ---------- layout */
main { padding-top: 28px; padding-bottom: 40px; min-height: 70vh; }
.loading { padding: 80px 0; color: var(--muted); text-align: center; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 19px; letter-spacing: -.01em; margin: 0 0 4px; font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
.lede { color: var(--ink-2); font-size: 16px; max-width: 760px; margin: 0 0 22px; }
.sub { color: var(--ink-2); margin: 0 0 16px; font-size: 14px; max-width: 820px; }
.small { font-size: 13px; color: var(--ink-2); }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.stack { display: grid; gap: 20px; margin-bottom: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.crumbs { font-size: 13px; margin-bottom: 10px; color: var(--muted); }

/* ---------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi .v small { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.kpi .l { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: end; margin-bottom: 22px; }
.hero-fig { font-size: 64px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.hero-fig small { font-size: 24px; font-weight: 600; color: var(--ink-2); letter-spacing: -.01em; }

/* ---------- segmented bar */
.seg { display: flex; gap: 2px; height: 36px; border-radius: 6px; overflow: hidden; }
.seg > div { min-width: 2px; position: relative; }
.seg.sm { height: 12px; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.sw-tested { background: var(--op-tested); } .sw-untested { background: var(--op-untested); }
.sw-stub { background: var(--op-stub); } .sw-none { background: var(--op-none); }

/* ---------- pass-rate bars */
.bars { display: grid; gap: 4px; }
.bgroup { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 12px 0 2px; }
.bgroup:first-child { margin-top: 0; }
.brow { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 132px; align-items: center; gap: 12px; padding: 3px 4px; border-radius: 6px; cursor: default; }
.brow:hover { background: var(--surface-2); }
.brow .lab { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow a.lab { color: var(--ink); }
.track { height: 12px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px var(--ring); }
.track > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.track .mark50 { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.brow .val { font-size: 13px; text-align: right; color: var(--ink-2); white-space: nowrap; }
.brow .val b { color: var(--ink); font-weight: 650; }

/* ---------- atlas tiles */
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.seg-ctl { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-ctl button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.seg-ctl button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--ring), 0 1px 2px rgba(0,0,0,.06); }
input[type=search], input[type=text], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--grid); border-radius: 8px; padding: 7px 10px; min-width: 0;
}
input[type=search]:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 4px; }
.tile { border-radius: 6px; padding: 6px 7px 5px; min-height: 50px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; color: inherit; border: 0; text-align: left; font: inherit; transition: transform .08s ease, opacity .15s; }
.tile:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 0 0 2px var(--ink); }
.tile .tn { font-size: 11.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tv { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.tile.na { background: var(--surface-2) !important; background-image: var(--hatch) !important; color: var(--muted) !important; }
.tile.dim { opacity: .14; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.scale .ramp { width: 160px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--seq-0), var(--seq-2), var(--seq-4), var(--seq-6), var(--seq-8)); }
.scale .na { width: 14px; height: 10px; border-radius: 3px; background: var(--surface-2); background-image: var(--hatch); box-shadow: inset 0 0 0 1px var(--ring); }

/* ---------- svg charts */
svg text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--muted); font-size: 11px; }
svg .gl { stroke: var(--grid); stroke-width: 1; }
svg .ax { stroke: var(--axis); stroke-width: 1; }
svg .lbl { fill: var(--ink-2); font-size: 12px; }
.chart { width: 100%; display: block; overflow: visible; }
.dot { fill: var(--accent); fill-opacity: .55; stroke: var(--surface); stroke-width: 1.5; cursor: pointer; }
.dot:hover, .dot.hl { fill-opacity: 1; stroke: var(--ink); }
.hit { fill: transparent; cursor: pointer; }

/* ---------- tables */
.tbl-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; border-bottom: 1px solid var(--axis); padding: 8px 10px; white-space: nowrap; position: sticky; top: 0; background: var(--surface); user-select: none; }
th.s { cursor: pointer; }
th.s:hover { color: var(--ink); }
th.r, td.r { text-align: right; }
th .arr { color: var(--accent); }
td { padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td .minibar { display: inline-block; width: 64px; height: 6px; background: var(--surface-2); border-radius: 3px; position: relative; vertical-align: middle; margin-right: 8px; box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
td .minibar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.name-cell b { font-weight: 600; }
.name-cell .small { display: block; font-size: 12px; color: var(--muted); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
button.btn { font: inherit; font-size: 13px; border: 1px solid var(--grid); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button.btn:hover:not(:disabled) { border-color: var(--axis); background: var(--surface-2); }
button.btn:disabled { opacity: .4; cursor: default; }
button.btn.primary { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
button.btn.primary:hover { background: var(--accent-ink); }

/* ---------- chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 13%, transparent); }
.chip.good::before { content: "✓"; width: auto; height: auto; background: none; font-size: 11px; }
.chip.crit { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 12%, transparent); }
.chip.crit::before { content: "✕"; width: auto; height: auto; background: none; font-size: 10px; }
.chip.warn { color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.chip.warn::before { content: "!"; width: auto; height: auto; background: none; font-size: 11px; font-weight: 800; }
.chip.ser { color: var(--serious-ink); background: color-mix(in srgb, var(--serious) 15%, transparent); }
.chip.ser::before { content: "◐"; width: auto; height: auto; background: none; font-size: 10px; }
.chip.neutral::before { background: var(--muted); }
.chip.tested::before { background: var(--op-tested); } .chip.untested::before { background: var(--op-untested); box-shadow: inset 0 0 0 1px var(--ring); }
.chip.stub { color: var(--serious-ink); } .chip.stub::before { background: var(--op-stub); }
.chip.none::before { background: var(--op-none); }
.chip.tag { font-weight: 500; padding: 1px 7px; }
.chip.tag::before { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.fchip { font: inherit; font-size: 12.5px; border: 1px solid var(--grid); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 11px; cursor: pointer; white-space: nowrap; }
.fchip:hover { border-color: var(--axis); color: var(--ink); }
.fchip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.fchip .c { opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- callouts */
.callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.callout { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; }
.callout b { display: block; font-size: 22px; letter-spacing: -.02em; font-weight: 700; }
.callout span { font-size: 13.5px; color: var(--ink-2); }
.note { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }
.note b { color: var(--ink); }
.prose { max-width: 820px; }
.prose p, .prose li { color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.prose h2 { margin-top: 28px; }
.prose strong { color: var(--ink); }

/* ---------- tooltip */
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--ring); box-shadow: 0 6px 24px rgba(0,0,0,.18); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; max-width: 320px; }
#tip .tt { font-weight: 650; font-size: 13px; margin-bottom: 3px; }
#tip .tr { display: flex; justify-content: space-between; gap: 18px; color: var(--ink-2); }
#tip .tr b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- check tool */
textarea { width: 100%; min-height: 150px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; }
.verdicts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 16px 0; }
.vbox { border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.vbox b { font-size: 22px; display: block; letter-spacing: -.02em; }
.vbox span { font-size: 12.5px; color: var(--ink-2); }

.foot { color: var(--muted); font-size: 12.5px; padding-top: 18px; padding-bottom: 40px; border-top: 1px solid var(--grid); }
.foot a { color: var(--ink-2); }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis .kpi:first-child { grid-column: span 2; }
  .hero, .grid2 { grid-template-columns: 1fr; }
  .callouts { grid-template-columns: 1fr; }
  .verdicts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .tabs a { padding: 6px 10px; }
  .top-in { gap: 10px; }
  h1 { font-size: 24px; }
  .hero-fig { font-size: 48px; }
  .card { padding: 16px; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  .brow { grid-template-columns: 96px 1fr 92px; gap: 8px; }
  .brow .val { font-size: 12px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .seg-ctl button { padding: 5px 8px; }
  .hide-sm { display: none; }
}
@media (forced-colors: active) {
  .tile, .seg > div, .track > span { forced-color-adjust: none; }
}
