/* ============================================================
   RadioLive.co — design system
   White ground, black text, cool hairline neutrals.
   Black is the UI colour; red appears only as the on-air lamp
   and on errors. Light always — dark only if the visitor
   opts in with the theme toggle, never from the OS setting.
============================================================ */

:root{
  --page:#FFFFFF;
  --surface:#FFFFFF;
  --surface-2:#F5F6F8;
  --surface-3:#ECEEF2;
  --line:#E4E7EC;
  --line-strong:#D2D7DF;
  --text:#0B0C0F;
  --muted:#3D424A;
  --faint:#5F6670;
  --ink:#0F1319;          /* primary UI: buttons, active states */
  --ink-on:#FFFFFF;
  --signal:#D6203C;       /* on air / play — the only saturated colour */
  --signal-soft:#FDEEF0;
  --signal-line:#F4C3CB;
  --ok:#0F7B4F;
  --shadow-sm:0 1px 2px rgba(15,19,25,.06);
  --shadow:0 8px 24px -8px rgba(15,19,25,.18);
  --shadow-lg:0 24px 60px -20px rgba(15,19,25,.30);
  --rail-w:244px;
  --bar-h:76px;
  --r:8px;
  --r-sm:6px;
  --plate-sat:14%;
  --plate-a:96%;
  --plate-b:90%;
  --plate-ink:40%;
}
:root[data-theme="dark"]{
  --page:#0C0E12; --surface:#13161B; --surface-2:#181C22; --surface-3:#232830;
  --line:#242931; --line-strong:#333A44;
  --text:#F2F4F7; --muted:#9BA4B2; --faint:#6C7583;
  --ink:#F2F4F7; --ink-on:#0C0E12;
  --signal:#FF5A70; --signal-soft:rgba(255,90,112,.12); --signal-line:rgba(255,90,112,.32);
  --ok:#3DD68C;
  --shadow-sm:0 1px 2px rgba(0,0,0,.5);
  --shadow:0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-lg:0 24px 60px -20px rgba(0,0,0,.75);
  --plate-sat:14%; --plate-a:22%; --plate-b:16%; --plate-ink:72%;
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--page);color:var(--text);
  font-family:"Instrument Sans","Helvetica Neue",Arial,sans-serif;
  font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;
  padding-bottom:calc(var(--bar-h) + 8px);
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:4px}
.mono,.tnum{font-family:"IBM Plex Mono",ui-monospace,Menlo,monospace;font-variant-numeric:tabular-nums}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}

/* ---------------- Top bar ---------------- */
.top{
  position:sticky;top:0;z-index:60;
  display:flex;align-items:center;gap:12px;height:60px;padding:0 20px;
  background:var(--surface);border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:9px;flex-shrink:0}
.lamp{width:8px;height:8px;border-radius:50%;background:var(--signal)}
.brand-name{font-weight:700;font-size:16px;letter-spacing:-.025em}
.brand-name i{font-style:normal;color:var(--muted);font-weight:500}
.search{flex:1;max-width:440px;position:relative}
.search input{
  width:100%;height:38px;padding:0 12px 0 36px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);
  color:var(--text);font:inherit;font-size:13.5px;
}
.search input::placeholder{color:var(--faint)}
.search input:focus{outline:none;border-color:var(--ink);background:var(--surface)}
.search svg{position:absolute;left:12px;top:11px;width:16px;height:16px;stroke:var(--faint);fill:none;stroke-width:2}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.icon-btn{width:36px;height:36px;border-radius:var(--r);display:grid;place-items:center;
  border:1px solid var(--line);color:var(--text);background:var(--surface)}
.icon-btn:hover{background:var(--surface-2);color:var(--text);border-color:var(--line-strong)}
.icon-btn svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8}
.menu-btn{display:none}

