:root {
  font: 100%/1.55 system-ui, sans-serif;
  color-scheme: dark;
  color: #edf2ff;
  background: #0b1020;
  --muted: #afbdd4;
  --line: #334363;
  --surface: #121c30;
  --panel: #0b1426;
  --accent: #90e2cf;
  --warning: #ffcc94;
  --danger: #f87171;
  --blue: #38bdf8;
  --purple: #a78bfa;
  --amber: #f59e0b;
  --green: #34d399;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(72rem, calc(100% - 2rem)); margin-inline: auto; padding-bottom: 3rem; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding-block: .8rem;
  color: var(--muted);
}
a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, p { margin: 0; }
h1 { margin-top: 2rem; font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.25; }
p { color: var(--muted); }
.intro { margin-top: .75rem; max-width: 68ch; }
nav, .controls, fieldset { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; }
nav { margin: 1.25rem 0 1.75rem; }
nav a {
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: .35rem .85rem;
  background: var(--surface);
  text-decoration: none;
}
nav a:hover { border-color: var(--accent); }
section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .9rem;
  margin-bottom: 1.4rem;
  padding: clamp(.95rem, 3vw, 1.75rem);
  scroll-margin-top: 1rem;
}
section > p { margin-top: .45rem; max-width: 82ch; }
.controls { align-items: end; margin: 1rem 0; }
label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
label strong { color: #edf2ff; }
.check { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.2rem; color: #edf2ff; }
input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; }
input[type="range"] { accent-color: var(--accent); width: 12.5rem; }
select, input[type="number"] {
  background: #0d1527;
  color: #edf2ff;
  border: 1px solid #586e93;
  border-radius: .45rem;
  padding: .45rem .65rem;
  min-height: 2.35rem;
  font: inherit;
}
input[type="number"] { width: 7rem; }
fieldset { border: 1px solid var(--line); margin: 0 0 1rem; padding: .45rem .85rem .7rem; border-radius: .5rem; }
legend { color: var(--muted); font-size: .85rem; padding-inline: .35rem; }
.bar-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: .6rem; padding: .85rem 1rem; margin: .85rem 0 1rem; }
.bar-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .45rem; font-size: .9rem; }
.tabular { font-variant-numeric: tabular-nums; color: #edf2ff; }
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-weight: 600; font-size: .82rem; }
.badge.ok { background: rgba(52,211,153,.18); color: var(--green); border: 1px solid rgba(52,211,153,.45); }
.badge.warn { background: rgba(245,158,11,.18); color: var(--warning); border: 1px solid rgba(245,158,11,.45); }
.badge.bad { background: rgba(248,113,113,.18); color: var(--danger); border: 1px solid rgba(248,113,113,.45); }
.stack-bar { display: flex; width: 100%; height: 1.45rem; border-radius: .35rem; overflow: hidden; background: #1c2942; border: 1px solid #2b3c5e; }
.seg { height: 100%; transition: width .2s ease; }
.legend { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .55rem; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { display: inline-block; width: .75rem; height: .75rem; border-radius: .15rem; }
.sw-w, .seg-w { background: #38bdf8; }
.sw-kv, .seg-kv { background: #a78bfa; }
.sw-oh, .seg-oh { background: #64748b; }
.sw-spill, .seg-spill { background: #ef4444; }
.sw-rr, .seg-rr { background: #ef4444; }
.sw-tb, .seg-tb { background: #f97316; }
.sw-th, .seg-th { background: #eab308; }
.sw-sc, .seg-sc { background: #a78bfa; }
.sw-hi, .seg-hi { background: #64748b; }
.sw-uw, .seg-uw { background: #22c55e; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); gap: .75rem; margin-bottom: .9rem; }
.metric { background: var(--panel); border: 1px solid #253452; padding: .75rem .9rem; border-radius: .5rem; }
.metric .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.metric .v { font-size: 1.35rem; font-weight: 700; color: #f8fafc; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.metric .sub { font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.detail { background: var(--panel); border-inline-start: .22rem solid var(--accent); padding: .7rem .95rem; border-radius: .25rem; font-size: .88rem; }
.detail code { color: var(--accent); }
.source { font-size: .86rem; margin-top: .85rem; }
