/* Quran Radio — premium dark neumorphism. No web fonts: uses the device's Arabic fonts (fast on 3G/4G). */
:root {
  --bg: #1b1f1f;
  --surface: #222727;
  --surface-2: #272d2c;
  --hi: rgba(255, 255, 255, 0.055);
  --lo: rgba(0, 0, 0, 0.55);
  --text: #ece8df;
  --muted: #9ea6a1;
  --accent: #f3a338;
  --accent-2: #ffcf7a;
  --accent-ink: #2a1a05;
  --danger: #ef6b5b;
  --ok: #7bc47f;
  --dot-off: #2c2a22;
  --radius: 26px;
  --shadow-out: 9px 9px 20px var(--lo), -7px -7px 18px var(--hi);
  --shadow-out-sm: 5px 5px 12px var(--lo), -4px -4px 10px var(--hi);
  --shadow-in: inset 6px 6px 14px var(--lo), inset -5px -5px 12px var(--hi);
  --font: "Noto Naskh Arabic", "Noto Sans Arabic", "SamsungOneArabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
  --spin: 3.2s;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #e3e6e1;
  --surface: #e8ebe6;
  --surface-2: #dfe3dd;
  --hi: rgba(255, 255, 255, 0.85);
  --lo: rgba(110, 120, 112, 0.38);
  --text: #1f2422;
  --muted: #5d6762;
  --accent: #c97412;
  --accent-2: #e89a3a;
  --accent-ink: #fff8ee;
  --dot-off: #d3d1c8;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, #263030 0%, transparent 60%), var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  padding-bottom: calc(env(safe-area-inset-bottom) + 96px);
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] body { background: radial-gradient(1200px 600px at 80% -10%, #f2f4ef 0%, transparent 60%), var(--bg); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.sr-only, .dm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 12px; z-index: 50; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: grid; gap: 20px; }
@media (min-width: 960px) {
  main { grid-template-columns: 440px 1fr; align-items: start; }
  .radio { position: sticky; top: 16px; grid-row: span 3; }
  .foot { grid-column: 2; }
}

/* ---------- top bar ---------- */
.topbar { max-width: 1120px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 16px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand h1 { margin: 0; font-size: 1.25rem; letter-spacing: 0; }
.brand p { margin: 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 420px) { .brand p { display: none; } }
.topbar-actions { display: flex; gap: 10px; }

/* Compact share control in the existing top header. */
.topbar-actions { flex-shrink: 0; }
.topbar-actions #shareSiteBtn { color: var(--accent); }
@media (max-width: 600px) {
  .topbar { gap: 6px; padding-inline: 10px; }
  .brand { gap: 6px; min-width: 0; }
  .brand img { width: 34px; height: 34px; flex-shrink: 0; }
  .brand h1 { font-size: 1.08rem; line-height: 1.35; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .nbtn.sm { --s: 38px; }
  .topbar-actions .nbtn.sm svg { width: 18px; height: 18px; }
}
@media (max-width: 360px) {
  .brand img { display: none; }
  .topbar { padding-inline: 8px; }
  .topbar-actions { gap: 4px; }
}

.site-share-form { text-align: center; }
.site-share-form label { font-size: .86rem; color: var(--muted); text-align: start; }
.site-share-form input {
  width: 100%; min-width: 0; box-sizing: border-box; padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px; background: var(--surface-2); color: var(--text); text-align: left;
  font: 500 .9rem/1.5 system-ui, sans-serif;
}
.site-share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.site-share-form .sheet-actions { justify-content: center; }
@media (max-width: 480px) {
  .site-share-actions .pill { flex: 1 1 140px; }
}

/* ---------- memorial dedication (development edition only) ---------- */
.memorial {
  --memorial-gold: #ebc98c;
  max-width: 1120px;
  margin: 0 auto 22px;
  padding: 0 16px;
}
[data-theme="light"] .memorial { --memorial-gold: #855317; }
.memorial-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--memorial-gold) 30%, transparent);
  border-radius: 22px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--memorial-gold) 8%, var(--surface-2)), var(--surface));
  box-shadow: var(--shadow-out-sm);
  padding: 18px clamp(16px, 4vw, 38px) 20px;
}
.memorial-kicker {
  margin: 0 0 2px;
  font-size: .86rem;
  font-weight: 700;
  color: var(--memorial-gold);
}
.memorial h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1.5;
  font-weight: 700;
  color: var(--text);
}
.memorial-rule {
  display: block;
  width: 74px;
  height: 2px;
  margin: 7px auto 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--memorial-gold), transparent);
}
.memorial-prayer {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text);
  font-size: .93rem;
  line-height: 1.85;
  opacity: .9;
}
@media (max-width: 480px) {
  .memorial { margin-bottom: 18px; }
  .memorial-card { padding: 14px 16px 16px; border-radius: 18px; }
  .memorial-prayer { font-size: .88rem; line-height: 1.75; }
}

