/* NOIR Music: premium dark UI */
@font-face {
  font-family: "AradVF";
  src: url("../fonts/AradVF.woff2") format("woff2"), url("../fonts/AradVF.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: "AradVF", "Vazirmatn", "Vazir", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, sans-serif;
  --bg: #000;
  --surface: #0b0b0b;
  --card: #151515;
  --card-2: #1e1e1e;
  --line: #242424;
  --text: #f4f4f4;
  --muted: #8b8b8b;
  --accent: #ffffff;
  --accent-ink: #000;
  --danger: #ff6464;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 248px;
  --tabbar-h: 60px;
  --player-h: 88px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="charcoal"] {
  --bg: #161616;
  --surface: #1b1b1b;
  --card: #232323;
  --card-2: #2c2c2c;
  --line: #333;
}
:root[data-accent="gold"] { --accent: #d9b56a; --accent-ink: #15110a; }
:root[data-accent="ice"] { --accent: #8fd3ff; --accent-ink: #04121b; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; }

/* ---------- layout ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: var(--player-h); width: var(--sidebar-w);
  padding: 28px 18px; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px; z-index: 20;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: .18em; padding: 0 10px; }
.brand span { font-weight: 300; letter-spacing: .08em; color: var(--muted); margin-inline-start: 6px; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  text-align: start; padding: 11px 12px; border-radius: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 12px; transition: background .25s var(--ease), color .25s;
}
.nav-item:hover { color: var(--text); background: var(--card); }
.nav-item.active { color: var(--text); background: var(--card-2); }
.sidebar .import-btn { margin-top: auto; }

.main {
  margin-inline-start: var(--sidebar-w); min-height: 100dvh;
  padding: 0 36px calc(var(--player-h) + 36px);
}
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 18px 0 14px; background: linear-gradient(var(--bg) 70%, transparent);
}
.topbar h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; }
.view { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); transition: transform .2s var(--ease), background .2s;
}
.icon-btn:hover { background: var(--card-2); }
.icon-btn:active, .btn:active, .chip:active, .row:active { transform: scale(.96); }
.icon-btn.on { color: var(--accent); }
.icon-btn.big { width: 56px; height: 56px; }
.icon-btn.plain { background: none; }

.btn {
  padding: 11px 18px; border-radius: 999px; background: var(--card-2); display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; transition: transform .2s var(--ease), background .2s, opacity .2s; white-space: nowrap;
}
.btn:hover { background: #333; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

.chip {
  padding: 8px 15px; border-radius: 999px; background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600;
  transition: all .25s var(--ease);
}
.chip.active { background: var(--accent); color: var(--accent-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.tabbar { display: none; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 28px; margin-bottom: 8px;
  background: radial-gradient(120% 140% at 0% 0%, #3a3a3a 0%, #111 55%, #000 100%);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; justify-content: flex-end; min-height: 200px;
}
.hero h2 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.hero p { color: #bdbdbd; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head .muted { color: var(--muted); font-size: 13px; }
.rail { display: flex; gap: 18px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 156px; scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 22px 18px; }
.empty {
  padding: 22px; border-radius: var(--radius); background: var(--card); color: var(--muted);
  border: 1px dashed #3a3a3a; text-align: center;
}

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; gap: 10px; text-align: start; min-width: 0; transition: transform .3s var(--ease); }
.card:hover { transform: translateY(-3px); }
.card:hover .art { box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.art {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--card-2); box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: grid; place-items: center; transition: box-shadow .3s var(--ease);
}
.art img { width: 100%; height: 100%; object-fit: cover; }
.art.round { border-radius: 50%; }
.art .glyph { font-size: 38px; font-weight: 800; opacity: .75; letter-spacing: -.02em; }
.art svg { width: 36%; height: 36%; opacity: .5; }
.card-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .play-dot {
  position: absolute; right: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  opacity: 0; transform: translateY(8px); transition: all .3s var(--ease);
}
.card:hover .play-dot, .card:focus-visible .play-dot { opacity: 1; transform: none; }
.card .play-dot svg { fill: currentColor; stroke: none; width: 20px; height: 20px; }

/* ---------- track rows ---------- */
.tracks { display: flex; flex-direction: column; gap: 2px; }
.row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px; transition: background .2s, transform .2s var(--ease); text-align: start; width: 100%;
}
.row:hover { background: var(--card); }
.row .thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--card-2); display: grid; place-items: center; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row .thumb .glyph { font-weight: 800; font-size: 15px; opacity: .7; }
.row .meta { min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.active .t { color: var(--accent); }
.row .right { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row .right .icon-btn { width: 36px; height: 36px; background: none; }
.row .right .icon-btn svg { width: 19px; height: 19px; }
.row .right .icon-btn.on { color: var(--accent); }
.row .num { width: 22px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.row .eq { display: none; }
.row.active .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.row.active.playing .eq i { animation: eq 0.9s infinite var(--ease); }
.eq i { width: 3px; background: var(--accent); border-radius: 2px; height: 40%; }
.eq i:nth-child(2) { animation-delay: .2s !important; }
.eq i:nth-child(3) { animation-delay: .4s !important; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.row.active .thumb { box-shadow: 0 0 0 2px var(--accent); }

.detail-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: end; margin-bottom: 24px; }
.detail-head .art { width: 220px; }
.detail-head .kind { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted); }
.detail-head h2 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 8px; }
.detail-head .sub { color: var(--muted); margin-bottom: 18px; }
.detail-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.search-box {
  display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px; padding: 0 18px; height: 50px;
  border: 1px solid transparent; transition: border-color .2s, background .2s; margin-bottom: 22px;
}
.search-box:focus-within { border-color: #3a3a3a; background: var(--card-2); }
.search-box input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; min-width: 0; }
.search-box svg { color: var(--muted); }

/* ---------- forms ---------- */
input[type="text"], input[type="search"], input:not([type]) {
  background: var(--card-2); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; outline: 0; width: 100%;
}
input[type="text"]:focus { border-color: var(--accent); }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px;
  background: var(--card); border-radius: 14px; margin-bottom: 8px;
}
.setting .label { font-weight: 600; }
.setting .hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
.settings-group { margin-bottom: 28px; }
.settings-group > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 4px 10px; font-weight: 700; }
.segmented { display: inline-flex; background: var(--card-2); border-radius: 999px; padding: 3px; gap: 2px; }
.segmented button { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); font-weight: 600; }
.segmented button.active { background: var(--accent); color: var(--accent-ink); }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 999px; background: #3a3a3a; transition: background .3s var(--ease); flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--knob, #fff); transition: transform .3s var(--ease); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }
:root[dir="rtl"] .toggle.on::after, .toggle.on:dir(rtl)::after { transform: translateX(-20px); }
.layout-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border-radius: 14px; margin-bottom: 8px; }
.layout-row .name { flex: 1; font-weight: 600; }
.layout-row .name.off { color: var(--muted); text-decoration: line-through; }
.notice { padding: 14px 16px; border-radius: 14px; background: #2a2412; color: #f2d89b; font-size: 14px; margin-bottom: 14px; }
.notice.error { background: #2b1414; color: #ffb4b4; }
.notice.info { background: var(--card-2); color: var(--text); }
.meter { height: 6px; background: var(--card-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s var(--ease); }

/* ---------- sheets / dialogs ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .3s var(--ease);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: 100%; max-width: 520px; max-height: 84dvh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0;
  padding: 12px 14px calc(18px + var(--safe-b)); transform: translateY(40px); transition: transform .4s var(--ease);
  border: 1px solid var(--line); border-bottom: 0;
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet .grab { width: 42px; height: 5px; border-radius: 999px; background: #444; margin: 0 auto 14px; }
.sheet h3 { font-size: 18px; font-weight: 800; padding: 4px 8px 12px; }
.sheet .action {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 12px; border-radius: 12px; text-align: start; font-weight: 600;
}
.sheet .action:hover { background: var(--card-2); }
.sheet .action.danger { color: var(--danger); }
.sheet .action .sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.sheet .field { display: grid; gap: 12px; padding: 4px 8px 8px; }
.sheet .field .row-btns { display: flex; gap: 10px; justify-content: flex-end; }
.sheet .pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; width: 100%; text-align: start; }
.sheet .pick-row:hover { background: var(--card-2); }
.center-dialog { max-width: 420px; border-radius: 22px; margin: 0 auto 18px; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); transform: scale(.96); }
  .sheet-backdrop.open .sheet { transform: none; }
}

.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast {
  background: #1d1d1d; border: 1px solid #333; padding: 12px 16px; border-radius: 14px; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: rise .35s var(--ease) both; pointer-events: auto;
}
.toast.error { border-color: #5a2222; color: #ffc2c2; }
.toast.warn { border-color: #5a4a1e; color: #f5deaa; }
.toast.ok { border-color: #2a4a33; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .4s var(--ease); }

/* ---------- player bar ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h); z-index: 60;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 2fr) minmax(0, 1fr); align-items: center; gap: 20px;
  padding: 0 22px; background: var(--player-bg); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.player.empty .pb-info { opacity: .45; }
.pb-info { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.pb-info .art { width: 56px; flex: none; border-radius: 10px; }
.pb-info .art .glyph { font-size: 18px; }
.pb-text { min-width: 0; }
.pb-text .js-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-text .js-artist { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-center { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.transport { display: flex; align-items: center; justify-content: center; gap: 14px; }
.transport .icon-btn { width: 38px; height: 38px; background: none; }
.transport .icon-btn:hover { background: var(--card); }
.transport .icon-btn svg { width: 20px; height: 20px; }
.transport .icon-btn.on { color: var(--accent); }
.badge-rep { position: relative; }
.badge-rep b { position: absolute; top: 2px; right: 2px; font-size: 9px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 4px; line-height: 13px; }
.pb-extras { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.pb-extras .vol { display: flex; align-items: center; gap: 8px; width: 140px; color: var(--muted); }
.pb-extras .icon-btn { width: 36px; height: 36px; background: none; }
.pb-extras .icon-btn svg { width: 19px; height: 19px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {.pb-extras .vol,.pb-extras .hide-sm,.transport .hide-sm{ display: none; }
  .player { grid-template-columns: minmax(0, 1fr) auto; height: 66px; bottom: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 12px; gap: 8px; }
  .pb-center { flex-direction: row; }
  .player::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 2px; background: var(--card-2); }
  .player .mini-progress { position: absolute; left: 0; top: 0; height: 2px; background: var(--accent); width: var(--p, 0%); }
  .pb-info .art { width: 44px; }
  .pb-info { padding: 4px 0; }
  .transport { gap: 8px; }
  .transport .icon-btn { width: 40px; height: 40px; }
  .sidebar { display: none; }
  .main { margin: 0; padding: 0 16px calc(var(--player-h) + var(--tabbar-h) + 20px); }
  .topbar { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .topbar h1 { font-size: 24px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: calc(var(--tabbar-h) + var(--safe-b));
    padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(0,0,0,.94); border-top: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
  .tabbar button.active { color: var(--text); }
  .tabbar svg { width: 22px; height: 22px; }
  .detail-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .detail-head .art { width: min(62vw, 220px); }
  .detail-head .actions { justify-content: center; }
  .detail-head h2 { font-size: 30px; }
  .hero { padding: 22px; min-height: 170px; }
  .hero h2 { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 18px 14px; }
  .rail > * { flex-basis: 140px; }
  .sheet-backdrop { z-index: 110; }
  .toasts { top: calc(12px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 380px) {
  .transport .icon-btn.hide-xs { display: none; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .player { grid-template-columns: minmax(0, 1fr) minmax(260px, 2fr) minmax(0, 1fr); }
  .pb-extras .vol { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.mini-progress { display: none; }
@media (max-width: 900px) { .mini-progress { display: block; } }

/* ---------- layout fixes ---------- */
.row { grid-template-columns: minmax(0, 1fr) auto; }
.row-main { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.row-main .meta { flex: 1; min-width: 0; }
.row .thumb { position: relative; flex: none; }
.row .num { flex: none; }
.row .dur { min-width: 40px; text-align: end; }
.row.active .eq { display: inline-flex; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 2px; background: rgba(0,0,0,.55); border-radius: 8px; }
.row.active .eq i { height: 40%; }
.row.active.playing .eq i { animation: eq .9s infinite var(--ease); }
.search-box input { background: none; border: 0; padding: 0; width: auto; flex: 1; min-width: 0; }
.search-box input:focus { border: 0; }
@media (pointer: coarse) {.pb-extras .vol{ display: none; } }
.sheet .pick-row { display: flex; align-items: center; gap: 12px; }
@media (max-width: 900px) {
  .player { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pb-extras { display: flex; gap: 0; }
  .pb-extras .icon-btn { width: 40px; height: 40px; }
  .pb-center { gap: 0; }
}

/* ================= v1.1 polish ================= */
:root { --spring: cubic-bezier(.34, 1.4, .64, 1); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { letter-spacing: -.005em; }
.miss { color: #f5c46b; font-weight: 600; }
h2 { letter-spacing: -.02em; }
.section-head h2 { font-size: 21px; }
.card-title { font-size: 15px; letter-spacing: -.01em; }
.card-sub { font-size: 12.5px; margin-top: -4px; }
.art { border-radius: 16px; }.art img{ animation: artIn .6s var(--ease) both; }
@keyframes artIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.card:active { transform: scale(.975); }
.card, .row, .btn, .icon-btn, .chip { transition: transform .25s var(--spring), background-color .25s, color .25s, box-shadow .3s; }
.row:active { background: var(--card-2); }
.nav-item { font-weight: 600; font-size: 15px; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item .ico { width: 20px; height: 20px; }
.hero { border-radius: 26px; background: radial-gradient(130% 150% at 0% 0%, #4a4a4a 0%, #161616 50%, #050505 100%); }
.hero h2 { font-size: 34px; line-height: 1.05; }
.hero p:first-child { color: #d0d0d0; font-size: 14px; font-weight: 600; letter-spacing: .02em; }

/* Bottom navigation: pill indicator instead of plain text */
@media (max-width: 900px) {
  .tabbar { background: rgba(10,10,10,.82); backdrop-filter: saturate(1.6) blur(24px); -webkit-backdrop-filter: saturate(1.6) blur(24px); }
  .tabbar button { position: relative; padding-top: 8px; font-size: 10.5px; letter-spacing: .02em; transition: color .25s; }
  .tabbar button svg { transition: transform .35s var(--spring); }
  .tabbar button.active svg { transform: translateY(-1px) scale(1.06); }
  .tabbar button.active::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 30px; height: 3px; margin-left: -15px;
    border-radius: 0 0 4px 4px; background: var(--accent);
  }
  .main { padding-inline: 18px; }
  .section { margin-top: 30px; }
  .section-head { margin-bottom: 12px; }
  .rail { margin-inline: -18px; padding-inline: 18px; scroll-padding-inline: 18px; }
  .rail > * { flex-basis: 146px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .player { box-shadow: 0 -10px 30px rgba(0,0,0,.45); }
  .pb-info .t, .pb-text .js-title { font-size: 14.5px; }
  .pb-text .js-artist { font-size: 12px; }
  .sheet-backdrop { overscroll-behavior: contain; }
  .sheet { overscroll-behavior: contain; }
  .topbar { padding-bottom: 10px; }
  .topbar h1 { font-size: 26px; font-weight: 800; }
  .search-box { height: 48px; }
}
/* Stop iOS from zooming when a text field is focused (needs >= 16px) */
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px !important; }
}
/* Touch devices: no hover, so artwork play buttons stay visible and targets grow */
@media (hover: none) {
  .play-dot { opacity: 1; transform: none; }
  .card:hover { transform: none; }
  .card:hover .art { box-shadow: 0 8px 24px rgba(0,0,0,.45); }
  .row .right .icon-btn { width: 40px; height: 40px; }
}
@media (pointer: coarse) {
  .transport .icon-btn { width: 44px; height: 44px; }
}.player,.tabbar,.transport,.sheet-backdrop .action{ -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
button, .row, .card, .chip, .nav-item { touch-action: manipulation; }

/* ================= Major Update 2: design system ================= */
:root {
  --player-bg: rgba(10,10,10,.86);
  --tabbar-bg: rgba(10,10,10,.84);
  --shadow-md: 0 10px 28px rgba(0,0,0,.42);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  --hairline: rgba(255,255,255,.07);
}
:root[data-theme="charcoal"] { --player-bg: rgba(28,28,28,.9); --tabbar-bg: rgba(28,28,28,.88); }
:root[data-theme="light"] {
  --bg: #f4f4f1; --surface: #fbfbf9; --card: #ffffff; --card-2: #ebeae6; --line: #e1e0db;
  --text: #121212; --muted: #6d6d68; --danger: #c42b2b;
  --player-bg: rgba(255,255,255,.9); --tabbar-bg: rgba(255,255,255,.92);
  --shadow-md: 0 10px 26px rgba(0,0,0,.09); --shadow-lg: 0 24px 60px rgba(0,0,0,.14);
  --hairline: rgba(0,0,0,.06);
}
:root[data-theme="light"][data-accent="white"] { --accent: #121212; --accent-ink: #ffffff; }
:root[data-theme="light"] .hero { background: radial-gradient(130% 150% at 0% 0%, #ffffff 0%, #e8e7e2 60%, #dcdbd4 100%); }
:root[data-theme="light"] .hero p { color: #4b4b46; }
:root[data-theme="light"] .art, :root[data-theme="light"] .card:hover .art { box-shadow: var(--shadow-md); }
:root[data-theme="light"] .toast { background: #fff; color: #111; border-color: var(--line); }
:root[data-theme="light"] .sheet .grab { background: #cfcdc7; }
:root[data-theme="light"] .segmented button.active { box-shadow: var(--shadow-md); }
:root[data-theme="light"] .chip:not(.active) { background: #e9e8e3; }
:root[data-theme="light"] .btn:not(.primary) { background: #e9e8e3; }
:root[data-theme="light"] .btn:not(.primary):hover, :root[data-theme="light"] .icon-btn:hover { background: #dedcd6; }
:root[data-theme="light"] .row:hover, :root[data-theme="light"] .layout-row, :root[data-theme="light"] .setting, :root[data-theme="light"] .card-2 { background: var(--card); }
:root[data-theme="light"] .search-box { background: #fff; border: 1px solid var(--line); }
:root[data-theme="light"] .sheet .action:hover, :root[data-theme="light"] .sheet .pick-row:hover { background: #f0efeb; }
:root[data-theme="light"] .art { background: #e6e5e0; }
:root[data-theme="light"] .eq i { background: var(--accent); }
:root[data-theme="light"] .row.active .eq { background: rgba(255,255,255,.7); }
:root[data-theme="light"] .row.active .eq i { background: #111; }
:root[data-theme="light"] .row.active .t { color: var(--text); font-weight: 800; }
:root[data-theme="light"] .nav-item.active { background: #fff; box-shadow: var(--shadow-md); }
:root[data-theme="light"] .sidebar { background: #f8f8f6; }
:root[data-theme="light"] .tabbar button.active::before { background: #121212; }
:root[data-theme="light"] .notice { background: #fbf1d8; color: #6b4e0e; }
:root[data-theme="light"] .notice.error { background: #fbe4e4; color: #8a1d1d; }
@keyframes pbSpin { to { transform: rotate(360deg); } }

/* Album/artist/playlist "Play" pill */
.btn.primary.pill { padding: 9px 22px 9px 14px; gap: 10px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.tri { width: 22px; height: 22px; display: grid; place-items: center; }
.tri svg { width: 100%; height: 100%; fill: currentColor; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; }
.btn.primary.pill .tri svg { transform: translateX(.6px); }

/* Secondary controls: consistent, quiet, with an active state */
.icon-btn { color: var(--text); }
.icon-btn svg { stroke-width: 1.7; }
.icon-btn.on { color: var(--accent); }.transport .icon-btn{ background: none; }.transport .icon-btn:hover{ background: var(--card-2); }.transport .icon-btn:active{ transform: scale(.9); }.transport .icon-btn.on::after{
  content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent);
}.transport .icon-btn{ position: relative; }
.row .right .icon-btn.on svg { fill: currentColor; }

/* ---- Mini player (mobile): floating card above the bottom nav ---- */
@media (max-width: 900px) {
  .player {
    left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); height: 66px; border-radius: 20px;
    background: var(--player-bg); border: 1px solid var(--hairline); box-shadow: var(--shadow-lg); overflow: hidden;
    padding: 0 10px 0 8px; gap: 6px; grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .player::before { display: none; }
  .mini-progress { display: block; position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: 2px; width: auto; background: var(--card-2); }
  .mini-progress::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--accent); transition: width .5s linear; }
  .pb-info { padding: 0; }
  .pb-info .art { width: 46px; border-radius: 12px; }
  .pb-text .js-title { font-size: 14.5px; font-weight: 700; }
  .pb-center .transport { gap: 4px; }
  .pb-center .icon-btn { width: 40px; height: 40px; }
  .pb-extras .icon-btn { width: 40px; height: 40px; }
  .main { padding-bottom: calc(66px + var(--tabbar-h) + var(--safe-b) + 32px); }
  .tabbar { background: var(--tabbar-bg); }
  .tabbar button { color: var(--muted); }
  .tabbar button.active { color: var(--text); }
}
.thumb { border-radius: 8px; overflow: hidden; background: var(--card-2); display: grid; place-items: center; flex: none; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .glyph { font-weight: 800; font-size: 15px; opacity: .7; }

/* ---- Focus, touch, motion ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }.row-main:focus-visible,.card:focus-visible{ outline-offset: -2px; border-radius: 14px; }
.card, .row, .chip, .nav-item, .tabbar button { -webkit-tap-highlight-color: transparent; }
.card:active .art { transform: scale(.98); transition: transform .15s var(--ease); }
.tabbar button:active { transform: scale(.94); }

/* ================= Major Update 2 (phase 2): library, controls, audio, stats ================= */
.lib-tabs { flex-wrap: nowrap; margin-bottom: 14px; }
.lib-tabs .chip { flex: none; }
.lib-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 16px; flex-wrap: wrap; }
.filter-box { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid transparent; }
.filter-box:focus-within { border-color: var(--line); background: var(--card-2); }
.filter-box svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.filter-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0; width: auto; font-size: 15px; }
.sort-chip { display: inline-flex; align-items: center; gap: 6px; }
.sort-chip svg { width: 16px; height: 16px; }
.chip.active { box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.head-actions { display: flex; gap: 8px; }
.hint-line { color: var(--muted); font-size: 12.5px; margin: 14px 4px 4px; }
.sel-bar { position: sticky; top: 70px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 16px; margin-bottom: 12px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.sel-count { font-weight: 700; font-size: 14px; }
.sel-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sel-actions .btn:disabled { opacity: .4; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.check svg { width: 14px; height: 14px; stroke-width: 2.6; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.row.selected { background: var(--card); }
.row.selected .t { color: var(--accent); }
.row.is-missing .t { opacity: .7; }
.row.dragging { opacity: .45; }
.row.drop-target { box-shadow: inset 0 2px 0 var(--accent); }
.tracks[data-reorder] .row { cursor: grab; }
.tracks[data-reorder] .row-main { cursor: grab; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: var(--card); border: 1px solid var(--hairline); border-radius: 18px; padding: 18px; }
.stat-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; font-weight: 700; }
.bar-list { display: flex; flex-direction: column; gap: 12px; background: var(--card); border-radius: 18px; padding: 16px 18px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 44px; align-items: center; gap: 12px; }
.bar-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s var(--ease); }
.bar-val { text-align: end; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.eq-panel { background: var(--card); border-radius: 18px; padding: 16px 16px 12px; margin-bottom: 8px; border: 1px solid var(--hairline); }
.eq-status { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.eq-status.on { color: var(--text); font-weight: 600; }
.eq-status.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.eq-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.eq-bands { display: flex; flex-direction: column; gap: 6px; }
.eq-band { display: grid; grid-template-columns: 62px 1fr 60px; align-items: center; gap: 12px; }
.eq-name { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eq-val { font-size: 12px; text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); }
.eq-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.info-list { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 6px; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 6px; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.info-row span { color: var(--muted); flex: none; }
.info-row b { font-weight: 600; text-align: end; word-break: break-word; min-width: 0; }
.queue-body .row .right { gap: 0; }
.queue-body .row .right .icon-btn { width: 34px; height: 34px; }
.sheet .action svg, .sheet .action .icon-btn { color: var(--text); }
.sheet .action.danger svg { color: var(--danger); }
.sheet .action:has(svg.check), .sheet .action .check { color: var(--accent); }
@media (max-width: 900px) {
  .sel-bar { top: 64px; }
  .lib-tools .filter-box { flex-basis: 100%; order: -1; }
  .bar-row { grid-template-columns: minmax(0, 110px) 1fr 40px; }
  .eq-band { grid-template-columns: 56px 1fr 56px; }
  .info-row { font-size: 13px; }
}

/* ================= v3: Now Playing layout, playback controls, progress, theme-aware controls ================= */
:root { --np-x: 22px; --track-h: 4px; --track-c: rgba(255,255,255,.14); }
:root[data-theme="light"] { --track-c: #d9d8d2; }
:root[data-theme="light"] .toggle:not(.on) { background: #8a8984; }
:root[data-theme="light"] { --muted: #5c5c57; }
:root[data-theme="charcoal"] { --muted: #a0a0a0; }
.toggle.on { --knob: var(--accent-ink); }

/* ---- Range: slim track, small thumb that appears on hover, focus and drag ---- */
input[type="range"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 24px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; outline: none; touch-action: none; --p: 0%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 24px; border: 0;
  background: linear-gradient(to right, var(--accent) 0 var(--p), var(--track-c) var(--p) 100%) center / 100% var(--track-h) no-repeat;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; margin-top: 6px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); opacity: 0; transform: scale(.5);
  transition: opacity .2s var(--ease), transform .25s var(--spring);
}
input[type="range"]::-moz-range-track { height: 24px; background: transparent; border: 0; }
input[type="range"]::-moz-range-progress { height: var(--track-h); background: var(--accent); border-radius: 999px; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .2s; }
input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb,
input[type="range"]:active::-webkit-slider-thumb { opacity: 1; transform: scale(1); }
input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:focus-visible::-moz-range-thumb,
input[type="range"]:active::-moz-range-thumb { opacity: 1; }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-runnable-track { box-shadow: 0 0 0 3px rgba(255,255,255,.18); border-radius: 999px; }
@media (pointer: coarse) {
  /* touch screens: no hover, so keep the thumb visible as a target */
  input[type="range"]::-webkit-slider-thumb { opacity: 1; transform: none; width: 14px; height: 14px; margin-top: 5px; }
}
.seek-line input[type="range"] { min-width: 0; }

/* ---- Play / Pause: one refined component ---- */
.pbtn {
  --pb: 56px;
  position: relative; display: inline-grid; place-items: center; width: var(--pb); height: var(--pb); flex: none;
  padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.14), 0 6px 14px -6px rgba(0,0,0,.6);
  transition: transform .18s var(--spring), box-shadow .25s var(--ease), filter .25s var(--ease), opacity .25s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pbtn:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.14), 0 8px 18px -6px rgba(0,0,0,.65); }
.pbtn:active { transform: scale(.93); transition-duration: .08s; }
.pbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pbtn svg { width: 36%; height: 36%; display: block; overflow: visible; stroke-width: 1.2; }
.pbtn path { transform-box: fill-box; transform-origin: 50% 50%; transition: opacity .22s var(--ease), transform .38s var(--spring); }
.pbtn .p-play { fill: currentColor; stroke: currentColor; stroke-linejoin: round; transform: translateX(6%); }
.pbtn .p-pause { fill: currentColor; stroke: none; opacity: 0; transform: scale(.4); }
.pbtn.is-playing .p-play { opacity: 0; transform: scale(.4) translateX(6%); }
.pbtn.is-playing .p-pause { opacity: 1; transform: none; }
.pbtn-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent-ink);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.pbtn.is-loading { cursor: progress; }
.pbtn.is-loading .pbtn-ring { opacity: .9; animation: pbSpin .8s linear infinite; }
.pbtn.is-loading svg { opacity: .35; }
.pbtn.is-idle { opacity: .45; box-shadow: none; }
.pbtn.sm { --pb: 40px; }
.pbtn.lg { --pb: 50px; }
.pbtn.xl { --pb: 64px; }
.play-dot.pbtn { --pb: 46px; box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.play-dot.pbtn svg { width: 40%; height: 40%; }

/* ---- Shared icon sizing ---- */
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.7; }
.icon-btn { color: var(--text); }
.icon-btn.on { color: var(--accent); }
.transport .icon-btn, .transport .icon-btn:hover { background: none; }
.transport .icon-btn:hover { background: var(--card-2); }
.transport .icon-btn.on::after {
  content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent);
}
.transport .icon-btn { position: relative; }

/* ---- Mini player: a card above the bottom nav (mobile) ---- */
@media (max-width: 900px) {
  .player { background: var(--player-bg); }
  .pb-center .pbtn.lg { --pb: 46px; }
  .transport .icon-btn svg { width: 19px; height: 19px; }
}

/* ---- Now Playing: a scrollable page. Nothing inside is clipped, and nothing is fixed-height ---- */
.np {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; overflow: hidden;
  background: #050505; color: #f5f5f5;
  --text: #f5f5f5; --muted: #9b9b9b; --card: #141414; --card-2: #232323; --line: #262626;
  --accent: #ffffff; --accent-ink: #000000;
  transform: translateY(100%); visibility: hidden;
  transition: transform .55s var(--ease), visibility .55s;
}
.np.open { transform: none; visibility: visible; }
:root[data-accent="gold"] .np { --accent: #d9b56a; --accent-ink: #15110a; }
:root[data-accent="ice"] .np { --accent: #8fd3ff; --accent-ink: #04121b; }
.np-bg {
  position: absolute; inset: -12%; background-size: cover; background-position: center;
  filter: blur(64px) saturate(1.35); opacity: .6; transition: background-image .5s var(--ease);
}
.np-bg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(75% 55% at 15% 8%, rgba(var(--tint, 40,40,44), .85), transparent 70%),
              radial-gradient(70% 55% at 95% 95%, rgba(var(--tint, 40,40,44), .55), transparent 70%);
}
.np-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.78) 70%, #000 100%); }
.np-scroll {
  position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none;
  padding: 0 var(--np-x) calc(36px + env(safe-area-inset-bottom, 0px));
}
.np-scroll::-webkit-scrollbar { display: none; }
.np-inner { max-width: 560px; margin: 0 auto; min-width: 0; }
.np-top {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 calc(var(--np-x) * -1); padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--np-x) 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,0));
}
.np-top .icon-btn.plain { width: 42px; height: 42px; background: rgba(255,255,255,.08); color: #f5f5f5; }
.np-top .icon-btn.plain:hover { background: rgba(255,255,255,.16); }
.np-label { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #c4c4c4; font-weight: 700; }
.np-cover { position: relative; width: min(100%, 360px, 46dvh); aspect-ratio: 1 / 1; margin: 4px auto 26px; }
.np-art {
  position: absolute; inset: 0; border-radius: 20px; overflow: hidden;
  box-shadow: 0 26px 60px -12px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.05);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.np-art .art { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.np-art .art img { width: 100%; height: 100%; object-fit: cover; }
.np-art .art .glyph { font-size: 64px; }
.np-art .art svg { width: 34%; height: 34%; }
.np.paused .np-art { transform: scale(.97); }
.np-lyrics { display: none; padding: 4px 2px 8px; }
.np.show-lyrics .np-lyrics { display: block; }
.np.show-lyrics .np-cover { aspect-ratio: auto; height: auto; }
.np.show-lyrics .np-art { display: none; }
.np-lyrics-text { white-space: pre-wrap; text-align: center; font-size: 19px; line-height: 1.65; font-weight: 700; color: #f2f2f2; overflow-wrap: anywhere; }
.np-main { display: flex; flex-direction: column; min-width: 0; }
.np-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-titles { flex: 1; min-width: 0; }
.np-info .t {
  font-size: clamp(22px, 6.2vw, 28px); font-weight: 800; letter-spacing: -.02em; line-height: 1.16; color: #f5f5f5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.np-info .s { margin-top: 4px; font-size: 15px; color: #c4c4c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-info .js-fav { width: 42px; height: 42px; flex: none; background: rgba(255,255,255,.08); color: #f5f5f5; }
.np-info .js-fav.on { color: var(--accent); }
.np-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; flex: none;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: .06em;
}
.np-badge[hidden] { display: none !important; }
.np-seek { margin-top: 20px; }
.np-time {
  display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; font-weight: 600;
  color: #a6a6a6; font-variant-numeric: tabular-nums;
}
.np-transport { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 14px; }
.np-transport .icon-btn { width: 46px; height: 46px; background: none; color: #f2f2f2; }
.np-transport .icon-btn:hover { background: rgba(255,255,255,.08); }
.np-transport .icon-btn svg { width: 24px; height: 24px; }
.np-transport .icon-btn.on { color: var(--accent); }
.np-transport .icon-btn.on::after { bottom: 3px; background: var(--accent); }
.np-secondary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 16px; }
.np-sec-start { justify-self: start; }
.np-sec-center { justify-self: center; }
.np-sec-end { justify-self: end; }
.np-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 14px;
  border-radius: 999px; background: rgba(255,255,255,.08); color: #f2f2f2; font-size: 13px; font-weight: 600;
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.np-sec svg { width: 19px; height: 19px; flex: none; }
.np-sec:hover { background: rgba(255,255,255,.15); }
.np-sec:active { transform: scale(.95); }
.np-sec[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.np-sec .js-sleep-label { font-variant-numeric: tabular-nums; }
.np-next { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.np-next h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #a6a6a6; font-weight: 700; }
.np-next-list { display: flex; flex-direction: column; gap: 2px; }
.np-next-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border-radius: 12px; text-align: start;
  color: #f5f5f5; transition: background .2s;
}
.np-next-row:hover, .np-next-row:focus-visible { background: rgba(255,255,255,.07); }
.np-next-row .thumb { width: 44px; height: 44px; }
.np-next-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.np-next-meta .t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f5f5f5; }
.np-next-meta .s { color: #a6a6a6; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-next-tag { font-size: 11px; color: #a6a6a6; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.np-next-empty { color: #a6a6a6; font-size: 13px; padding: 6px 8px; }
.menu-volume { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; padding: 12px 12px 14px; }
.menu-volume > span { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.menu-volume svg { width: 20px; height: 20px; }

/* Wide screens: artwork beside the controls and Up Next, page still scrolls */
@media (min-width: 900px) and (min-height: 600px) {
  .np-inner { max-width: 1080px; }
  .np-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
  .np-cover { width: 100%; max-width: 440px; margin: 8px 0 0; position: sticky; top: 92px; }
  .np-main { max-width: 520px; padding-top: 12px; }
}
/* Phone landscape: artwork left, controls right, scrolls as one page */
@media (orientation: landscape) and (max-height: 560px) {
  .np-inner { max-width: 1080px; }
  .np-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: start; }
  .np-cover { width: 100%; max-width: 240px; margin: 0; position: sticky; top: 64px; }
  .np-main { padding-top: 0; }
  .np-transport .icon-btn { width: 42px; height: 42px; }
  .np-transport .pbtn.xl { --pb: 56px; }
  .np-next { margin-top: 18px; }
}
@media (max-width: 380px) {
  :root { --np-x: 18px; }
  .np-transport .icon-btn { width: 42px; height: 42px; }
  .np-transport .pbtn.xl { --pb: 58px; }
  .np-sec { padding: 0 10px; }
}
