:root {
  /* Nox Dark Intelligence is the radio base; light is an explicit override. */
  --bg: #0B1120;
  --bg-soft: #020617;
  --fg: #E5E7EB;
  --fg-strong: #F9FAFB;
  --card: #111827;
  --primary: #1D4ED8;
  --primary-hover: #2563EB;
  --primary-fg: #F9FAFB;
  --secondary: #1F2937;
  --muted: #9CA3AF;
  --border: rgb(31 41 55 / 0.95);
  --onair: #22C55E;
  --onair-text: #22C55E;
  --accent-gold: #FACC15;
  --accent-cyan: #22D3EE;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #F8FAFC;
  --bg-soft: #FDFBF7;
  --fg: #1E293B;
  --fg-strong: #0F172A;
  --card: #FFFFFF;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-fg: #FFFFFF;
  --secondary: #E2E8F0;
  --muted: #64748B;
  --border: rgb(226 232 240 / 0.95);
  --onair: #059669;
  --onair-text: #047857;
  --accent-gold: #F59E0B;
  --accent-cyan: #0891B2;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1120;
  --bg-soft: #020617;
  --fg: #E5E7EB;
  --fg-strong: #F9FAFB;
  --card: #111827;
  --primary: #1D4ED8;
  --primary-hover: #2563EB;
  --primary-fg: #F9FAFB;
  --secondary: #1F2937;
  --muted: #9CA3AF;
  --border: rgb(31 41 55 / 0.95);
  --onair: #22C55E;
  --onair-text: #22C55E;
  --accent-gold: #FACC15;
  --accent-cyan: #22D3EE;
}
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] { color-scheme: light; --bg:#F8FAFC; --bg-soft:#FDFBF7; --fg:#1E293B; --fg-strong:#0F172A; --card:#FFFFFF; --primary:#2563EB; --primary-hover:#1D4ED8; --primary-fg:#FFFFFF; --secondary:#E2E8F0; --muted:#64748B; --border:rgb(226 232 240 / 0.95); --onair:#059669; --onair-text:#047857; --accent-gold:#F59E0B; --accent-cyan:#0891B2; }
}


* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
html { -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); line-height: 1.5; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
img { max-width: 100%; display: block; outline: 1px solid rgb(255 255 255 / 0.1); outline-offset: -1px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.player {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 90%, transparent);
  padding: 10px 12px;
}
@media (min-width: 768px) { .player { padding: 10px 20px; } }

.player-row { display: flex; align-items: center; gap: 12px; }
.cover {
  width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; position: relative;
}
@media (min-width: 768px) { .cover { width: 56px; height: 56px; } }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.now { min-width: 0; flex: 1; }
.now-title { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) { .now-title { font-size: 16px; } }
.now-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.eq { display: none; align-items: flex-end; gap: 2px; height: 16px; margin-left: 8px; }
@media (min-width: 640px) { .eq { display: flex; } }
.eq span {
  width: 3px; height: 100%; border-radius: 99px; background: var(--primary); transform-origin: bottom;
  animation: eq 1s ease-in-out infinite; animation-play-state: paused; transform: scaleY(0.28); opacity: 0.4;
}
.eq.on span { animation-play-state: running; opacity: 1; transform: none; }
.eq span:nth-child(2) { animation-delay: 110ms; animation-duration: 0.9s; }
.eq span:nth-child(3) { animation-delay: 220ms; animation-duration: 0.72s; }
.eq span:nth-child(4) { animation-delay: 80ms; animation-duration: 1.08s; }
.eq span:nth-child(5) { animation-delay: 160ms; animation-duration: 0.84s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.28); }
  50% { transform: scaleY(1); }
}

