:root{
  --accent: #7c5cff;
  --accent2: #ff4d8d;
  --accent-ink: var(--accent);   /* accent color for TEXT — overridden to a dark tone in light mode */
  --bg: #07070a;
  --surface: #141419;
  --surface2: #1d1d25;
  --text: #ffffff;
  --muted: #9a9aa6;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Heebo,Arial,sans-serif;
  overscroll-behavior:none;-webkit-font-smoothing:antialiased}
body{overflow:hidden}
.hidden{display:none !important}
button{font-family:inherit;color:inherit;border:0;background:none;cursor:pointer}
input{font-family:inherit}
img{display:block}

/* ---------- Login ---------- */
.login{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  padding:24px;background:radial-gradient(120% 80% at 50% 0%,#221a4d 0%,#07070a 60%)}
.login-card{width:100%;max-width:360px;background:rgba(20,20,28,.7);backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,.08);border-radius:24px;padding:28px 22px;text-align:center}
.login-logo{width:64px;height:64px;margin:0 auto 14px;border-radius:20px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex;align-items:center;justify-content:center;font-size:32px}
.login-card h1{font-size:24px;margin:0 0 4px;font-weight:800}
.login-sub{color:var(--muted);margin:0 0 22px;font-size:14px}
.login-card label{display:block;text-align:right;font-size:13px;color:var(--muted);margin:12px 4px 6px}
.login-card input{width:100%;height:48px;border-radius:14px;background:#0e0e13;
  border:1px solid rgba(255,255,255,.1);color:#fff;padding:0 14px;font-size:16px;direction:ltr;text-align:left}
.login-card input:focus{outline:none;border-color:var(--accent)}
#loginBtn{width:100%;height:50px;margin-top:22px;border-radius:14px;font-size:17px;font-weight:700;
  background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;transition:transform .1s}
#loginBtn:active{transform:scale(.97)}
.login-err{color:#ff6b6b;font-size:14px;margin-top:14px;min-height:18px}

/* ---------- App shell ---------- */
.app{position:fixed;inset:0;display:flex;flex-direction:column}
.bg-wash{position:fixed;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(180deg,var(--accent) -40%,transparent 45%);
  opacity:.30;transition:background 1.2s ease}
.topbar{position:relative;z-index:3;display:flex;align-items:center;justify-content:space-between;
  padding:calc(var(--safe-top) + 14px) 18px 12px}
.topbar-title{font-size:22px;font-weight:800;letter-spacing:-.5px;flex:1;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext}
.content{position:relative;z-index:2;flex:1;overflow-y:auto;overflow-x:hidden;
  -webkit-overflow-scrolling:touch;padding:4px 0 200px}
.content::-webkit-scrollbar{display:none}

/* ---------- Icons (inline svg via mask) ---------- */
.icon-btn{width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:50%;transition:transform .12s,background .2s}
.icon-btn:active{transform:scale(.9)}
i[data-i]{width:24px;height:24px;display:inline-block;background:currentColor;
  -webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center}

/* ---------- Sections ---------- */
.section{margin:22px 0 6px}
.section-head{display:flex;align-items:center;justify-content:space-between;padding:0 18px 12px}
.section-head h2{font-size:20px;font-weight:800;margin:0}
.section-head .more{font-size:13px;color:var(--muted)}

/* horizontal scroller */
.row{display:flex;gap:14px;overflow-x:auto;padding:0 18px 4px;scroll-snap-type:x mandatory}
.row::-webkit-scrollbar{display:none}
.row .tile{scroll-snap-align:start}

/* tile */
.tile{flex:0 0 auto;width:150px;cursor:pointer}
.tile .art{width:150px;height:150px;border-radius:var(--radius);overflow:hidden;background:var(--surface);
  position:relative;box-shadow:0 8px 22px rgba(0,0,0,.45)}
.tile .art img{width:100%;height:100%;object-fit:cover}
.tile .t{font-size:14px;font-weight:600;margin:8px 2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile .s{font-size:12px;color:var(--muted);margin:2px 2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* grid */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:18px 14px;padding:6px 18px}
.grid .tile,.grid .tile .art{width:100%}
.grid .tile .art{aspect-ratio:1;height:auto}

/* hero */
.hero{margin:8px 18px 6px;border-radius:22px;overflow:hidden;position:relative;height:210px;
  display:flex;align-items:flex-end;box-shadow:0 14px 40px rgba(0,0,0,.5)}
.hero img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hero .scrim{position:absolute;inset:0;background:linear-gradient(0deg,rgba(0,0,0,.85),transparent 70%)}
.hero .h-body{position:relative;padding:18px;width:100%}
.hero .h-tag{font-size:12px;font-weight:700;opacity:.85;letter-spacing:.5px}
.hero .h-title{font-size:24px;font-weight:800;margin-top:2px}
.hero .h-sub{font-size:14px;color:#dcdce4;margin-top:2px}
.hero .h-play{margin-top:12px;display:inline-flex;align-items:center;gap:7px;
  background:#fff;color:#000;font-weight:700;font-size:14px;padding:9px 18px;border-radius:30px}
.hero .h-play i{width:16px;height:16px}

/* genre chips */
.chips{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:6px 18px}
.chip{height:88px;border-radius:18px;position:relative;overflow:hidden;display:flex;align-items:flex-end;
  padding:12px;font-weight:800;font-size:16px;cursor:pointer}
.chip:active{transform:scale(.97);transition:transform .1s}

/* song list */
.songs{padding:4px 10px}
.song{display:flex;align-items:center;gap:12px;padding:9px 8px;border-radius:12px;cursor:pointer}
.song:active{background:rgba(255,255,255,.06)}
.song .num{width:22px;text-align:center;color:var(--muted);font-size:14px;flex:0 0 22px}
.song .sc{width:46px;height:46px;border-radius:9px;overflow:hidden;flex:0 0 46px;background:var(--surface)}
.song .sc img{width:100%;height:100%;object-fit:cover}
.song .sm{flex:1;min-width:0}
.song .sm .st{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.song .sm .ss{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.song.playing .st{color:var(--accent-ink)}
.song .fav{flex:0 0 auto;color:var(--muted)}
.song .fav.on{color:var(--accent2)}
.song .fav i{width:20px;height:20px}

/* detail header */
.detail-head{display:flex;flex-direction:column;align-items:center;text-align:center;padding:10px 18px 6px}
.detail-head .dart{width:200px;height:200px;border-radius:20px;overflow:hidden;
  box-shadow:0 18px 48px rgba(0,0,0,.6);background:var(--surface)}
.detail-head .dart img{width:100%;height:100%;object-fit:cover}
.detail-head .dt{font-size:22px;font-weight:800;margin-top:16px;line-height:1.3;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;word-break:break-word}
.detail-head .ds{font-size:15px;color:var(--muted);margin-top:3px}
.detail-actions{display:flex;gap:12px;justify-content:center;margin:16px 0 6px}
.btn-pill{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:15px;
  padding:12px 26px;border-radius:30px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff}
.btn-pill.ghost{background:rgba(255,255,255,.12)}
.btn-pill i{width:18px;height:18px}
.btn-pill:active{transform:scale(.96);transition:transform .1s}

/* loading / empty */
.loading,.empty{padding:60px 20px;text-align:center;color:var(--muted)}
.spinner{width:40px;height:40px;margin:0 auto 14px;border:3px solid rgba(255,255,255,.15);
  border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.showcase.show-in{animation:showin .6s ease}
@keyframes showin{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
.fade{animation:fade .35s ease}
@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- Mini player ---------- */
.mini{position:fixed;left:10px;right:10px;bottom:calc(var(--safe-bot) + 64px);z-index:5;
  display:flex;align-items:center;gap:10px;padding:8px;border-radius:16px;
  background:rgba(29,29,37,.86);backdrop-filter:blur(24px);border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.5)}
.mini-cover{width:44px;height:44px;border-radius:10px;overflow:hidden;flex:0 0 44px;background:var(--surface)}
.mini-cover img{width:100%;height:100%;object-fit:cover}
.mini-meta{flex:1;min-width:0}
.mini-title{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-artist{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-play{width:40px;height:40px}
.mini-play i{width:26px;height:26px}

/* ---------- Tab bar ---------- */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:6;display:flex;justify-content:space-around;
  padding:8px 4px calc(var(--safe-bot) + 8px);
  background:rgba(10,10,12,.9);backdrop-filter:blur(24px);border-top:1px solid rgba(255,255,255,.06)}
.tab{display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted);font-size:10px;flex:1;
  transition:color .2s}
.tab i{width:24px;height:24px}
.tab.active{color:var(--text)}
.tab.active i{background:var(--accent)}

/* ---------- Now playing ---------- */
.now{position:fixed;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;
  padding:calc(var(--safe-top) + 14px) 26px calc(var(--safe-bot) + 26px);
  background:var(--bg);animation:slideUp .35s cubic-bezier(.2,.8,.2,1)}
@keyframes slideUp{from{transform:translateY(100%)}to{transform:none}}
.now-bg{position:absolute;inset:0;z-index:0;opacity:.9;overflow:hidden;
  background:linear-gradient(180deg,var(--accent) -10%,var(--bg) 60%);transition:background 1s}
.blob{position:absolute;width:72vw;height:72vw;border-radius:50%;filter:blur(64px);
  opacity:.62;will-change:transform;pointer-events:none;transition:background 1.4s ease}
.blob.b1{top:-14%;right:-18%;animation:blob1 16s ease-in-out infinite alternate}
.blob.b2{top:26%;left:-24%;width:64vw;height:64vw;animation:blob2 19s ease-in-out infinite alternate}
.blob.b3{bottom:-16%;right:-8%;width:78vw;height:78vw;opacity:.5;animation:blob3 23s ease-in-out infinite alternate}
.blob.b4{top:52%;right:30%;width:38vw;height:38vw;opacity:.4;filter:blur(52px);animation:blob1 27s ease-in-out infinite alternate-reverse}
@keyframes blob1{from{transform:translate(0,0) scale(1)}to{transform:translate(-14vw,10vh) scale(1.25)}}
@keyframes blob2{from{transform:translate(0,0) scale(1.1)}to{transform:translate(16vw,-8vh) scale(0.9)}}
@keyframes blob3{from{transform:translate(0,0) scale(1)}to{transform:translate(-10vw,-9vh) scale(1.2)}}
.now>*:not(#nowBg){position:relative;z-index:1}
.now-close{align-self:center;margin-bottom:auto}
.now-close i{width:28px;height:28px}
.now-art{width:min(78vw,330px);height:min(78vw,330px);border-radius:22px;overflow:hidden;
  box-shadow:0 30px 70px rgba(0,0,0,.6);background:var(--surface)}
.now-art img{width:100%;height:100%;object-fit:cover}
.now-info{width:100%;max-width:360px;text-align:center;margin-top:28px}
.now-title{font-size:24px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.now-artist{font-size:16px;color:#dcdce4;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.now-seek{width:100%;max-width:360px;display:flex;align-items:center;gap:10px;margin-top:22px;font-size:12px;color:#cfcfd8;direction:ltr}
.now-controls{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:22px;direction:ltr}
.now-controls .lg i{width:34px;height:34px}
.play-big{width:74px;height:74px;border-radius:50%;background:#fff;color:#000}
.play-big i{width:36px;height:36px}
.now-actions{margin-top:22px;display:flex;gap:26px;align-items:center}

/* queue sheet */
.q-count{font-size:13px;color:var(--muted);font-weight:600;margin-right:8px}
.q-list{overflow-y:auto;max-height:58vh;margin:0 -6px}
.q-list::-webkit-scrollbar{display:none}
.q-now{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:800;color:#fff;flex:0 0 auto}
.q-past{opacity:.42}
.q-current{background:linear-gradient(135deg,var(--accent),var(--accent2));border-radius:14px;
  box-shadow:0 6px 18px rgba(0,0,0,.35)}
.q-current .ss{color:rgba(255,255,255,.85)}
.eq{display:inline-flex;align-items:flex-end;gap:2px;height:12px}
.eq i{width:3px;background:#fff;border-radius:1px;animation:eq 1s ease-in-out infinite}
.eq i:nth-child(1){height:6px;animation-delay:0s}
.eq i:nth-child(2){height:11px;animation-delay:.25s}
.eq i:nth-child(3){height:8px;animation-delay:.5s}
@keyframes eq{0%,100%{transform:scaleY(.5)}50%{transform:scaleY(1)}}

/* composer badge in album view */
.num.comp{width:auto;min-width:26px;height:22px;padding:0 6px;border-radius:8px;
  background:rgba(255,255,255,.1);display:inline-flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:800;color:#e8e8ee;flex:0 0 auto}
.num.comp.ess{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff}
.kebab{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:50%;color:var(--muted);flex:0 0 auto}
.kebab i{width:18px;height:18px}
.sa-head{display:flex;align-items:center;gap:12px;padding:4px 2px 14px;border-bottom:1px solid rgba(255,255,255,.07);margin-bottom:6px}
.sa-head .sc{width:48px;height:48px;border-radius:10px;overflow:hidden;flex:0 0 48px;background:var(--surface)}
.sa-head .sc img{width:100%;height:100%;object-fit:cover}
.sa-head .st{font-size:15px;font-weight:700}
.sa-head .ss{font-size:13px;color:var(--muted)}
.sort-opt span{display:inline-flex;align-items:center;gap:10px}
.sort-opt span i{width:18px;height:18px;color:var(--accent-ink)}

/* pick labels in album song rows */
.pick-in{color:var(--accent-ink);font-weight:700}
.pick-out{color:var(--muted)}

/* toast */
.toast{position:fixed;left:50%;bottom:calc(var(--safe-bot) + 130px);transform:translateX(-50%) translateY(12px);
  background:rgba(30,30,40,.95);backdrop-filter:blur(12px);color:#fff;font-size:14px;font-weight:600;
  padding:11px 20px;border-radius:24px;border:1px solid rgba(255,255,255,.12);
  opacity:0;pointer-events:none;transition:.25s;z-index:60}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* mix mode */
.mix-intro{text-align:center;padding:24px 18px 4px}
.mix-big{width:72px;height:72px;margin:0 auto 12px;border-radius:22px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,var(--accent),var(--accent2))}
.mix-big i{width:34px;height:34px;color:#fff}
.mix-intro h2{font-size:22px;font-weight:800;margin:0}
.mix-count{text-align:center;font-size:15px;font-weight:800;color:var(--accent-ink);padding:6px 0 4px}

/* more hub */
.more-cards{display:flex;flex-direction:column;gap:14px;padding:10px 18px}
.more-card{display:flex;align-items:center;gap:14px;border-radius:20px;padding:18px 16px;cursor:pointer;color:#fff}
.more-card:active{transform:scale(.98);transition:transform .1s}
.more-card i{width:26px;height:26px;flex:0 0 26px;filter:drop-shadow(0 1px 3px rgba(0,0,0,.55))}
.mc-t{font-size:18px;font-weight:800;text-shadow:0 1px 4px rgba(0,0,0,.6)}
.mc-s{font-size:13px;opacity:.95;margin-top:2px;text-shadow:0 1px 3px rgba(0,0,0,.55)}
.more-card::before{content:"";position:absolute;inset:0;border-radius:20px;
  background:linear-gradient(90deg,rgba(0,0,0,.28),rgba(0,0,0,.05));pointer-events:none}
.more-card{position:relative}
.more-card>*{position:relative;z-index:1}
.chip-n{font-size:12px;opacity:.85;margin-right:8px;font-weight:600}

/* ---------- Themes ---------- */
body[data-theme="light"]{--bg:#f4f4f7;--surface:#ffffff;--surface2:#e9e9ef;--text:#121216;--muted:#5a5a66;--accent-ink:#5b3bd0}
body[data-theme="light"] .rank-badge{background:rgba(0,0,0,.1);color:#26262e}
body[data-theme="light"] .top-rank{color:#3a2800}
body[data-theme="light"] .sheet-card{background:#ffffff;color:#121216}
body[data-theme="light"] .sheet-close{background:rgba(0,0,0,.07);color:#121216}
body[data-theme="light"] .mini{background:rgba(255,255,255,.9);border-color:rgba(0,0,0,.08)}
body[data-theme="light"] .tabbar{background:rgba(244,244,247,.92);border-top-color:rgba(0,0,0,.07)}
body[data-theme="light"] .tab.active{color:#121216}
body[data-theme="light"] .sort-btn,body[data-theme="light"] .pl-btn:not(.bot){background:rgba(0,0,0,.06);border-color:rgba(0,0,0,.1);color:#121216}
body[data-theme="light"] .panel{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.07)}
body[data-theme="light"] .top-card{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.07)}
body[data-theme="light"] .f-chip{background:rgba(0,0,0,.06);border-color:rgba(0,0,0,.1);color:#26262e}
body[data-theme="light"] .song:active{background:rgba(0,0,0,.05)}
body[data-theme="light"] .num.comp{background:rgba(0,0,0,.08);color:#26262e}
body[data-theme="light"] .search{background:var(--bg)}
body[data-theme="light"] .search-bar input{background:#e9e9ef;color:#121216}
body[data-theme="light"] .bar-label{color:#3c3c46}
body[data-theme="light"] .bar-track{background:rgba(0,0,0,.09)}
body[data-theme="light"] .set-hint,body[data-theme="light"] .ss,body[data-theme="light"] .tile .s{color:#5a5a66}
body[data-theme="light"] .tile .t,body[data-theme="light"] .st{color:#121216}
body[data-theme="light"] .f-foot{background:rgba(244,244,247,.95);border-top-color:rgba(0,0,0,.08)}
body[data-theme="light"] .seg{background:rgba(0,0,0,.06)}
body[data-theme="light"] .seg button{color:#3c3c46}
body[data-theme="light"] .sort-opt{color:#121216;border-bottom-color:rgba(0,0,0,.08)}
body[data-theme="light"] .top-sub{color:#3c3c46}
body[data-theme="light"] .split-legend{color:#3c3c46}
body[data-theme="light"] .f-sec-title{color:#3c3c46}
body[data-theme="light"] .sheet-handle{background:rgba(0,0,0,.25)}
body[data-theme="light"] .sa-head{border-bottom-color:rgba(0,0,0,.08)}
body[data-theme="light"] .q-count{color:#5a5a66}
body[data-theme="light"] .rank{border-top-color:rgba(0,0,0,.07)}
body[data-theme="light"] .rank-name,body[data-theme="light"] .top-name,body[data-theme="light"] .set-label,
body[data-theme="light"] .sm .st,body[data-theme="light"] .detail-head .dt,body[data-theme="light"] .topbar-title,
body[data-theme="light"] .section-head h2,body[data-theme="light"] .panel h3,body[data-theme="light"] .f-count,
body[data-theme="light"] .f-title,body[data-theme="light"] .mini-title,body[data-theme="light"] .sheet-card h2{color:#121216}
body[data-theme="light"] .mini-artist{color:#5a5a66}
body[data-theme="light"] .tabbar .tab.active i{background:var(--accent)}
body[data-theme="light"] input[type=range]{background:rgba(0,0,0,.2)}
body[data-theme="light"] .login-card input{background:#fff;border-color:rgba(0,0,0,.15);color:#121216}
body[data-theme="vivid"]{--bg:#0e0620;--surface:#1c1038;--surface2:#281a4a}
body[data-theme="vivid"] .bg-wash{opacity:.5}
body[data-theme="vivid"] .panel{background:rgba(150,90,255,.08);border-color:rgba(150,90,255,.18)}
body[data-theme="vivid"] .top-card{background:rgba(150,90,255,.09);border-color:rgba(150,90,255,.18)}
body[data-theme="vivid"] .tabbar{background:rgba(16,6,36,.92)}
body[data-theme="vivid"] .mini{background:rgba(34,18,66,.9)}
body[data-theme="vivid"] .sheet-card{background:#1b0f36}

/* ---------- Deep-analysis report ---------- */
.report{position:fixed;inset:0;z-index:40;background:#0b0b10;color:#fff;overflow-y:auto;
  -webkit-overflow-scrolling:touch}
.report::-webkit-scrollbar{display:none}
.rp-inner{max-width:720px;margin:0 auto;padding:calc(var(--safe-top) + 14px) 22px 80px}
.rp-top{display:flex;gap:10px;justify-content:flex-start;margin-bottom:10px}
.rp-cover{border-radius:24px;padding:36px 26px;margin-bottom:22px;text-align:center;
  background:linear-gradient(135deg,#2b1a5e,#7c2b5e)}
.rp-kicker{font-size:12px;letter-spacing:1px;color:#d9c9ff;font-weight:700}
.rp-cover h1{font-size:30px;font-weight:800;margin:10px 0 4px}
.rp-cover .rp-sub{font-size:15px;color:#e6dcff}
.rp-bignums{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:22px}
.rp-bignums div{background:rgba(255,255,255,.1);border-radius:16px;padding:12px}
.rp-bignums b{display:block;font-size:26px;font-weight:800}
.rp-bignums span{font-size:12px;color:#e6dcff}
.rp-sec{margin:46px 0;padding-top:28px;border-top:1px solid rgba(255,255,255,.09)}
.rp-thumb{width:40px;height:40px;border-radius:10px;overflow:hidden;flex:0 0 40px;background:#222}
.rp-thumb img{width:100%;height:100%;object-fit:cover}
.rp-sec h2{font-size:20px;font-weight:800;margin:0 0 4px;color:#fff}
.rp-sec .rp-tag{font-size:12px;font-weight:700;color:#b9a5ff;letter-spacing:.5px}
.rp-sec p.lead{font-size:14px;color:#c9c9d4;margin:4px 0 14px}
.rp-insight{background:rgba(150,110,255,.12);border-right:3px solid #9b7bff;border-radius:10px;
  padding:12px 14px;font-size:14px;color:#e8e2ff;margin-top:12px}
.rp-row{display:flex;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid rgba(255,255,255,.07)}
.rp-row:last-child{border-bottom:0}
.rp-pos{width:26px;font-size:16px;font-weight:800;color:#b9a5ff;flex:0 0 26px;text-align:center}
.rp-name{flex:1;font-size:15px;font-weight:600;unicode-bidi:plaintext;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}
.rp-val{font-size:13px;color:#9a9aa6}
.rp-grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media print{
  body *{visibility:hidden}
  .report,.report *{visibility:visible}
  .report{position:static;background:#fff !important;color:#111 !important;overflow:visible}
  .rp-top{display:none !important}
  .rp-sec h2{color:#111}
  .rp-sec p.lead{color:#444}
  .rp-val{color:#555}
  .rp-name{color:#111}
  .rp-pos{color:#6b46c1}
  .rp-row{border-bottom-color:#ddd}
  .rp-insight{background:#f3efff;color:#333;border-right-color:#6b46c1}
  .rp-sec{page-break-inside:avoid}
  .bar-label{color:#333 !important}
  .bar-track{background:#eee !important}
  .bar-val{color:#555 !important}
  .report .panel{background:#fafafa;border-color:#e5e5e5}
  .report .panel h3{color:#111}
}

/* playlists actions */
.pl-actions{display:flex;gap:10px;padding:6px 18px 14px}
.pl-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;height:48px;
  border-radius:14px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);
  font-size:14px;font-weight:700;color:#fff}
.pl-btn.bot{background:linear-gradient(135deg,var(--accent),var(--accent2));border:0}
.pl-btn i{width:18px;height:18px}

/* now-playing is ALWAYS bright (album-tinted): fonts & controls dark + bold */
.now .now-title{color:#101014;font-weight:800}
.now .now-artist{color:#26262e;font-weight:700}
.now .now-seek,.now #curTime,.now #durTime{color:#2c2c34;font-weight:600}
.now .icon-btn{color:#101014}
.now .now-close{color:#101014}
.now .now-close i{background:#101014}
.now .play-big{background:#101014;color:#fff}
.now input[type=range]{background:rgba(0,0,0,.28)}
.now input[type=range]::-webkit-slider-thumb{background:#101014}

/* marquee: long names roll back & forth so the full text is readable */
.mq{text-overflow:clip}
.mq>span{display:inline-block;white-space:nowrap}
.mq.roll>span{animation-name:mqroll;animation-timing-function:linear;
  animation-iteration-count:infinite;animation-direction:alternate;animation-delay:1.4s}
@keyframes mqroll{0%,14%{transform:translateX(0)}86%,100%{transform:translateX(var(--mqx))}}

/* playlists grid: uniform medium tiles */
.grid.mid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:16px 12px}
.grid.mid .tile{width:100%}
.grid.mid .tile .art{width:100%;aspect-ratio:1;height:auto}
.grid.mid .tile .t{font-size:13px}

/* range sliders */
input[type=range]{-webkit-appearance:none;appearance:none;height:4px;border-radius:2px;
  background:rgba(255,255,255,.25);flex:1}
/* setting sliders: force LTR so left=less, right=more (matches the "drag right" hint) on every engine */
#xfRange,#mixDurRange{direction:ltr}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;
  background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.4)}

/* ---------- Search ---------- */
.search{position:fixed;inset:0;z-index:25;background:var(--bg);display:flex;flex-direction:column}
.search-bar{display:flex;align-items:center;gap:8px;padding:calc(var(--safe-top) + 34px) 14px 12px}
.search-bar input{flex:1;height:46px;border-radius:14px;background:var(--surface2);border:0;
  color:#fff;padding:0 16px;font-size:16px}
.search-bar input:focus{outline:none}
.search-results{flex:1;overflow-y:auto;padding:6px 10px 40px}
.search-results::-webkit-scrollbar{display:none}
.res-head{font-size:13px;font-weight:700;color:var(--muted);padding:14px 8px 6px}

/* ---------- Bidi: auto-detect direction per text (English/numbers vs Hebrew) ---------- */
.topbar-title,.tile .t,.tile .s,.st,.ss,.h-title,.h-sub,.dt,.ds,
.now-title,.now-artist,.mini-title,.mini-artist,.bar-label,.rank-name{unicode-bidi:plaintext}

.topbar-actions{display:flex;align-items:center;gap:2px}

/* sync/upload progress banner */
.sync-banner{position:relative;z-index:3;margin:0 14px 6px;border-radius:12px;overflow:hidden;
  background:var(--surface2);height:34px;display:flex;align-items:center}
.sync-fill{position:absolute;inset:0 auto 0 0;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));
  opacity:.28;transition:width 1s ease;border-radius:12px}
.sync-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;padding:0 12px}
.sync-ic{width:16px;height:16px;color:var(--accent-ink);flex:0 0 16px}
#syncText{flex:1;font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sync-x{color:var(--muted);font-size:14px;padding:4px 6px;flex:0 0 auto}

/* ---------- Analysis dashboard ---------- */
.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:8px 18px 4px}
.stat{border-radius:18px;padding:16px;color:#fff;position:relative;overflow:hidden;min-height:92px;
  display:flex;flex-direction:column;justify-content:center}
.stat .num{font-size:30px;font-weight:800;line-height:1}
.stat .lbl{font-size:13px;opacity:.92;margin-top:6px;font-weight:600}
.stat i{position:absolute;left:12px;top:12px;width:22px;height:22px;opacity:.55}
.panel{margin:20px 14px 0;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.07);
  border-radius:20px;padding:16px}
.panel h3{font-size:16px;font-weight:800;margin:0 0 14px}
.bar{display:flex;align-items:center;gap:10px;margin:9px 0}
.bar-label{flex:0 0 92px;font-size:13px;color:#dcdce4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}
.bar-track{flex:1;height:14px;border-radius:8px;background:rgba(255,255,255,.08);overflow:hidden;direction:ltr}
.bar-fill{height:100%;border-radius:8px;min-width:3px;transition:width .9s cubic-bezier(.2,.8,.2,1)}
.bar-val{flex:0 0 auto;font-size:12px;color:var(--muted);min-width:40px}
.split{display:flex;height:34px;border-radius:12px;overflow:hidden;margin-top:4px;direction:ltr}
.split>div{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#08121f}
.split-legend{display:flex;gap:16px;justify-content:center;margin-top:12px;font-size:13px;color:#dcdce4}
.split-legend span{display:inline-flex;align-items:center;gap:6px}
.dot{width:11px;height:11px;border-radius:3px;display:inline-block}
.rank{display:flex;align-items:center;gap:12px;padding:8px 2px;border-top:1px solid rgba(255,255,255,.05)}
.rank:first-of-type{border-top:0}
.rank-pos{width:24px;font-size:15px;font-weight:800;color:var(--accent-ink);text-align:center;flex:0 0 24px}
.rank-name{flex:1;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-val{font-size:13px;color:var(--muted)}

/* top-20 leaders list (analysis) — one artist per row */
.top-grid{display:grid;grid-template-columns:1fr;gap:10px}
.top-card{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);border-radius:16px;padding:9px}
.top-card.gold{background:linear-gradient(135deg,rgba(255,190,60,.14),rgba(255,90,140,.12));
  border-color:rgba(255,200,90,.28)}
.top-cover{position:relative;width:56px;height:56px;border-radius:12px;overflow:hidden;flex:0 0 56px;
  background:var(--surface);box-shadow:0 6px 16px rgba(0,0,0,.4)}
.top-cover img{width:100%;height:100%;object-fit:cover}
.top-rank{position:absolute;top:-1px;right:-1px;min-width:20px;height:20px;padding:0 5px;
  display:flex;align-items:center;justify-content:center;border-radius:0 11px 0 11px;
  background:rgba(10,10,14,.85);font-size:11px;font-weight:800;color:#fff}
.top-rank.r1{background:linear-gradient(135deg,#ffd200,#f7971e);color:#3a2800}
.top-rank.r2{background:linear-gradient(135deg,#e8e8ee,#9a9aa6);color:#26262e}
.top-rank.r3{background:linear-gradient(135deg,#f0997b,#b06a4a);color:#3a1c0c}
.top-meta{min-width:0;flex:1}
.top-name{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext;text-align:center}
.top-sub,.top-sub2{text-align:center}
.top-sub{font-size:12px;color:#e8e8ee;margin-top:2px}
.top-sub b{color:var(--accent-ink);font-weight:800}
.top-sub2{font-size:11px;color:var(--muted)}

/* ---------- Settings sheet ---------- */
.sheet{position:fixed;inset:0;z-index:30;display:flex;align-items:flex-end;
  background:rgba(0,0,0,.5);animation:fade .25s}
.sheet-card{width:100%;background:#15151b;border-radius:24px 24px 0 0;padding:0 22px calc(var(--safe-bot) + 26px);
  animation:slideUp .3s cubic-bezier(.2,.8,.2,1);overflow-y:auto;-webkit-overflow-scrolling:touch;
  max-height:82vh;max-height:min(82dvh, calc(100dvh - 92px))}
.sheet-card::-webkit-scrollbar{display:none}
/* handle + first header stick to the top of the sheet so close/X is always reachable */
.sheet-handle{position:sticky;top:0;z-index:3;width:100%;padding:10px 0 6px;margin:0;background:inherit}
.sheet-handle::before{content:"";display:block;width:40px;height:4px;border-radius:2px;
  background:rgba(255,255,255,.25);margin:0 auto}
.sheet-card>h2:first-of-type,.sheet-card>.sheet-hd{position:sticky;top:34px;z-index:2;background:inherit;
  padding-bottom:12px;margin-bottom:6px}
.sheet-card h2{font-size:20px;font-weight:800;margin:0 0 18px}
.set-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.set-label{font-size:15px;font-weight:600}
.set-val{font-size:14px;color:var(--accent-ink);font-weight:700}
.set-hint{font-size:12px;color:var(--muted);margin-top:8px}
.seg{display:flex;gap:6px;background:rgba(255,255,255,.06);border-radius:12px;padding:4px;direction:ltr}
.seg button{flex:1;padding:9px 0;border-radius:9px;font-size:13px;font-weight:700;color:#cfcfd8;transition:.15s}
.seg button.on{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff}
.sheet-logout{width:100%;margin-top:26px;height:46px;border-radius:13px;font-weight:700;font-size:15px;
  background:rgba(255,77,109,.15);color:#ff6b81}
.sheet-close{width:100%;margin-top:10px;height:46px;border-radius:13px;font-weight:700;font-size:15px;
  background:rgba(255,255,255,.08);color:#fff}

/* ---------- Filter screen ---------- */
.f-title{flex:1;font-size:18px;font-weight:800}
.f-clear{font-size:14px;color:var(--accent2);font-weight:700;padding:8px}
.f-sec{padding:14px 16px 4px}
.f-sec-title{font-size:14px;font-weight:800;margin-bottom:10px;color:#dcdce4}
.f-chips{display:flex;flex-wrap:wrap;gap:8px}
.f-chip{display:inline-flex;align-items:center;gap:6px;padding:8px 13px;border-radius:20px;
  background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1);
  font-size:13px;font-weight:600;color:#e8e8ee;transition:.15s;unicode-bidi:plaintext}
.f-chip span{font-size:11px;color:var(--muted)}
.f-chip.on{background:linear-gradient(135deg,var(--accent),var(--accent2)) !important;border-color:transparent !important;
  color:#fff !important;font-weight:800;box-shadow:0 4px 14px rgba(0,0,0,.3);transform:scale(1.04)}
.f-chip.on span{color:rgba(255,255,255,.92) !important}
.f-foot{position:fixed;left:0;right:0;bottom:0;z-index:26;display:flex;align-items:center;gap:10px;
  padding:12px 16px calc(var(--safe-bot) + 14px);
  background:rgba(12,12,16,.92);backdrop-filter:blur(20px);border-top:1px solid rgba(255,255,255,.08)}
.f-count{flex:1;font-size:15px;font-weight:800}
.f-foot .btn-pill{padding:11px 20px}

/* ---------- Albums toolbar + compact grid ---------- */
.alb-toolbar{display:flex;align-items:center;justify-content:space-between;padding:4px 18px 10px}
.sort-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 15px;border-radius:20px;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);font-size:13px;font-weight:700;color:#fff}
.sort-btn i{width:16px;height:16px}
.alb-count{font-size:13px;color:var(--muted)}
.grid.compact{grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:14px 10px}
.grid.compact .tile .t{font-size:12px;margin-top:6px}
.ct-meta{display:flex;align-items:center;gap:6px;margin-top:3px}
.rank-badge{min-width:20px;height:20px;padding:0 5px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.12);font-size:11px;font-weight:800;color:#fff}
.ct-sub{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sort-opt{display:flex;align-items:center;justify-content:space-between;width:100%;padding:15px 4px;
  border-bottom:1px solid rgba(255,255,255,.06);font-size:16px;font-weight:600;color:#fff;text-align:right}
.sort-opt:last-of-type{border-bottom:0}
.sort-opt i{width:20px;height:20px;color:var(--accent-ink)}
