:root {
  --bg-0: #0a0d12;
  --bg-1: #11161d;
  --bg-2: #1a212b;
  --line: #2a323e;
  --cyan: #4fd6ff;          /* Pioneer scale numbers */
  --cyan-glow: #9beaff;
  --cyan-deep: #1e7ea8;
  --green: #6cff8c;         /* tuning / signal meters */
  --green-glow: #b6ffc7;
  --amber: #ffd96b;         /* needle / pointer */
  --amber-glow: #ffefa8;
  --red: #ff3b3b;           /* FM-STEREO lamp */
  --text: #e6ecf2;
  --muted: #8a96a6;
  --pro: #c084fc;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 70% -10%, #1a2230 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #1c1530 0%, transparent 55%),
    var(--bg-0);
  color: var(--text);
  min-height: 100vh;
}

/* ───── Top bar ───── */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; backdrop-filter: blur(8px);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--cyan); }
.logo-mark {
  height: 60px;
  width: auto;
  display: block;
  filter:
    drop-shadow(0 0 6px rgba(79,214,255,.55))
    drop-shadow(0 0 14px rgba(79,214,255,.25));
  transition: filter .2s;
}
.logo-mark:hover {
  filter:
    drop-shadow(0 0 8px rgba(79,214,255,.8))
    drop-shadow(0 0 18px rgba(79,214,255,.4));
}
.brand-tag {
  font-size: 11px; color: var(--muted); letter-spacing: .15em; text-transform: uppercase;
  align-self: flex-end;
  margin-bottom: 12px;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .brand-tag { display: none; }
}
.topnav {
  display: flex; gap: 4px; margin-left: 12px;
  align-self: flex-end;
  margin-bottom: 4px;
}
.navbtn {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbtn:hover { color: var(--text); }
.navbtn.active {
  color: var(--cyan);
  border-color: transparent;
  background: transparent;
  text-shadow: 0 0 6px rgba(79,214,255,.5);
  position: relative;
}
.navbtn.active::before,
.navbtn.active::after {
  color: var(--cyan);
  font-weight: 400;
  font-size: 1.25em;
  letter-spacing: -.18em;
  text-shadow: 0 0 8px rgba(79,214,255,.75);
  display: inline-block;
  vertical-align: -.04em;
  opacity: .92;
}
.navbtn.active::before { content: "(("; margin-right: 10px; }
.navbtn.active::after  { content: "))"; margin-left:  10px; }

/* Scanner tab turns red while a public-safety / scanner feed is playing */
.navbtn.scanner-playing,
.navbtn.scanner-playing.active {
  color: var(--red);
  text-shadow: 0 0 6px rgba(255,59,59,.55);
}
.navbtn.scanner-playing.active::before,
.navbtn.scanner-playing.active::after {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255,59,59,.7);
}
.top-search-wrap {
  position: relative;
  display: flex; align-items: center;
  margin-left: 12px;
}
.top-search-icon {
  position: absolute;
  left: 10px;
  width: 14px; height: 14px;
  color: var(--muted);
  pointer-events: none;
  transition: color .15s;
}
.top-search-wrap input {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 12px 7px 30px;
  border-radius: 999px;
  outline: none;
  font-size: 13px;
  width: 220px;
  transition: all .18s ease;
}
.top-search-wrap input::placeholder { color: var(--muted); }
.top-search-wrap input:focus {
  border-color: var(--cyan);
  width: 280px;
  box-shadow: 0 0 0 1px rgba(79,214,255,.15), 0 0 10px rgba(79,214,255,.2);
}
.top-search-wrap:focus-within .top-search-icon { color: var(--cyan); }
@media (max-width: 900px) {
  .top-search-wrap input { width: 140px; }
  .top-search-wrap input:focus { width: 180px; }
}

