/* ============================================================
   Radios — black & white redesign (light + dark themes)
   Theme is selected by a class on <html>:  .dark (default) / .light
   Everything is driven by CSS custom properties so the same
   components render correctly in either theme.
   ============================================================ */
:root, html.dark{
  --bg:#0b0b0d; --bg2:#101013; --elev:#16161a; --card:#161619;
  --ink:#ffffff; --muted:#7d7d86;
  --line:rgba(255,255,255,.09); --line2:rgba(255,255,255,.15);
  --soft:rgba(255,255,255,.07);
  --wave:rgba(255,255,255,.16);
  --accent:#ffffff; --accent-ink:#0b0b0d;   /* primary pill: white bg / black glyph */
  --rose:#ff6b81;
  --shadow:0 18px 40px rgba(0,0,0,.5);
}
html.light{
  --bg:#e6e6ea; --bg2:#dedee3; --elev:#f3f3f6; --card:#f3f3f6;
  --ink:#1a1a1e; --muted:#7e7e88;
  --line:#d5d5db; --line2:#c7c7ce;
  --soft:#dbdbe1;
  --wave:#c2c2cb;
  --accent:#15151a; --accent-ink:#e6e6ea;   /* primary pill: near-black bg / soft-grey glyph */
  --rose:#d04e63;
  --shadow:0 18px 40px rgba(40,40,55,.16);
}
/* light theme: the dark artwork + near-black icons look harsh on grey-white,
   so soften them to a mild grey here (dark theme keeps the bold look) */
