:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #13161b;
  --panel-strong: #1c2028;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f0eeea;
  --muted: #7e8494;
  --accent: #7c6bff;
  --accent-2: #bfa8ff;
  --accent-3: #35d4ff;
  --hot: #ff6b6b;
  --ink: #07080a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 96px;
  background:
    linear-gradient(135deg, rgba(124, 107, 255, 0.16), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(191, 168, 255, 0.16), transparent 34%),
    radial-gradient(circle at 70% 88%, rgba(53, 212, 255, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 100px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #111217;
  box-shadow: 0 12px 30px rgba(124, 107, 255, 0.22);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.mini-panel p,
.track-copy p,
.station-meta {
  color: var(--muted);
}

.section-head span {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item,
.icon-button,
.play-button {
  border: 0;
  color: var(--text);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(135deg, rgba(124, 107, 255, 0.22), rgba(255, 255, 255, 0.07));
  color: var(--text);
}

.mini-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
}

.mini-panel p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.signal-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 5px rgba(53, 212, 255, 0.14);
  animation: signalPulse 2.4s ease-in-out infinite;
}

@keyframes signalPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(53, 212, 255, 0.12); }
  50% { box-shadow: 0 0 0 8px rgba(53, 212, 255, 0.22); }
}

.main-content {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 26px 30px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.utility-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.utility-button:hover,
.utility-button.active {
  border-color: rgba(124, 107, 255, 0.6);
  background: rgba(124, 107, 255, 0.14);
  color: var(--text);
}

.topbar,
.now-playing,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 560px;
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(380px, 100%);
}

.search-box svg {
  position: absolute;
  left: 15px;
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.87rem;
  transition: border-color 150ms ease;
}

.search-box input:focus {
  border-color: rgba(124, 107, 255, 0.7);
  background: rgba(124, 107, 255, 0.06);
}

.now-playing {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 20px 22px;
  border: 1px solid rgba(124, 107, 255, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(11, 13, 16, 0.97), rgba(16, 19, 25, 0.88)),
    url("https://images.unsplash.com/photo-1516280440614-37939bbacd81?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
  box-shadow: 0 0 0 1px rgba(124, 107, 255, 0.1), var(--shadow);
}

.now-playing::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 0% 50%, rgba(124, 107, 255, 0.22), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(53, 212, 255, 0.1), transparent 35%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.022) 0,
      rgba(255, 255, 255, 0.022) 1px,
      transparent 1px,
      transparent 40px
    );
}

.now-playing > * {
  position: relative;
  z-index: 1;
}

.cover-art {
  position: relative;
  overflow: hidden;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 108px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--ink);
  font-size: 3rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.now-playing.is-live {
  border-color: rgba(124, 107, 255, 0.38);
}

.now-playing.is-live .cover-art {
  animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.14),
      0 0 0 rgba(124, 107, 255, 0);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.22),
      0 0 28px rgba(124, 107, 255, 0.4);
  }
}

.cover-art img {
  width: 78%;
  max-height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.28));
}

.cover-art span {
  line-height: 1;
}

.track-copy {
  flex: 1;
  min-width: 0;
}