.ctrl { display: flex; align-items: center; gap: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-outline { border: 1px solid var(--border); }
.btn-ghost { color: var(--fg); }
.btn-ghost:hover { background: var(--secondary); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 12px; border-radius: 999px; }
.btn-lg { height: 48px; padding: 0 20px; border-radius: 999px; }
.btn-icon { width: 36px; padding: 0; border-radius: 8px; }
.theme-toggle svg { width: 17px; height: 17px; }
.btn-play {
  width: 48px; height: 48px; padding: 0; border-radius: 999px; background: var(--primary); color: var(--primary-fg); position: relative;
}
.btn-play svg { width: 20px; height: 20px; fill: currentColor; }
.play-icon { transform: translateX(1px); }
.skip { display: none; }
@media (min-width: 640px) { .skip { display: inline-flex; } }

.vol { display: none; width: 112px; align-items: center; gap: 8px; }
@media (min-width: 1024px) { .vol { display: flex; } }

.pill {
  display: none; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
}
@media (min-width: 768px) { .pill { display: inline-flex; } }
.pill-mobile { display: inline-flex; }
@media (min-width: 768px) { .pill-mobile { display: none; } }
.pill .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill.live { background: color-mix(in oklab, var(--onair) 15%, transparent); color: var(--onair-text); }
.pill.auto, .pill.connecting { background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary); }
.pill.on { background: var(--secondary); color: var(--fg); }
.pill.idle { background: var(--secondary); color: var(--muted); }
.pill.live.onair .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.72); }
}

.progress { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.time { width: 40px; font-family: var(--mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.time.end { width: 40px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 4px; width: 100%; flex: 1;
  background: var(--secondary); border-radius: 99px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 99px;
  background: var(--fg); border: 2px solid var(--bg); cursor: pointer;
}
input[type="range"]:disabled { opacity: 0.5; }

.body { display: flex; min-height: 0; flex: 1; }

.sidebar {
  display: none; width: 240px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--card);
  flex-direction: column;
}
@media (min-width: 768px) { .sidebar { display: flex; } }

.brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px; }
.brand img { width: 40px; height: 40px; border-radius: 8px; outline: none; }
.brand-name { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.brand-meta { margin-top: 4px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; flex: 1; }
.nav a, .nav button.nav-item {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 8px;
  font-size: 14px; color: var(--muted); text-align: left; width: 100%;
}
.nav a:hover, .nav button.nav-item:hover { background: var(--secondary); color: var(--fg); }
.nav a.active, .nav button.nav-item.active {
  background: var(--secondary); color: var(--fg); font-weight: 500;
  box-shadow: inset 2px 0 0 0 var(--primary);
}
.nav svg { width: 16px; height: 16px; flex-shrink: 0; }

.side-card { margin: 0 12px 16px; border-radius: 16px; background: var(--secondary); padding: 16px; }
.side-card .label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.side-card h3 { font-size: 14px; font-weight: 500; margin-top: 8px; }
.side-card p { font-size: 12px; color: var(--muted); margin-top: 4px; }

.main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.mobile-bar {
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding: 8px 12px;
}
@media (min-width: 768px) { .mobile-bar { display: none; } }
.content { flex: 1; min-height: 0; overflow: auto; }
.content-inner { max-width: 64rem; margin: 0 auto; padding: 24px 16px 32px; }
@media (min-width: 768px) { .content-inner { padding: 32px; } }

.view { display: none; flex-direction: column; gap: 24px; }
.view.active { display: flex; }
.kicker { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.page-title { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 4px; }
.lede { margin-top: 8px; max-width: 36rem; font-size: 14px; color: var(--muted); }

.hero { position: relative; overflow: hidden; border-radius: 16px; background: var(--card); padding: 8px; }
.hero-frame { position: relative; overflow: hidden; border-radius: 12px; }
.hero-frame picture { display: block; }
.hero-frame img { width: 100%; height: 224px; object-fit: cover; }
@media (min-width: 768px) { .hero-frame img { height: 320px; } }
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, color-mix(in oklab, var(--bg) 55%, transparent) 45%, transparent 100%);
}
.hero-copy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; padding: 20px; }
@media (min-width: 768px) { .hero-copy { padding: 32px; } }
.hero-copy h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
@media (min-width: 768px) { .hero-copy h1 { font-size: 36px; } }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border-radius: 16px; padding: 20px; }
.card h2 { font-size: 20px; font-weight: 600; margin-top: 8px; }
.card p { font-size: 14px; color: var(--muted); margin-top: 4px; }

