:root{color-scheme:dark;--bg:#080e0b;--surface:#121a15;--surface-2:#1a241e;--line:#2c3830;--ink:#f4f1e8;--muted:#a9b5ab;--mint:#c6ff00;--accent:#c6ff00;--on-accent:#11180a;--shadow:0 -10px 40px #0009}
@media(prefers-color-scheme:light){:root{color-scheme:light;--bg:#f6f5ef;--surface:#fff;--surface-2:#eeefe8;--line:#d8dccf;--ink:#111a14;--muted:#56614f;--mint:#456600;--shadow:0 -10px 40px #1a221633}}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font:16px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
button,a{font:inherit;touch-action:manipulation}
button{cursor:pointer;color:var(--ink)}
button:disabled{opacity:.45;cursor:default}
:focus-visible{outline:3px solid var(--mint);outline-offset:2px}
svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

/* Phone layout: top bar, one channel, optional mini-player, bottom tabs. */
.app-shell{display:flex;flex-direction:column;height:100%;height:100dvh;min-height:0}
.app-header{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:calc(4px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left));background:var(--bg);border-bottom:1px solid var(--line);min-height:56px}
.identity{display:flex;align-items:center;gap:8px;min-height:44px;color:var(--ink);text-decoration:none;white-space:nowrap;font-weight:900;font-size:15px;text-transform:uppercase;letter-spacing:-.3px}
.identity img{width:32px;height:32px;object-fit:contain}
.identity strong{color:var(--mint)}
.header-actions{display:flex;align-items:center;gap:2px}
.icon-button{position:relative;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;font-size:26px;line-height:1}
.icon-button:active{background:var(--surface-2)}
.profile-button{display:flex;align-items:center;justify-content:center;gap:5px;width:auto;min-width:72px;padding:0 9px;font-size:13px;font-weight:700;border-radius:999px}
.profile-button svg{width:20px;height:20px}
.badge{position:absolute;top:6px;right:5px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--accent);color:var(--on-accent);font-size:11px;font-weight:800;line-height:18px}
.badge[hidden]{display:none}
.radio-language-bar{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;border-bottom:1px solid var(--line);font-size:13px;color:var(--muted)}
.radio-language-bar select{min-height:44px;max-width:65%;padding:0 10px;color:var(--ink);background:var(--bg);border:0;font:inherit;font-weight:700}
.tabbar a[hidden]{display:none}.tabbar.hebrew-radio{grid-template-columns:repeat(3,1fr)}

.channel-stage{position:relative;flex:1;min-height:0}
.channel-frame{display:block;width:100%;height:100%;border:0;background:var(--bg)}
.channel-frame[hidden]{display:none}
.offline-panel{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;background:var(--bg)}
.offline-panel[hidden]{display:none}
.offline-panel h1{margin:0;font-size:26px}
.offline-panel p{color:var(--muted);max-width:320px}
.offline-panel button,.sheet-actions button{min-height:48px;padding:10px 20px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font-weight:700}

.mini-player{flex:none;display:flex;align-items:center;gap:10px;margin:0 8px 6px;padding:6px 6px 6px 8px;background:var(--surface-2);border:1px solid var(--line);border-radius:16px}
.mini-player[hidden]{display:none}
.mini-player img{width:44px;height:44px;border-radius:10px;object-fit:cover;flex:none}
.mini-info{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-height:44px;justify-content:center;padding:0;border:0;background:none;text-align:left}
.mini-info span{font-size:12px;color:var(--mint);font-weight:700}
.mini-info strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.mini-play{flex:none;display:grid;place-items:center;width:48px;height:48px;padding:0;border:0;border-radius:50%;background:var(--accent);color:var(--on-accent)}
.mini-play::before{content:'';width:0;height:0;margin-left:4px;border-style:solid;border-width:9px 0 9px 15px;border-color:transparent transparent transparent currentColor}
.mini-play[data-playing="true"]::before{width:14px;height:16px;margin:0;border:0;border-left:5px solid currentColor;border-right:5px solid currentColor}
.mini-play[data-connecting="true"]::before{width:20px;height:20px;margin:0;border:3px solid currentColor;border-top-color:transparent;border-radius:50%;animation:mini-spin .8s linear infinite}
@keyframes mini-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.mini-play[data-connecting="true"]::before{animation:none}}