.track-copy h2 {
  margin-bottom: 5px;
  font-size: clamp(1.1rem, 2.2vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.track-copy p:last-child {
  margin-bottom: 0;
}

.song-id-panel {
  display: grid;
  gap: 3px;
  max-width: 480px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.song-id-label {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.song-id-panel strong {
  color: var(--text);
  font-size: 1rem;
}

.song-id-panel small {
  color: var(--muted);
  line-height: 1.45;
}

.song-id-panel[data-status="success"] {
  border-color: rgba(36, 224, 164, 0.5);
  background: rgba(36, 224, 164, 0.1);
}

.song-id-panel[data-status="loading"] {
  border-color: rgba(105, 183, 255, 0.55);
}

.song-id-panel[data-status="notice"] {
  border-color: rgba(255, 204, 102, 0.42);
}

.player-actions {
  display: grid;
  align-items: center;
  justify-items: end;
  gap: 8px;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-button:hover {
  background: rgba(255, 107, 107, 0.18);
  color: var(--hot);
}

.icon-button,
.play-button,
.identify-button {
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  transition: background 150ms ease, transform 100ms ease;
}

.icon-button {
  width: 40px;
  height: 40px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.icon-button.small,
.play-button.small {
  width: 38px;
  height: 38px;
}

.play-button.small {
  box-shadow: none;
}

.icon-button.active {
  background: rgba(255, 107, 107, 0.2);
  color: var(--hot);
}

.play-button {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 8px 28px rgba(124, 107, 255, 0.38);
  transition: transform 100ms ease, box-shadow 150ms ease;
}

.play-button:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 36px rgba(124, 107, 255, 0.52);
}

.play-button:active {
  transform: scale(0.96);
}

.identify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.identify-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.shazam-btn {
  border-color: rgba(41, 128, 239, 0.45);
  color: #5aabff;
}

.shazam-btn:hover {
  background: rgba(41, 128, 239, 0.15);
  border-color: rgba(41, 128, 239, 0.7);
  color: #82c4ff;
}

.shazam-btn.is-listening {
  background: rgba(41, 128, 239, 0.2);
  border-color: rgba(41, 128, 239, 0.8);
  color: #82c4ff;
  animation: shazam-pulse 1s ease-in-out infinite;
}

@keyframes shazam-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(41, 128, 239, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(41, 128, 239, 0); }
}

.shazam-key-form {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(41, 128, 239, 0.08);
  border: 1px solid rgba(41, 128, 239, 0.3);
  border-radius: var(--radius-sm);
}

.shazam-key-hint {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.shazam-key-hint a {
  color: #5aabff;
  text-decoration: none;
}

.shazam-key-hint a:hover { text-decoration: underline; }

.shazam-key-row {
  display: flex;
  gap: 8px;
}

.shazam-key-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.82rem;
}

.shazam-key-row input:focus {
  outline: none;
  border-color: rgba(41, 128, 239, 0.6);
}

.shazam-key-row button {
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: #2980ef;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}

.shazam-key-row button:hover { background: #1a6fd4; }

.volume-control {
  display: grid;
  grid-template-columns: 18px minmax(80px, 120px) 38px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.volume-control input {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.volume-control span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.identify-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.content-grid {
  display: grid;
  gap: 12px;
}

.visualizer-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(124, 107, 255, 0.18);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 30%, rgba(124, 107, 255, 0.14), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(53, 212, 255, 0.09), transparent 35%),
    rgba(255, 255, 255, 0.04);
}

.visualizer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visualizer-body {
  position: relative;
  display: grid;
  gap: 16px;
}

.snoop-dancer {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 78px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.snoop-dancer.visible {
  opacity: 1;
  transform: translateY(0);
}

.visualizer-panel.is-collapsed .visualizer-body {
  display: none;
}

.visualizer-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.visualizer-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.visualizer-preset:hover {
  border-color: rgba(124, 107, 255, 0.5);
  color: var(--text);
}

.visualizer-preset.active {
  border-color: transparent;
  background: var(--accent);
  color: var(--ink);
}

.visualizer-panel canvas {
  display: block;
  width: 100%;
  height: clamp(180px, 22vw, 300px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  background: #07080d;
  box-shadow: inset 0 0 60px rgba(124, 107, 255, 0.14);
}

#visualizerMode {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.station-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.station-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 45%);
  opacity: 0;
  transition: opacity 160ms ease;
}

.station-logo-bg {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 130px;
  height: 130px;
  opacity: 0.09;
  pointer-events: none;
  transform: rotate(-8deg);
}

.station-logo-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.station-logo {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 82px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 38%),
    var(--logo-bg);
}

.station-logo img {
  width: 100%;
  max-width: 200px;
  max-height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.24));
}

.station-logo span {
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 900;
}

.station-card:hover,
.station-card.active {
  border-color: rgba(124, 107, 255, 0.5);
  background: rgba(124, 107, 255, 0.07);
  transform: translateY(-3px);
}

.station-card:hover::before,
.station-card.active::before {
  opacity: 1;
}

.station-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.station-card h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.station-meta {
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.station-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.station-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.listen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(124, 107, 255, 0.3);
  transition: transform 100ms ease, box-shadow 150ms ease;
}

.listen-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(124, 107, 255, 0.48);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.sticky-player {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 860px;
  min-height: 64px;
  padding: 10px 14px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(11, 13, 16, 0.94);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 107, 255, 0.12);
  backdrop-filter: blur(22px);
}

.sticky-player[hidden] {
  display: none;
}

.sticky-station,
.sticky-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sticky-station img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.07);
}

.sticky-station strong,
.sticky-station span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-station span {
  color: var(--muted);
  font-size: 0.84rem;
}

.volume-control.mini {
  grid-template-columns: 20px minmax(80px, 130px);
}

.volume-control.mini span {
  display: none;
}

body.compact-mode .topbar h1,
body.compact-mode .topbar .eyebrow,
body.compact-mode .song-id-panel,
body.compact-mode .visualizer-panel,
body.compact-mode .station-note,
body.compact-mode .station-logo-bg {
  display: none;
}

body.compact-mode .main-content {
  gap: 12px;
}

body.compact-mode .now-playing {
  min-height: 110px;
}

body.compact-mode .cover-art {
  width: 76px;
}

body.compact-mode .station-card {
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 84px;
}

body.compact-mode .station-logo {
  min-height: 54px;
  padding: 7px;
}

body.compact-mode .station-top {
  min-width: 0;
  overflow: hidden;
}

body.compact-mode .station-card h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.compact-mode .station-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

body.compact-mode .station-actions {
  margin-top: 0;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  flex-shrink: 0;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mini-panel {
    display: none;
  }

  .main-content {
    padding: 20px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .search-box {
    width: 100%;
    min-width: unset;
  }

  .now-playing {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media (max-width: 640px) {
  body {
    padding-bottom: 160px;
  }

  /* ── Layout ── */
  .sidebar,
  .main-content {
    padding: 14px;
  }

  .main-content {
    gap: 10px;
  }

  /* ── Sidebar ── */
  .brand {
    min-height: 46px;
  }

  .brand-mark {
    width: 82px;
    height: 33px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .nav-item {
    gap: 0;
    justify-content: center;
    min-height: 40px;
    padding: 0;
    font-size: 0;
  }

  /* ── Topbar: hide text wrapper in compact mode, search full-width ── */
  body.compact-mode .topbar > div {
    display: none;
  }

  .search-box {
    width: 100%;
    min-width: unset;
  }

  /* ── Quick actions ── */
  .quick-actions {
    gap: 6px;
  }

  /* Icon-only pills for action buttons */
  #shuffleButton,
  #shareButton {
    padding: 0;
    gap: 0;
    width: 38px;
    font-size: 0;
    overflow: hidden;
  }

  /* Continuar retains label */
  #continueButton {
    font-size: 0.76rem;
    gap: 6px;
    max-width: calc(100% - 38px * 3 - 6px * 3);
  }

  /* ── Now-playing: 2-col grid ── */
  .now-playing {
    display: grid;
    grid-template-columns: 84px 1fr;
    align-items: start;
    min-height: auto;
    padding: 14px;
    gap: 10px;
  }

  .listener-badge {
    top: 10px;
    right: 10px;
    padding: 3px 7px;
    font-size: 0.67rem;
    gap: 4px;
  }

  .cover-art {
    grid-row: 1;
    grid-column: 1;
    width: 84px;
    font-size: 2.2rem;
  }

  .track-copy {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }

  .track-copy h2 {
    font-size: clamp(0.95rem, 4.5vw, 1.3rem);
    margin-bottom: 3px;
  }

  .track-copy p {
    font-size: 0.77rem;
  }

  .song-id-panel {
    margin-top: 8px;
    padding: 7px 9px;
  }

  .lyrics-panel {
    max-width: 100%;
    max-height: 90px;
    margin-top: 6px;
    padding: 7px 9px;
  }

  .lyrics-text {
    font-size: 0.77rem;
  }

  /* ── Player actions: flexbox — avoids grid placement bugs ── */
  .player-actions {
    grid-row: 2;
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-items: unset;
  }

  #favoriteButton {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  #pipButton {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .identify-button {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    font-size: 0.76rem;
    padding: 0 10px;
  }

  #playButton {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
  }

  /* Volume wraps to its own full-width row */
  .volume-control {
    flex-basis: 100%;
    min-height: 36px;
    grid-template-columns: 18px minmax(0, 1fr) 38px;
  }

  /* ── Visualizer ── */
  .visualizer-panel {
    padding: 12px;
    gap: 10px;
  }

  .visualizer-presets {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }

  .visualizer-presets::-webkit-scrollbar {
    display: none;
  }

  .visualizer-preset {
    flex-shrink: 0;
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.73rem;
  }

  .eq-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .eq-row::-webkit-scrollbar {
    display: none;
  }

  .eq-label {
    display: none;
  }

  .eq-preset {
    flex-shrink: 0;
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.71rem;
  }

  #visualizerMode {
    display: none;
  }

  .visualizer-panel canvas {
    height: clamp(140px, 42vw, 230px);
  }

  .snoop-dancer {
    width: 50px;
    right: 8px;
    bottom: 8px;
  }

  /* ── Station section ── */
  .section-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-head h2 {
    font-size: 1rem;
  }

  body.compact-mode .station-card {
    grid-template-columns: 60px minmax(0, 1fr);
    min-height: 72px;
    padding: 10px;
    gap: 8px;
  }

  body.compact-mode .station-logo {
    min-height: 48px;
    padding: 6px;
  }

  body.compact-mode .station-actions {
    grid-column: 1 / -1;
  }

  /* ── Sticky player ── */
  .sticky-player {
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: var(--radius);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    min-height: auto;
  }

  .sticky-actions {
    justify-content: space-between;
  }

  .volume-control.mini {
    flex: 1;
    grid-template-columns: 18px minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .sidebar,
  .main-content {
    padding: 10px;
  }

  .main-content {
    gap: 8px;
  }

  .brand-mark {
    width: 66px;
    height: 27px;
  }

  .now-playing {
    grid-template-columns: 72px 1fr;
    gap: 8px;
    padding: 11px;
  }

  .cover-art {
    width: 72px;
    font-size: 1.9rem;
  }

  .track-copy h2 {
    font-size: 0.95rem;
  }

  .song-id-panel,
  .lyrics-panel {
    font-size: 0.76rem;
  }

  /* PiP ocupa espaço mas não agrega em telas tiny */
  #pipButton {
    display: none;
  }

  /* Identify fica maior sem o PiP */
  .identify-button {
    font-size: 0.74rem;
  }

  #playButton {
    width: 44px;
    height: 44px;
  }

  .visualizer-panel canvas {
    height: clamp(120px, 40vw, 160px);
  }

  body.compact-mode .station-card {
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 66px;
    padding: 8px;
  }

  .sticky-player {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 10px 12px;
  }
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 18, 24, 0.97);
  backdrop-filter: blur(20px);
  animation: cookieSlideUp 0.35s ease;
}