.account { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.user-label { color: var(--muted); font-size: 13px; }
.pro-pill {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: rgba(192,132,252,.15); color: var(--pro); font-size: 10px; letter-spacing: .12em; font-weight: 700;
}

/* ───── Buttons / inputs ───── */
button.primary {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-deep));
  color: #021a25; border: 0; padding: 9px 16px; border-radius: 8px; font-weight: 700; cursor: pointer;
}
button.primary.now-playing {
  background: linear-gradient(180deg, var(--green), #3aa05a);
  color: #02250e;
  box-shadow: 0 0 10px rgba(108,255,140,.4), inset 0 0 6px rgba(255,255,255,.15);
  letter-spacing: .03em;
}
button.primary.now-playing::first-letter {
  /* the leading "●" — give it the pulse */
  animation: now-playing-dot 1.4s ease-in-out infinite;
}
@keyframes now-playing-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
button.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
button.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
input, select {
  background: var(--bg-1); color: var(--text); border: 1px solid var(--line);
  padding: 10px 12px; border-radius: 8px; outline: none; font-size: 14px;
}
input:focus, select:focus { border-color: var(--cyan); }

/* ───── Views ───── */
main { padding: 24px; max-width: 1280px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

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

/* ───── Tuner / Dial ───── */
.dial-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
@media (max-width: 980px) { .dial-wrap { grid-template-columns: 1fr; } }

.dial-frame {
  background: linear-gradient(180deg, #1a1c20 0%, #0a0c0f 100%);
  border: 1px solid #2a2d33;
  border-radius: 14px;
  padding: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 30px 60px -30px rgba(0,0,0,.8);
}

.dial-display {
  position: relative;
  display: flex; align-items: stretch; justify-content: space-between; gap: 16px;
  background: #050709;
  border: 1px solid #1a1d22;
  border-radius: 8px;
  padding: 26px 18px 14px;
  font-family: "Menlo", ui-monospace, monospace;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(79,214,255,.55);
  box-shadow: inset 0 0 40px rgba(0,0,0,.8);
  min-height: 60px;
}
.now-playing { display: flex; flex-direction: column; justify-content: center; }
.np-line1 { font-size: 18px; font-weight: 700; letter-spacing: .04em; color: var(--cyan); }
.np-track {
  font-size: 13px;
  color: rgba(155,234,255,.45);
  margin-top: 4px;
  letter-spacing: .04em;
  min-height: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
  transition: color .25s, text-shadow .25s;
}
.np-track.has-track {
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255,217,107,.45);
}
.np-line2 { font-size: 11px; color: rgba(155,234,255,.55); margin-top: 4px; letter-spacing: .08em; }

/* FM-STEREO red lamp inside the display */
.dial-display::before {
  content: "● FM STEREO";
  position: absolute; top: 6px; left: 18px;
  font-size: 9px; letter-spacing: .25em; font-weight: 700;
  color: var(--red);
  text-shadow: 0 0 6px rgba(255,59,59,.7);
}

/* "+ ADD STATION" button inside the now-playing display */
.add-current {
  align-self: center;
  background: rgba(79,214,255,.08);
  color: var(--cyan);
  border: 1px solid rgba(79,214,255,.4);
  padding: 7px 14px; border-radius: 4px;
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .18em; font-weight: 700;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(79,214,255,.6);
  box-shadow: inset 0 0 8px rgba(79,214,255,.15), 0 0 8px rgba(79,214,255,.2);
  transition: all .15s;
  white-space: nowrap;
}
.add-current:hover {
  background: rgba(79,214,255,.18);
  box-shadow: inset 0 0 12px rgba(79,214,255,.3), 0 0 14px rgba(79,214,255,.4);
}
.add-current.saved {
  color: var(--green); border-color: rgba(108,255,140,.5);
  text-shadow: 0 0 6px rgba(108,255,140,.6);
  background: rgba(108,255,140,.08);
}
.add-current.hidden { display: none; }

/* Oscilloscope replacing the old signal bars */
.scope-wrap {
  align-self: center;
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
}
.scope-mode {
  background: transparent;
  color: rgba(108,255,140,.55);
  border: 1px solid rgba(108,255,140,.25);
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: .15em;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.4;
  transition: all .15s;
}
.scope-mode:hover {
  color: var(--green);
  border-color: rgba(108,255,140,.65);
  text-shadow: 0 0 4px rgba(108,255,140,.55);
  box-shadow: 0 0 6px rgba(108,255,140,.25);
}
.scope {
  width: 140px;
  height: 56px;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at center, rgba(108,255,140,.05) 0%, transparent 75%),
    #02060a;
  border: 1px solid rgba(108,255,140,.18);
  box-shadow:
    inset 0 0 14px rgba(0,0,0,.7),
    0 0 8px rgba(108,255,140,.05);
  display: block;
}

.dial-scale {
  position: relative;
  height: 130px;
  margin: 22px 4px 6px;
  background: linear-gradient(180deg, #050709 0%, #0a0d10 100%);
  border: 1px solid #1a1d22;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,.7),
    inset 0 -2px 8px rgba(0,0,0,.5);
}
/* MHz / kHz unit labels at right edge */
.dial-scale::after {
  content: "MHz\Akz";
  position: absolute; right: 6px; top: 22px;
  font-family: "Menlo", ui-monospace, monospace; font-size: 9px;
  color: #d6d6d6; white-space: pre;
  letter-spacing: .1em; line-height: 38px;
  text-shadow: 0 0 4px rgba(255,255,255,.3);
}
.scale-line {
  position: absolute; left: 0; right: 0; top: 40%;
  height: 1px; background: var(--cyan);
  box-shadow: 0 0 6px rgba(79,214,255,.6);
  opacity: .85;
}
/* second (AM) scale line — closer to FM than before */
.dial-scale .scale-line + .scale-line {
  top: 60%;
  background: var(--cyan-deep);
  box-shadow: 0 0 4px rgba(30,126,168,.5);
}
.scale-ticks { position: absolute; inset: 0; }
.scale-ticks .tick {
  position: absolute; top: 40%; width: 1px;
  background: var(--cyan);
  box-shadow: 0 0 4px rgba(79,214,255,.7);
  transform: translateY(-100%);
}
.scale-ticks .tick.major { height: 18px; width: 2px; }
.scale-ticks .tick.minor { height: 9px; opacity: .7; }
.scale-numbers {
  position: absolute; left: 0; right: 0; top: 6px;
  font-family: "Menlo", ui-monospace, monospace; font-size: 12px; font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(79,214,255,.7);
  letter-spacing: .04em;
}
.scale-numbers span {
  position: absolute; transform: translateX(-50%);
}
.scale-numbers span.am-num {
  top: 80px;
  color: var(--cyan-deep);
  text-shadow: 0 0 4px rgba(30,126,168,.6);
  font-size: 10px;
  font-weight: 600;
}
/* AM scale line (added by JS) */
.scale-line.am {
  position: absolute; left: 0; right: 0; top: 60%;
  height: 1px; background: var(--cyan-deep);
  box-shadow: 0 0 4px rgba(30,126,168,.5);
  opacity: .8;
}
/* "FM" sits just below its scale line; "AM" just above its line */
.scale-ticks::before {
  content: "FM";
  position: absolute; left: 4px; top: 40%;
  margin-top: 2px;
  font-family: "Menlo", ui-monospace, monospace; font-size: 10px; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 6px rgba(79,214,255,.7);
}
.scale-ticks::after {
  content: "AM";
  position: absolute; left: 4px; top: 60%;
  transform: translateY(-100%);
  margin-top: -2px;
  font-family: "Menlo", ui-monospace, monospace; font-size: 10px; font-weight: 700;
  color: var(--cyan-deep); text-shadow: 0 0 4px rgba(30,126,168,.6);
}

.favorites-pegs { position: absolute; inset: 0; pointer-events: none; }
.peg {
  position: absolute; top: 33%; width: 14px; height: 18px;
  transform: translateX(-50%);
  pointer-events: auto; cursor: pointer;
}
.peg::before {
  content: ""; display: block; width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 9px solid var(--red);
  filter: drop-shadow(0 0 4px rgba(255,59,59,.7));
}
.peg::after {
  content: attr(data-label);
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--cyan); white-space: nowrap;
  background: rgba(5,7,9,.95); padding: 2px 6px; border-radius: 3px;
  border: 1px solid rgba(79,214,255,.4);
  text-shadow: 0 0 4px rgba(79,214,255,.6);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.peg:hover::after { opacity: 1; }

/* Refined SX-990-style pointer: hairline stem with a polished gold cap */
.needle {
  position: absolute; top: -2px; bottom: -2px; width: 1px;
  background: linear-gradient(180deg,
    rgba(255,217,107,.95) 0%,
    rgba(255,217,107,.7) 40%,
    rgba(201,162,58,.55) 100%);
  box-shadow:
    0 0 4px rgba(255,217,107,.7),
    0 0 12px rgba(255,217,107,.25);
  transform: translateX(-.5px);
  pointer-events: none;
}
.needle::before {
  content: ""; position: absolute; top: 30%; left: -2.5px;
  width: 6px; height: 6px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%,
      #fff5cc 0%,
      #ffd96b 35%,
      #c89a2e 75%,
      #6e521b 100%);
  box-shadow:
    0 0 5px rgba(255,217,107,.7),
    inset 0 .5px .5px rgba(255,255,255,.6),
    inset 0 -.5px .5px rgba(0,0,0,.4);
  border: .5px solid rgba(0,0,0,.35);
}

/* Slim 2px dial track with the thin amber needle riding it.
   Matches the volume slider's styling pattern: track on the pseudo-element,
   transparent input as hit-area, thumb negatively margined to center. */
#dialSlider {
  -webkit-appearance: none; appearance: none;
  background: transparent;
  width: 100%; height: 22px;
  margin-top: 8px;
  padding: 0; border: none;
  outline: none;
  cursor: pointer;
}
#dialSlider::-webkit-slider-runnable-track {
  height: 2px;
  border: none; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,217,107,.10), rgba(0,0,0,.4));
  box-shadow: 0 0 4px rgba(255,217,107,.08);
}
#dialSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px; height: 22px; border-radius: 1px;
  background: linear-gradient(180deg,
    rgba(255,217,107,.95) 0%,
    rgba(255,217,107,.7) 50%,
    rgba(201,162,58,.55) 100%);
  border: none; cursor: grab;
  margin-top: -10px;          /* center 22px thumb on 2px track */
  box-shadow: 0 0 4px rgba(255,217,107,.8), 0 0 10px rgba(255,217,107,.3);
}
#dialSlider::-moz-range-track {
  height: 2px;
  border: none; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,217,107,.10), rgba(0,0,0,.4));
}
#dialSlider::-moz-range-thumb {
  width: 2px; height: 22px; border-radius: 1px;
  background: linear-gradient(180deg,
    rgba(255,217,107,.95) 0%,
    rgba(255,217,107,.7) 50%,
    rgba(201,162,58,.55) 100%);
  border: none; cursor: grab;
  box-shadow: 0 0 4px rgba(255,217,107,.8), 0 0 10px rgba(255,217,107,.3);
}

