:root {
  --bg: #f5f6f8; --surface: #ffffff; --text: #141a22; --muted: #566171; --line: #dfe3e9;
  --accent: #1c5fd4; --accent-soft: #e6eefc; --wait: #b9c1cd; --track: #e9ecf1;
  --good: #0c7a4c; --bad: #b3261e; --bad-soft: #fdecea; --warn-soft: #fff4d6; --warn-text: #6b4e00;
  --focus: #1c5fd4; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218; --surface: #161b23; --text: #e8ecf1; --muted: #9aa5b5; --line: #2a323d;
    --accent: #6ea4ff; --accent-soft: #1b2a45; --wait: #4b5666; --track: #222a35;
    --good: #4fcf90; --bad: #ff8d84; --bad-soft: #3a1c1a; --warn-soft: #3a3010; --warn-text: #f1d27a; --focus: #8db6ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
h1 { margin: 0; font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.25; }
h3 { margin: 24px 0 8px; font-size: 1.05rem; }
p { margin: 0 0 12px; }
.muted, .hint { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; border: 2px solid var(--focus); z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; gap: 16px 32px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding-top: 22px; padding-bottom: 18px; }
.tag { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }
.status { margin: 0; font-size: 0.85rem; color: var(--muted); }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--good); }
.status.warn .dot { background: var(--bad); }

.banner { max-width: 1080px; margin: 16px auto 0; padding: 12px 16px; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); font-weight: 600; }
.banner[hidden] { display: none; }
@media (max-width: 1120px) { .banner { margin-left: 20px; margin-right: 20px; } }

main section { padding: 32px 0 8px; }
.lede { color: var(--muted); max-width: 70ch; }

.controls { display: flex; gap: 10px 12px; align-items: center; flex-wrap: wrap; margin: 16px 0 6px; }
.controls label { font-weight: 600; }
select { min-width: 0; max-width: 100%; flex: 1 1 320px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
button { padding: 10px 18px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; }
@media (prefers-color-scheme: dark) { button { color: #0b1220; } }
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: progress; }
.hint { margin: 4px 0 12px; font-size: 0.9rem; min-height: 1.4em; }

.lanes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.lanes:empty { display: none; }
.lane { display: grid; grid-template-columns: minmax(170px, 260px) minmax(120px, 1fr) minmax(190px, 250px); gap: 6px 18px; align-items: center; padding: 12px 0; }
.lanes .lane + .lane { border-top: 1px solid var(--line); }
.lane .name { font-weight: 600; line-height: 1.3; }
.lane .sub { display: block; margin-top: 2px; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.track { display: flex; height: 16px; background: var(--track); border-radius: 8px; overflow: hidden; }
.seg { height: 100%; }
.seg.wait { background: var(--wait); }
.seg.stream { background: var(--accent); }
.nums { display: flex; gap: 14px; justify-content: space-between; font-variant-numeric: tabular-nums; }
.nums div { display: flex; flex-direction: column; min-width: 0; }
.nums .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.nums .v { font-weight: 600; white-space: nowrap; }
.lane .extra { grid-column: 1 / -1; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.lane .text { flex: 1 1 260px; min-width: 0; margin: 0; font-size: 0.86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lane .err { flex: 1 1 100%; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 0.86rem; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.mock { background: var(--bad-soft); color: var(--bad); }
.axis[hidden] { display: none; }
.axis { padding: 0 0 12px; font-size: 0.75rem; color: var(--muted); }
.lanes + .axis { margin-top: 6px; padding: 0 16px 12px; }
.axis-scale { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.race-summary { margin: 14px 0 0; padding: 0; max-width: 75ch; }
.race-summary:empty { display: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.meta { font-size: 0.9rem; color: var(--muted); margin: 6px 0 12px; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 4px 0 8px; }
.seg-ctl input { position: absolute; opacity: 0; pointer-events: none; }
.seg-ctl label { padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 0.9rem; background: var(--surface); }
.seg-ctl input:checked + label { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .seg-ctl input:checked + label { color: #0b1220; } }
.seg-ctl input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 9px 10px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-top: 0; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; font-size: 0.78rem; color: var(--muted); }
.verdict { font-weight: 700; }
.verdict.faster { color: var(--good); }
.verdict.slower { color: var(--bad); }
.verdict.unclear { color: var(--muted); }
.chart { display: block; width: 300px; min-width: 300px; height: 26px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .one { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .whisker { stroke-width: 2.5; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .tick { fill: var(--muted); font-size: 10px; }
.chart .faster { stroke: var(--good); fill: var(--good); }
.chart .slower { stroke: var(--bad); fill: var(--bad); }
.chart .unclear { stroke: var(--muted); fill: var(--muted); }
.bar { position: relative; height: 12px; min-width: 120px; background: var(--track); border-radius: 6px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 6px; }
.bar .p95 { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.warnings { margin: 8px 0 0; padding-left: 20px; color: var(--warn-text); background: var(--warn-soft); border-radius: 8px; padding-top: 8px; padding-bottom: 8px; }
.legend { font-size: 0.82rem; color: var(--muted); margin: 8px 0 0; }
.method { padding-left: 20px; max-width: 80ch; }
.method li { margin-bottom: 8px; }
.foot { padding-top: 24px; padding-bottom: 40px; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 760px) {
  .lane { grid-template-columns: 1fr; gap: 6px; }
  .nums { justify-content: flex-start; gap: 20px; }
  .top-inner { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