.schedule { overflow: hidden; border-radius: 16px; background: var(--card); }
.schedule li { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.schedule li:first-child { border-top: 0; }
.schedule li.active { background: color-mix(in oklab, var(--primary) 8%, transparent); }
.sched-time { width: 56px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sched-now { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); display: flex; align-items: center; gap: 4px; }

.pod { display: flex; gap: 16px; background: var(--card); border-radius: 16px; padding: 12px; }
@media (min-width: 768px) { .pod { padding: 16px; } }
.pod.active { box-shadow: inset 0 0 0 1px var(--primary); }
.pod img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
@media (min-width: 768px) { .pod img { width: 96px; height: 96px; } }
.pod-meta { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); }
.pod h2 { font-size: 16px; font-weight: 600; margin-top: 2px; }
.pod .desc { margin-top: 4px; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pod-actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.mono { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.track {
  display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; text-align: left;
  border-top: 1px solid var(--border);
}
.track:hover { background: var(--secondary); }
.track.active { background: color-mix(in oklab, var(--primary) 8%, transparent); }
.track img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.num { width: 24px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.track .meta { min-width: 0; flex: 1; }
.track .meta strong { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .meta span { display: block; font-size: 12px; color: var(--muted); }

.news-hero { position: relative; overflow: hidden; border-radius: 16px; }
.news-hero img { width: 100%; height: 160px; object-fit: cover; }
@media (min-width: 768px) { .news-hero img { height: 208px; } }
.news-hero .fade { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), transparent); }
.news-item { background: var(--card); border-radius: 16px; overflow: hidden; }
.news-btn { display: flex; gap: 16px; width: 100%; padding: 16px; text-align: left; }
.news-btn img { display: none; width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
@media (min-width: 640px) { .news-btn img { display: block; } }
.news-item .body-text { margin-top: 8px; font-size: 14px; color: var(--muted); }
.news-item .body-text.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-audio { border-top: 1px solid var(--border); padding: 12px 16px; }

.pre {
  margin-top: 16px; overflow-x: auto; border-radius: 8px; background: var(--bg); padding: 16px;
  font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.6; white-space: pre-wrap;
}
.steps { margin-top: 16px; padding-left: 20px; color: var(--muted); font-size: 14px; }
.steps li { margin: 12px 0; }
.steps code { font-family: var(--mono); color: var(--fg); font-size: 12px; }
.row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dl dt { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.dl dd { margin: 4px 0 12px; font-family: var(--mono); font-size: 12px; word-break: break-all; }

.bottom {
  display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); background: var(--card);
}
@media (min-width: 768px) { .bottom { display: none; } }
.bottom button {
  min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.bottom button.active { color: var(--primary); }
.bottom svg { width: 16px; height: 16px; }

.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: var(--primary-fg); padding: 8px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  z-index: 20;
}
.toast.show { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { width: 20px; height: 20px; animation: spin 0.8s linear infinite; }

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] { color-scheme: dark; --bg:#0B1120; --bg-soft:#020617; --fg:#E5E7EB; --fg-strong:#F9FAFB; --card:#111827; --primary:#1D4ED8; --primary-hover:#2563EB; --primary-fg:#F9FAFB; --secondary:#1F2937; --muted:#9CA3AF; --border:rgb(31 41 55 / 0.95); --onair:#22C55E; --onair-text:#22C55E; --accent-gold:#FACC15; --accent-cyan:#22D3EE; }
}