/* ───── Live caption bar ───── */
.caption-bar {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 8px 12px;
  background: #050709;
  border: 1px solid #1a1d22;
  border-radius: 6px;
  box-shadow: inset 0 0 24px rgba(0,0,0,.7);
  min-height: 36px;
}
.caption-toggle {
  background: transparent;
  border: 1px solid rgba(108,255,140,.3);
  color: rgba(108,255,140,.55);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: .15em;
  cursor: pointer;
  transition: all .15s;
}
.caption-toggle:hover {
  color: var(--green);
  border-color: var(--green);
  text-shadow: 0 0 4px rgba(108,255,140,.55);
}
.caption-toggle.armed {
  background: rgba(108,255,140,.14);
  color: var(--green);
  border-color: var(--green);
  text-shadow: 0 0 6px rgba(108,255,140,.7);
  box-shadow: inset 0 0 8px rgba(108,255,140,.2), 0 0 8px rgba(108,255,140,.18);
  animation: caption-armed 1.8s ease-in-out infinite;
}
@keyframes caption-armed {
  0%, 100% { box-shadow: inset 0 0 8px rgba(108,255,140,.2), 0 0 8px rgba(108,255,140,.18); }
  50%      { box-shadow: inset 0 0 12px rgba(108,255,140,.35), 0 0 14px rgba(108,255,140,.4); }
}
.caption-lang {
  background: #0a0d10;
  color: var(--green);
  border: 1px solid rgba(108,255,140,.18);
  border-radius: 4px;
  padding: 4px 6px;
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 11px;
  cursor: pointer;
  outline: none;
  text-shadow: 0 0 4px rgba(108,255,140,.4);
}
.caption-lang:focus { border-color: var(--green); }
.caption-text {
  position: relative;
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 12px;
  color: rgba(108,255,140,.45);
  text-shadow: 0 0 4px rgba(108,255,140,.25);
  letter-spacing: .03em;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
}
.caption-text.live {
  color: var(--green);
  text-shadow: 0 0 6px rgba(108,255,140,.45);
}
/* The track holds the running transcript and slides left as new text arrives */
.caption-text .caption-track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}
.caption-text .caret {
  display: inline-block;
  width: 6px; height: 11px;
  background: var(--green);
  margin-left: 3px;
  vertical-align: middle;
  animation: caption-caret .9s steps(2) infinite;
}
@keyframes caption-caret { 50% { opacity: 0; } }