.cookie-banner[hidden] {
  display: none;
}

@keyframes cookieSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.cookie-text {
  flex: 1;
  min-width: 0;
}

.cookie-text strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.95rem;
}

.cookie-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.cookie-decline {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.cookie-decline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.cookie-accept {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 107, 255, 0.3);
}

.cookie-accept:hover {
  background: var(--accent-2);
}

@media (max-width: 640px) {
  .snoop-dancer {
    width: 58px;
    right: 10px;
    bottom: 10px;
  }
}

@media (max-width: 640px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .cookie-icon {
    display: none;
  }

  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cookie-btn {
    min-height: 46px;
    font-size: 0.95rem;
  }
}

/* ── Dynamic accent ─────────────────────────────────────────── */
:root {
  --dyn-1: var(--accent);
  --dyn-2: var(--accent-2);
  transition: --dyn-1 0.6s ease, --dyn-2 0.6s ease;
}
.now-playing { transition: border-color 0.6s ease; }
.now-playing.is-live {
  border-color: rgba(124, 107, 255, 0.38); /* fallback */
  border-color: color-mix(in srgb, var(--dyn-1) 50%, transparent);
}

/* ── EQ row ──────────────────────────────────────────────────── */
.eq-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eq-label { color: var(--muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.eq-preset { min-height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: rgba(0,0,0,0.22); color: var(--muted); font-size: 0.75rem; font-weight: 700; transition: background 150ms, color 150ms, border-color 150ms; }
.eq-preset:hover { color: var(--text); border-color: rgba(124,107,255,0.5); }
.eq-preset.active { border-color: transparent; background: var(--accent); color: var(--ink); }

/* ── Lyrics ──────────────────────────────────────────────────── */
.lyrics-panel { max-width: 480px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0,0,0,0.22); backdrop-filter: blur(12px); max-height: 140px; overflow-y: auto; }
.lyrics-label { color: var(--accent-2); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.lyrics-text { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.75; white-space: pre-wrap; font-family: inherit; }

/* ── Listener badge ──────────────────────────────────────────── */
.listener-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; margin-bottom: 6px; border-radius: var(--radius-pill); background: rgba(0,0,0,0.35); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.08); font-size: 0.72rem; font-weight: 700; color: var(--text); width: fit-content; }
.listener-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; flex-shrink: 0; animation: signalPulse 2s ease-in-out infinite; }

