:root {
  --bg: #fafafa; --bg2: #fff; --fg: #1a1a2e; --muted: #777;
  --accent: #2563eb; --border: #e2e2e8; --hover: #eef2ff;
  --ok: #16a34a; --bad: #dc2626; --warn: #d97706;
}
:root[data-theme="dark"] {
  --bg: #14141c; --bg2: #1d1d28; --fg: #e8e8f0; --muted: #9a9ab0;
  --accent: #7aa2ff; --border: #2e2e3e; --hover: #232338;
  --ok: #4ade80; --bad: #f87171; --warn: #fbbf24;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
}
header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .6rem 1.2rem; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .5rem; }
.logo { color: var(--accent); font-size: 1.3rem; }
h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; }
.mkdocs-link { font-size: .75rem; color: var(--muted); text-decoration: none; }
nav#tabs { display: flex; gap: .2rem; flex: 1; }
nav#tabs a {
  padding: .35rem .8rem; border-radius: 6px;
  color: var(--fg); text-decoration: none; font-weight: 500;
}
nav#tabs a.active { background: var(--accent); color: #fff; }
nav#tabs a:not(.active):hover { background: var(--hover); }
#theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); cursor: pointer; font-size: 1rem; padding: .2rem .5rem;
}
#filters {
  display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-end;
  padding: .7rem 1.2rem; background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.filter-group label {
  display: block; font-size: .7rem; text-transform: uppercase;
  color: var(--muted); margin-bottom: .25rem; letter-spacing: .04em;
}
.presets { display: inline-flex; gap: .25rem; margin-right: .6rem; }
.presets button {
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  border-radius: 6px; padding: .25rem .6rem; cursor: pointer; font-size: .8rem;
}
.presets button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
input[type="date"], select, input[type="search"] {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px; padding: .3rem .5rem;
  font-size: .85rem;
}
.filter-note { font-size: .75rem; color: var(--muted); flex-basis: 100%; }
main { padding: 1.2rem; max-width: 1400px; margin: 0 auto; }
.loading, .empty { color: var(--muted); padding: 2rem; text-align: center; }
table.data {
  width: 100%; border-collapse: collapse; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
  padding: .4rem .65rem; text-align: left; border-bottom: 1px solid var(--border);
}
table.data th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap;
}
table.data th.sorted::after { content: " ▾"; color: var(--accent); }
table.data th.sorted.asc::after { content: " ▴"; }
table.data tbody tr:hover { background: var(--hover); }
table.data td.num, table.data th.num { text-align: right; }
tr.clickable { cursor: pointer; }
.rate-bad { color: var(--bad); font-weight: 600; }
.rate-warn { color: var(--warn); font-weight: 600; }
.rate-ok { color: var(--ok); }
.test-name { font-family: ui-monospace, monospace; font-size: .82rem; }
.toolbar { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.toolbar input[type="search"] { min-width: 280px; }
.toolbar .count { color: var(--muted); font-size: .8rem; }
.chart-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: .9rem; margin-bottom: 1.1rem;
}
.chart-card h3 { margin: 0 0 .6rem; font-size: .9rem; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.1rem; }
.spark { vertical-align: middle; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark .spark-fill { fill: var(--accent); opacity: .15; stroke: none; }
.sig-msg {
  font-family: ui-monospace, monospace; font-size: .78rem; color: var(--muted);
  white-space: pre-wrap; word-break: break-word; max-width: 60ch;
}
details.examples { margin: .3rem 0; }
details.examples summary { cursor: pointer; color: var(--accent); font-size: .8rem; }
.example { border-left: 3px solid var(--border); margin: .5rem 0; padding: .3rem .7rem; }
.example a { color: var(--accent); }
.breadcrumb { margin-bottom: .8rem; font-size: .85rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.kpis { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.kpi { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: .6rem 1rem; }
.kpi .v { font-size: 1.4rem; font-weight: 650; }
.kpi .l { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.note { font-size: .78rem; color: var(--muted); margin: .4rem 0 1rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--bg); color: var(--fg); padding: .25rem .7rem; cursor: pointer; font-size: .8rem; }
.seg button.active { background: var(--accent); color: #fff; }
footer { padding: 1rem 1.2rem; color: var(--muted); font-size: .75rem; }
footer a { color: var(--muted); }
.u-legend { font-size: 11px; }