.player {
  display: flex; align-items: center; gap: 18px; margin-top: 18px;
  flex-wrap: wrap;
}
.play {
  width: 44px; height: 44px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #0d1418 0%, #050709 70%);
  border: 1px solid rgba(79,214,255,.45);
  color: var(--cyan);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(79,214,255,.08),
    inset 0 0 10px rgba(79,214,255,.08),
    0 2px 6px rgba(0,0,0,.6);
  transition: all .18s ease;
}
.play:hover {
  border-color: rgba(79,214,255,.85);
  color: var(--cyan-glow);
  box-shadow:
    0 0 0 1px rgba(79,214,255,.2),
    0 0 14px rgba(79,214,255,.35),
    inset 0 0 12px rgba(79,214,255,.18);
}
.play .ico {
  width: 14px; height: 14px;
  fill: currentColor;
  filter: drop-shadow(0 0 4px rgba(79,214,255,.65));
}
.play .ico-stop { display: none; }
.play.playing .ico-play { display: none; }
.play.playing .ico-stop { display: block; }
.play.playing {
  border-color: rgba(255,59,59,.55);
  color: var(--red);
  box-shadow:
    0 0 0 1px rgba(255,59,59,.12),
    0 0 14px rgba(255,59,59,.3),
    inset 0 0 12px rgba(255,59,59,.18);
}
.play.playing .ico { filter: drop-shadow(0 0 4px rgba(255,59,59,.7)); }
.vol { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-size: 12px; letter-spacing: .15em; text-shadow: 0 0 6px rgba(79,214,255,.5); }
.vol input { width: 140px; }

