:root {
  color-scheme: light;
  --page:        #f9f9f7;
  --surface:     #fcfcfb;
  --text:        #0b0b0b;
  --text-secondary: #52514e;
  --muted:       #898781;
  --gridline:    #e1e0d9;
  --border:      rgba(11, 11, 11, 0.10);
  --link:        #2a78d6;
  --good:        #0ca30c;
  --critical:    #d03b3b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page:        #0d0d0d;
    --surface:     #1a1a19;
    --text:        #ffffff;
    --text-secondary: #c3c2b7;
    --muted:       #898781;
    --gridline:    #2c2c2a;
    --border:      rgba(255, 255, 255, 0.10);
    --link:        #3987e5;
    --good:        #0ca30c;
    --critical:    #e66767;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page:        #0d0d0d;
  --surface:     #1a1a19;
  --text:        #ffffff;
  --text-secondary: #c3c2b7;
  --muted:       #898781;
  --gridline:    #2c2c2a;
  --border:      rgba(255, 255, 255, 0.10);
  --link:        #3987e5;
  --good:        #0ca30c;
  --critical:    #e66767;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 24px;
}

h1 {
  font-size: 22px;
  margin: 0;
}

h2 {
  font-size: 17px;
  margin: 32px 0 12px;
}

nav.site a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}
nav.site a:hover { color: var(--link); }

p.lede {
  color: var(--text-secondary);
  max-width: 62ch;
  margin: 0 0 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gridline);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:last-child td { border-bottom: none; }

td a { color: var(--link); text-decoration: none; }
td a:hover { text-decoration: underline; }

.num { text-align: right; }

.note {
  color: var(--muted);
  font-size: 12px;
}

.self-reported {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: italic;
  margin-top: 2px;
  max-width: 32ch;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.ok { color: var(--good); }
.status-badge.stale { color: var(--critical); }
.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 8px;
}

.stat-tile .label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 2px;
}
.stat-tile .value {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: normal;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.chart-legend .key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  white-space: nowrap;
  transform: translate(-50%, -110%);
}

.chart-wrap { position: relative; }

footer.site {
  margin-top: 48px;
  color: var(--muted);
  font-size: 12px;
}

.methodology dt {
  font-weight: 600;
  margin-top: 16px;
}
.methodology dd {
  margin: 4px 0 0;
  color: var(--text-secondary);
}