/* ---------------- Shell ---------------- */
.shell{display:grid;grid-template-columns:var(--rail-w) 1fr;align-items:start}
.rail{
  position:sticky;top:60px;height:calc(100vh - 60px);
  border-right:1px solid var(--line);background:var(--surface);
  padding:18px 12px;overflow-y:auto;display:flex;flex-direction:column;gap:22px;
}
.rail::-webkit-scrollbar{width:6px}
.rail::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:3px}
.rail-label{font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);padding:0 10px;margin-bottom:8px}
.rail-item{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:8px 10px;border-radius:var(--r-sm);
  font-size:13.5px;font-weight:500;color:var(--text);text-align:left;
}
.rail-item:hover{background:var(--surface-2);color:var(--text)}
.rail-item.active{font-weight:600}
.rail-item.active{background:var(--surface-3);color:var(--text);font-weight:600}
.rail-item .n{margin-left:auto;font-size:11.5px;color:var(--muted)}
.rail-item svg{width:16px;height:16px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.8}
.rail-scroll{max-height:260px;overflow-y:auto}
.rail-scroll::-webkit-scrollbar{width:5px}
.rail-scroll::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:3px}
.main{min-width:0}
.pad{padding:22px 24px}

/* ---------------- Filter strip ---------------- */
.dial{position:sticky;top:60px;z-index:20;background:var(--surface);
  border-bottom:1px solid var(--line);padding:12px 24px}
.dial-row{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none}
.dial-row::-webkit-scrollbar{display:none}
.chip{flex-shrink:0;padding:6px 13px;border-radius:99px;border:1px solid var(--line-strong);
  font-size:12.5px;font-weight:500;color:var(--text);white-space:nowrap;background:var(--surface)}
.chip:hover{border-color:var(--ink);color:var(--text)}
.chip.on{background:var(--ink);border-color:var(--ink);color:var(--ink-on);font-weight:600}

/* ---------------- Shelves + grid ---------------- */
.shelf-head{display:flex;align-items:baseline;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.shelf-head h1,.shelf-head h2{font-size:17px;font-weight:600;letter-spacing:-.02em;text-wrap:balance}
.shelf-head .sub{font-size:12.5px;color:var(--muted)}
.shelf-head .more{margin-left:auto;font-size:12.5px;font-weight:600;color:var(--text);text-decoration:underline;text-underline-offset:3px}
.shelf-head .more:hover{text-decoration:underline}
.shelf{display:flex;gap:14px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x mandatory}
.shelf::-webkit-scrollbar{height:8px}
.shelf::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:4px}
.shelf .card{width:160px;flex-shrink:0;scroll-snap-align:start}
.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(158px,1fr))}

/* ---------------- Card ---------------- */
.card{display:flex;flex-direction:column;gap:9px;text-align:left;position:relative}
.art{position:relative;aspect-ratio:1;border-radius:var(--r);overflow:hidden;
  background:var(--surface-2);border:1px solid var(--line)}
.art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1}
/* Generated plate — 42% of the catalogue has no logo, so this is a main path. */
.plate{position:absolute;inset:0;z-index:0;display:grid;place-items:center;
  background:linear-gradient(150deg,hsl(var(--h) var(--plate-sat) var(--plate-a)),hsl(var(--h) var(--plate-sat) var(--plate-b)))}
.plate span{font-weight:600;font-size:27px;letter-spacing:-.03em;color:hsl(var(--h) 18% var(--plate-ink))}
.card-link{position:static}
.card-link::after{content:"";position:absolute;inset:0;z-index:2}
.card-link:focus-visible::after{outline:2px solid var(--ink);outline-offset:3px;border-radius:10px}
.art .play{position:absolute;right:9px;bottom:9px;z-index:3;
  width:38px;height:38px;border-radius:50%;
  background:var(--ink);color:var(--ink-on);display:grid;place-items:center;
  box-shadow:var(--shadow);opacity:0;transform:translateY(5px) scale(.94);
  transition:opacity .15s ease,transform .15s ease}