/* Sleek volume slider — used by both the main player and the mini-tuner.
   Track styled via the pseudo-element so the bar stays thin even though the
   input element itself is taller (to give the thumb hover-able area). */
#volSlider, #miniVolSlider {
  -webkit-appearance: none; appearance: none;
  background: transparent;
  height: 8px;
  padding: 0; margin: 0; border: none;
  outline: none;
  cursor: pointer;
}
#volSlider::-webkit-slider-runnable-track,
#miniVolSlider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(to right,
    var(--cyan) 0%, var(--cyan) var(--vol-fill, 70%),
    rgba(79,214,255,.14) var(--vol-fill, 70%), rgba(79,214,255,.14) 100%);
  box-shadow: 0 0 4px rgba(79,214,255,.2);
}
#volSlider::-webkit-slider-thumb,
#miniVolSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--cyan-glow), var(--cyan));
  border: none;
  margin-top: -3px;          /* center 8px thumb on 2px track */
  box-shadow: 0 0 5px rgba(79,214,255,.7);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
#volSlider::-webkit-slider-thumb:hover,
#miniVolSlider::-webkit-slider-thumb:hover {
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(79,214,255,.9);
}
#volSlider::-moz-range-track,
#miniVolSlider::-moz-range-track {
  height: 2px;
  border: none; border-radius: 999px;
  background: linear-gradient(to right,
    var(--cyan) 0%, var(--cyan) var(--vol-fill, 70%),
    rgba(79,214,255,.14) var(--vol-fill, 70%), rgba(79,214,255,.14) 100%);
}
#volSlider::-moz-range-thumb,
#miniVolSlider::-moz-range-thumb {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); border: none;
  box-shadow: 0 0 5px rgba(79,214,255,.7);
  cursor: pointer;
}
.band { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.band-btn {
  background: #050709; color: var(--cyan-deep); border: 1px solid #1a2a35;
  padding: 6px 10px; border-radius: 4px; font-size: 11px; letter-spacing: .12em; cursor: pointer;
}
.band-btn:hover { color: var(--cyan); border-color: rgba(79,214,255,.4); }
.band-btn.active {
  background: rgba(79,214,255,.15); color: var(--cyan);
  border-color: var(--cyan);
  text-shadow: 0 0 6px rgba(79,214,255,.7);
  box-shadow: inset 0 0 8px rgba(79,214,255,.25);
}

/* VIZ toggle — replaces the dial window with a full oscilloscope */
.band-btn.viz-toggle.armed {
  background: rgba(108,255,140,.12); color: var(--green);
  border-color: var(--green);
  text-shadow: 0 0 6px rgba(108,255,140,.6);
  box-shadow: inset 0 0 8px rgba(108,255,140,.25), 0 0 8px rgba(108,255,140,.2);
}

.big-scope {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: none;
  border-radius: inherit;
  background: #02060a;
}
.dial-scale.viz {
  background: #02060a;
  border-color: rgba(108,255,140,.22);
  box-shadow:
    inset 0 0 22px rgba(0,0,0,.8),
    0 0 12px rgba(108,255,140,.08);
}
.dial-scale.viz .big-scope { display: block; }
.dial-scale.viz > .scale-line,
.dial-scale.viz > .scale-ticks,
.dial-scale.viz > .scale-numbers,
.dial-scale.viz > .favorites-pegs,
.dial-scale.viz > .needle { display: none !important; }
.dial-scale.viz::after { display: none; }

/* Live FM/AM tuning bands — when armed, the dial overrides saved stations
   and plays the nearest local broadcaster */
.band-btn.live-band.armed {
  background: rgba(255,217,107,.15); color: var(--amber);
  border-color: var(--amber);
  text-shadow: 0 0 6px rgba(255,217,107,.65);
  box-shadow: inset 0 0 8px rgba(255,217,107,.25), 0 0 8px rgba(255,217,107,.2);
  animation: live-band-pulse 2.4s ease-in-out infinite;
}
@keyframes live-band-pulse {
  0%, 100% { box-shadow: inset 0 0 8px rgba(255,217,107,.25), 0 0 8px rgba(255,217,107,.2); }
  50%      { box-shadow: inset 0 0 12px rgba(255,217,107,.4),  0 0 14px rgba(255,217,107,.4); }
}

/* Skip-ads toggle (replaces the old PODCAST band) */
.band-btn.skip-ads {
  display: inline-flex; align-items: center; gap: 6px;
}
.band-btn.skip-ads .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2a3540;
  box-shadow: inset 0 0 2px rgba(0,0,0,.6);
  transition: all .2s;
}
.band-btn.skip-ads.armed {
  background: rgba(255,217,107,.12);
  color: var(--amber);
  border-color: rgba(255,217,107,.7);
  text-shadow: 0 0 6px rgba(255,217,107,.55);
  box-shadow: inset 0 0 8px rgba(255,217,107,.2);
}
.band-btn.skip-ads.armed .dot {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber), 0 0 12px rgba(255,217,107,.5);
  animation: skip-pulse 1.6s ease-in-out infinite;
}
@keyframes skip-pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .35; }
}
.band-btn.skip-ads.triggered {
  background: rgba(255,59,59,.18);
  color: var(--red);
  border-color: var(--red);
  text-shadow: 0 0 6px rgba(255,59,59,.6);
}

