:root {
  --space: #0b0b0d;
  --glass: rgba(28, 28, 30, .66);
  --glass-2: rgba(255, 255, 255, .06);
  --hairline: rgba(255, 255, 255, .1);
  --ink: #f5f5f7;
  --muted: #98989d;
  --faint: #636366;
  --accent: #0a84ff;
  --ok: #30d158;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --data: #64d2ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--space);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#map { position: absolute; inset: 0; background: var(--space); }
.maplibregl-ctrl-attrib { background: rgba(11,11,13,.5) !important; font-size: 9px; }
.maplibregl-ctrl-attrib a { color: var(--faint) !important; }
.maplibregl-canvas { outline: none; }

/* ---------- brand ---------- */
#brand { position: absolute; top: 20px; left: 24px; z-index: 10; pointer-events: none; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.freq-readout { margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
#freq-name { font-size: 15px; font-weight: 600; }
#freq-num {
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.freq-question { margin-top: 2px; font-size: 12px; color: var(--muted); max-width: 260px; line-height: 1.45; }

/* ---------- page links ---------- */
.pages { margin-top: 8px; display: flex; gap: 12px; pointer-events: auto; }
.pages a {
  font-size: 12px; font-weight: 500; color: var(--accent);
  text-decoration: none;
}
.pages a:hover { text-decoration: underline; }

/* ---------- sub-dial (channel subsections) ---------- */
#subdial {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 3px;
  width: fit-content;
  pointer-events: auto;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
#subdial button {
  appearance: none; background: none; border: none;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  padding: 4px 11px; border-radius: 7px;
  transition: background .15s ease, color .15s ease;
}
#subdial button:hover { color: var(--ink); background: var(--glass-2); }
#subdial button.active { background: rgba(255,255,255,.14); color: var(--ink); }

/* ---------- HERE panel ---------- */
#here-panel {
  position: absolute; left: 24px; bottom: 96px; z-index: 10;
  width: 280px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  padding: 12px 14px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.here-head { display: flex; align-items: center; gap: 8px; }
.here-label {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: rgba(10,132,255,.14);
  padding: 2px 8px; border-radius: 99px;
}
.here-place {
  font-size: 12.5px; color: var(--muted); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#btn-locate {
  font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--accent);
  background: none; border: none; border-radius: 6px;
  padding: 3px 6px; cursor: pointer;
}
#btn-locate:hover { background: var(--glass-2); }
.here-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.here-body { margin-top: 10px; }
.hidden { display: none !important; }

.readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ro {
  background: var(--glass-2);
  border-radius: 10px; padding: 8px 10px 7px;
}
.ro.wide { grid-column: 1 / -1; }
.ro .k { font-size: 10.5px; font-weight: 500; color: var(--muted); display: block; }
.ro .val {
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  margin-top: 2px; display: block; font-variant-numeric: tabular-nums;
}
.ro .val small { font-size: 11px; color: var(--muted); font-weight: 500; }
.ro .sub { font-size: 10.5px; color: var(--muted); display: block; margin-top: 1px; }
.pm-link {
  display: block; text-decoration: none;
  font-size: 12px; font-weight: 500; color: var(--accent);
}
.pm-link:hover { background: rgba(10,132,255,.12); }

.val.good { color: var(--ok); }
.val.warn { color: var(--warn); }
.val.bad  { color: var(--bad); }

#spark { width: 100%; height: 40px; display: block; margin-top: 4px; }
.spark-label { font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* ---------- legend ---------- */
#legend {
  position: absolute; right: 24px; bottom: 96px; z-index: 10;
  background: var(--glass); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 10px 12px;
  font-size: 11px; color: var(--muted);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  max-width: 230px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
#legend .lg-title { font-size: 11px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
#legend .lg-row { display: flex; align-items: center; gap: 7px; margin: 3px 0; }
#legend .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
#legend .bar { height: 6px; border-radius: 3px; flex: 1; }

/* ---------- status line ---------- */
#statusline {
  position: absolute; top: 20px; right: 24px; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--muted);
}
#statusline .live { color: var(--ok); }
#btn-borders, #btn-spin {
  appearance: none; cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  padding: 4px 12px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