/* ── Sleep timer active ──────────────────────────────────────── */
#sleepTimerButton.active { border-color: rgba(255,107,107,0.55); color: var(--hot); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-80px); z-index: 200; padding: 10px 22px; border-radius: var(--radius-pill); background: var(--accent); color: var(--ink); font-weight: 700; font-size: 0.88rem; pointer-events: none; transition: transform 0.28s cubic-bezier(.22,1,.36,1); }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Fullscreen ──────────────────────────────────────────────── */
:fullscreen .app-shell { grid-template-columns: 1fr; }
:fullscreen .sidebar { display: none; }
:fullscreen .main-content { padding: 0; gap: 0; }
:fullscreen .topbar, :fullscreen .quick-actions, :fullscreen .now-playing, :fullscreen .content-grid { display: none; }
:fullscreen .visualizer-panel { height: 100dvh; border: none; border-radius: 0; margin: 0; }
:fullscreen .visualizer-panel canvas { height: calc(100dvh - 80px); border-radius: 0; border: none; }
:-webkit-full-screen .app-shell { grid-template-columns: 1fr; }
:-webkit-full-screen .sidebar, :-webkit-full-screen .topbar, :-webkit-full-screen .quick-actions, :-webkit-full-screen .now-playing, :-webkit-full-screen .content-grid { display: none; }
:-webkit-full-screen .main-content { padding: 0; gap: 0; }
:-webkit-full-screen .visualizer-panel { height: 100dvh; border: none; border-radius: 0; }
:-webkit-full-screen .visualizer-panel canvas { height: calc(100dvh - 80px); border-radius: 0; border: none; }