/* favorites list — thin / streamlined */
.favorites-list {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 8px;
  max-height: 580px; overflow-y: auto;
}
.favorites-list h3 {
  margin: 0 0 8px; padding: 0 4px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
#favList { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.fav-item {
  display: grid; grid-template-columns: 34px 1fr 18px; gap: 10px; align-items: center;
  padding: 5px 6px; border-radius: 5px; cursor: pointer; border: 1px solid transparent;
  min-width: 0;
}
.fav-item:hover { background: var(--bg-2); border-color: var(--line); }
.fav-item.tuned { background: rgba(79,214,255,.08); border-color: rgba(79,214,255,.3); box-shadow: inset 0 0 8px rgba(79,214,255,.08); }
.fav-num { font-family: "Menlo", monospace; color: var(--cyan); font-size: 16px; font-weight: 600; text-shadow: 0 0 5px rgba(79,214,255,.55); text-align: right; }
.fav-text { min-width: 0; overflow: hidden; }
.fav-name {
  font-weight: 600; font-size: 12px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fav-meta {
  font-size: 10px; color: var(--muted); line-height: 1.2;
  white-space: nowrap; overflow: hidden;
  position: relative;
  --scroll-distance: 0px;
}
.meta-text {
  display: inline-block;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  overflow: hidden;
  vertical-align: bottom;
}
/* Auto-detected by JS when text actually overflows */
.fav-meta.scrolling .meta-text {
  text-overflow: clip;
  max-width: none;
  overflow: visible;
}
.fav-item:hover .fav-meta.scrolling .meta-text {
  animation: meta-marquee 7s ease-in-out infinite alternate;
}
@keyframes meta-marquee {
  0%, 12%   { transform: translateX(0); }
  88%, 100% { transform: translateX(var(--scroll-distance)); }
}
.fav-remove {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 0; line-height: 1; opacity: .55;
}
.fav-remove:hover { color: var(--red); opacity: 1; }
.empty { color: var(--muted); font-size: 11px; padding: 4px 6px; line-height: 1.4; }

/* ───── Discover / Podcasts grid ───── */
.search-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-row input { flex: 1; min-width: 240px; }
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.card .title { font-weight: 700; }
.card .sub { font-size: 12px; color: var(--muted); }
.card .row { display: flex; gap: 8px; margin-top: 6px; }
.card .row button { flex: 1; }
.card .star {
  background: transparent; border: 1px solid var(--line); color: var(--cyan); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; font-size: 14px;
}
.card .star.on { background: var(--cyan); color: #021a25; box-shadow: 0 0 10px rgba(79,214,255,.4); }

.episodes { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.ep-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.ep-title { font-size: 13px; }
.ep-date { font-size: 11px; color: var(--muted); }

/* ───── Scanner view ───── */
.scanner-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.scanner-title {
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 16px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--red);
  text-shadow: 0 0 6px rgba(255,59,59,.55);
  display: inline-flex; align-items: center; gap: 10px;
}
.dot-live {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red), 0 0 16px rgba(255,59,59,.5);
  animation: scanner-pulse 1.4s ease-in-out infinite;
}
@keyframes scanner-pulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.25); }
}
.scanner-sub { color: var(--muted); font-size: 13px; }