.card:hover .play,.card:focus-within .play{opacity:1;transform:none}
.art .play svg{width:15px;height:15px;fill:currentColor}
.card.playing .art{border-color:var(--ink);box-shadow:0 0 0 2px var(--surface-3)}
.card.playing .play{opacity:1;transform:none}
.card-name{font-size:13.5px;font-weight:600;line-height:1.35;letter-spacing:-.01em;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-meta{font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:6px;
  white-space:nowrap;overflow:hidden;min-width:0}
.card-meta > span{overflow:hidden;text-overflow:ellipsis;min-width:0}
.card-meta .dot{width:2px;height:2px;border-radius:50%;background:currentColor;
  flex-shrink:0;overflow:visible}
.card-meta .tnum{flex-shrink:0;overflow:visible}
.badge-top{position:absolute;left:9px;top:9px;z-index:3;padding:3px 7px;border-radius:5px;
  background:var(--ink);color:var(--ink-on);font-size:9.5px;font-weight:700;letter-spacing:.07em}

/* ---------------- Station page ---------------- */
.hero{display:flex;gap:24px;align-items:flex-start}
.hero-art{width:180px;flex-shrink:0;aspect-ratio:1;border-radius:12px;overflow:hidden;
  position:relative;border:1px solid var(--line);box-shadow:var(--shadow-sm)}
.hero-art .plate span{font-size:54px}
.eyebrow{font-size:10.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:var(--signal);margin-bottom:9px;display:flex;align-items:center;gap:6px}
.hero h1{font-size:32px;font-weight:600;letter-spacing:-.035em;line-height:1.12;
  text-wrap:balance;margin-bottom:8px}
.hero-meta{font-size:13.5px;color:var(--muted);margin-bottom:18px;overflow-wrap:anywhere}
.stat-row{display:flex;gap:26px;margin-bottom:18px;flex-wrap:wrap}
.stat .k{font-family:"IBM Plex Mono",monospace;font-variant-numeric:tabular-nums;
  font-size:20px;font-weight:500;letter-spacing:-.02em}
.stat .l{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-top:2px}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;gap:7px;height:40px;padding:0 17px;border-radius:var(--r);
  font-size:13.5px;font-weight:600;border:1px solid var(--line-strong);color:var(--text);background:var(--surface)}
