:root{--bg:#0E1014;--bg2:#0A0C0F;--panel:#171A21;--panel2:#1E232C;--line:#262B36;--text:#E8EAF0;--text2:#C3C9D4;--muted:#9AA3B2;--green:#3FD47A;--a:#3FC1FF;--b:#FF9E3D;--red:#FF5A4E;--mono:ui-monospace,'Roboto Mono',monospace;
  --safe-b:env(safe-area-inset-bottom,0px);--safe-t:env(safe-area-inset-top,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font:15px/1.35 Roboto,'Segoe UI',system-ui,sans-serif;overscroll-behavior:none}
button,input{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
svg.fill{fill:currentColor;stroke:none}
.hidden{display:none!important}
.muted{color:var(--muted)}
.mono{font-family:var(--mono)}
.eyebrow{font-size:11px;letter-spacing:.08em;color:var(--muted);text-transform:uppercase}
.btn{height:44px;padding:0 18px;border-radius:22px;background:var(--panel2);font-weight:600}
.btn.primary{background:var(--green);color:#08130C}
.chip{height:34px;padding:0 12px;border-radius:17px;background:var(--panel2);font-size:13px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.chip svg{width:16px;height:16px}
.icon{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:22px;color:var(--text2)}
.icon[aria-pressed=true]{color:var(--green)}
.field{width:100%;height:52px;border-radius:12px;border:1px solid var(--line);background:var(--panel);padding:0 16px;font:600 22px var(--mono);letter-spacing:.15em;text-align:center;text-transform:uppercase}
.err{color:var(--red);min-height:20px;font-size:14px}

.screen{position:fixed;inset:0;display:flex;flex-direction:column}
.connect-box{margin:auto;width:min(360px,88vw);display:flex;flex-direction:column;gap:14px;align-items:stretch;text-align:center}
.connect-logo{width:84px;height:84px;margin:0 auto;border-radius:20px}
.connect-box h1{margin:0;font-size:30px}

.top{display:flex;align-items:center;gap:10px;padding:calc(10px + var(--safe-t)) 16px 8px}
.top h1{margin:0;font-size:24px;flex:1}
.chip.out{max-width:52vw}
.chip.out span{overflow:hidden;text-overflow:ellipsis}
.chip.out.remote{background:#13301F;color:var(--green)}

#views{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;padding-bottom:140px}
.view{padding:0 12px}
.searchbar{display:flex;align-items:center;gap:8px;height:44px;border-radius:12px;background:var(--panel);padding:0 12px;margin:4px 0 10px}
.searchbar input{flex:1;background:none;border:0;outline:none;height:100%}
.searchbar svg{color:var(--muted);width:18px;height:18px}
.seg{display:flex;gap:6px;margin-bottom:10px;overflow:auto}
.seg button{height:34px;padding:0 14px;border-radius:17px;background:var(--panel);color:var(--text2);font-size:14px;white-space:nowrap}
.seg button.on{background:var(--text);color:var(--bg);font-weight:600}
.crumb{display:flex;align-items:center;gap:8px;margin:2px 0 10px}
.crumb > button:first-child{width:36px;height:36px;font-size:26px;line-height:1;color:var(--text2)}
.crumb span{flex:1;font-weight:700;font-size:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.list{display:flex;flex-direction:column}
.row{display:flex;align-items:center;gap:12px;padding:7px 4px;border-radius:10px;min-height:60px}
.row:active{background:var(--panel)}
.row img,.row .ph{width:48px;height:48px;border-radius:6px;object-fit:cover;background:var(--panel2);flex:none}
.row .t{flex:1;min-width:0;display:flex;flex-direction:column}
.row .t b{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .t span{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row.cur .t b{color:var(--green)}
.row .more{width:40px;height:40px;color:var(--muted);font-size:20px}
.row .q{font:11px var(--mono);color:var(--muted);padding:2px 5px;border:1px solid var(--line);border-radius:4px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
.card{display:flex;flex-direction:column;gap:6px;text-align:left}
.card img,.card .ph{width:100%;aspect-ratio:1;border-radius:8px;object-fit:cover;background:var(--panel2)}
.card b{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card span{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:-4px}
.empty{padding:40px 16px;text-align:center;color:var(--muted)}
.pl-head{margin:4px 0 10px}
.pl-actions{display:flex;gap:10px;margin-bottom:10px}

.mini{position:fixed;left:8px;right:8px;bottom:calc(64px + var(--safe-b));height:60px;border-radius:12px;background:var(--panel2);display:flex;align-items:center;gap:10px;padding:0 6px 0 8px;box-shadow:0 6px 20px rgba(0,0,0,.45);overflow:hidden}
.mini img{width:44px;height:44px;border-radius:6px;object-fit:cover;background:var(--panel)}
.mini-t{flex:1;min-width:0;display:flex;flex-direction:column}
.mini-t b,.mini-t span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-t b{font-weight:600;font-size:14px}.mini-t span{font-size:12px;color:var(--muted)}
.mini-bar{position:absolute;left:8px;right:8px;bottom:0;height:2px;background:rgba(255,255,255,.12)}
.mini-bar i{display:block;height:100%;width:0;background:var(--green)}

.tabs{position:fixed;left:0;right:0;bottom:0;height:calc(60px + var(--safe-b));padding-bottom:var(--safe-b);display:flex;background:linear-gradient(transparent,var(--bg) 30%);}
.tabs button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--muted);font-size:11px}
.tabs button.on{color:var(--text)}

.sheet{position:fixed;inset:0;z-index:20;background:linear-gradient(180deg,#22303A 0%,var(--bg) 55%);display:flex;flex-direction:column;padding:calc(8px + var(--safe-t)) 22px calc(18px + var(--safe-b));gap:12px;overflow:auto}
.now-top{display:flex;align-items:center;justify-content:space-between}
.now-art{display:flex;justify-content:center;margin-top:8px}
.now-art img{width:min(84vw,46vh);aspect-ratio:1;border-radius:12px;object-fit:cover;background:var(--panel2);box-shadow:0 18px 40px rgba(0,0,0,.5)}
.now-info h2{margin:6px 0 2px;font-size:22px;line-height:1.2}
.now-info p{margin:0 0 6px}
.badges{display:flex;gap:6px;flex-wrap:wrap}
.badges span{font:11px var(--mono);padding:3px 6px;border-radius:4px;background:var(--panel2);color:var(--text2)}
.badges span.hq{background:#13301F;color:var(--green)}
.seek input{width:100%}
.times{display:flex;justify-content:space-between;font:12px var(--mono);color:var(--muted);margin-top:-2px}
.ctrls{display:flex;align-items:center;justify-content:space-between}
.icon.big svg{width:30px;height:30px}
.play{width:72px;height:72px;border-radius:36px;background:var(--text);color:var(--bg);display:inline-flex;align-items:center;justify-content:center}
.play svg{width:30px;height:30px}
.vol{display:flex;align-items:center;gap:10px;color:var(--muted)}
.vol input{flex:1}
.out-big{display:flex;align-items:center;justify-content:center;gap:8px;height:40px;border-radius:20px;color:var(--green);font-weight:600}
input[type=range]{-webkit-appearance:none;appearance:none;height:28px;background:transparent}
input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(90deg,var(--text) var(--p,0%),rgba(255,255,255,.18) var(--p,0%))}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:8px;background:var(--text);margin-top:-6px}

.sheet-ov{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:30}
.pick{position:fixed;left:0;right:0;bottom:0;z-index:31;max-height:75vh;overflow:auto;background:var(--panel);border-radius:16px 16px 0 0;padding:10px 12px calc(14px + var(--safe-b))}
.pick h3{margin:6px 8px 10px;font-size:16px}
.pick .opt{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:6px 8px;border-radius:10px;text-align:left}
.pick .opt:active{background:var(--panel2)}
.pick .opt.on{color:var(--green)}
.pick .opt.danger{color:var(--red)}
.pick .opt small{display:block;color:var(--muted);font-size:12px}
.pick .opt img{width:28px;height:28px;border-radius:6px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(140px + var(--safe-b));background:var(--text);color:var(--bg);padding:10px 16px;border-radius:10px;font-size:14px;z-index:40;max-width:90vw;text-align:center}

/* radio */
.r-head{margin:2px 4px 6px;min-height:16px}
.row .logo{width:48px;height:48px;border-radius:8px;object-fit:contain;background:#fff;flex:none;padding:2px}
.row .logo.ph{background:var(--panel2);display:flex;align-items:center;justify-content:center;color:var(--muted);padding:0}
.row .star{width:40px;height:40px;color:var(--muted);font-size:22px}
.row .star.on{color:#FFC93D}
.live{display:inline-flex;align-items:center;gap:5px}
.live::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--red);animation:blink 1.4s infinite}
@keyframes blink{50%{opacity:.25}}
.badges span.live{background:#3A1614;color:#FF8A80}
.badges button{font:11px var(--mono);padding:3px 7px;border-radius:4px;background:var(--panel2);color:var(--text2)}
.badges button.on{color:#FFC93D}
#now.radio .seek input{visibility:hidden;height:4px}
#now.radio #bShuffle,#now.radio #bRepeat{visibility:hidden}
.now-art img.logo,.mini img.logo{object-fit:contain;background:#fff}
.tabs button span{white-space:nowrap}
.badges span.warn{background:#3A2A14;color:#FFB86B}

/* navegación por niveles de la biblioteca */
.seg{scrollbar-width:none}.seg::-webkit-scrollbar{display:none}
.smartbar{display:flex;gap:6px;margin:-2px 0 10px;overflow-x:auto;scrollbar-width:none}
.smartbar::-webkit-scrollbar{display:none}
.chip.on{background:#13301F;color:var(--green)}
.row.cat .chev{color:var(--muted);font-size:24px;padding:0 6px 0 2px}
.row .ph.ico{display:flex;align-items:center;justify-content:center;color:var(--text2)}
.row .ph.ico svg{width:22px;height:22px}
.az{position:fixed;right:2px;top:200px;bottom:calc(140px + var(--safe-b));display:flex;flex-direction:column;justify-content:space-between;z-index:5}
.az button{font:600 10px/1 Roboto,system-ui;color:var(--green);padding:1px 6px;min-height:14px}
.az button.off{color:#3A414D}
#libList:has(+ .az:not(.hidden)) .row{padding-right:18px}
.crumb span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* ---------- Inicio (Spotify / Tidal) ---------- */
#homeBody{padding:6px 0 24px}
.h-quick{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:4px 14px 6px}
.h-q{position:relative;display:flex;align-items:center;gap:10px;height:56px;border-radius:8px;background:#1C2029;border:0;color:var(--text);padding:0 36px 0 0;overflow:hidden;text-align:left;font:inherit}
.h-q img{width:56px;height:56px;object-fit:cover;background:#262B36;flex:none}
.h-q b{font-size:13px;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.h-qplay{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:50%;background:var(--green);display:flex;align-items:center;justify-content:center}
.h-qplay svg{width:14px;height:14px;fill:#06240F}
.h-sec{margin-top:18px}
.h-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:0 16px 8px}
.h-head h2{margin:0;font-size:19px;font-weight:700}
.h-head .muted{font-size:12px}
.h-row{display:flex;gap:12px;overflow-x:auto;padding:0 16px 4px;scroll-snap-type:x proximity;scrollbar-width:none}
.h-row::-webkit-scrollbar{display:none}
.h-card{flex:none;width:136px;background:none;border:0;padding:0;color:var(--text);text-align:left;font:inherit;scroll-snap-align:start}
.h-art{width:136px;height:136px;border-radius:8px;overflow:hidden;background:#1C2029;margin-bottom:7px}
.h-art img{width:100%;height:100%;object-fit:cover;display:block}
.h-card.round .h-art{border-radius:50%}
.h-card b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h-card span{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h-art.smart{display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#2A6BFF,#3FD47A)}
.h-art.smart span{font-size:54px;color:#fff;display:block}
.h-all{display:block;margin:22px 16px 0;width:calc(100% - 32px);height:46px;border-radius:23px;border:1px solid var(--line);background:none;color:var(--text);font:600 14px inherit}
.h-empty{padding:4px 16px}
.btn.danger{background:#c53a3a;color:#fff}
.pick .confirm-text{white-space:pre-line;color:var(--muted,#9aa0aa);font-size:15px;line-height:1.5;margin:4px 0 0}