.scanner-types {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.scanner-type-btn {
  background: var(--bg-1);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  cursor: pointer;
  transition: all .15s;
}
.scanner-type-btn:hover {
  color: var(--text);
  border-color: rgba(255,59,59,.4);
}
.scanner-type-btn.active {
  background: rgba(255,59,59,.12);
  color: var(--red);
  border-color: var(--red);
  text-shadow: 0 0 6px rgba(255,59,59,.55);
  box-shadow: inset 0 0 8px rgba(255,59,59,.18), 0 0 8px rgba(255,59,59,.18);
}

#scannerResults .card .star { color: var(--red); }
#scannerResults .card .star.on { background: var(--red); color: #1a0606; box-shadow: 0 0 10px rgba(255,59,59,.4); }

/* ───── AI scan ───── */
.scan-card {
  max-width: 760px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(192,132,252,.06), transparent), var(--bg-1);
  border: 1px solid var(--line); border-radius: 16px; padding: 24px;
}
.scan-card h2 { margin: 0 0 6px; }
.scan-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; margin: 18px 0 14px; }
@media (max-width: 700px) { .scan-form { grid-template-columns: 1fr; } }
.scan-log {
  background: #050709; border: 1px solid #1a1d22; border-radius: 6px;
  padding: 14px; min-height: 200px; max-height: 380px; overflow-y: auto;
  font-family: "Menlo", ui-monospace, monospace; font-size: 12px;
  color: var(--green); text-shadow: 0 0 4px rgba(108,255,140,.4);
  box-shadow: inset 0 0 30px rgba(0,0,0,.6);
}
.scan-log .hit { color: var(--amber); text-shadow: 0 0 6px rgba(255,217,107,.6); }
.scan-log .err { color: var(--red); text-shadow: 0 0 4px rgba(255,59,59,.5); }

/* ───── Modal ───── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: min(420px, 92vw); display: flex; flex-direction: column; gap: 10px;
}
.modal-card h3 { margin: 0; }
.pro-toggle { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ───── Mini Tuner (persistent bottom bar) ───── */
.mini-tuner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  background:
    linear-gradient(180deg, rgba(10,13,18,.7) 0%, rgba(10,13,18,.92) 100%);
  border-top: 1px solid rgba(79,214,255,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 4;
  box-shadow: 0 -8px 24px rgba(0,0,0,.5);
}
.mini-tuner.show { display: flex; }
body.has-mini-tuner main { padding-bottom: 80px; }

.mini-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #0d1418 0%, #050709 70%);
  border: 1px solid rgba(79,214,255,.45);
  color: var(--cyan);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
  box-shadow:
    inset 0 0 8px rgba(79,214,255,.08),
    0 2px 6px rgba(0,0,0,.5);
  transition: all .15s;
}
.mini-play:hover {
  border-color: rgba(79,214,255,.85);
  color: var(--cyan-glow);
  box-shadow: 0 0 12px rgba(79,214,255,.3), inset 0 0 10px rgba(79,214,255,.15);
}
.mini-play .ico { width: 11px; height: 11px; fill: currentColor;
  filter: drop-shadow(0 0 3px rgba(79,214,255,.55)); }
.mini-play .ico-stop { display: none; }
.mini-play.playing .ico-play { display: none; }
.mini-play.playing .ico-stop { display: block; }
.mini-play.playing {
  border-color: rgba(255,59,59,.55);
  color: var(--red);
  box-shadow: 0 0 12px rgba(255,59,59,.3), inset 0 0 10px rgba(255,59,59,.15);
}
.mini-play.playing .ico { filter: drop-shadow(0 0 3px rgba(255,59,59,.6)); }