html.light .lart, html.light .cdot, html.light .now-art, html.light .libart{
  background:linear-gradient(145deg,#d9d9e0,#cbccd4) !important}
html.light .lart svg, html.light .cdot svg, html.light .now-art svg, html.light .libart svg{color:#62626d;filter:none}
html.light .iconbtn svg, html.light .nc, html.light .now-close svg, html.light .ns-label svg{color:#54545f}
:root{ --tab-h:62px; --mini-h:60px;
  --sat:env(safe-area-inset-top,0px); --sab:env(safe-area-inset-bottom,0px); }

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow:hidden}
body{
  font-family:"Schibsted Grotesk",system-ui,-apple-system,sans-serif;
  background:var(--bg);color:var(--ink);
  -webkit-font-smoothing:antialiased;position:fixed;inset:0;display:flex;flex-direction:column;
  transition:background .25s ease,color .25s ease;
}
/* the old green atmosphere layer is retired in the B/W design */
.atmos{display:none}

/* scrolling view */
#view{position:relative;z-index:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:calc(var(--sat) + 8px) 0 calc(var(--tab-h) + var(--mini-h) + var(--sab) + 40px);}
#view::-webkit-scrollbar{width:0}
.pad{padding:0 18px}

/* ---------- headers ---------- */
.vhead{padding:16px 18px 6px}
.vtop{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.vtools{display:flex;align-items:center;gap:10px;flex:none}
.clock{text-align:right;line-height:1.1}
.clock .ck-time{display:block;font-weight:700;font-size:14px;color:var(--ink)}
.clock .ck-date{display:block;font-size:11px;color:var(--muted);margin-top:1px}
.iconbtn{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;flex:none;cursor:pointer;
  background:var(--soft);border:none;color:var(--ink);transition:background .15s}
.iconbtn svg{width:19px;height:19px;color:var(--ink)}
.iconbtn:active{background:var(--line2)}
.greet{font-size:13px;color:var(--muted);font-weight:600;letter-spacing:.2px}
.vtitle{font-weight:800;font-size:32px;letter-spacing:-.03em;line-height:1.04;margin-top:3px}
.vtitle em{font-style:normal}
.vsub{color:var(--muted);font-size:14px;margin-top:7px;font-weight:500}
.vsub .ta{color:var(--ink);opacity:.85}

/* Play (left) + Install (right) share one row, vertically aligned */
.home-cta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}
.home-cta .home-play,.home-cta .install{margin-top:0}
.home-play{display:inline-flex;align-items:center;gap:8px;margin-top:18px;background:var(--accent);color:var(--accent-ink);
  border:none;border-radius:12px;padding:10px 17px;font-family:inherit;font-weight:700;font-size:14px;cursor:pointer}
.home-play svg{width:17px;height:17px}
.home-play .btnspin{width:16px;height:16px;border-color:rgba(0,0,0,.18);border-top-color:var(--accent-ink)}
/* compact "Now playing" state: tiny equaliser instead of a second pause button */
.hp-eq{display:inline-flex;align-items:flex-end;gap:2px;height:13px}
.hp-eq i{width:2.5px;border-radius:2px;background:var(--accent-ink);height:4px;animation:eq .9s ease-in-out infinite}
.hp-eq i:nth-child(2){animation-delay:.25s}.hp-eq i:nth-child(3){animation-delay:.5s}

.install{display:inline-flex;align-items:center;gap:8px;margin-top:16px;background:transparent;color:var(--ink);
  border:1.5px solid var(--line2);border-radius:14px;padding:11px 18px;font-family:inherit;font-weight:700;font-size:14px;cursor:pointer}
.install svg{width:17px;height:17px}

/* ---------- sections ---------- */
.section{margin-top:26px}
.sec-h{display:flex;align-items:baseline;justify-content:space-between;padding:0 18px 12px}
.sec-h h3{font-size:18px;font-weight:800;letter-spacing:-.02em}
.sec-h .cnt{font-size:12px;color:var(--muted);font-weight:600}

/* ---------- compact list rows ---------- */
.list{display:flex;flex-direction:column;padding:2px 10px 0;gap:2px}
.lrow{display:flex;align-items:center;gap:13px;padding:9px 8px;border-radius:13px;cursor:pointer;transition:background .12s}
.lrow:active{background:var(--soft)}
.lrow.on{background:var(--soft)}
.lart{width:50px;height:50px;border-radius:13px;flex:none;display:grid;place-items:center;position:relative;overflow:hidden;
  color:#fff;background:#1a1a1f}
.lart svg{width:25px;height:25px;position:relative;z-index:1;color:#fff;filter:drop-shadow(0 1px 4px rgba(0,0,0,.35))}
.lart img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:2}
.linfo{flex:1;min-width:0}
.lnm{font-weight:700;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lmt{font-size:12.5px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}
.lplay{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:var(--muted)}
.lplay svg{width:20px;height:20px}
.lrow.on .lplay{color:var(--ink)}
.leq{flex:none;display:flex;gap:2.5px;align-items:flex-end;height:15px;padding:0 9px}
.leq i{width:3px;background:var(--ink);border-radius:2px;height:5px;animation:eq .9s ease-in-out infinite}
.leq i:nth-child(2){animation-delay:.25s}.leq i:nth-child(3){animation-delay:.5s}
@keyframes eq{0%,100%{height:4px}50%{height:14px}}

/* audio-quality badges (monochrome) */
.qb{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.3px;padding:1px 6px;border-radius:6px;
  vertical-align:middle;margin-left:5px;line-height:1.55}
.qb.loss,.qb.hd{background:var(--soft);color:var(--ink)}
.qb.hi{background:var(--soft);color:var(--muted)}
.qb.std{background:transparent;color:var(--muted)}

/* ---------- search ---------- */
.searchbar{position:sticky;top:0;z-index:5;padding:8px 18px 12px;background:var(--bg)}
.sbox{display:flex;align-items:center;gap:10px;background:var(--soft);border:none;border-radius:14px;padding:14px 15px}
.sbox svg{width:18px;height:18px;color:var(--muted);flex:none}
.sbox input{flex:1;background:none;border:none;outline:none;color:var(--ink);font-size:16px;font-family:inherit;font-weight:500}
.sbox input::placeholder{color:var(--muted)}

.chips{display:flex;gap:9px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:10px 18px 2px}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;font-family:inherit;font-size:13px;font-weight:600;color:var(--ink);background:var(--soft);
  border:none;border-radius:30px;padding:9px 15px;cursor:pointer;white-space:nowrap}
.chip.on{color:var(--accent-ink);background:var(--accent)}

/* ---------- category index ---------- */
.catgroup{padding:0 18px}
.cath{font-size:12px;text-transform:uppercase;letter-spacing:1.1px;color:var(--muted);font-weight:800;margin:24px 0 6px}
.catlist{display:flex;flex-direction:column}
.cat{display:flex;align-items:center;gap:14px;width:100%;background:none;border:none;border-bottom:1px solid var(--line);
  padding:15px 2px;cursor:pointer;color:var(--ink);font-family:inherit;text-align:left}
.cat:last-child{border-bottom:none}
.cat:active{background:var(--soft)}
.cdot{width:44px;height:44px;border-radius:13px;flex:none;display:grid;place-items:center;position:relative;overflow:hidden;
  color:#fff;background:#1a1a1f}
.cdot svg{width:21px;height:21px;position:relative;z-index:1;color:#fff}
.cname{flex:1;font-size:16px;font-weight:700;letter-spacing:-.01em}
.ccount{font-size:13px;color:var(--muted);font-weight:600}
.cat svg{width:19px;height:19px;color:var(--muted);flex:none}

/* list header / back */
.lhead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px 2px}
.lhead>span{font-size:13px;color:var(--muted);flex:none;font-weight:600}
.backcat{display:inline-flex;align-items:center;gap:6px;background:none;border:none;color:var(--ink);
  font-family:inherit;font-weight:800;font-size:22px;letter-spacing:-.02em;cursor:pointer;padding:0;min-width:0}
.backcat svg{width:24px;height:24px;flex:none}

/* ---------- library extras ---------- */
.add-btn{display:inline-flex;align-items:center;gap:8px;background:var(--accent);color:var(--accent-ink);border:none;
  border-radius:14px;padding:12px 18px;font-family:inherit;font-weight:700;font-size:14px;cursor:pointer;margin-top:6px}
.add-btn svg{width:18px;height:18px}
.lrm{flex:none;width:30px;height:30px;border-radius:50%;border:none;background:var(--soft);
  color:var(--muted);cursor:pointer;font-size:13px;line-height:1}
.lrm:active{background:rgba(226,83,106,.18);color:var(--rose)}

.refresh-wrap{margin-top:32px;display:flex;flex-direction:column;align-items:center;gap:9px;padding-bottom:12px}
.refresh-btn{display:inline-flex;align-items:center;gap:8px;background:var(--soft);border:none;
  border-radius:30px;padding:11px 20px;color:var(--ink);font-family:inherit;font-weight:600;font-size:14px;cursor:pointer}
.refresh-btn svg{width:17px;height:17px;color:var(--ink)}
.refresh-btn:active{background:var(--line2)}
.ver{font-size:11.5px;color:var(--muted);letter-spacing:.3px;font-weight:500}

/* ---------- states ---------- */
.state{display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);
  text-align:center;padding:80px 30px;font-size:15px;gap:6px;font-weight:500}
.state .big{font-weight:800;font-size:21px;color:var(--ink);letter-spacing:-.02em}
.spin{width:30px;height:30px;border-radius:50%;border:3px solid var(--line2);border-top-color:var(--ink);
  margin-bottom:14px;animation:rot .8s linear infinite}
@keyframes rot{to{transform:rotate(360deg)}}
.btnspin{width:20px;height:20px;border-radius:50%;border:2.5px solid rgba(0,0,0,.22);
  border-top-color:var(--accent-ink);animation:rot .7s linear infinite}
.nc.big .btnspin{width:34px;height:34px;border-width:3px}

/* ---------- mini player (solid ink pill) ---------- */
.mini{position:fixed;left:10px;right:10px;bottom:calc(var(--tab-h) + var(--sab) + 16px);z-index:30;
  height:var(--mini-h);display:none;align-items:center;gap:12px;padding:9px 12px;
  background:var(--accent);color:var(--accent-ink);border-radius:18px;box-shadow:var(--shadow);overflow:hidden}
.mini.show{display:flex;animation:rise .3s ease}
@keyframes rise{from{transform:translateY(20px);opacity:0}to{transform:none;opacity:1}}
.mini-art{width:42px;height:42px;border-radius:11px;flex:none;display:grid;place-items:center;overflow:hidden;
  position:relative;color:#fff;background:#1a1a1f}
.mini-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:2}
.mini-art span{position:relative;z-index:1}
.mini-art svg{width:22px;height:22px;position:relative;z-index:1;color:#fff}
.mini-left{display:flex;align-items:center;gap:12px;flex:1;min-width:0;cursor:pointer}
.mini-info{flex:1;min-width:0}
.mini-nm{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--accent-ink)}
.mini-mt{font-size:12px;color:var(--accent-ink);opacity:.62;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px;font-weight:500}
.mini-ctrls{display:flex;align-items:center;gap:6px;flex:none}
.mini-tbtns{display:flex;align-items:center;gap:6px}
.mini-btn{flex:none;width:40px;height:40px;border-radius:50%;border:none;background:var(--accent-ink);color:var(--accent);
  display:grid;place-items:center;cursor:pointer}
.mini-btn svg{width:20px;height:20px}
.mini-x{flex:none;background:none;border:none;color:var(--accent-ink);cursor:pointer;display:grid;place-items:center;
  width:34px;height:34px;border-radius:50%;opacity:.82;transition:opacity .12s}
.mini-x svg{width:20px;height:20px}
.mini-x:hover{opacity:1}
.mini-x.on{opacity:1}.mini-x.on svg{fill:currentColor}
.mini-vol{display:flex;align-items:center;gap:8px}
.mini-vol svg{width:17px;height:17px;color:var(--accent-ink);opacity:.7}
.mini-vol input{width:92px;-webkit-appearance:none;appearance:none;height:4px;border-radius:4px;
  background:rgba(255,255,255,.28);outline:none}
.mini-vol input::-webkit-slider-thumb{-webkit-appearance:none;width:13px;height:13px;border-radius:50%;background:var(--accent-ink);cursor:pointer}
.mini-vol input::-moz-range-thumb{width:13px;height:13px;border:none;border-radius:50%;background:var(--accent-ink)}
/* on phones the bar only shows artwork + title + play */
.mini-ctrls #miniPrev,.mini-ctrls #miniNext{display:none}
.mini-right{display:none}
.mini.err{box-shadow:0 0 0 1.5px var(--rose),var(--shadow)}
.mini.err .mini-mt{color:var(--rose);opacity:1}

/* ---------- toast ---------- */
.toast{position:fixed;left:50%;bottom:calc(var(--tab-h) + var(--mini-h) + var(--sab) + 22px);z-index:60;
  transform:translateX(-50%) translateY(16px);background:#1c1c20;
  color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:13px;padding:12px 17px;font-size:13.5px;font-weight:500;
  max-width:86%;text-align:center;box-shadow:var(--shadow);opacity:0;pointer-events:none;
  transition:opacity .25s ease,transform .25s ease}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.now-mt.err{color:var(--rose)}

/* ---------- tab bar ---------- */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:31;height:calc(var(--tab-h) + var(--sab));
  display:flex;padding:0 8px var(--sab);background:var(--bg);border-top:1px solid var(--line)}
.tab{flex:1;background:none;border:none;color:var(--muted);font-family:inherit;font-size:10px;font-weight:700;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;transition:color .15s}
.tab svg{width:22px;height:22px}
.tab.on{color:var(--ink)}

/* ---------- now playing sheet ---------- */
.now{position:fixed;inset:0;z-index:50;transform:translateY(100%);transition:transform .38s cubic-bezier(.2,.8,.2,1);
  background:var(--bg);overflow:hidden;visibility:hidden}
.now.open{transform:none;visibility:visible}
.now-bg{display:none}
.now-inner{position:relative;z-index:2;height:100%;display:flex;flex-direction:column;align-items:center;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:calc(var(--sat) + 16px) 28px calc(var(--sab) + 26px);background:var(--bg)}
.now-inner::-webkit-scrollbar{width:0}
.now-handle{width:40px;height:5px;border-radius:5px;background:var(--line2);margin-bottom:6px;cursor:grab}
.now-close{position:absolute;top:calc(var(--sat) + 14px);left:18px;background:var(--soft);border:none;
  width:38px;height:38px;border-radius:50%;color:var(--ink);display:grid;place-items:center;cursor:pointer}
.now-close svg{width:22px;height:22px}
.now-art{width:min(56vw,232px);aspect-ratio:1;border-radius:24px;margin:min(3.5vh,18px) 0 16px;display:grid;place-items:center;
  overflow:hidden;position:relative;color:#fff;
  background:repeating-radial-gradient(circle at 50% 50%,#1b1b1f 0 2px,#26262c 2px 5px);box-shadow:var(--shadow)}
.now-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:2}
.now-art span{position:relative;z-index:1}
.now-art svg{width:30%;height:30%;position:relative;z-index:1;color:#fff;filter:drop-shadow(0 6px 18px rgba(0,0,0,.4))}
.now-art::before{content:"";position:absolute;inset:0;z-index:1;
  background:radial-gradient(circle at 50% 50%,transparent 27%,rgba(255,255,255,.05) 27.5%,transparent 28.5%,transparent 40%,rgba(255,255,255,.05) 40.5%,transparent 41.5%)}
.now-live{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:800;letter-spacing:1px;color:var(--ink)}
.now-live i{width:7px;height:7px;border-radius:50%;background:var(--ink);animation:blink 1.6s infinite}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.25}}
.now-nm{font-weight:800;font-size:25px;letter-spacing:-.03em;text-align:center;margin-top:13px;line-height:1.15;max-width:92%}
.now-mt{color:var(--muted);font-size:14px;margin-top:7px;text-align:center;font-weight:500}
/* live "now playing" song line (from ICY metadata) */
.now-track{color:var(--ink);font-size:13px;margin-top:11px;text-align:center;font-weight:600;max-width:90%;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#now.episode .now-track{display:none!important}

/* live spectrum — bars animate independently while playing (calm when paused) */
.now-eq{display:flex;align-items:center;justify-content:center;gap:3px;height:38px;margin:24px 0 6px}
.now-eq i{width:3.5px;border-radius:3px;background:var(--wave);height:7px;
  animation:spec 1s ease-in-out infinite;animation-play-state:paused}
.now.playing .now-eq i{background:var(--ink);animation-play-state:running}
@keyframes spec{0%,100%{height:7px;opacity:.55}50%{height:32px;opacity:1}}
.now-eq i:nth-child(2n){animation-duration:.78s;animation-delay:.12s}
.now-eq i:nth-child(3n){animation-duration:1.12s;animation-delay:.34s}
.now-eq i:nth-child(3n+1){animation-duration:.92s;animation-delay:.5s}
.now-eq i:nth-child(4n){animation-duration:.68s;animation-delay:.22s}
.now-eq i:nth-child(5n){animation-duration:1.28s;animation-delay:.06s}
.now-eq i:nth-child(7n){animation-duration:.84s;animation-delay:.44s}

/* podcast seek bar */
.now-seek{display:none;width:100%;max-width:360px;margin:20px 0 2px}
#now.episode .now-seek{display:block}
#now.episode .now-eq{display:none}
#now.episode .now-live{display:none}
.now-seek input{-webkit-appearance:none;appearance:none;width:100%;height:5px;border-radius:5px;background:var(--line2);outline:none}
.now-seek input::-webkit-slider-thumb{-webkit-appearance:none;width:15px;height:15px;border-radius:50%;background:var(--ink);cursor:pointer}
.now-seek input::-moz-range-thumb{width:15px;height:15px;border:none;border-radius:50%;background:var(--ink)}
.seek-times{display:flex;justify-content:space-between;margin-top:6px;font-size:11.5px;color:var(--muted);font-weight:600}

.now-controls{display:flex;align-items:center;gap:30px;margin-top:auto}
.nc{background:none;border:none;color:var(--ink);cursor:pointer;display:grid;place-items:center}
.nc svg{width:30px;height:30px}
.nc.big{width:72px;height:72px;border-radius:50%;background:var(--accent);color:var(--accent-ink)}
.nc.big svg{width:30px;height:30px}
.now-vol{display:flex;align-items:center;gap:12px;width:100%;max-width:340px;margin-top:28px}
.now-vol svg{width:19px;height:19px;color:var(--muted);flex:none}
.now-vol input{flex:1;-webkit-appearance:none;appearance:none;height:5px;border-radius:5px;background:var(--line2);outline:none}
.now-vol input::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:var(--ink);cursor:pointer}
.now-vol input::-moz-range-thumb{width:16px;height:16px;border:none;border-radius:50%;background:var(--ink)}
.now-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:22px}
.na{display:inline-flex;align-items:center;gap:8px;background:transparent;border:1.5px solid var(--line2);
  border-radius:30px;padding:11px 18px;color:var(--ink);font-family:inherit;font-size:13.5px;font-weight:600;
  cursor:pointer;text-decoration:none}
.na svg{width:17px;height:17px}
.na.on{color:var(--rose);border-color:var(--rose)}
.na.off{opacity:.4}   /* greyed out when no song/lyrics is available */
.na.on svg{fill:var(--rose);stroke:var(--rose)}

/* sound enhancer / sleep / buffer panels */
.now-sound{width:100%;max-width:360px;margin-top:22px}
/* breathing room + divider between the player controls and the settings panels */
#nowSound{margin-top:34px;padding-top:26px;border-top:1px solid var(--line)}
.ns-label{display:flex;align-items:center;gap:7px;font-size:10.5px;font-weight:800;letter-spacing:1.3px;
  color:var(--muted);justify-content:center;margin-bottom:11px}
.ns-label svg{width:15px;height:15px;color:var(--ink)}
.ns-chips{display:flex;gap:8px;justify-content:center;align-items:center;flex-wrap:wrap}
.nschip,.slchip{font-family:inherit;font-size:13px;font-weight:600;color:var(--muted);background:var(--soft);
  border:none;border-radius:30px;padding:8px 14px;cursor:pointer;white-space:nowrap;
  -webkit-appearance:none;appearance:none;line-height:1.1}
.nschip.on,.slchip.on{color:var(--accent-ink);background:var(--accent)}
.nsmore-btn{display:inline-flex;align-items:center;gap:5px;padding-right:11px}
.nsmore-btn svg{width:13px;height:13px;flex:none;transition:transform .22s ease}
.nsmore-btn.open{color:var(--ink);background:var(--line2)}
.nsmore-btn.open svg{transform:rotate(180deg)}
.nsmore-btn.has{color:var(--accent-ink);background:var(--accent)}
.ns-more{display:none;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:9px;animation:nsmoreIn .2s ease}
.ns-more.open{display:flex}
@keyframes nsmoreIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.now-sleep{margin-top:18px}
.sleep-left{margin-left:8px;color:var(--ink);font-weight:800;letter-spacing:.5px}

/* ---------- modals ---------- */
.modal{position:fixed;inset:0;z-index:70;display:none;align-items:flex-end;justify-content:center;
  background:rgba(0,0,0,.55);backdrop-filter:blur(3px)}
.modal.open{display:flex}
.modal-card{width:100%;max-width:460px;background:var(--bg);border:1px solid var(--line2);
  border-radius:22px 22px 0 0;padding:24px 20px calc(var(--sab) + 22px);animation:rise .25s ease}
@media(min-width:560px){.modal{align-items:center}.modal-card{border-radius:22px}}
.modal-h{font-size:21px;font-weight:800;letter-spacing:-.02em}
.modal-sub{color:var(--muted);font-size:13px;margin:7px 0 16px;line-height:1.45;font-weight:500}
.modal-in{width:100%;background:var(--soft);border:none;border-radius:12px;
  padding:14px;color:var(--ink);font-family:inherit;font-size:15px;margin-bottom:10px;outline:none}
.modal-in::placeholder{color:var(--muted)}
.modal-row{display:flex;gap:10px;margin-top:8px}
.modal-btn{flex:1;border:1.5px solid var(--line2);background:transparent;color:var(--ink);
  border-radius:30px;padding:13px;font-family:inherit;font-weight:700;font-size:14px;cursor:pointer}
.modal-btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
/* lyrics text */
.lyrics-body{font-family:inherit;font-size:14px;line-height:1.7;color:var(--ink);white-space:pre-wrap;
  word-break:break-word;max-height:52vh;overflow-y:auto;margin:4px 0 14px;-webkit-overflow-scrolling:touch}
.lyrics-body::-webkit-scrollbar{width:0}

/* legal / info pages */
.info-body{font-size:13.5px;line-height:1.6;color:var(--ink);max-height:60vh;overflow-y:auto;margin:6px 0 14px;
  -webkit-overflow-scrolling:touch}
.info-body::-webkit-scrollbar{width:0}
.info-body p{margin:0 0 11px;color:var(--muted)}
.info-body p b{color:var(--ink);font-weight:700}
.legal{padding:26px 22px calc(var(--sab) + 8px);text-align:center}
.legal-note{font-size:12px;line-height:1.55;color:var(--muted);max-width:560px;margin:0 auto 14px}
.legal-links{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center}
.legal-links button{background:none;border:none;color:var(--ink);font-family:inherit;font-size:12.5px;font-weight:600;
  cursor:pointer;padding:2px;text-decoration:underline;text-underline-offset:2px}
.legal-links i{color:var(--muted);font-style:normal}
.legal-copy{font-size:11px;color:var(--muted);margin-top:14px;letter-spacing:.2px}

/* one-time storage consent banner */
.consent{position:fixed;left:10px;right:10px;bottom:calc(var(--tab-h) + var(--mini-h) + var(--sab) + 22px);z-index:65;
  display:none;align-items:center;gap:12px;padding:12px 14px;background:var(--card);border:1px solid var(--line2);
  border-radius:16px;box-shadow:var(--shadow);max-width:560px;margin:0 auto}
.consent.show{display:flex;animation:rise .3s ease}
.consent-tx{flex:1;font-size:12.5px;line-height:1.45;color:var(--muted)}
.consent-link{background:none;border:none;color:var(--ink);font-family:inherit;font-size:12.5px;font-weight:700;
  cursor:pointer;text-decoration:underline;text-underline-offset:2px;padding:0}
.consent-ok{flex:none;background:var(--accent);color:var(--accent-ink);border:none;border-radius:30px;
  padding:9px 16px;font-family:inherit;font-weight:700;font-size:13px;cursor:pointer}
@media(min-width:1024px){ .consent{left:auto;right:24px;bottom:104px;margin:0;max-width:420px} }

/* desktop-only chrome — hidden on phone & tablet */
.dtopbar,.side-brand,.side-langs,.side-lib,.cardsec,.mini-prog{display:none}
/* the logo mark is black line-art — flip it to white in dark theme */
html.dark .brand-mark,html.dark .vtitle-mark{filter:invert(1)}
/* logo mark beside the "Radios" wordmark in the home header */
.vtitle{display:flex;align-items:center;gap:9px}
.vtitle-mark{height:30px;width:auto;flex:none}

/* =========================================================
   Auto-detected layout tiers (by viewport width):
     • Phone   ( < 700px ) — base styles above
     • Tablet  ( 700–1023 ) — wider column, card grid,
                 2-col lists, full player controls, bottom tabs
     • Desktop ( ≥ 1024 )  — left sidebar, top bar, docked
                 player bar, multi-column grids
   ========================================================= */

/* ---------- TABLET and up (shared with desktop) ---------- */
@media(min-width:700px){
  #view{max-width:820px;margin:0 auto;width:100%}
  .mini{max-width:760px;margin:0 auto}
  .tabs{padding-left:max(8px,calc((100% - 760px)/2));padding-right:max(8px,calc((100% - 760px)/2))}

  /* two-column lists + hover */
  .list{display:grid;grid-template-columns:repeat(2,1fr);gap:2px 18px;padding:4px 18px 0}
  .lrow:hover,.cat:hover,.iconbtn:hover{background:var(--soft)}

  /* "Popular now" card grid */
  .cardsec{display:block}
  .cardgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:0 18px}
  .card{cursor:pointer}
  .cart{position:relative;aspect-ratio:1;border-radius:16px;overflow:hidden;display:grid;place-items:center;margin-bottom:11px;color:#fff}
  .cart svg{width:34%;height:34%;color:#fff;opacity:.92;position:relative;z-index:1}
  .cart::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,.12),transparent 55%)}
  .clive{position:absolute;top:11px;left:11px;display:flex;align-items:center;gap:6px;background:rgba(0,0,0,.45);
    -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:#fff;padding:5px 9px;border-radius:30px;
    font-size:9.5px;font-weight:800;letter-spacing:.06em;z-index:2}
  .clive i{width:5px;height:5px;border-radius:50%;background:#fff;animation:blink 1.6s infinite}
  .cplay{position:absolute;right:11px;bottom:11px;width:42px;height:42px;border-radius:50%;background:#fff;
    display:grid;place-items:center;opacity:0;transform:translateY(8px);transition:.2s;z-index:2}
  .cplay svg{width:17px;height:17px;color:#111}
  .card:hover .cplay,.card.on .cplay{opacity:1;transform:none}
  .cnm{font-size:15px;font-weight:700;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
  .cmt{font-size:13px;color:var(--muted)}

  /* player bar gains the full transport (prev/next + volume) */
  .mini.show{display:grid;grid-template-columns:minmax(150px,1fr) auto minmax(150px,1fr);gap:14px;align-items:center}
  .mini-ctrls{justify-self:center;gap:10px}
  .mini-ctrls #miniPrev,.mini-ctrls #miniNext{display:grid}
  .mini-right{display:flex;align-items:center;gap:10px;justify-self:end}
}

/* ---------- DESKTOP only: sidebar + top bar + docked bar ---------- */
@media(min-width:1024px){
  /* left sidebar nav (repurposed bottom tabs) */
  .tabs{
    top:0;bottom:0;left:0;right:auto;width:248px;height:100vh;
    flex-direction:column;justify-content:flex-start;align-items:stretch;gap:4px;
    padding:22px 14px 16px;border-top:none;border-right:1px solid var(--line);
    background:var(--bg2);transform:none;border-radius:0;box-shadow:none}
  .tab{flex:none;flex-direction:row;justify-content:flex-start;gap:14px;padding:12px 16px;border-radius:12px}
  .tab svg{width:22px;height:22px}
  .tab span{font-size:15px;font-weight:600}
  .tab.on{background:var(--soft);color:var(--ink)}
  .tab:hover{color:var(--ink);background:var(--soft)}

  /* content centred to the right of the sidebar, below the top bar */
  #view{margin:0 0 0 248px;max-width:none;width:auto;
    padding:calc(var(--sat) + 82px) max(44px,calc((100vw - 248px - 900px)/2)) 116px}
  .vtitle{font-size:38px}
  .home-cta{justify-content:flex-start}

  /* docked desktop player bar (surface, full transport) */
  .mini{left:248px;right:0;bottom:0;margin:0;max-width:none;height:84px;
    border-radius:0;border-top:1px solid var(--line);box-shadow:none;padding:0 24px;
    background:var(--bg2);color:var(--ink)}
  .mini.show{grid-template-columns:minmax(220px,1fr) auto minmax(220px,1fr);gap:16px}
  .mini-art{width:52px;height:52px}
  .mini-nm{color:var(--ink);font-size:15px}
  .mini-mt{color:var(--muted);opacity:1}
  .mini-btn{width:42px;height:42px;background:var(--accent);color:var(--accent-ink)}
  .mini-btn svg{width:20px;height:20px}
  .mini-x{color:var(--ink);opacity:.62}
  .mini-x:hover{opacity:1;background:var(--soft)}
  .mini-x.on{color:var(--rose);opacity:1}
  /* centre column = transport row over a progress/LIVE row */
  .mini-ctrls{flex-direction:column;gap:6px}
  .mini-tbtns{display:flex;align-items:center;gap:16px}
  .mini-prog{display:flex;align-items:center;gap:9px;width:min(440px,32vw)}
  .mp-cur,.mp-dur{font-size:11px;color:var(--muted);font-weight:600;font-variant-numeric:tabular-nums;min-width:30px}
  .mp-cur{text-align:right}.mp-dur{text-align:left}
  .mp-bar{flex:1;height:4px;border-radius:4px;background:var(--line2);position:relative;cursor:pointer}
  .mp-fill{position:absolute;inset:0;width:0;background:var(--ink);border-radius:4px}
  .mini-prog.live .mp-bar{cursor:default}
  .mini-prog.live .mp-fill{background:var(--line2)}
  .mini-prog.live .mp-cur{color:var(--ink);display:inline-flex;align-items:center;gap:5px;min-width:0}
  .mini-prog.live .mp-cur::before{content:"";width:6px;height:6px;border-radius:50%;background:#e0444d;animation:blink 1.6s infinite}
  .mini-vol svg{color:var(--ink);opacity:.6}
  .mini-vol input{background:var(--line2)}
  .mini-vol input::-webkit-slider-thumb{background:var(--ink)}
  .mini-vol input::-moz-range-thumb{background:var(--ink)}

  .cardgrid{grid-template-columns:repeat(4,1fr);gap:18px}
  .now{left:248px}
  .toast{left:calc(248px + (100vw - 248px)/2);bottom:108px}

  /* sidebar brand + languages */
  .side-brand{display:flex;align-items:center;gap:10px;padding:2px 8px 20px}
  .brand-mark{height:30px;width:auto;flex:none}
  .brand-name{font-size:20px;font-weight:800;letter-spacing:-.02em;color:var(--ink)}
  .vtitle-mark{display:none}   /* sidebar already shows the logo on desktop */
  .side-langs{display:flex;flex-direction:column;flex:none;min-height:0}
  .slabel{font-size:11px;font-weight:800;letter-spacing:.08em;color:var(--muted);padding:16px 12px 8px}
  .langs{display:flex;flex-direction:column;gap:1px}
  .lang{display:flex;align-items:center;gap:11px;padding:8px 12px;border-radius:10px;color:var(--muted);
    font-family:inherit;font-size:13.5px;font-weight:500;cursor:pointer;border:none;background:none;text-align:left}
  .lang i{width:7px;height:7px;border-radius:50%;background:currentColor;opacity:.5;flex:none}
  .lang:hover,.lang.on{color:var(--ink);background:var(--soft)}

  /* sidebar LIBRARY (favourites + recents, scrollable) */
  .side-lib{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
  .libitems{display:flex;flex-direction:column;gap:1px;overflow-y:auto;flex:1;
    scrollbar-width:thin;scrollbar-color:var(--line2) transparent}
  .libitems::-webkit-scrollbar{width:8px}
  .libitems::-webkit-scrollbar-thumb{background:var(--line2);border-radius:8px;border:2px solid var(--bg2)}
  .libitem{display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:10px;cursor:pointer;
    border:none;background:none;text-align:left;width:100%}
  .libitem:hover,.libitem.on{background:var(--soft)}
  .libart{width:34px;height:34px;border-radius:8px;flex:none;display:grid;place-items:center;color:#fff;
    overflow:hidden;position:relative}
  .libart svg{width:16px;height:16px;color:#fff}
  .libtx{min-width:0;flex:1}
  .libtx b{font-size:13px;font-weight:600;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
  .libtx span{font-size:11px;color:var(--muted);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .libitem.on .libtx b{color:var(--ink)}
  .libempty{font-size:12px;color:var(--muted);padding:8px 12px;line-height:1.45}

  /* top bar */
  .dtopbar{display:flex;align-items:center;gap:16px;position:fixed;top:0;left:248px;right:0;height:66px;z-index:20;
    padding:0 28px;background:var(--bg);border-bottom:1px solid var(--line)}
  .dfind{display:flex;align-items:center;gap:11px;background:var(--soft);border-radius:13px;padding:11px 15px;width:min(420px,40vw)}
  .dfind svg{width:18px;height:18px;color:var(--muted);flex:none}
  .dfind input{background:none;border:0;outline:0;color:var(--ink);font-family:inherit;font-size:14px;width:100%}
  .dfind input::placeholder{color:var(--muted)}
  .dsp{flex:1}
  .icbtn{width:40px;height:40px;border-radius:50%;background:var(--soft);display:grid;place-items:center;cursor:pointer;color:var(--ink);border:none}
  .icbtn:hover{background:var(--line2)}
  .icbtn svg{width:18px;height:18px}
  .avatar{width:40px;height:40px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-weight:800;font-size:14px;cursor:pointer}

  /* ---------- desktop polish (Apple Music / Spotify feel) ---------- */
  /* declutter the in-content header — the top bar already owns theme/search */
  .vhead{padding:6px 18px 6px}
  .vhead .clock,#themeTop{display:none}
  .greet{font-size:14px}
  .vtitle{font-size:34px;margin-top:2px}
  .vsub{margin-top:5px}

  /* roomier sections + bolder headings */
  .section{margin-top:36px}
  .sec-h{padding:0 18px 14px}
  .sec-h h3{font-size:22px}
  .sec-h .cnt{font-size:13px}

  /* cards: gentle hover lift + art shadow, like a music app */
  .cart{box-shadow:0 8px 22px -12px rgba(0,0,0,.5);transition:transform .18s ease,box-shadow .18s ease}
  .card{transition:transform .18s ease}
  .card:hover{transform:translateY(-4px)}
  .card:hover .cart{box-shadow:0 16px 30px -14px rgba(0,0,0,.6)}
  .cnm{font-size:15.5px}

  /* list rows: reveal the play affordance on hover (Spotify-style) */
  .lrow{padding:9px 12px;border-radius:10px}
  .lrow .lplay{opacity:0;transition:opacity .15s ease}
  .lrow:hover .lplay,.lrow.on .lplay,.lrow.on .leq{opacity:1}

  /* thin, subtle scrollbars */
  #view{scrollbar-width:thin;scrollbar-color:var(--line2) transparent}
  #view::-webkit-scrollbar{width:10px}
  #view::-webkit-scrollbar-thumb{background:var(--line2);border-radius:10px;border:3px solid var(--bg)}
  #view::-webkit-scrollbar-thumb:hover{background:var(--muted)}
  #view::-webkit-scrollbar-track{background:transparent}

  /* player bar: tighter, more refined */
  .mini{padding:0 22px}
  .mini-art{border-radius:10px}
  .mini-nm{font-weight:700}
  .mini-x{width:36px;height:36px}
  .mini-vol input{width:104px}
}
@media(min-width:1500px){
  .list{grid-template-columns:repeat(3,1fr)}
  .cardgrid{grid-template-columns:repeat(5,1fr)}
}