#btn-borders:hover, #btn-spin:hover { color: var(--ink); }
#btn-borders.on, #btn-spin.on { background: rgba(255,255,255,.16); color: var(--ink); }

/* ---------- global alert pill ---------- */
#alerts {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 15;
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--warn);
  background: var(--glass);
  border: 1px solid rgba(255, 159, 10, .35);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  max-width: min(60vw, 480px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#alerts.red { color: var(--bad); border-color: rgba(255, 69, 58, .4); }
#alerts .adot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: currentColor;
  animation: adotpulse 2s ease-in-out infinite;
}
@keyframes adotpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { #alerts .adot { animation: none; } }
#alerts:hover { background: rgba(255, 159, 10, .12); }
@media (max-width: 720px) {
  #alerts { top: 96px; max-width: calc(100% - 48px); }
}

/* ---------- Signal ticker + caption ---------- */
#ticker {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 14;
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 8px 12px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  width: min(440px, 60vw);
}
#btn-sound {
  appearance: none; background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 6px; opacity: .7;
}
#btn-sound:hover { background: var(--glass-2); opacity: 1; }
#btn-sound.on { opacity: 1; }
#ticker-lines { flex: 1; overflow: hidden; height: 54px; }
#ticker-lines .tline {
  font-size: 12px; line-height: 18px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#ticker-lines .tline:nth-child(2) { opacity: .55; }