.mini-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.mini-name {
  font-size: 13px; font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 5px rgba(79,214,255,.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: "Menlo", ui-monospace, monospace;
  letter-spacing: .04em;
}
.mini-meta {
  font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: .04em;
}

.mini-vol {
  display: flex; align-items: center; gap: 8px;
  color: var(--cyan); font-size: 10px; letter-spacing: .15em;
  text-shadow: 0 0 5px rgba(79,214,255,.4);
  flex-shrink: 0;
}
.mini-vol input { width: 110px; }

.mini-open {
  background: transparent;
  border: 1px solid rgba(79,214,255,.25);
  color: var(--muted);
  border-radius: 6px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.mini-open svg { width: 16px; height: 16px; }
.mini-open:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(79,214,255,.25), inset 0 0 6px rgba(79,214,255,.15);
}
@media (max-width: 640px) {
  .mini-vol { display: none; }
  .mini-tuner { padding: 8px 14px; gap: 12px; }
}

/* ───── Discover layout (globe left, search right) ───── */
.discover-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1024px) {
  .discover-layout { grid-template-columns: 1fr; }
}
.discover-left {
  position: sticky; top: 88px;
  background:
    radial-gradient(700px 350px at 30% 20%, rgba(79,214,255,.06), transparent 60%),
    linear-gradient(180deg, #050709, #0a0c0f);
  border: 1px solid #1a1d22;
  border-radius: 14px;
  padding: 18px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.discover-right { min-width: 0; }

/* ───── 3D Globe ───── */
#globe {
  width: 100%; aspect-ratio: 1 / 1; max-width: 380px; margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 0 30px rgba(79,214,255,.15));
}
#globe svg { display: block; cursor: grab; }
#globe svg:active { cursor: grabbing; }

.globe-sphere-bg {
  fill: radial-gradient(circle at 30% 30%, #0a1a26, #02060a);
  fill: #0a1a26;
}
.globe-ocean {
  fill: url(#oceanGradient);
  stroke: rgba(79,214,255,.5);
  stroke-width: 1;
  filter: drop-shadow(0 0 12px rgba(79,214,255,.4));
}
.globe-graticule {
  fill: none;
  stroke: rgba(79,214,255,.18);
  stroke-width: .5;
}
.globe-country {
  fill: rgba(79,214,255,.12);
  stroke: rgba(79,214,255,.7);
  stroke-width: .6;
  cursor: pointer;
  transition: fill .12s;
}
.globe-country:hover {
  fill: rgba(255,217,107,.45);
  stroke: var(--amber);
}
.globe-country.active {
  fill: rgba(255,59,59,.5);
  stroke: var(--red);
}

/* Pins for saved stations on the globe */
.globe-pins .pin { pointer-events: none; }
.globe-pins .pin-dot {
  fill: var(--amber);
  stroke: rgba(255,255,255,.85);
  stroke-width: .5;
  filter: drop-shadow(0 0 4px rgba(255,217,107,.9));
}
.globe-pins .pin-glow {
  fill: rgba(255,217,107,.18);
  stroke: rgba(255,217,107,.4);
  stroke-width: .4;
  animation: pin-pulse 2.4s ease-in-out infinite;
}
@keyframes pin-pulse {
  0%, 100% { r: 6; opacity: .6; }
  50%      { r: 9; opacity: .25; }
}

.globe-title {
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 14px; font-weight: 700; letter-spacing: .22em;
  color: var(--cyan); text-shadow: 0 0 8px rgba(79,214,255,.5);
  text-align: center;
  text-transform: uppercase;
}
.globe-sub { color: var(--muted); font-size: 11px; text-align: center; }
.globe-info-bar {
  display: flex; align-items: center; gap: 8px;
}
.globe-selected {
  flex: 1;
  min-height: 32px;
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 12px; color: var(--amber);
  text-shadow: 0 0 6px rgba(255,217,107,.4);
  background: rgba(255,217,107,.06);
  border: 1px solid rgba(255,217,107,.25);
  border-radius: 6px;
  padding: 7px 10px;
  display: flex; align-items: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.globe-selected.has-chips {
  flex-wrap: wrap; gap: 5px;
  white-space: normal; overflow: visible;
  padding: 6px;
}
.region-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: "Menlo", ui-monospace, monospace;
  font-size: 11px; font-weight: 600;
  background: rgba(255,217,107,.15);
  color: var(--amber);
  text-shadow: 0 0 4px rgba(255,217,107,.4);
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid rgba(255,217,107,.35);
  cursor: pointer;
  transition: all .12s;
}
.region-chip:hover {
  background: rgba(255,59,59,.18);
  color: var(--red);
  border-color: rgba(255,59,59,.5);
  text-shadow: 0 0 4px rgba(255,59,59,.5);
}
.globe-info-bar .ghost { padding: 6px 12px; font-size: 12px; }
.globe-loading { color: var(--muted); font-size: 12px; padding: 20px; text-align: center; }
