:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-max: #2a78d6;
  --series-min: #eb6834;
  --series-max-a: #b3261e;
  --series-max-b: #e8837a;
  --series-min-a: #1d4e94;
  --series-min-b: #7badea;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-max: #3987e5;
    --series-min: #d95926;
    --series-max-a: #b8302a;
    --series-max-b: #d5744c;
    --series-min-a: #2f5fc7;
    --series-min-b: #459fcc;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --series-max: #3987e5;
  --series-min: #d95926;
  --series-max-a: #b8302a;
  --series-max-b: #d5744c;
  --series-min-a: #2f5fc7;
  --series-min-b: #459fcc;
}

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

h1 { font-size: 1.25rem; margin: 0 0 0.25rem 0; }
.subtitle { color: var(--text-secondary); margin-top: 0; }

nav.top-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
nav.top-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}
nav.top-nav a[aria-current="page"] {
  color: var(--series-max);
  font-weight: 600;
}
nav.top-nav a:hover { color: var(--text-primary); }

input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 1rem;
}
button {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--series-max);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }

#error {
  color: var(--series-min);
  margin-bottom: 1rem;
  display: none;
}

.chart-wrap {
  position: relative;
  height: 300px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.card h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: right;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--grid);
}
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; }

.missing-row td {
  color: var(--muted);
  font-style: italic;
  text-align: left;
}