#ticker-lines .tline:nth-child(3) { opacity: .3; }
#ticker-lines .tl {
  display: inline-block; min-width: 22px; margin-right: 6px;
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.channel-caption {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%);
  z-index: 12; pointer-events: none;
  font-size: 17px; font-weight: 600; color: var(--ink);
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
  max-width: min(86vw, 640px); text-align: center; line-height: 1.35;
  animation: captionfade 6.5s ease forwards;
}
@keyframes captionfade {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  8%, 75% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .channel-caption { animation: none; } }
@media (max-width: 720px) { #ticker { display: none !important; } }


/* ---------- People › Ballot countdown pill ---------- */
#ballot {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 14;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  max-width: min(70vw, 520px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#ballot .bdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--warn); animation: adotpulse 2s ease-in-out infinite; }
#ballot .bk { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
#ballot .bt { color: var(--warn); font-variant-numeric: tabular-nums; }
#ballot:hover { background: rgba(255,255,255,.1); }
@media (max-width: 720px) { #ballot { top: 140px; max-width: calc(100% - 48px); } }

/* ---------- People panels: reading + elections lists ---------- */
.plist { list-style: none; margin: 6px 0 0; padding: 0; }
.plist li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; border-top: 1px solid var(--hairline); font-size: 12.5px; }
.plist li:first-child { border-top: 0; }
.plist .n { font-size: 10.5px; color: var(--faint); min-width: 16px; font-variant-numeric: tabular-nums; }
.plist a { color: var(--ink); text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist a:hover { color: var(--accent); }
.plist .v { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plist .tier { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hairline); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.plist .tier.national { color: var(--warn); border-color: rgba(255,159,10,.4); }
.plist .wd { font-size: 10.5px; color: var(--faint); text-decoration: none; }
.plist .wd:hover { color: var(--accent); }
.psrc { font-size: 10.5px; color: var(--faint); margin-top: 6px; }


/* ---------- Body › substances card ---------- */
.subst { list-style: none; margin: 0; padding: 0; }
.subst li { display: grid; grid-template-columns: 82px 1fr; gap: 6px 10px; padding: 6px 0; border-top: 1px solid var(--hairline); font-size: 12px; align-items: start; }
.subst li:first-child { border-top: 0; padding-top: 0; }
.subst .sk { font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 1px; }
.subst .st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.subst .st i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.subst .sn { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

/* ---------- dial ---------- */
#dial {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; align-items: center; gap: 14px;
  padding: 0 16px 18px;
  pointer-events: none;
}
/* ---------- tuning knob ---------- */
#knob {
  position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%;
  pointer-events: auto; cursor: grab; touch-action: none; user-select: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 0 0 1px var(--hairline);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
#knob.dragging { cursor: grabbing; transition: none; }
#knob:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.knob-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255,255,255,.22) 0deg 2.5deg, rgba(255,255,255,0) 2.5deg 8deg),
    radial-gradient(circle at 50% 40%, #3a3a3e, #1a1a1c 70%);
}
.knob-cap {
  position: absolute; inset: 9px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #4a4a4f, #232326 60%, #151517);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.18), inset 0 -2px 4px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.6);
}
.knob-mark {
  position: absolute; left: 50%; top: 5px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 6px rgba(10,132,255,.8);
}
@media (prefers-reduced-motion: reduce) { #knob { transition: none; } }
@media (max-width: 720px) {
  #dial { gap: 10px; }
  #knob { width: 50px; height: 50px; }
  .knob-cap { inset: 8px; }
}
.dial-track {
  display: flex; gap: 2px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  overflow-x: auto;
  pointer-events: auto;
  padding: 4px;
  max-width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.chan {
  appearance: none; background: none; border: none;
  color: var(--muted); cursor: pointer;
  padding: 8px 16px; text-align: center;
  border-radius: 12px;
  font-family: var(--font);
  transition: background .15s ease, color .15s ease;
}
.chan .n { display: block; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.chan .f { display: block; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 1px; }
.chan:hover { background: var(--glass-2); color: var(--ink); }
.chan.active { background: rgba(255,255,255,.14); color: var(--ink); }
.chan.active .f { color: var(--muted); }

/* markers */
.here-pin {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(10,132,255,.25), 0 2px 8px rgba(0,0,0,.4);
  animation: pinpulse 2.6s ease-in-out infinite;
}
@keyframes pinpulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(10,132,255,.25), 0 2px 8px rgba(0,0,0,.4); }
  50%      { box-shadow: 0 0 0 9px rgba(10,132,255,.1), 0 2px 8px rgba(0,0,0,.4); }
}
@media (prefers-reduced-motion: reduce) {
  .here-pin, .iss-marker span { animation: none !important; }
  .chan { transition: none; }
}
.iss-marker {
  font-size: 9.5px; font-weight: 600; letter-spacing: .06em;
  color: var(--ink); display: flex; align-items: center; gap: 5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.iss-marker span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,.9);
}
.launch-marker {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  color: var(--warn); display: flex; align-items: center; gap: 5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.launch-marker span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 10px rgba(255,159,10,.9);
  animation: adotpulse 1.8s ease-in-out infinite;
}

/* popups */
.maplibregl-popup-content {
  background: var(--glass) !important; color: var(--ink) !important;
  border: 1px solid var(--hairline); border-radius: 10px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-family: var(--font); font-size: 12px; padding: 8px 11px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.maplibregl-popup-tip { border-top-color: var(--hairline) !important; border-bottom-color: var(--hairline) !important; }

@media (max-width: 720px) {
  #here-panel { width: calc(100% - 48px); bottom: 100px; }
  #legend { display: none; }
  .freq-question { display: none; }
  .chan { padding: 8px 10px; }
}

/* ---------- Future: year bar + HERE lists ---------- */
#future-bar {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 11;
  width: min(480px, calc(100% - 640px)); min-width: 300px; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  padding: 8px 12px; box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
#fut-play {
  appearance: none; flex: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  background: var(--glass-2); border: 1px solid var(--hairline); display: grid; place-items: center;
}
#fut-play svg { width: 11px; height: 11px; fill: var(--ink); }
#fut-play:hover { background: rgba(255,255,255,.14); }
.fut-yearbox { display: flex; flex-direction: column; flex: none; min-width: 72px; }
.fut-yearbox b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.fut-yearbox span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
#fut-slider { flex: 1; min-width: 0; accent-color: var(--accent); }
.fut-mode { display: flex; flex: none; gap: 2px; background: var(--glass-2); border-radius: 8px; padding: 2px; }
.fut-mode button {
  appearance: none; border: none; background: none; cursor: pointer; border-radius: 6px;
  font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 8px;
}
.fut-mode button.active { background: rgba(255,255,255,.14); color: var(--ink); }
#future-bar button:focus-visible, #fut-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.ch-future #here-panel { max-height: calc(100vh - 320px); overflow-y: auto; }
.fut-list { list-style: none; margin: 4px 0 0; padding: 0; }
.fut-list li { display: flex; flex-direction: column; gap: 1px; padding: 5px 0 5px 9px; border-top: 1px solid var(--hairline); position: relative; }
.fut-list li:first-child { border-top: 0; }
.fut-list li::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 1px; }
.fut-list li.g::before { background: var(--ok); }
.fut-list li.r::before { background: var(--bad); }
.fut-list b { font-size: 12px; font-weight: 600; }
.fut-list span { font-size: 11px; color: var(--muted); line-height: 1.35; }
@media (max-width: 1000px) { #future-bar { width: calc(100% - 48px); bottom: auto; top: 150px; } }
@media (max-width: 720px) {
  #future-bar { top: auto; bottom: 88px; min-width: 0; gap: 8px; padding: 6px 10px; }
  body.ch-future #here-panel { bottom: 146px; max-height: 42vh; }
  .fut-yearbox { min-width: 56px; }
  .fut-mode button { padding: 4px 6px; }
}

/* ---------- Radio: now-playing strip + station list ---------- */
#radio-now {
  display: flex; align-items: center; gap: 9px;
  margin: -2px 0 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}
#radio-now button {
  appearance: none; flex: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--glass-2); border: 1px solid var(--hairline);
  color: var(--ink); display: grid; place-items: center; padding: 0;
}
#radio-now button svg { width: 10px; height: 10px; fill: currentColor; }
#radio-now button:hover { background: rgba(255,255,255,.14); }
#radio-now button:focus-visible, .rlist li:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#rn-toggle { background: #ff375f !important; border-color: transparent !important; }
#radio-now[data-status="paused"] #rn-toggle, #radio-now[data-status="dead"] #rn-toggle { background: var(--glass-2) !important; border-color: var(--hairline) !important; }
#rn-next, #rn-close { width: 24px !important; height: 24px !important; color: var(--muted) !important; }
.rn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rn-text b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-text span { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#radio-now[data-status="dead"] .rn-text span { color: var(--warn); }
#radio-now[data-status="tuning"] #rn-toggle { animation: adotpulse 1.2s ease-in-out infinite; }

.rlist { list-style: none; margin: 6px -4px 0; padding: 0; max-height: min(340px, calc(100vh - 470px)); min-height: 96px; overflow-y: auto; }
.rlist li {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 5px 4px; border-radius: 7px; border-top: 1px solid var(--hairline);
}
.rlist li:first-child { border-top: 0; }
.rlist li:hover { background: var(--glass-2); }
.rlist .ri { flex: none; width: 18px; height: 18px; display: grid; place-items: center; color: var(--faint); }
.rlist .ri svg { width: 9px; height: 9px; fill: currentColor; }
.rlist li:hover .ri { color: var(--ink); }
.rlist .rb { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rlist .rb b { font-size: 12.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlist .rb span { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlist li.on .rb b, .rlist li.on .ri { color: #ff375f; }
.rlist li.dead { opacity: .4; }
.rlist li.dead .rb b { text-decoration: line-through; }
.psrc a { color: inherit; }
.psrc a:hover { color: var(--accent); }

.rn-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.rn-eq i { width: 2px; background: currentColor; border-radius: 1px; animation: rneq 0.9s ease-in-out infinite; }
.rn-eq i:nth-child(1) { height: 60%; }
.rn-eq i:nth-child(2) { height: 100%; animation-delay: -.3s; }
.rn-eq i:nth-child(3) { height: 40%; animation-delay: -.6s; }
@keyframes rneq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.rn-eq i { transform-origin: bottom; }
@media (prefers-reduced-motion: reduce) { .rn-eq i, #radio-now[data-status="tuning"] #rn-toggle { animation: none; } }

@media (max-width: 720px) {
  .rlist { max-height: 25vh; }
}
/* seven channels on a phone: tighten so the whole dial fits without scrolling */
@media (max-width: 430px) {
  .chan { padding: 8px 5px; }
  .chan .n { font-size: 12.5px; }
}

/* ---------- explanations: hover card + "i" button ---------- */
#explain {
  position: fixed; z-index: 40; left: 0; top: 0;
  width: 290px; max-width: calc(100vw - 24px);
  background: rgba(28, 28, 30, .9);
  border: 1px solid var(--hairline); border-radius: 12px;
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  padding: 10px 12px 11px;
  font-size: 12px; line-height: 1.45; color: var(--ink);
  pointer-events: none;
  visibility: hidden; opacity: 0; transition: opacity .12s ease;
}
#explain.show { visibility: visible; opacity: 1; }
#explain b { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
#explain p { margin: 0; }
#explain .ex-src { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--muted); }
#explain .ex-src span {
  display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 1px;
}
#btn-explain {
  appearance: none; cursor: pointer; pointer-events: auto; align-self: center;
  width: 17px; height: 17px; border-radius: 50%; padding: 0;
  font-family: Georgia, "Times New Roman", serif; font-size: 11px; font-style: italic; font-weight: 600; line-height: 1;
  color: var(--muted); background: var(--glass-2); border: 1px solid var(--hairline);
}
#btn-explain:hover, #btn-explain[aria-expanded="true"] { color: var(--ink); background: rgba(255,255,255,.16); }
#btn-explain:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { #explain { transition: none; } }

/* ---------- trends: ten-year arrow + sparkline inside a readout ---------- */
.ro { min-width: 0; overflow: hidden; }
.ro .tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 4px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ro .tr b { flex: none; }
.ro .tr i { flex: 1; min-width: 0; }
.ro .tr svg { flex: none; overflow: visible; }
.ro .tr polyline { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; opacity: .8; }
.ro .tr b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.ro .tr i { font-style: normal; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro .tr.good b, .ro .tr.good polyline { color: var(--ok); }
.ro .tr.bad b, .ro .tr.bad polyline { color: var(--bad); }
.ro .tr.flat b { color: var(--muted); }

/* ---------- Place: region hint on other channels ---------- */
.place-hint { border-left: 2px solid var(--data); }
.place-hint .k { color: var(--data); }
.place-hint .sub a { color: var(--accent); text-decoration: none; }
.place-hint .sub a:hover { text-decoration: underline; }

/* the HERE panel never climbs over the header block, whatever the channel */
#here-panel { max-height: calc(100vh - 96px - var(--brand-bottom, 200px) - 14px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 720px) {
  #here-panel { max-height: calc(100vh - 100px - var(--brand-bottom, 160px) - 54px); }
}

/* ---------- People › State and Faith ---------- */
.ro .civ { display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink); margin-top: 2px; }
.faith { list-style: none; margin: 8px 0 0; padding: 0; }
.faith li { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; font-size: 11.5px; padding: 3px 0; }
.faith .fk { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faith .fb { height: 6px; background: var(--glass-2); border-radius: 3px; overflow: hidden; }
.faith .fb i { display: block; height: 100%; border-radius: 3px; }
.faith .fv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------- hide buttons on panels ---------- */
.user-hidden { display: none !important; }
.hide-x {
  appearance: none; cursor: pointer; flex: none;
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  background: var(--glass-2); border: 1px solid var(--hairline); color: var(--muted);
  display: grid; place-items: center; opacity: .75; transition: opacity .15s ease, background .15s ease;
}
.hide-x svg { width: 10px; height: 10px; }
.hide-x:hover { opacity: 1; background: rgba(255,255,255,.16); color: var(--ink); }
.hide-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#legend .hide-x { position: absolute; top: 8px; right: 8px; }
#legend { padding-right: 36px; }
#ticker .hide-x, #future-bar .hide-x { align-self: center; }
.hide-x.beside {
  position: absolute; z-index: 15;
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
#btn-restore {
  appearance: none; cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--glass); border: 1px solid var(--hairline); border-radius: 99px; padding: 4px 12px;
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
#btn-restore:hover { background: rgba(10,132,255,.14); }
@media (max-width: 720px) {
  #statusline { flex-wrap: wrap; justify-content: flex-end; max-width: 60%; gap: 6px; }
  #status-text { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Mind › Radio: list filter inside the card ---------- */
.rfilter { display: flex; gap: 3px; background: var(--glass-2); border-radius: 8px; padding: 2px; margin-bottom: 7px; width: fit-content; }
.rfilter button { appearance: none; border: none; background: none; cursor: pointer; border-radius: 6px; font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 9px; }
.rfilter button.active { background: rgba(255,255,255,.14); color: var(--ink); }

/* ---------- State › Passport picker inside the card ---------- */
.pp-pick {
  appearance: none; width: 100%; margin-top: 3px;
  font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--glass-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 28px 6px 9px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}

/* ---------- State › Parties ---------- */
.parties { list-style: none; margin: 8px 0 0; padding: 0; }
.parties li { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 5px 0; border-top: 1px solid var(--hairline); }
.parties li:first-child { border-top: 0; }
.parties li.other { opacity: .6; }
.plogo { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; background: rgba(255,255,255,.9); padding: 2px; }
.plogo.pini { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; letter-spacing: .02em; background: #4a4a4f; padding: 0; }
.parties .pn { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.parties .pn b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parties .pn b small { font-weight: 500; color: var(--muted); }
.parties .pbar { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.parties .pbar i { display: block; height: 100%; border-radius: 3px; }
.parties .pv { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.parties .pv small { font-weight: 500; color: var(--muted); font-size: 11px; }
.parties .pv em { display: block; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.parties li.leads .pn b { color: var(--ok); }

/* ---------- State › Power ---------- */
.plist.power { counter-reset: none; max-height: min(420px, 45vh); overflow-y: auto; margin: 6px -4px 0; padding: 0 4px; }
.plist.power li { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; gap: 8px; align-items: center; }
.plist.power .pw { min-width: 0; display: flex; flex-direction: column; }
.plist.power .pw a { font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist.power .pw a:hover { color: var(--accent); }
.plist.power .pr { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist.power .pk { font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.plist.power li.pk-state .pk, .plist.power li.pk-government .pk { color: var(--warn); }
.plist.power li.pk-money .pk { color: var(--ok); }
.pfind { appearance: none; width: 100%; margin-top: 6px; font-family: var(--font); font-size: 12.5px; color: var(--ink); background: var(--glass-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 9px; }
.pfind::placeholder { color: var(--faint); }
.pkinds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pkinds button { appearance: none; cursor: pointer; font-family: var(--font); font-size: 10.5px; font-weight: 600; color: var(--muted); background: var(--glass-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 2px 8px; }
.pkinds button.on { background: rgba(10,132,255,.18); color: var(--ink); border-color: rgba(10,132,255,.4); }
a.plain { color: inherit; text-decoration: none; } a.plain:hover { color: var(--accent); }