/* ---------- surfaces ---------- */
.panel { background: linear-gradient(145deg, var(--surface-2), var(--surface)); border-radius: var(--radius); box-shadow: var(--shadow-out); }
.panel-inset { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-in); }

.nbtn {
  --s: 56px;
  width: var(--s); height: var(--s); border-radius: 50%; border: 0; display: inline-grid; place-items: center; position: relative;
  background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow-out-sm); color: var(--text);
  cursor: pointer; transition: box-shadow .18s, transform .1s, color .2s; touch-action: manipulation;
}
.nbtn:active { box-shadow: var(--shadow-in); transform: scale(.97); }
.nbtn.sm { --s: 46px; }
.nbtn.sm svg { width: 20px; height: 20px; }
.nbtn.xl { --s: 84px; }
.nbtn.xl svg { width: 34px; height: 34px; }
.nbtn[aria-pressed="true"], .nbtn.on { color: var(--accent); }
.nbtn[aria-pressed="true"] svg { fill: currentColor; }
.nbtn:disabled { opacity: .45; cursor: not-allowed; }
.play { color: var(--accent); }
.play svg { fill: currentColor; stroke: none; }
.play .i-pause, .is-playing .play .i-play, .mini.is-playing .i-play { display: none; }
.is-playing .play .i-pause, .mini.is-playing .i-pause { display: block; }
.mini .i-pause { display: none; }
.mini svg.i-play, .mini svg.i-pause { fill: currentColor; stroke: none; }
.spinner { position: absolute; inset: 6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); opacity: 0; }
.is-loading .spinner { opacity: 1; animation: spin 1s linear infinite; }
.chip-count { position: absolute; bottom: -6px; inset-inline-start: 50%; transform: translateX(50%); background: var(--accent); color: var(--accent-ink); font-size: .68rem; padding: 0 6px; border-radius: 99px; font-variant-numeric: tabular-nums; }

.pill { border: 0; border-radius: 99px; padding: 10px 18px; background: var(--surface); box-shadow: var(--shadow-out-sm); cursor: pointer; min-height: 44px; }
.pill:active { box-shadow: var(--shadow-in); }
.pill.accent { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: var(--accent-ink); font-weight: 700; }
.pill.ghost { box-shadow: none; background: transparent; }
.link-btn { background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 6px; }

