:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page:           #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --grid:           #e1e0d9;
  --baseline:       #c3c2b7;
  --series-1:       #2a78d6;
  --good:           #006300;
  --critical:       #d03b3b;
  --border:         rgba(11,11,11,0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page:           #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --grid:           #2c2c2a;
    --baseline:       #383835;
    --series-1:       #3987e5;
    --good:           #0ca30c;
    --critical:       #e66767;
    --border:         rgba(255,255,255,0.10);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  background: #1a1a1a;
  display: flex;
  align-items: center;
  padding: 14px 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left { display: flex; align-items: center; }
.header-logo { height: 20px; display: block; }
.header-pipe { width: 1px; height: 24px; background: rgba(255,255,255,0.3); margin: 0 14px; }

header h1 { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; margin: 0; }
header h1 a { color: #fff; text-decoration: none; }
header h1 .title-accent { color: #ff0000; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #888; }
.header-right .pulse { width: 7px; height: 7px; border-radius: 50%; background: #4caf50; flex: none; }

.page-subtitle { color: var(--text-secondary); font-size: 13px; margin: 0 0 20px; }

main { padding: 24px 32px; max-width: 1100px; margin: 0 auto; }

a { color: var(--series-1); text-decoration: none; }
a:hover { text-decoration: underline; }

table { width: 100%; border-collapse: collapse; background: var(--surface-1); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--grid); }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.delta-up { color: var(--good); }
.delta-down { color: var(--critical); }
.muted { color: var(--text-muted); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: var(--grid); color: var(--text-secondary); }

.chart-card {
  background: var(--surface-1);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.chart-card h2 { font-size: 14px; margin: 0 0 12px; color: var(--text-secondary); font-weight: 500; }

.empty-state { color: var(--text-secondary); padding: 40px; text-align: center; }

.stat-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-tile { background: var(--surface-1); border-radius: 8px; padding: 14px 20px; min-width: 160px; }
.stat-tile .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-tile .stat-value { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: normal; }

th a.sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th a.sort-link:hover { color: var(--text-primary); text-decoration: underline; }
.sort-arrow { font-size: 9px; color: var(--text-secondary); }

.chart-tooltip {
  position: absolute;
  background: var(--text-primary);
  color: var(--surface-1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -110%);
  white-space: nowrap;
}
