:root {
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --idle: #7f7f95;
  --other: #4b4b5e;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
main { max-width: var(--max); margin: 0 auto; padding: 0 24px 48px; }
.stats-page .top-links { display: contents; }


.hero { padding: 24px 0 8px; }
.crumbs { color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 6px; }
.crumbs::before { content: '// '; color: var(--accent); }
h1 { font-size: 34px; margin: 0 0 12px; }
.headline { font-size: 20px; margin: 0 0 4px; color: var(--text-2); }
.headline .num { color: var(--text-bright); font-family: var(--font-display); font-size: 36px; font-weight: 700; }
.sub { color: var(--muted); margin: 0; }

.tiles {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 20px 0 16px;
}
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.tile.wide { grid-column: span 3; }
.tile .label { color: var(--muted); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.tile .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.15; color: var(--text-bright); }
.tile .note { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; min-height: 18px; }
.tile .note.up { color: var(--good); }
.tile .note.down { color: var(--bad); }
.spark { height: 56px; margin-top: 4px; }
.spark canvas { width: 100% !important; height: 56px !important; }

.controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 8px 0 14px;
}
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tabs button {
  background: none; border: 0; color: var(--text-2); font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 14px;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.range { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.range-label { color: var(--muted); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-right: 6px; }
.range button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-family: var(--font-mono); font-size: 12px;
  padding: 5px 11px; border-radius: var(--radius-sm); cursor: pointer;
}
.range button:hover { border-color: var(--border-hi); color: var(--text); }
.range button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.panel { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; clip-path: var(--clip-chamfer);
  transition: opacity 0.2s; min-width: 0;
}
.card.loading { opacity: 0.6; }
.card h2 { font-size: 17px; margin: 0 0 10px; font-weight: 600; letter-spacing: 0.06em; }
.card h2::before { content: '// '; color: var(--accent); }
.card h2 .when { color: var(--muted); font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.chart { position: relative; height: 300px; }
.chart.tall { height: 380px; }
.chart.short { height: 200px; }
.caption { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 10px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--series-1); border-radius: 4px; }
.bar-row .val { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bars .none { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.r { font-family: var(--font-mono); font-size: 12.5px; }
tbody tr:last-child td { border-bottom: 0; }
td .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }

.empty, .error { color: var(--muted); text-align: center; padding: 24px; }
.error { color: var(--bad); }
.foot { color: var(--muted); font-size: 13px; margin-top: 28px; border-top: 1px solid var(--border); padding: 16px 0 0; background: none; }
.foot p { max-width: none; color: var(--muted); }
.foot a { color: var(--accent); }
.foot p { margin: 0 0 6px; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile.wide { grid-column: span 3; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile.wide { grid-column: span 2; }
  .headline .num { font-size: 26px; }
  h1 { font-size: 24px; }
  .bar-row { grid-template-columns: 90px 1fr 48px; }
}