/* ---------- radio ---------- */
.radio { padding: 18px 18px 22px; display: grid; gap: 16px; }
.radio-top { display: flex; justify-content: space-between; align-items: stretch; gap: 12px; }
.badges { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; justify-content: center; }
.badge { font-size: .78rem; padding: 3px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-in); color: var(--muted); white-space: nowrap; }
.badge.live { color: #ff8d7e; display: inline-flex; align-items: center; gap: 6px; }
.badge.live i { width: 8px; height: 8px; border-radius: 50%; background: #ff5a45; box-shadow: 0 0 8px #ff5a45; }
.is-playing .badge.live i { animation: pulse 1.6s ease-in-out infinite; }

/* dot-matrix clock */
.clock { flex: 1; min-width: 0; }
.dm-screen { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 18px; background: #12100b; box-shadow: inset 5px 5px 12px rgba(0,0,0,.7), inset -3px -3px 8px rgba(255,255,255,.04), 0 0 0 1px rgba(255,255,255,.03); direction: ltr; }
[data-theme="light"] .dm-screen { background: #1a1710; }
.dm-svg { width: 100%; height: auto; max-height: 72px; stroke: none; }
.dm-dot { fill: var(--dot-off); transition: fill .25s; }
[data-theme="light"] .dm-dot { fill: #2c2a22; }
.dm-dot.on { fill: var(--accent); filter: drop-shadow(0 0 2.5px rgba(243,163,56,.85)); }
.dm-colon .dm-dot.on { animation: blink 2s steps(1) infinite; }
.dm-period { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; order: 2; }
.dm-period span { color: #4a4433; padding: 0 6px; border-radius: 6px; line-height: 1.5; }
.dm-period span.lit { color: var(--accent); text-shadow: 0 0 6px rgba(243,163,56,.8); }
.is-24h .dm-period { display: none; }
.clock-meta { margin-top: 6px; font-size: .78rem; color: var(--muted); padding-inline: 6px; }

/* turntable */
.deck { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; }
.platter { position: absolute; inset: 4%; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-in); display: grid; place-items: center; }
.vinyl {
  width: 92%; aspect-ratio: 1; border-radius: 50%; position: relative;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 31%, rgba(255,255,255,.035) 31.5%, transparent 32%),
    repeating-radial-gradient(circle at 50% 50%, #121313 0 1.2px, #1a1b1b 1.6px 2.6px),
    #141515;
  box-shadow: 0 10px 25px rgba(0,0,0,.5), 0 0 0 2px #0d0e0e;
  animation: spin var(--spin) linear infinite; animation-play-state: paused;
}
.vinyl::after { /* asymmetric highlight that rotates with the record so motion is visible */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 0 18%, rgba(255,255,255,.07) 22%, transparent 28% 68%, rgba(255,255,255,.05) 72%, transparent 78%);
}
.label {
  position: absolute; inset: 33%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--accent-2), var(--accent) 55%, #a8600f);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.18), inset 0 0 0 9px rgba(255,255,255,.08);
}
.label span { font-size: clamp(.8rem, 3.6vw, 1.05rem); font-weight: 700; color: #3a2408; text-align: center; line-height: 1.15; position: absolute; top: 17%; inset-inline: 10%; }
.label::after { content: "إذاعة القرآن"; position: absolute; bottom: 18%; font-size: clamp(.5rem, 2.2vw, .62rem); color: #5a3a10; letter-spacing: 0; }
.sheen { position: absolute; inset: 8%; border-radius: 50%; pointer-events: none; background: linear-gradient(130deg, rgba(255,255,255,.10), transparent 35%, transparent 65%, rgba(255,255,255,.04)); }
.spindle { position: absolute; width: 4%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #8d918e 60%, #444); box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.is-playing .vinyl { animation-play-state: running; will-change: transform; }
.tonearm { position: absolute; top: -1%; right: 0; width: 30%; height: auto; stroke: none; transform-origin: 75% 11.5%; transform: rotate(-13deg); transition: transform 1.1s cubic-bezier(.4,.1,.2,1); filter: drop-shadow(4px 8px 6px rgba(0,0,0,.45)); }
.tonearm path { stroke-width: 7; }
.arm-base { fill: var(--surface-2); filter: drop-shadow(2px 3px 4px rgba(0,0,0,.4)); }
.arm-pivot { fill: #9aa09c; }
.arm-head { fill: #2a2d2c; stroke: #8b918d; stroke-width: 1.5; }
.is-playing .tonearm, .is-loading .tonearm { transform: rotate(4deg); }

.now { text-align: center; min-height: 104px; }
.now h2 { margin: 0; font-size: clamp(1.4rem, 5.6vw, 1.9rem); line-height: 1.35; }
.now p { margin: 2px 0; }
.status { min-height: 1.6em; font-size: .92rem; color: var(--muted); }
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

.controls { direction: ltr; /* media controls are not mirrored in RTL (Material guideline) */ display: flex; justify-content: center; align-items: center; gap: 26px; }
.secondary { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.volume { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--muted); }
.volume input { flex: 1; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 10px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-in); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: 2px 2px 6px var(--lo); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--accent); }

/* full-screen radio */
.radio:fullscreen, .radio.fs { border-radius: 0; max-width: none; width: 100%; height: 100%; align-content: center; justify-items: stretch; padding: max(24px, env(safe-area-inset-top)) 24px; overflow: auto; }
.radio:fullscreen .deck { width: min(70vh, 92vw); }

/* continue card */
.continue { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; gap: 12px; }
.continue p { margin: 0; font-size: .85rem; }

/* ---------- library ---------- */
.library { display: grid; gap: 14px; }
.lib-head { display: flex; align-items: baseline; justify-content: space-between; }
.lib-head h2 { margin: 0; font-size: 1.3rem; }
.search { display: flex; align-items: center; gap: 10px; padding: 4px 16px; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; padding: 12px 0; outline: none; font-size: 1.05rem; color: var(--text); min-width: 0; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 99px; padding: 8px 16px; min-height: 40px; background: var(--surface); box-shadow: var(--shadow-out-sm); cursor: pointer; color: var(--muted); }
.chip[aria-selected="true"] { box-shadow: var(--shadow-in); color: var(--accent); font-weight: 700; }
.stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.st { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow-out-sm); }
.st[hidden] { display: none; }
.st.current { box-shadow: var(--shadow-in); }
.st.current .st-name { color: var(--accent); }
.st-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px; text-align: start; cursor: pointer; border-radius: 14px; }
.st-art { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.25rem; color: #2b1c08; background: radial-gradient(circle at 50% 50%, hsl(var(--h) 70% 62%) 0 34%, #161717 35% 100%); box-shadow: 0 0 0 2px #0e0f0f, 3px 4px 8px var(--lo); position: relative; }
.st-art span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .9rem; }
.st-text { min-width: 0; }
.st-name { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-sub { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.health { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.health.ok { background: var(--ok); }
.health.bad { background: var(--danger); }
.st .nbtn.sm { --s: 42px; flex: none; }
.empty { text-align: center; padding: 30px; }

.foot { text-align: center; font-size: .88rem; padding: 10px 0 20px; }
.foot p { margin: 4px 0; }

/* ---------- mini player ---------- */
.mini {
  position: fixed; inset-inline: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,.45), -2px -2px 8px var(--hi);
  max-width: 560px; margin: 0 auto;
}
.mini[hidden] { display: none; }
.mini-disc { width: 42px; height: 42px; border-radius: 50%; flex: none; background: radial-gradient(circle, var(--accent) 0 28%, #151616 30% 100%); box-shadow: 0 0 0 2px #0d0e0e; animation: spin 3.2s linear infinite paused; }
.mini.is-playing .mini-disc { animation-play-state: running; }
.mini-text { flex: 1; min-width: 0; display: grid; }
.mini-text strong, .mini-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text span { font-size: .8rem; }

/* ---------- dialogs ---------- */
.sheet { border: 0; padding: 0; border-radius: 26px; background: var(--surface); color: var(--text); width: min(520px, calc(100% - 24px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); max-height: 88dvh; }
.sheet::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.sheet form { padding: 22px; display: grid; gap: 14px; }
.sheet h3 { margin: 0; font-size: 1.25rem; }
.sheet p { margin: 0; }
.grid-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
.row-field { display: grid; gap: 6px; }
.row-field input, .row-field select { border: 0; border-radius: 14px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow-in); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 700; margin-bottom: 6px; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); }

.toast { position: fixed; bottom: calc(env(safe-area-inset-bottom) + 96px); left: 50%; transform: translateX(-50%); z-index: 30; background: #0f1111; color: #f4efe6; padding: 10px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); text-align: center; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { fill: var(--dot-off); filter: none; } }
[data-motion="reduced"] { --spin: 9s; }
[data-motion="reduced"] .tonearm { transition-duration: .3s; }
[data-motion="off"] .vinyl, [data-motion="off"] .mini-disc, [data-motion="off"] .dm-colon .dm-dot.on, [data-motion="off"] .badge.live i { animation: none !important; }
[data-motion="off"] .tonearm { transition: none; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full-forced"]) .vinyl, .mini-disc, .dm-colon .dm-dot.on, .badge.live i { animation: none !important; }
  .tonearm { transition: none; }
}

/* Mobile compact radio / quick station picker
   Visual-only layout changes. Audio & Media Session logic remain unchanged. */
.mobile-quick-picker { display: none; }
.player-mode-btn { display: none; }

.station-picker-dialog {
  width: min(480px, calc(100% - 20px));
  max-height: min(84dvh, 760px);
  overflow: hidden;
}
.station-picker-content { display: flex; flex-direction: column; gap: 12px; padding: 18px; min-height: 0; }
.station-picker-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.station-picker-head h3 { margin: 0; font-size: 1.18rem; }
.station-picker-head p { margin: 0; font-size: .85rem; }
.station-picker-close {
  border: 0; background: var(--surface-2); color: var(--text); border-radius: 50%;
  width: 40px; height: 40px; display: grid; place-items: center; flex: none; cursor: pointer;
}
.station-picker-search {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px;
  background: var(--surface-2); box-shadow: var(--shadow-in);
}
.station-picker-search svg { flex: none; color: var(--accent); }
.station-picker-search input {
  border: 0; outline: 0; min-width: 0; width: 100%; min-height: 46px; background: transparent;
  color: var(--text); font: inherit;
}
.station-picker-filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.station-picker-filters::-webkit-scrollbar { display: none; }
.quick-filter-pill {
  border: 0; flex: none; border-radius: 99px; min-height: 36px; padding: 6px 12px;
  background: var(--surface-2); color: var(--muted); box-shadow: var(--shadow-out-sm); cursor: pointer;
}
.quick-filter-pill[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.station-picker-count { font-size: .8rem; margin: -4px 2px; }
.station-picker-results {
  list-style: none; margin: 0; padding: 2px; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; max-height: min(46dvh, 440px);
  display: grid; align-content: start; gap: 8px;
}
.quick-station-choice {
  width: 100%; min-height: 58px; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px;
  background: var(--surface-2); display: flex; gap: 8px; align-items: center; text-align: start;
  color: var(--text); cursor: pointer;
}
.quick-station-choice[aria-current="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.quick-station-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.quick-station-info strong { font-size: .93rem; line-height: 1.4; }
.quick-station-info small { font-size: .78rem; color: var(--muted); }
.quick-station-indicator { flex: none; color: var(--accent); font-size: 1rem; }
.station-picker-empty { padding: 16px; text-align: center; }
@media (max-width: 767px) {
  .topbar { padding-bottom: 9px; }
  .memorial { margin-bottom: 10px; }
  .memorial-card { padding: 8px 14px 9px; }
  .memorial-kicker { font-size: .76rem; }
  .memorial h2 { font-size: 1.1rem; }
  .memorial-rule { margin: 3px auto 4px; }
  .memorial-prayer { font-size: .81rem; line-height: 1.5; }
  .mobile-quick-picker { display: block; max-width: 1120px; padding: 0 16px; margin: 0 auto 12px; }
  .quick-picker-trigger {
    width: 100%; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    display: flex; gap: 10px; align-items: center; text-align: start; padding: 9px 12px;
    min-height: 54px; background: var(--surface); color: var(--text); cursor: pointer;
  }
  .quick-picker-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; color: var(--accent); }
  .quick-picker-label { display: grid; gap: 0; min-width: 0; flex: 1; }
  .quick-picker-label small { font-size: .73rem; color: var(--muted); }
  .quick-picker-label strong { font-size: .91rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .quick-picker-chevron { width: 20px; height: 20px; flex: none; color: var(--accent); }
  .player-mode-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px;
    white-space: nowrap; padding: 3px 7px; border: 0; border-radius: 12px;
    background: var(--surface-2); color: var(--accent); cursor: pointer; font: inherit; font-size: .73rem;
  }
  .player-mode-btn svg { width: 15px; height: 15px; }
  main { gap: 14px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) {
    grid-template-columns: minmax(0, 133px) minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "now now"
      "deck controls"
      "secondary secondary"
      "volume volume";
    grid-template-rows: auto auto auto auto auto;
    align-items: center; gap: 8px 10px; padding: 10px 12px 13px; border-radius: 20px;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .radio-top {
    grid-area: top; gap: 6px; align-items: center;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .clock { max-width: 122px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .dm-screen {
    padding: 7px 8px; gap: 3px; border-radius: 10px;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .dm-svg { max-height: 30px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .dm-period { font-size: .63rem; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .clock-meta { display: none; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .badge { font-size: .68rem; padding: 3px 8px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .badges { gap: 3px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .deck {
    grid-area: deck; width: min(100%, 112px); max-width: 112px; align-self: center;
    justify-self: center;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .now {
    grid-area: now; min-width: 0; min-height: 0; text-align: center; align-self: center;
    padding: 1px 4px 3px;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .now h2 {
    font-size: clamp(1.08rem, 4.3vw, 1.36rem); line-height: 1.55;
    max-width: 100%; overflow-wrap: break-word; text-wrap: balance;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .now p {
    font-size: .81rem; line-height: 1.5; margin: 1px auto; max-width: 100%; overflow-wrap: break-word;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .status { min-height: 0; font-size: .78rem; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls {
    grid-area: controls; min-width: 0; align-self: center; gap: 8px; justify-content: center;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls .nbtn { --s: 40px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls .nbtn.xl { --s: 52px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls .nbtn svg { width: 19px; height: 19px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls .nbtn.xl svg { width: 24px; height: 24px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .secondary {
    grid-area: secondary; justify-content: space-around; gap: 6px;
  }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .secondary .nbtn.sm { --s: 42px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .volume-panel {
    grid-area: volume; margin-top: 0;
  }
  /* Avoid unreadable overlapping letters at the small vinyl-label scale.
     Station names are already displayed in full in the text row above. */
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .label span,
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .label::after { display: none; }
  /* In live mode, the extra "إذاعة" badge is redundant and crowds the top row. */
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) #liveBadge:not([hidden]) + #kindBadge { display: none; }
  /* Expanded mode keeps the original full-size turntable and player. */
  html[data-player-mode="expanded"] .radio { padding: 18px 18px 22px; }
}
@media (max-width: 360px) {
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) { grid-template-columns: minmax(0, 104px) minmax(0, 1fr); gap: 7px; padding: 9px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls .nbtn { --s: 36px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .controls .nbtn.xl { --s: 48px; }
  html:not([data-player-mode="expanded"]) .radio:not(:fullscreen):not(.fs) .secondary .nbtn.sm { --s: 39px; }
  .player-mode-btn { padding-inline: 4px; font-size: .68rem; }
}

/* Clear, accessible sound control — replaces the narrow legacy range row. */
.volume-panel {
  display: grid; gap: 8px; min-width: 0;
  padding: 10px 12px 12px; border-radius: 17px;
  background: var(--surface-2); box-shadow: var(--shadow-in);
}
.volume-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.volume-caption { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: .92rem; }
.volume-caption svg { color: var(--accent); flex: none; width: 22px; height: 22px; }
.volume-heading output {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 59px; height: 31px; padding: 3px 9px;
  border-radius: 9px; background: var(--surface);
  color: var(--accent); font: 700 1rem/1.2 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.volume-controls {
  direction: ltr; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center; gap: 12px; min-width: 0;
}
.volume-track { display: flex; align-items: center; min-width: 0; min-height: 44px; cursor: pointer; }
.volume-panel .volume-track input[type="range"] {
  width: 100%; min-width: 0; flex: 1; height: 12px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--volume-progress, 90%), var(--surface) var(--volume-progress, 90%), var(--surface) 100%);
  box-shadow: var(--shadow-in); cursor: pointer; touch-action: pan-y;
}
.volume-panel .volume-track input[type="range"]::-webkit-slider-thumb {
  width: 28px; height: 28px; background: var(--accent-2);
  border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.volume-panel .volume-track input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border: 3px solid var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,.25); background: var(--accent-2);
}
.volume-step {
  width: 42px; height: 42px; border-radius: 13px; border: 0;
  display: grid; place-items: center; font: 600 1.6rem/1 system-ui,sans-serif;
  color: var(--text); background: var(--surface);
  box-shadow: var(--shadow-out-sm); cursor: pointer; touch-action: manipulation;
}
.volume-step:active { transform: scale(.96); box-shadow: var(--shadow-in); }
@media (max-width: 400px) {
  .volume-controls { grid-template-columns: 39px minmax(0,1fr) 39px; gap: 10px; }
  .volume-step { width: 39px; height: 39px; }
  .volume-panel { padding-inline: 10px; }
}
