/* Poppins is not shipped (no third-party requests, D14); the system font stack is used. */
/* Layer 1: palette (raw values, never used directly by components) */
:root {
  --teal-50: #e6f7f5;
  --teal-500: #14a89a;
  --teal-700: #0d6f66;
  --indigo-300: #a5b0f5;
  --indigo-500: #5865e0;
  --indigo-900: #1b1f4b;
  --amber-400: #f5b83d;
  --amber-600: #b87a00;
  --red-500: #d9485b;
  --green-500: #2e9e63;
  --slate-0: #ffffff;
  --slate-50: #f4f6fa;
  --slate-200: #dde2ec;
  --slate-500: #667089;
  --slate-800: #1c2236;
  --slate-900: #11152a;
  --slate-950: #0b0e1d;
}

/* Layer 2: semantic tokens, light by default */
:root, [data-theme="light"] {
  --bg: var(--slate-50);
  --surface: var(--slate-0);
  --border: var(--slate-200);
  --text: var(--slate-800);
  --text-muted: var(--slate-500);
  --accent: var(--indigo-500);
  --accent-soft: var(--indigo-300);
  --brand: var(--teal-700);
  --brand-soft: var(--teal-50);
  --ok: #1e7a49;
  --bad: #b8283c;
  --warn: var(--amber-600);
  --spark: var(--teal-500);
}

/* Layer 3: dark theme re-maps the semantic tokens */
[data-theme="dark"] {
  --bg: var(--slate-950);
  --surface: var(--slate-900);
  --border: #262c47;
  --text: #e8ebf5;
  --text-muted: #98a1bd;
  --accent: var(--indigo-300);
  --accent-soft: var(--indigo-900);
  --brand: var(--teal-500);
  --brand-soft: #0f2d2b;
  --ok: var(--green-500);
  --bad: #ff7a8a;
  --warn: var(--amber-400);
  --spark: var(--teal-500);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 20px clamp(12px, 4vw, 32px) 4px;
}
h1 { margin: 0; font-size: 1.5rem; font-weight: 600; color: var(--brand); }
h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 600; }
.muted { color: var(--text-muted); margin: 4px 0; font-size: .875rem; }
main {
  display: grid; gap: 16px; padding: 16px clamp(12px, 4vw, 32px) 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; min-width: 0;
}
.card.wide { grid-column: 1 / -1; }
.btn {
  font: inherit; color: var(--text); background: var(--surface); cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 16px;
}
.btn:hover { border-color: var(--accent); }
a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 6px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.list li:first-child { border-top: 0; }
.tag {
  display: inline-block; font-size: .75rem; padding: 0 8px; margin-right: 6px;
  border-radius: 999px; background: var(--accent-soft); color: var(--text);
}
.empty { color: var(--text-muted); font-style: italic; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }

.stations {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  list-style: none; margin: 0 0 8px; padding: 0;
}
@media (max-width: 360px) {
  .stations { grid-template-columns: repeat(3, 1fr); }
}
.stations li {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px; border-radius: 10px; border: 1px solid var(--border);
  color: var(--text-muted); font-size: .875rem;
}
.stations .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.stations li.active {
  background: var(--brand-soft); border-color: var(--brand); color: var(--text);
}
.stations li.active .dot { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

#spark svg { width: 100%; height: 64px; display: block; }
#spark rect { fill: var(--spark); }
