:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color-scheme:dark;--bg:#05070a;--panel:#080b10;--panel2:#0d1117;--line:#29303b;--text:#f7f7fb;--muted:#9298a5;--purple:#7441ed;--purple2:#a06dff;--pink:#ee326c;--green:#36dda0;--gold:#ffc959;--blue:#78d6ff}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;background:#030405;color:var(--text);overflow:hidden;-webkit-text-size-adjust:100%}
body{padding:calc(env(safe-area-inset-top) + 6px) 12px calc(env(safe-area-inset-bottom) + 6px);max-width:460px;margin:auto}
button,input{font:inherit}
button{border:0;color:inherit;-webkit-tap-highlight-color:transparent;cursor:pointer;background:transparent}
.hidden{display:none!important}
.grow{min-width:0;flex:1}
.shell{height:100%;display:flex;flex-direction:column;min-height:0}

/* top bar */
.topbar{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:60px;padding:2px 2px 6px}
.logo{width:46px;height:46px;border-radius:14px;object-fit:cover;border:1px solid #40244d;box-shadow:0 7px 24px #b92d6425}
.kicker,.sheet-kicker{font-size:9px;letter-spacing:.2em;font-weight:800;color:#a8a9b6}
.brand h1{font-size:22px;line-height:1;margin:2px 0 3px}
.sub{font-size:11px;color:#737985;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conn{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.refresh{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#111820;border:1px solid #29363f;color:#cce9df}
.refresh svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
.refresh.spin svg{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.pill{font-size:10px;font-weight:800;border:1px solid #2d333e;background:#0b0e13;color:#8f95a0;border-radius:999px;padding:3px 9px;min-width:72px;text-align:center}
.pill.online{color:#67efbc;border-color:#145b43;background:#071b14}
.pill.warn{color:#ffd375;border-color:#604b1c;background:#191405}
.pill.bad{color:#ff839a;border-color:#662137;background:#1d0810}

/* setup */
.setup-card{margin:auto 0;background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:22px;text-align:center}
.setup-logo{width:72px;height:72px;border-radius:20px}
.setup-card h2{margin:12px 0 6px;font-size:19px}
.setup-card p{color:var(--muted);font-size:13px;margin:0 0 10px}
.setup-card .tiny{font-size:11px;margin-top:12px}
.setup-actions{margin-top:10px}
.field{width:100%;height:45px;border-radius:12px;background:var(--panel2);border:1px solid #333b47;color:white;padding:0 12px;outline:none}

/* tabs + toolbar */
.tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:2px 0 6px}
.tab{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 6px;border-radius:13px;background:var(--panel);border:1px solid var(--line);color:#aeb3bf}
.tab b{font-size:13px}.tab small{font-size:10px;color:#6f7683}
.tab.active{background:linear-gradient(180deg,#151027,#0d0a1a);border-color:#5b3fb0;color:white}
.tab.active small{color:#c9b8f5}
.toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin-bottom:6px}
.search{height:38px;border-radius:12px;background:var(--panel2);border:1px solid #333b47;color:white;padding:0 12px;outline:none;-webkit-appearance:none}
.sort{height:38px;padding:0 12px;border-radius:12px;background:var(--panel2);border:1px solid #333b47;font-size:12px;font-weight:800;color:#dcd6f0;white-space:nowrap}

/* bulk bar */
.bulk{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 10px;margin-bottom:6px;border-radius:14px;background:linear-gradient(180deg,#0b1220,#080d16);border:1px solid #1f3a55}
.bulk-copy b{display:block;font-size:12px}.bulk-copy small{display:block;font-size:10px;color:#8ea3b8;margin-top:2px}
.primary{background:linear-gradient(180deg,#8250ef,#6135d7);border:1px solid #976fff;box-shadow:0 6px 17px #6635db2e;height:40px;border-radius:12px;font-weight:800;font-size:12px;padding:0 16px;color:white}
.primary.small{height:34px;padding:0 12px;font-size:11px}
.secondary{background:#0d1117;border:1px solid #343a45;height:40px;border-radius:12px;font-weight:800;font-size:12px;padding:0 14px}
.danger-soft{background:#1d0911;border:1px solid #5d2033;color:#ffc2cf;height:40px;border-radius:12px;font-weight:800;font-size:12px;padding:0 14px}
button:disabled{opacity:.42;cursor:default}

/* list */
.list{flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:14px;background:var(--panel);border:1px solid var(--line);padding:2px 0}
.empty{display:grid;place-items:center;text-align:center;padding:40px 20px;color:#747b87;font-size:12px;line-height:1.5}
.empty b{color:#c3c7d1}.empty b:first-child{display:block;font-size:14px;margin-bottom:6px}
.group{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 6px;background:#0b0e15;border-top:1px solid #151a22;border-bottom:1px solid #151a22}
.group b{font-size:12px;letter-spacing:.02em}.group small{font-size:10px;color:#7d8592;margin-left:6px}
.group .gbtn{font-size:10px;font-weight:800;color:#c9b8f5;background:#171021;border:1px solid #4d3270;padding:4px 9px;border-radius:999px;white-space:nowrap}
.album{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 10px 3px 14px;color:#8f96a3;font-size:10.5px;font-weight:800}
.album .gbtn{font-size:9.5px;font-weight:800;color:#a6b7c7;background:#0e141c;border:1px solid #2b3846;padding:3px 8px;border-radius:999px}
.row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:9px;padding:6px 8px 6px 10px;border-top:1px solid #10141a}
.row:first-child{border-top:0}
.row .art{width:42px;height:42px;border-radius:9px;object-fit:cover;background:#12161d;display:grid;place-items:center;color:#5f5a7a;font-size:18px;overflow:hidden}
.row .art img{width:100%;height:100%;object-fit:cover;display:block}
.row .meta{min-width:0}
.row .title{font-size:13.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .line2{font-size:10.5px;color:#9096a3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.row.playing .title{color:#c9b8f5}
.row.playing .art{box-shadow:0 0 0 2px #7441ed}
.row .act{display:flex;align-items:center;gap:6px}
.ibtn{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#121720;border:1px solid #313845;color:#dfe3ea;position:relative}
.ibtn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ibtn.get{color:#8fd8ff;border-color:#20475e;background:#0a1620}
.ibtn.update{color:#ffd375;border-color:#5a4718;background:#181205}
.ibtn.done{color:#67efbc;border-color:#145b43;background:#071b14}
.ibtn.busy{color:#c9b8f5;border-color:#4d3270}
.ibtn .ring{position:absolute;inset:-1px;border-radius:50%;background:conic-gradient(#a06dff var(--p,0%),transparent 0);-webkit-mask:radial-gradient(circle,transparent 62%,#000 64%);mask:radial-gradient(circle,transparent 62%,#000 64%)}
.row .dur{font-size:10px;color:#6f7683;min-width:32px;text-align:right}
.loadmore{display:grid;place-items:center;padding:12px;color:#8f96a3;font-size:11px}

/* storage footer */
.storage{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:10px;color:#78818d;padding:6px 4px 0;min-height:24px;white-space:nowrap;overflow:hidden}
.storage span{overflow:hidden;text-overflow:ellipsis}
.link{font-size:10px;font-weight:800;color:#c9b8f5;padding:2px 6px}

/* mini player */
.mini{position:relative;display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;align-items:center;gap:9px;margin-top:6px;padding:7px 8px 9px;border-radius:15px;background:linear-gradient(180deg,#0f0c1c,#0a0813);border:1px solid #3a2a63;box-shadow:0 8px 24px #0009}
.mini img{width:44px;height:44px;border-radius:10px;object-fit:cover;background:#171326}
.mini-title{font-size:13px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-artist{font-size:10.5px;color:#a79fc4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.mini-btn{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#1a1530;border:1px solid #3f3068}
.mini-btn svg{width:18px;height:18px;fill:currentColor}
.mini-progress{position:absolute;left:10px;right:10px;bottom:3px;height:3px;border-radius:2px;background:#221b3a;overflow:hidden}
.mini-progress div{height:100%;width:0;background:linear-gradient(90deg,#7441ed,#ee326c)}
.ico-pause{display:none}
.playing .ico-play{display:none}.playing .ico-pause{display:block}

/* sheets */
.sheet{position:fixed;inset:0;background:#000b;z-index:80;display:none;align-items:flex-end}
.sheet.open{display:flex}
.sheet-inner{width:100%;max-width:460px;margin:0 auto;max-height:92dvh;overflow:auto;background:#080b10;border:1px solid #333b47;border-bottom:0;border-radius:24px 24px 0 0;padding:14px 14px calc(16px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px #0009}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.sheet-head h2{font-size:18px;margin:1px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.close{width:36px;height:36px;border-radius:50%;background:#151a22;border:1px solid #343b47;font-size:20px;display:grid;place-items:center}
.now{height:92dvh;display:flex;flex-direction:column}
.now-art-wrap{position:relative;width:min(70vw,300px);aspect-ratio:1/1;margin:6px auto 12px;border-radius:22px;overflow:hidden;background:#12101f;box-shadow:0 18px 50px #000a}
.now-art-wrap img{width:100%;height:100%;object-fit:cover;display:none}
.now-art-wrap.has img{display:block}
.now-art-empty{position:absolute;inset:0;display:grid;place-items:center;font-size:64px;color:#3d3560}
.now-art-wrap.has .now-art-empty{display:none}
.now-title{font-size:19px;font-weight:850;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.now-artist{font-size:13px;color:#b9b2d6;text-align:center;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.now-album{font-size:11px;color:#7d8592;text-align:center;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scrub{margin:12px 6px 4px}
.scrub input{width:100%;-webkit-appearance:none;appearance:none;height:4px;border-radius:2px;background:linear-gradient(90deg,#a06dff var(--p,0%),#241d3a var(--p,0%));outline:none}
.scrub input::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:white;box-shadow:0 2px 8px #0008}
.times{display:flex;justify-content:space-between;font-size:10px;color:#7d8592;margin-top:5px}
.transport{display:grid;grid-template-columns:1fr 1fr 1.4fr 1fr 1fr;align-items:center;justify-items:center;gap:6px;margin:6px 0 10px}
.tbtn{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#0d1117;border:1px solid #2b3240;color:#dfe3ea}
.tbtn svg{width:20px;height:20px;fill:currentColor}
#shuffleBtn svg,#repeatBtn svg{fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
.tbtn.on{color:#c9b8f5;border-color:#5b3fb0;background:#151027}
.tbtn.big{width:66px;height:66px;background:linear-gradient(180deg,#8258f4,#6535db);border-color:#976fff;box-shadow:0 8px 22px #6635db44}
.tbtn.big svg{width:30px;height:30px}
.queue-head{display:flex;justify-content:space-between;font-size:11px;color:#9298a5;padding:6px 4px 4px;border-top:1px solid #1f252e}
.queue{flex:1;min-height:60px;overflow:auto}
.qrow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 6px;border-top:1px solid #151a22;font-size:12px}
.qrow:first-child{border-top:0}
.qrow b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12.5px}
.qrow span{display:block;font-size:10px;color:#8b92a0;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qrow.current b{color:#c9b8f5}
.song-sheet-meta{font-size:11px;color:#9298a5;line-height:1.5;margin-bottom:10px;word-break:break-word}
.song-actions{display:grid;gap:8px}
.song-actions button{width:100%;height:44px}

.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translate(-50%,18px);opacity:0;pointer-events:none;z-index:120;background:#11161d;border:1px solid #333b46;color:white;padding:10px 14px;border-radius:999px;font-size:11px;white-space:nowrap;max-width:90vw;overflow:hidden;text-overflow:ellipsis;transition:.2s}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media(max-height:700px){.topbar{min-height:52px}.logo{width:40px;height:40px}.brand h1{font-size:19px}.now-art-wrap{width:min(50vw,220px)}}
