:root {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --line: #2f2f2c;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
  --s-strata: #3987e5; --s-strata-2: #9cc6f5; --s-mysql: #d95926; --s-mariadb: #199e70; --s-pg: #c98500; --s-es: #a781e8; --s-ch: #2cb4c8;
  --good: #3fb37a; --bad: #e66767; --warn: #e0a43a;
  --accent: #3987e5;
  --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 17px; --fs-xl: 22px; --fs-kpi: 30px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --r-card: 14px; --r-ctl: 12px; --r-sm: 8px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f4f2; --surface: #fcfcfb; --surface-2: #f0efec; --line: #e2e1dc;
    --text: #0b0b0b; --text-2: #52514e; --muted: #6b6a65;
    --s-strata: #2a78d6; --s-strata-2: #86b4ee; --s-mysql: #eb6834; --s-mariadb: #1baf7a; --s-pg: #eda100; --s-es: #7e52d4; --s-ch: #138aa0;
    --good: #1d8a55; --bad: #c43c3b; --warn: #9a6400;
    --accent: #2a78d6;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 64px; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: var(--fs-md)/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; }
body { padding: 0 14px 56px; max-width: 760px; margin: 0 auto; }
@media (min-width: 900px) { body { max-width: 1040px; padding: 0 24px 72px; } }
button, summary { font: inherit; color: inherit; }
button, summary, input[type="range"], .ctl, .legend, .nav, .kpi {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:focus-visible, summary:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: var(--fs-xl); line-height: 1.2; margin: 14px 0 var(--sp-1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-lg); margin: 0 0 var(--sp-1); display: flex; align-items: center; gap: var(--sp-2); }
h3 { font-size: var(--fs-md); margin: var(--sp-4) 0 var(--sp-2); color: var(--text-2); font-weight: 600; }
.intro { color: var(--text-2); margin: 0 0 var(--sp-3); font-size: var(--fs-sm); }
.sub { color: var(--text-2); margin: 0 0 var(--sp-3); font-size: var(--fs-sm); }
.tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--sp-4); margin: var(--sp-3) 0; }
.nav { position: sticky; top: 0; z-index: 20; display: flex; gap: var(--sp-1); padding: var(--sp-2) 14px; margin: 0 -14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; padding: 0 var(--sp-1); }
.nav button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.ctlrow { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); }
.ctlf { flex: 1 1 100%; min-width: 0; }
@media (max-width: 699px) { .ctlf.half { flex: 1 1 calc(50% - 8px); } }
@media (min-width: 700px) { .ctlf { flex: 0 1 auto; } }
.pill-label { font-size: var(--fs-xs); color: var(--muted); margin: 0 0 var(--sp-1); text-transform: uppercase; letter-spacing: .04em; }
.seg { display: flex; background: var(--surface-2); border-radius: var(--r-ctl); padding: 3px; gap: 3px; margin-bottom: var(--sp-3); }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; line-height: 1.2; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); font-weight: 600; }
.seg.pick { display: grid; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 700px) { .seg.pick { grid-template-columns: repeat(9, 1fr); } .seg.pick button { padding: 6px 2px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 var(--sp-3); }
.legend button, .legend span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.legend button { cursor: pointer; }
.legend button[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.note { color: var(--muted); font-size: var(--fs-xs); margin: var(--sp-2) 0 0; }
.modelnote { font-size: var(--fs-sm); color: var(--text-2); padding: var(--sp-2) 10px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 3px solid var(--warn); margin: var(--sp-3) 0 0; }
.modelnote b { color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 10px var(--sp-3); min-width: 0; }
.kpi:first-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(5, 1fr); } .kpi:first-child { grid-column: auto; } }
.kpis.four { grid-template-columns: repeat(2, 1fr); }
.kpis.four .kpi:first-child { grid-column: auto; }
@media (min-width: 700px) { .kpis.four { grid-template-columns: repeat(4, 1fr); } }
.kpi b { display: block; font-size: var(--fs-kpi); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi b.up { color: var(--good); }
.kpi b.down { color: var(--bad); }
.kpi b.tie { color: var(--warn); }
.kpi h3 { margin: 0 0 2px; font-size: var(--fs-sm); color: var(--text); }
.kpi span { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: var(--sp-1); line-height: 1.3; }
.grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4) var(--sp-5); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid.one { grid-template-columns: 1fr; }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid.two { grid-template-columns: repeat(2, 1fr); } }
.panel { min-width: 0; }
.out-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); margin-bottom: var(--sp-1); }
.out-head b { font-size: var(--fs-md); }
.out-head span { color: var(--muted); font-size: var(--fs-xs); text-align: right; }
.out-head span.up { color: var(--good); font-weight: 600; }
.out-head span.down { color: var(--bad); font-weight: 600; }
.out-head span.tie { color: var(--warn); font-weight: 600; }
.chart-sub { color: var(--text-2); font-size: var(--fs-sm); margin: 0 0 var(--sp-2); }
.panel svg { display: block; width: 100%; height: auto; overflow: visible; }
.panel text { font-size: var(--fs-xs); fill: var(--muted); font-variant-numeric: tabular-nums; }
.panel text.ch-x { fill: var(--text-2); font-size: var(--fs-sm); }
.panel text.ch-xm { fill: var(--text); font-weight: 600; }
.panel text.ch-val { fill: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.panel text.ch-ratio { font-size: 13px; font-weight: 700; }
.panel text.ch-note { fill: var(--muted); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.hist-grid-line { stroke: var(--line); stroke-width: 1; }
.hist-axis { stroke: var(--muted); stroke-width: 1; }
.hist-parity { stroke: var(--muted); stroke-width: 1; }
.hist-target { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }
.hist-line { fill: none; stroke: var(--s-strata); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hist-line.ext { stroke-dasharray: 4 4; opacity: .85; }
.hist-dot { fill: var(--s-strata); stroke: var(--surface); stroke-width: 1; }
.hist-halo { fill: none; stroke: var(--s-strata); stroke-width: 2; opacity: 0; pointer-events: none; }
.hist-hit { fill: transparent; cursor: pointer; }
.hist-hit:hover + .hist-halo, .hist-hit:focus + .hist-halo { opacity: 1; }
.hist-raw { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.hist-panel text.hist-last { font-size: var(--fs-sm); font-weight: 600; }
.ch-bar { stroke: none; }
.ch-best { fill: none; stroke: var(--text); stroke-width: 1.5; pointer-events: none; }
.ch-slot { fill: transparent; cursor: pointer; }
.ch-slot:hover, .ch-slot:focus { fill: color-mix(in srgb, var(--text) 7%, transparent); }
.sc-extra { fill: var(--muted); opacity: .09; }
.sc-now { stroke: var(--accent); stroke-width: 1.5; }
.sc-ring { fill: var(--surface); stroke-width: 2; }
.cmp-sw { display: inline-block; width: 24px; height: 12px; flex: none; }
.cmp-sw line { stroke-width: 2; stroke-linecap: round; }
.cmp-cross { stroke: var(--muted); stroke-width: 1; opacity: 0; pointer-events: none; }
.cmp-col:hover .cmp-cross, .cmp-col:focus-within .cmp-cross { opacity: .7; }
.cmp-col:hover .hist-halo, .cmp-col:focus-within .hist-halo { opacity: 1; }
.sc-read { display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--text); font-variant-numeric: tabular-nums; }
.sc-read span { display: inline-flex; align-items: center; gap: 3px; }
.sc-read .cmp-sw { width: 16px; height: 10px; }
.empty { margin: var(--sp-4) 0; text-align: center; }
.slider-box { margin: 0 0 var(--sp-3); }
.slider-box.sticky { position: sticky; top: 61px; z-index: 15; background: var(--surface); padding: var(--sp-2) 0 var(--sp-1); margin: 0 0 var(--sp-2); border-bottom: 1px solid var(--line); }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); color: var(--text-2); }
.slider-head b { color: var(--text); font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.slider-head b i { font-style: normal; font-weight: 600; font-size: var(--fs-xs); margin-left: var(--sp-2); padding: 2px 8px; border-radius: 999px; }
.slider-head b i.measured { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.slider-head b i.simulated { color: var(--text-2); background: var(--surface-2); }
.slider-head b i.extrapolated { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.slider { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; align-items: center; }
.step { height: 44px; width: 44px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.step:active { background: var(--line); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; touch-action: pan-y; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 7px var(--sp-1); border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: var(--fs-xs); border-top: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
td.num { color: var(--text); }
th.meas { color: var(--good); }
.up { color: var(--good); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }
.tie { color: var(--warn); font-weight: 600; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tables { display: grid; gap: var(--sp-4); }
.tables h3 { margin: 0 0 var(--sp-1); }
.changes details { border-top: 1px solid var(--line); }
.changes details:first-child { border-top: 0; }
.changes summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; }
.changes summary::-webkit-details-marker { display: none; }
.changes summary::after { content: "+"; font-size: 20px; color: var(--text-2); flex: none; }
.changes details[open] summary::after { content: "\2212"; }
.changes details.more { border-top: 1px solid var(--line); }
.changes details.more > summary { color: var(--accent); }
.changes p { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
details.meth { border-top: 1px solid var(--line); padding: 0; }
details.meth summary { list-style: none; cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: var(--fs-md); }
details.meth summary::-webkit-details-marker { display: none; }
details.meth summary::after { content: "+"; font-size: 20px; color: var(--text-2); }
details.meth[open] summary::after { content: "\2212"; }
details.meth .body { padding: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
details.meth .body p { margin: 6px 0; }
details.meth .body b { color: var(--text); }
details.meth ul { margin: 6px 0; padding-left: 18px; }
.swnotes p { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.swnotes p:last-child { margin-bottom: 0; }
.swnotes b { color: var(--text); }
code { font-size: .92em; }
.tip { position: fixed; z-index: 50; pointer-events: none; max-width: 280px; padding: var(--sp-2) 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); background: var(--text); color: var(--bg); box-shadow: 0 4px 16px rgba(0,0,0,.35); display: none; }
.tip b { font-variant-numeric: tabular-nums; }
@media (forced-colors: active) {
  .seg button[aria-pressed="true"], .nav button[aria-pressed="true"] { outline: 2px solid Highlight; }
  .ch-bar { forced-color-adjust: none; stroke: CanvasText; }
}
@media (max-width: 560px) {
  .nav button { padding: 0 2px; font-size: var(--fs-xs); }
  .seg button { padding: 6px 6px; }
}
