
:root{
  color-scheme:dark;
  --bg:#09090a; --panel:#141416; --panel2:#1c1c1f; --panel3:#242428;
  --text:#f7f7f8; --muted:#9b9ba1; --line:#2d2d31; --accent:#f5f5f6;
  --danger:#ff7a7a; --radius:18px;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",sans-serif}
body{min-height:100vh;padding-bottom:118px}
button,input,select{font:inherit}
button{cursor:pointer}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:max(18px,env(safe-area-inset-top)) 18px 12px;background:rgba(9,9,10,.9);backdrop-filter:blur(22px);border-bottom:1px solid var(--line)}
h1{margin:2px 0 0;font-size:28px;letter-spacing:-.7px}
.eyebrow{font-size:10px;color:var(--muted);letter-spacing:1.5px}
.topActions{display:flex;gap:2px}
main{max-width:850px;margin:0 auto;padding:18px}
.card{background:linear-gradient(180deg,#19191b,#111113);border:1px solid var(--line);border-radius:24px}
.hero{padding:22px;display:grid;gap:18px}
.hero h2{font-size:27px;margin:0 0 6px;letter-spacing:-.7px}
.hero p{color:var(--muted);margin:0;line-height:1.55}
.heroActions{display:grid;grid-template-columns:1.25fr 1fr;gap:10px}
.heroStats{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line);padding-top:15px}
.heroStats div{text-align:center}
.heroStats span{display:block;font-size:22px;font-weight:800}
.heroStats small{color:var(--muted)}
.row{display:flex;gap:10px;align-items:center}
.primaryBtn,.secondaryBtn,.dangerBtn,.ghost{border:0;border-radius:14px;padding:13px 16px;text-align:center}
.primaryBtn{background:var(--accent);color:#09090a;font-weight:750}
.secondaryBtn{background:var(--panel2);color:var(--text);border:1px solid var(--line);flex:1}
.dangerBtn{background:#2b1516;color:#ffabab;border:1px solid #4e2426;flex:1}
.ghost{background:transparent;color:var(--muted);padding:8px}
.small{padding:9px 12px!important;font-size:13px;flex:0 0 auto!important}
.centered{display:block;text-align:center}
.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:16px 0 18px}
.tab{border:1px solid var(--line);background:var(--panel);color:var(--muted);padding:10px;border-radius:13px;font-weight:700}
.tab.active{background:#ededee;color:#111;border-color:#ededee}
.toolbar{display:flex;gap:10px;margin:12px 0}
.toolbar.compact{margin-top:-4px}
.search,.select,.textInput,#urlInput{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:14px;padding:12px 14px;outline:none}
.search{flex:1;min-width:0}
.select{width:125px}
.grow{flex:1;width:auto}
.sectionTitle{display:flex;align-items:center;gap:8px;margin:16px 2px 12px}
.sectionTitle.withAction{justify-content:space-between;align-items:flex-start}
.sectionTitle.noMargin{margin:0}
.sectionTitle h2{margin:0;font-size:21px}
.sectionTitle p{margin:4px 0 0;color:var(--muted);font-size:13px}
.badge{font-size:12px;padding:3px 8px;border:1px solid var(--line);border-radius:999px;color:var(--muted)}
.library{display:grid;gap:10px}
.item{display:grid;grid-template-columns:72px 1fr auto;gap:12px;align-items:center;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:18px}
.thumb{width:72px;height:72px;border-radius:13px;background:#202024;display:grid;place-items:center;font-size:24px;overflow:hidden;border:0;color:#fff}
.thumb img{width:100%;height:100%;object-fit:cover}
.itemTitle{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.itemMeta{margin-top:5px;color:var(--muted);font-size:12px}
.tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}
.tag{font-size:10px;background:#242429;border:1px solid #313137;color:#bdbdc4;border-radius:999px;padding:3px 7px}
.itemBtns{display:flex;flex-direction:column;gap:7px}
.iconBtn{width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:var(--panel2);color:var(--text);font-size:18px}
.iconBtn.emphasis{background:#eee;color:#111}
.empty{padding:34px 20px;text-align:center;color:var(--muted)}
.empty h3{color:var(--text);margin:6px 0}
.emptyIcon{font-size:36px}
.playlistGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.playlistCard{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:16px;text-align:left;color:var(--text)}
.playlistIcon{width:48px;height:48px;border-radius:13px;background:#242429;display:grid;place-items:center;font-size:22px;margin-bottom:12px}
.playlistName{font-weight:800}
.playlistMeta{font-size:12px;color:var(--muted);margin-top:5px}
.miniPlayer{position:fixed;z-index:35;left:8px;right:8px;bottom:8px;max-width:850px;margin:auto;background:rgba(20,20,22,.97);border:1px solid #343438;border-radius:20px;padding:8px calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));display:grid;grid-template-columns:1fr auto auto auto;gap:6px;align-items:center;box-shadow:0 15px 50px #000}
.miniInfo{background:none;border:0;color:inherit;display:flex;gap:10px;align-items:center;min-width:0;text-align:left}
.miniThumb{width:46px;height:46px;border-radius:11px;background:#242428;display:grid;place-items:center;overflow:hidden;flex:0 0 auto}
.miniThumb img{width:100%;height:100%;object-fit:cover}
.miniText{min-width:0}
.miniTitle{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.miniMeta{font-size:11px;color:var(--muted);margin-top:3px}
.playerSheet{position:fixed;z-index:50;inset:0;background:rgba(12,12,14,.985);padding:max(10px,env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));overflow:auto}
.grabber{width:42px;height:5px;border-radius:9px;background:#4a4a4f;margin:0 auto 6px}
.playerTop{display:grid;grid-template-columns:50px 1fr 50px;align-items:center;max-width:760px;margin:auto}
.playerTopTitle{text-align:center;font-size:13px;color:var(--muted);font-weight:700}
.bigGhost{font-size:25px}
.mediaWrap{max-width:650px;margin:10px auto 0;display:grid;place-items:center;overflow:hidden;border-radius:22px;background:#000;aspect-ratio:1/1}
video{width:100%;height:100%;object-fit:contain;background:#000}
audio{display:none}
.audioArtwork{width:100%;height:100%;display:grid;place-items:center;font-size:min(30vw,180px);background:radial-gradient(circle at 40% 35%,#35353b,#141417 70%)}
.nowPlaying{max-width:650px;margin:18px auto 0;text-align:center}
.nowTitle{font-weight:900;font-size:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nowMeta{color:var(--muted);font-size:12px;margin-top:5px}
.seekArea{max-width:650px;margin:16px auto 0}
.seekArea input{width:100%}
.timeRow{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;margin-top:3px}
.transport{max-width:520px;margin:12px auto;display:grid;grid-template-columns:repeat(5,1fr);align-items:center;justify-items:center}
.transportBtn{width:50px;height:50px;border-radius:50%;border:0;background:var(--panel2);color:var(--text);font-size:20px}
.transportBtn.big{width:64px;height:64px;background:#f2f2f2;color:#111}
.transportBtn.subtle{background:transparent;color:var(--muted)}
.transportBtn.active{color:#fff;background:#2b2b30}
.chips{max-width:650px;margin:10px auto;display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.chip{background:var(--panel2);color:var(--text);border:1px solid var(--line);border-radius:999px;padding:10px 8px}
.hidden{display:none!important}
dialog{width:min(92vw,560px);border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:22px;padding:0}
.wideDialog{width:min(88vw,680px)}
dialog::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(5px)}
.dialogBody{padding:22px;display:grid;gap:15px}
.dialogBody h2,.dialogBody p{margin:0}
.dialogBody p,.dialogBody li{color:var(--muted);line-height:1.5}
.dialogBody ol{padding-left:22px;margin:0}
#urlInput,.textInput{width:100%}
.status{min-height:18px;color:var(--muted);font-size:13px}
.warning{padding:12px;background:#211d10;border:1px solid #493f1a;border-radius:12px;color:#d6c77d!important}
.storageCard{padding:15px;background:#101012;border:1px solid var(--line);border-radius:15px}
.storageBar{height:11px;background:#29292e;border-radius:999px;overflow:hidden}
#storageBarFill{height:100%;width:0;background:#eee}
.storageNumbers{display:flex;justify-content:space-between;margin-top:10px;color:var(--muted)}
.storageNumbers strong{color:var(--text)}
.settingRow{display:flex;justify-content:space-between;align-items:center;padding:13px;background:#111113;border:1px solid var(--line);border-radius:14px}
.settingRow span{display:grid;gap:4px}
.settingRow small{color:var(--muted)}
.toast{position:fixed;z-index:100;left:50%;transform:translateX(-50%);bottom:26px;background:#f5f5f5;color:#111;padding:11px 16px;border-radius:999px;font-weight:750;box-shadow:0 7px 30px #000}
@media(min-width:700px){
  .library{grid-template-columns:1fr 1fr}
  .playlistGrid{grid-template-columns:repeat(3,1fr)}
  .mediaWrap{aspect-ratio:16/10}
}
@media(max-width:520px){
  .heroActions{grid-template-columns:1fr}
  .playlistGrid{grid-template-columns:1fr 1fr}
  .item{grid-template-columns:64px 1fr auto}
  .thumb{width:64px;height:64px}
  .chips{grid-template-columns:1fr 1fr}
}