/* ── Settings toggle (sidebar bottom) ───────────────────────── */
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.settings-toggle:hover,
.settings-toggle.active {
  background: rgba(124, 107, 255, 0.14);
  border-color: rgba(124, 107, 255, 0.5);
  color: var(--text);
}

/* ── Settings panel ──────────────────────────────────────────── */
.settings-panel {
  position: fixed;
  left: 14px;
  bottom: 72px;
  z-index: 100;
  width: 232px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(14, 16, 22, 0.98);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(124, 107, 255, 0.12);
  backdrop-filter: blur(28px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.settings-panel[hidden] { display: none; }
.settings-panel::-webkit-scrollbar { width: 4px; }
.settings-panel::-webkit-scrollbar-track { background: transparent; }
.settings-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
@keyframes settingsFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.settings-panel:not([hidden]) { animation: settingsFadeUp 0.18s ease; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.settings-header > span {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.settings-block { margin-bottom: 4px; }
.settings-block-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.settings-block-label svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Sleep options */
.sleep-options { display: flex; gap: 5px; flex-wrap: wrap; }
.sleep-opt {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.sleep-opt:hover { color: var(--text); border-color: rgba(124, 107, 255, 0.45); }
.sleep-opt.active { background: var(--accent); border-color: transparent; color: var(--ink); }

.sleep-countdown {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.28);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hot);
}
.sleep-countdown[hidden] { display: none; }

/* Toggle rows */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.settings-row-info { flex: 1; min-width: 0; }
.settings-row-name { display: block; font-size: 0.86rem; font-weight: 600; color: var(--text); }
.settings-row-desc { display: block; font-size: 0.73rem; color: var(--muted); margin-top: 2px; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-thumb {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 200ms ease, border-color 200ms ease;
}
.toggle-thumb::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 200ms ease, background 200ms ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.toggle-switch input:checked ~ .toggle-thumb {
  background: var(--accent);
  border-color: transparent;
}
.toggle-switch input:checked ~ .toggle-thumb::after {
  transform: translateX(18px);
  background: #fff;
}

/* Accent swatches */
.accent-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.accent-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.accent-swatch:hover { transform: scale(1.18); }
.accent-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18), 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Keyboard shortcuts */
.kbd-list { display: grid; gap: 7px; }
.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kbd-keys { display: flex; gap: 4px; }
.kbd-row > span {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
  flex: 1;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Settings footer */
.settings-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  opacity: 0.6;
}

/* Hide settings toggle on small screens (sidebar goes horizontal) */
@media (max-width: 1050px) {
  .settings-toggle { display: none; }
  .settings-panel { display: none !important; }
}
