:root {
  --bg: #0b1220;
  --panel: rgba(10, 16, 28, 0.86);
  --text: #eef3fb;
  --muted: #9aacbf;
  --accent: #f4c430;
  --line: rgba(255, 255, 255, 0.12);
  font-family: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
a { color: var(--accent); }

#map { position: absolute; inset: 0; }

.topbar, .slider, .legend {
  position: absolute;
  z-index: 2;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.topbar {
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
}
.topbar h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: 0.01em; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.topbar label { white-space: nowrap; }
.topbar .controls { margin-left: auto; display: flex; gap: 16px; align-items: center; }

.slider {
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(920px, calc(100% - 32px));
  padding: 14px 18px 16px;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.year {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 600;
  min-width: 11ch;
}
button.icon {
  appearance: none;
  border: 0;
  background: #1b2a3d;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
}
button.icon:hover { background: #24364d; }
#speed {
  appearance: none;
  border: 1px solid var(--line);
  background: #1b2a3d;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
#speed:hover { background: #24364d; }
input[type="range"] { flex: 1; accent-color: var(--accent); }
.ticks {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin: 6px 48px 0 96px;
}
.meta { color: var(--muted); font-size: 12px; margin-top: 8px; }

#demo-error {
  position: absolute;
  z-index: 5;
  left: 16px;
  right: 16px;
  bottom: 110px;
  background: #3b1020;
  color: #ffd6de;
  border: 1px solid #7a2438;
  border-radius: 8px;
  padding: 10px 12px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.legend {
  top: 86px;
  right: 16px;
  padding: 12px 14px;
  font-size: 12px;
  min-width: 180px;
}
.swatch { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.swatch i {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
}
.ramp {
  height: 10px;
  border-radius: 4px;
  margin: 8px 0 4px;
}

.zoom-pill {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

#hover {
  display: none;
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: #fff;
  color: #111;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transform: translate(12px, 12px);
}