.tabbar{flex:none;display:grid;grid-template-columns:repeat(4,1fr);padding:0 max(4px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px,env(safe-area-inset-left));background:var(--bg);border-top:1px solid var(--line)}
.tabbar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;color:var(--muted);text-decoration:none;font-size:11px;font-weight:700;letter-spacing:.1px}
.tabbar a[aria-current="page"]{color:var(--mint)}
.tabbar a[aria-current="page"] svg{stroke-width:2.4}
.tabbar a:active{background:var(--surface-2)}
/* Business and legal links stay discoverable across every channel. */
.site-footer{flex:none;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 12px;padding:0 10px;border-top:1px solid var(--line);background:var(--bg);font-size:12px}
.site-footer a{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:44px;color:var(--muted);text-decoration:none}
.site-footer a[hidden]{display:none}
.site-footer .advertise-link{color:var(--mint);font-weight:700;margin-right:auto}
.site-footer a:hover{text-decoration:underline}
/* Only narrow touch layouts trade navigation space for the focused composer. */
@media(max-width:600px) and (pointer:coarse){.app-shell.composing .tabbar,.app-shell.composing .mini-player,.app-shell.composing .site-footer{display:none}}
.app-shell.child-modal .identity,.app-shell.child-modal .header-actions,.app-shell.child-modal .radio-language-bar,.app-shell.child-modal .tabbar,.app-shell.child-modal .mini-player,.app-shell.child-modal .site-footer{filter:brightness(.38);pointer-events:none;transition:filter .15s}

/* Bottom sheets */
.sheet-backdrop{position:fixed;inset:0;z-index:10;background:#000a}
.sheet-backdrop[hidden]{display:none}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:11;max-height:88dvh;overflow:auto;overscroll-behavior:contain;padding:8px max(18px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));background:var(--surface);border-top:1px solid var(--line);border-radius:22px 22px 0 0;box-shadow:var(--shadow);animation:sheet-up .22s ease-out}
.sheet[hidden]{display:none}
@keyframes sheet-up{from{transform:translateY(40px);opacity:.4}}
@media(prefers-reduced-motion:reduce){.sheet{animation:none}}
.sheet-grip{display:block;width:40px;height:5px;margin:2px auto 6px;border-radius:3px;background:var(--line)}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sheet-head h2{margin:0;font-size:20px}
.sheet h3{margin:20px 0 6px;font-size:15px}
.sheet-note,.sheet-status{margin:6px 0;color:var(--muted);font-size:14px}
.sheet-status{color:var(--ink);min-height:20px}
.sheet-actions{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}
.sheet-actions .primary{border-color:var(--accent);background:var(--accent);color:var(--on-accent)}
.notification-items{color:var(--muted);font-size:14px}
.notification-items a{display:flex;align-items:center;min-height:44px;border-top:1px solid var(--line);color:var(--ink);font-weight:700;text-decoration:none}
.notification-items a::after{content:'›';margin-left:auto;color:var(--muted);font-size:22px}
.song-panel{top:max(24px,env(safe-area-inset-top));display:flex;flex-direction:column;max-height:none;padding-bottom:0;overflow:hidden}
.song-panel[hidden]{display:none}
.song-panel .sheet-head{position:relative;justify-content:flex-end;min-height:44px}
.song-panel .sheet-grip{position:absolute;left:50%;top:6px;transform:translateX(-50%);margin:0}
.song-panel iframe{flex:1;min-height:0;width:100%;border:0;background:var(--surface)}

.shell-toast{position:fixed;left:50%;bottom:calc(140px + env(safe-area-inset-bottom));z-index:20;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);padding:12px 16px;border-radius:14px;background:var(--accent);color:var(--on-accent);font-size:14px;font-weight:700;box-shadow:0 8px 30px #0006}
.shell-toast[hidden]{display:none}

/* Wide screens: tabs move into the top bar; sheets become centred dialogs. */
@media(min-width:900px){
 .app-shell{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto 1fr auto auto;grid-template-areas:"brand tabs actions" "language language language" "stage stage stage" "mini mini mini" "footer footer footer"}
 .app-header{display:contents}
 .identity{grid-area:brand;padding:8px 20px;background:var(--bg);border-bottom:1px solid var(--line);min-height:64px}
 .header-actions{grid-area:actions;padding:0 16px;background:var(--bg);border-bottom:1px solid var(--line)}
 .tabbar{grid-area:tabs;display:flex;justify-content:center;gap:6px;padding:0;border-top:0;border-bottom:1px solid var(--line)}
 .tabbar a{flex-direction:row;gap:8px;min-height:0;margin:10px 0;padding:0 16px;border-radius:999px;font-size:14px}
 .tabbar a[aria-current="page"]{background:var(--accent);color:var(--on-accent)}
 .tabbar svg{width:20px;height:20px}
 .radio-language-bar{grid-area:language;justify-content:center;gap:24px}
 .channel-stage{grid-area:stage}
 .mini-player{grid-area:mini;width:min(560px,calc(100% - 32px));margin:0 auto 12px}
 .site-footer{grid-area:footer;gap:24px}
 .site-footer .advertise-link{margin-right:0}
 .sheet{left:50%;right:auto;bottom:auto;top:50%;width:min(480px,calc(100% - 48px));transform:translate(-50%,-50%);border:1px solid var(--line);border-radius:22px;animation:none}
 .song-panel{top:5vh;bottom:5vh;width:min(820px,calc(100% - 48px));transform:translateX(-50%)}
 .sheet-grip{display:none}
}
