
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6f6e69;
  --axis-text: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --hover: rgba(11, 11, 11, 0.05);
  --selected: #0b0b0b;
  --selected-text: #fcfcfb;
  --link: #256abf;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #a3a29b;
    --axis-text: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --hover: rgba(255, 255, 255, 0.06);
    --selected: #f0efec;
    --selected-text: #1a1a19;
    --link: #6da7ec;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #a3a29b;
  --axis-text: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --hover: rgba(255, 255, 255, 0.06);
  --selected: #f0efec;
  --selected-text: #1a1a19;
  --link: #6da7ec;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 1240px; margin: 0 auto; padding: 32px 16px 64px; }
a { color: var(--link); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

header h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.lede { margin: 0; color: var(--text-secondary); max-width: 70ch; }
.updated { margin: 12px 0 0; color: var(--text-secondary); font-size: 13px; max-width: 80ch; }
.updated time { color: var(--text-primary); font-weight: 600; }
.meta { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; max-width: 80ch; }

.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px;
  margin: 28px 0 8px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field[hidden] { display: none; }
.field-label { font-size: 12px; color: var(--text-muted); }
.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.segmented button {
  font: inherit; font-size: 13px; color: var(--text-secondary);
  background: none; border: 0; border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
.segmented button:hover { background: var(--hover); }
.segmented button[aria-pressed="true"] { background: var(--selected); color: var(--selected-text); }
select {
  font: inherit; font-size: 13px; color: var(--text-primary);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; min-width: 220px;
}
.metric-note { margin: 4px 0 16px; color: var(--text-secondary); font-size: 13px; max-width: 80ch; }

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center;
  margin: 0 0 12px; font-size: 13px; color: var(--text-secondary);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { display: block; overflow: visible; }
button.legend-item {
  font: inherit; color: inherit; background: none; border: 0; border-radius: 6px;
  padding: 2px 6px; margin: -2px -6px; cursor: pointer;
}
button.legend-item:hover { background: var(--hover); }
button.legend-item[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }

.panels {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
}
.panels.single { grid-template-columns: 1fr; }
.panel {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 14px 8px;
}
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.readout { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--text-secondary); }
.readout strong { color: var(--text-primary); font-weight: 600; }
.readout span { display: inline-flex; align-items: center; gap: 5px; }
.panel svg.chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.panel svg.chart:focus { outline: none; }
.panel svg.chart:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.axis-label { fill: var(--axis-text); font-size: 11px; font-variant-numeric: tabular-nums; }
.empty { color: var(--text-muted); padding: 24px 0; }

.tooltip {
  position: absolute; z-index: 2; pointer-events: none;
  width: max-content; max-width: 300px;
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 10px; font-size: 12px; line-height: 1.4;
}
.tooltip[hidden] { display: none; }
.tooltip .tt-commit { color: var(--text-muted); }
.tooltip .tt-subject { margin: 2px 0 6px; color: var(--text-secondary); }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.tooltip .tt-row svg { flex: none; }
.tooltip .tt-row strong { flex: none; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.tooltip .tt-row .tt-name { color: var(--text-secondary); }
.tooltip .tt-hint { margin-top: 6px; color: var(--text-muted); }

details { margin-top: 24px; }
summary { cursor: pointer; color: var(--text-secondary); font-size: 14px; }
.table-wrap { overflow-x: auto; margin-top: 12px; max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface); color: var(--text-muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.subject { white-space: normal; min-width: 240px; color: var(--text-secondary); }

.about { margin-top: 40px; color: var(--text-secondary); font-size: 14px; max-width: 80ch; }
.about h2 { font-size: 15px; color: var(--text-primary); margin: 0 0 8px; }
.about p { margin: 0 0 10px; }