.btn:hover{background:var(--surface-2);border-color:var(--ink)}
.btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8}
.btn-primary{background:var(--ink);border-color:var(--ink);color:var(--ink-on)}
.btn-primary:hover{background:var(--ink);border-color:var(--ink);opacity:.88}
.btn-primary svg{fill:currentColor;stroke:none}
.btn.on{border-color:var(--ink);color:var(--text);background:var(--surface-2)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:22px;margin-top:20px}
.panel h2,.panel h3{font-size:13.5px;font-weight:600;letter-spacing:-.005em;margin-bottom:14px}
.desc{font-size:14.5px;color:var(--text);line-height:1.7;max-width:64ch}
.stars{display:flex;gap:3px;align-items:center}
.stars svg{width:17px;height:17px;fill:var(--surface-3)}
.stars svg.on{fill:var(--ink)}
.rate-line{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.rate-num{font-family:"IBM Plex Mono",monospace;font-variant-numeric:tabular-nums;
  font-size:13px;color:var(--muted)}
.stars-input{display:flex;gap:4px}
.stars-input input{position:absolute;left:-9999px}
.stars-input label{cursor:pointer;line-height:0}
.stars-input label svg{width:24px;height:24px;fill:var(--surface-3);transition:fill .12s}
.stars-input label:hover svg,.stars-input label:hover ~ label svg{fill:var(--ink)}
.stars-input:not(:hover) input:checked ~ label svg,
.stars-input:not(:hover) input:checked + label svg{fill:var(--ink)}
.cmt{display:flex;gap:12px;padding:15px 0;border-top:1px solid var(--line)}
.cmt:first-of-type{border-top:none;padding-top:0}
.cmt-av{width:34px;height:34px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;
  font-size:12.5px;font-weight:600;background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.cmt-who{font-size:13px;font-weight:600}
.cmt-when{font-size:11.5px;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.cmt-body{font-size:14px;color:var(--text);line-height:1.6;margin-top:5px;overflow-wrap:anywhere}

/* ---------------- Forms ---------------- */
.field{display:block;margin-bottom:16px}
.lbl{display:block;font-size:12.5px;font-weight:600;color:var(--text);margin-bottom:6px}
.input,.textarea,.select{
  width:100%;padding:10px 13px;border-radius:var(--r);border:1px solid var(--line-strong);
  background:var(--surface);color:var(--text);font:inherit;font-size:13.5px}
.input:focus,.textarea:focus,.select:focus{outline:none;border-color:var(--ink);box-shadow:0 0 0 3px var(--surface-3)}
.textarea{resize:vertical;min-height:100px}
.select option{background:var(--surface);color:var(--text)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
.hint{font-size:12.5px;color:var(--muted);margin-top:5px}
.notice{padding:12px 15px;border-radius:var(--r);margin-bottom:18px;font-size:13.5px;font-weight:500;
  border:1px solid var(--line-strong);background:var(--surface-2)}
.notice-ok{background:var(--surface-2);border-color:var(--ok);color:var(--ok)}
.notice-bad{background:var(--signal-soft);border-color:var(--signal-line);color:var(--signal)}

/* ---------------- Pagination ---------------- */
.pager{display:flex;flex-wrap:wrap;gap:6px;margin-top:28px;justify-content:center;align-items:center}
.pager a,.pager span{min-width:36px;height:36px;padding:0 11px;border-radius:var(--r-sm);
  display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:500;
  color:var(--text);font-family:"IBM Plex Mono",monospace;font-variant-numeric:tabular-nums}
.pager a{border:1px solid var(--line-strong);background:var(--surface)}
.pager a:hover{border-color:var(--ink);color:var(--text)}
.pager .on{background:var(--ink);color:var(--ink-on);font-weight:600}
.pager .gap{color:var(--faint)}

/* ============================================================
   PLAYER — compact bar, expandable to a full now-playing sheet
============================================================ */
.receiver{
  position:fixed;left:0;right:0;bottom:0;height:var(--bar-h);z-index:80;
  background:var(--surface);border-top:1px solid var(--line);
  display:flex;align-items:center;gap:14px;padding:0 18px;
  box-shadow:var(--shadow);
  transform:translateY(110%);transition:transform .28s cubic-bezier(.32,.72,0,1);
}
.receiver.up{transform:none}
.rc-art{width:52px;height:52px;border-radius:var(--r-sm);overflow:hidden;flex-shrink:0;
  position:relative;border:1px solid var(--line);cursor:pointer}
.rc-art .plate span{font-size:19px}
.rc-info{min-width:0;flex:1;cursor:pointer}
.rc-name{font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rc-meta{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;
  margin-top:2px;display:flex;align-items:center;gap:7px;min-width:0}
.rc-meta > span:not(.onair){overflow:hidden;text-overflow:ellipsis;min-width:0}
.rc-meta .onair{flex-shrink:0}
.rc-play{width:44px;height:44px;border-radius:50%;flex-shrink:0;background:var(--ink);
  color:var(--ink-on);display:grid;place-items:center;box-shadow:var(--shadow-sm)}
.rc-play:hover{filter:brightness(1.06)}
.rc-play svg{width:17px;height:17px;fill:currentColor}
.onair{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;
  font-size:10px;font-weight:700;letter-spacing:.09em;color:var(--signal)}
.onair i{width:6px;height:6px;border-radius:50%;background:currentColor;
  animation:pulse 2s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}
.receiver.paused .onair{color:var(--faint)}
.receiver.paused .onair i{animation:none}
.rc-right{margin-left:auto;display:flex;align-items:center;gap:10px;flex-shrink:0}
.rc-right svg{width:17px;height:17px;stroke:var(--muted);fill:none;stroke-width:1.8}
.vol{width:92px;accent-color:var(--ink)}
.rc-icon-btn{width:34px;height:34px;border-radius:var(--r-sm);display:grid;place-items:center;color:var(--muted)}
.rc-icon-btn:hover{background:var(--surface-2);color:var(--text)}
.rc-load{position:absolute;left:0;right:0;top:0;height:2px;overflow:hidden;display:none}
.receiver.loading .rc-load{display:block}
.rc-load i{position:absolute;inset:0;background:var(--ink);
  transform:translateX(-100%);animation:load 1.1s ease-in-out infinite}
@keyframes load{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}

/* ---- Expanded now-playing sheet ---- */
.sheet{
  position:fixed;inset:0;z-index:120;background:var(--page);
  display:flex;flex-direction:column;align-items:center;
  padding:20px 24px calc(24px + env(safe-area-inset-bottom));
  transform:translateY(100%);transition:transform .3s cubic-bezier(.32,.72,0,1);
  visibility:hidden;overflow-y:auto;
}
.sheet.open{transform:none;visibility:visible}
.sheet-bar{width:100%;display:flex;align-items:center;justify-content:space-between;
  margin-bottom:auto;flex-shrink:0}
.sheet-bar .lbl-sm{font-size:10.5px;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted)}
.sheet-art{width:min(300px,68vw);aspect-ratio:1;border-radius:16px;overflow:hidden;position:relative;
  border:1px solid var(--line);box-shadow:var(--shadow-lg);margin:20px 0 26px;flex-shrink:0}
.sheet-art .plate span{font-size:72px}
.sheet-name{font-size:22px;font-weight:600;letter-spacing:-.03em;text-align:center;
  text-wrap:balance;max-width:22ch;margin-bottom:7px}
.sheet-meta{font-size:14px;color:var(--muted);text-align:center;margin-bottom:8px}
.sheet-state{font-size:10.5px;font-weight:700;letter-spacing:.1em;margin-bottom:24px;
  display:flex;align-items:center;gap:6px;color:var(--signal)}
.sheet-state i{width:7px;height:7px;border-radius:50%;background:currentColor;
  animation:pulse 2s ease-in-out infinite}
.sheet.paused .sheet-state{color:var(--faint)}
.sheet.paused .sheet-state i{animation:none}
.sheet-controls{display:flex;align-items:center;gap:24px;margin-bottom:26px}
.sheet-play{width:72px;height:72px;border-radius:50%;background:var(--ink);color:var(--ink-on);
  display:grid;place-items:center;box-shadow:var(--shadow)}
.sheet-play:hover{filter:brightness(1.06)}
.sheet-play svg{width:27px;height:27px;fill:currentColor}
.sheet-side{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;
  border:1px solid var(--line-strong);color:var(--muted);background:var(--surface)}
.sheet-side:hover{color:var(--text);border-color:var(--ink)}
.sheet-side svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8}
.sheet-side.on{color:var(--text);border-color:var(--ink);background:var(--surface-2)}
.sheet-vol{display:flex;align-items:center;gap:12px;width:min(300px,68vw);margin-bottom:20px}
.sheet-vol svg{width:18px;height:18px;stroke:var(--faint);fill:none;stroke-width:1.8;flex-shrink:0}
.sheet-vol input{flex:1;accent-color:var(--ink)}
.sheet-link{font-size:13px;font-weight:600;color:var(--text);text-decoration:underline;text-underline-offset:3px;margin-bottom:8px}
.sheet-link:hover{text-decoration:underline}

/* ---------------- Drawer ---------------- */
.scrim{display:none;position:fixed;inset:0;background:rgba(15,19,25,.42);z-index:90}
.scrim.on{display:block}

/* ---------------- Footer ---------------- */
.foot{border-top:1px solid var(--line);background:var(--surface-2);padding:30px 24px 40px;margin-top:44px}
.foot-in{max-width:1180px;margin:0 auto}
.foot-nav{display:flex;gap:20px;flex-wrap:wrap;margin-bottom:18px}
.foot-nav a{font-size:13px;font-weight:600;color:var(--text)}
.foot-nav a:hover{color:var(--text)}
.foot p{font-size:12.5px;line-height:1.7;color:var(--muted);margin-bottom:11px;max-width:100ch}
.foot a{color:var(--muted);text-decoration:underline;text-underline-offset:2px}
.foot-links a{margin-right:4px}
.foot-copy{font-size:12px;color:var(--muted)}

@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .rail{position:fixed;top:0;left:0;bottom:0;height:100%;width:280px;z-index:100;
    transform:translateX(-100%);transition:transform .26s cubic-bezier(.32,.72,0,1);box-shadow:var(--shadow-lg)}
  .rail.open{transform:none}
  .menu-btn{display:grid}
  .grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
  .card-name{font-size:14px}
  .card-meta{font-size:12.5px}
  .rail-item{font-size:14.5px;padding:10px 12px}
  .rail-label{font-size:11px}
  .shelf .card{width:140px}
  .hero{flex-direction:column;gap:16px}
  .hero-art{width:150px}
  .hero h1{font-size:24px}
  .hero-art .plate span{font-size:46px}
  .row2,.row3{grid-template-columns:1fr}
  .rc-right{display:none}
  .pad{padding:18px 16px}
  .dial{padding:12px 16px}
  .top{padding:0 16px}
  .panel{padding:18px}
}
@media (max-width:430px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .search input{font-size:16px}
  .receiver{height:66px;padding:0 12px;gap:11px}
  .rc-art{width:44px;height:44px}
  .rc-play{width:40px;height:40px}
}
@media (prefers-reduced-motion:reduce){
  .onair i,.sheet-state i,.rc-load i{animation:none}
  .receiver,.rail,.sheet,.art .play{transition:none}
}
