/* ════════════════════════════════════════════════════════════════════════════
   نغم — design system v2
   References: Apple Music (iOS 26: floating Liquid-Glass dock + separate mini player,
   full-bleed art-tinted album pages, living mesh backdrop on Now Playing) and Spotify
   (quick-access tiles, art-coloured header wash, filter pills, round play button).

   Scene: a listener in Baghdad/the Gulf, phone in hand at night or mounted in a car —
   dark interior light, art is the hero, chrome recedes. → near-black base, colour comes
   only from the artwork (--accent + --c1..3 mesh palette); controls use the fixed --brand crimson.

   Liquid Glass on the web: true refraction needs SVG backdrop filters (Chromium only),
   so the material here is blur + saturation + tinted fill + specular rim, which renders
   identically on iOS Safari.

   Rules: Arabic never gets letter-spacing. State transitions 160–240 ms ease-out-quint;
   physical surfaces (sheets, player, swipes) use spring physics from dom.js.
   ════════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-arabic.woff2") format("woff2");
  font-weight: 160 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-latin.woff2") format("woff2");
  font-weight: 160 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@property --accent { syntax: '<color>'; inherits: true; initial-value: #c96a48; }
@property --c1 { syntax: '<color>'; inherits: true; initial-value: #5a2c1c; }
@property --c2 { syntax: '<color>'; inherits: true; initial-value: #2e1810; }
@property --c3 { syntax: '<color>'; inherits: true; initial-value: #140c09; }

:root {
  /* Brand: one fixed crimson for every control (like Spotify green / Apple Music red).
     Artwork colour (--accent, --c1..3) only tints backdrops, never controls. */
  --brand: oklch(0.69 0.135 42);           /* clay — the single identity colour */
  --brand-ink: oklch(0.8 0.1 48);          /* brand as text on dark: ≥ 9:1 */
  --on-brand: #1a0f0a;                     /* text/icons on brand fills: ≥ 7:1 */
  --brand-12: oklch(0.69 0.135 42 / .14);
  --brand-24: oklch(0.69 0.135 42 / .28);
  --accent: #c96a48;
  --c1: #5a2c1c; --c2: #2e1810; --c3: #140c09;

  --bg: #060608;
  --bg-raise: #0d0d11;
  --ink: #f5f5f7;
  --ink-2: rgb(245 245 247 / .64);   /* ≥ 7:1 on --bg */
  --ink-3: rgb(245 245 247 / .46);   /* ≥ 4.5:1 on --bg */
  --fg: 255 255 255;                 /* translucent chrome is drawn in this colour */
  --s1: rgb(var(--fg) / .06);
  --s2: rgb(var(--fg) / .1);
  --s3: rgb(var(--fg) / .16);
  --hair: rgb(var(--fg) / .08);
  --glass-fill: rgb(30 30 36 / .52);
  --sheet-fill: var(--sheet-fill);
  --sheet-solid: rgb(28 28 34);
  --bar-fill: var(--bar-fill);
  --toast-fill: var(--toast-fill);
  --field: rgb(0 0 0 / .32);
  --press: var(--press);
  --hover: var(--hover);
  --fallback: var(--fallback);
  --shadow-k: 1;                     /* scales drop-shadow darkness per theme */
  --wash-a: .78;
  --seg-on: rgb(255 255 255 / .16);
  --danger: #ff5c6c;
  --ok: #3ddc97;
  --warn: #ffb547;

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --ease: cubic-bezier(.22, 1, .36, 1);            /* ease-out-quint */
  /* Motion system — calm and fluid: nothing snaps. Micro feedback 260 ms, content reveals
     480 ms, pages/sheets/player ≈ 650 ms. --ease-soft is Apple's sheet curve. */
  --ease-soft: cubic-bezier(.32, .72, 0, 1);
  --d-micro: 260ms;
  --d-reveal: 480ms;
  --d-page: 650ms;
  --spring: cubic-bezier(.22, 1, .36, 1);           /* replaced by real spring linear() at runtime */
  --spring-dur: 680ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 64px;
  --mini-h: 58px;
  --dock-gap: 8px;
  --dock-b: max(10px, var(--safe-b));

  /* z-scale */
  --z-dock: 20; --z-player: 40; --z-car: 50; --z-banner: 60; --z-backdrop: 70; --z-sheet: 71; --z-toast: 90;

  --font: "Readex Pro", "SF Arabic", -apple-system, system-ui, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  color-scheme: dark;
  transition: --accent 1.4s var(--ease-soft), --c1 1.6s var(--ease-soft), --c2 1.6s var(--ease-soft), --c3 1.6s var(--ease-soft);
}

/* Light theme: same clay brand, darker clay for text (≥ 4.5:1 on the warm paper background). */
:root[data-theme="light"] {
  --bg: #f5f3f0; --bg-raise: #ffffff;
  --ink: #1d1b19; --ink-2: rgb(29 27 25 / .72); --ink-3: rgb(29 27 25 / .64);
  --brand-ink: oklch(0.5 0.12 40);
  --fg: 0 0 0;
  --glass-fill: rgb(252 251 249 / .62); --sheet-fill: rgb(249 248 246 / .88); --sheet-solid: rgb(249 248 246);
  --bar-fill: rgb(245 243 240 / .8); --toast-fill: rgb(252 251 249 / .9); --field: rgb(0 0 0 / .05);
  --press: #e8e4df; --hover: #eeebe7; --fallback: linear-gradient(145deg, #e7e3de, #d3cec8);
  --danger: #c4122a; --ok: #1a7a48; --warn: #9a5b00;
  --shadow-k: .3; --wash-a: .55; --seg-on: #fff;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f3f0; --bg-raise: #ffffff;
    --ink: #1d1b19; --ink-2: rgb(29 27 25 / .72); --ink-3: rgb(29 27 25 / .64);
    --brand-ink: oklch(0.5 0.12 40);
    --fg: 0 0 0;
    --glass-fill: rgb(252 251 249 / .62); --sheet-fill: rgb(249 248 246 / .88); --sheet-solid: rgb(249 248 246);
    --bar-fill: rgb(245 243 240 / .8); --toast-fill: rgb(252 251 249 / .9); --field: rgb(0 0 0 / .05);
    --press: #e8e4df; --hover: #eeebe7; --fallback: linear-gradient(145deg, #e7e3de, #d3cec8);
    --danger: #c4122a; --ok: #1a7a48; --warn: #9a5b00;
    --shadow-k: .3; --wash-a: .55; --seg-on: #fff;
    color-scheme: light;
  }
}
/* Song surfaces stay dark in every theme: colour there comes from the artwork. */
.np, .car {
  --bg: #060608; --ink: #f5f5f7; --ink-2: rgb(245 245 247 / .64); --ink-3: rgb(245 245 247 / .46);
  --brand-ink: oklch(0.8 0.1 48); --fg: 255 255 255;
  --s1: rgb(var(--fg) / .06); --s2: rgb(var(--fg) / .1); --s3: rgb(var(--fg) / .16); --hair: rgb(var(--fg) / .08);
  color: var(--ink); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: var(--font);
  font-size: 15px; line-height: 1.5; font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  font-synthesis: none;
  overflow: hidden; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .38; cursor: default; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; text-wrap: balance; }
img { display: block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.inline-ic { width: 18px; height: 18px; vertical-align: -4px; }

/* ── Liquid Glass material ─────────────────────────────────────────────── */
.glass {
  position: relative;
  background: var(--glass-fill);
  backdrop-filter: blur(30px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(30px) saturate(190%) brightness(1.08);
  border: .5px solid rgb(255 255 255 / .16);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .22),     /* top specular rim */
    inset 0 -1px 0 rgb(255 255 255 / .05),
    inset 0 0 18px rgb(255 255 255 / .05),    /* edge luminance */
    0 20px 44px -18px rgb(0 0 0 / calc(.85 * var(--shadow-k)));
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgb(var(--fg) / .12), transparent 38%, transparent 70%, rgb(var(--fg) / .05));
}

/* ── layout ────────────────────────────────────────────────────────────── */
#app { position: fixed; inset: 0; }
#views { position: absolute; inset: 0; }
#app { transition: transform var(--d-page) var(--ease-soft), border-radius var(--d-page) var(--ease-soft); transform-origin: 50% 40%; }
/* iOS depth: the page behind a sheet / Now Playing recedes. */
body.sheet-open #app { transform: scale(.965); border-radius: 18px; overflow: hidden; }
body.np-open #app { transform: scale(.94); border-radius: 22px; overflow: hidden; }
.view { position: absolute; inset: 0; overflow: hidden; isolation: isolate; background: var(--bg); }
.view.entering { z-index: 1; animation: tabin var(--d-reveal) var(--ease-soft) both; }
.view.leaving { z-index: 0; pointer-events: none; animation: tabout 320ms var(--ease-soft) both; }
@keyframes tabin { from { opacity: 0; transform: translate3d(0, 10px, 0); filter: blur(4px); } }
@keyframes tabout { to { opacity: 0; transform: translate3d(0, -4px, 0); } }
.page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: calc(var(--safe-t) + 20px) 18px calc(var(--tab-h) + var(--dock-b) + 32px);
  scrollbar-width: none; isolation: isolate; background: var(--bg); touch-action: pan-y;
}
.page::-webkit-scrollbar { display: none; }
body.has-mini .page { padding-bottom: calc(var(--tab-h) + var(--mini-h) + var(--dock-gap) + var(--dock-b) + 32px); }
.page > :not(.view-glow, .hero-wash, .artist-hero, .page-body) { max-width: 760px; margin-inline: auto; }
.page.pushed { padding-top: calc(var(--safe-t) + 58px); box-shadow: 0 0 50px rgb(0 0 0 / calc(.45 * var(--shadow-k))); }
.page.covered { visibility: hidden; }
.page.moving { will-change: transform, opacity; }
@keyframes itemin { from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.98); } }
.stagger > * { animation: itemin var(--d-reveal) var(--ease-soft) both; animation-delay: calc(var(--i, 0) * 35ms); }

/* Spotify-style colour wash behind the page header, from the playing artwork. */
.view-glow {
  position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 420px; pointer-events: none;
  background:
    radial-gradient(90% 70% at 85% 0%, oklch(0.69 0.135 42 / .2), transparent 70%);
  mask: linear-gradient(#000 40%, transparent);
  -webkit-mask: linear-gradient(#000 40%, transparent);
}

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.view-head h1 { font-size: 32px; font-weight: 700; line-height: 1.15; }
.view-sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 2px 10px; color: var(--ink-2); }
.section-head h2 { font-size: 20px; color: var(--ink); font-weight: 650; }
.muted { color: var(--ink-2); font-size: 14px; }
.center { text-align: center; justify-content: center; }

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform var(--d-micro) var(--ease-soft), background-color var(--d-micro), opacity var(--d-micro);
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn .ic { width: 20px; height: 20px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; height: 54px; font-size: 16px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-light { background: var(--ink); color: var(--bg); }
.btn-glass { background: var(--s2); }
.btn-ghost { color: var(--ink-2); }
.btn-danger { background: color-mix(in oklab, var(--danger) 16%, transparent); color: var(--danger); }
.link-btn { color: var(--brand-ink); font-weight: 600; font-size: 14px; text-decoration: none; padding: 6px 2px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
  transition: transform var(--d-micro) var(--ease-soft), background-color var(--d-micro), color var(--d-micro), opacity var(--d-micro);
}
.icon-btn:active { transform: scale(.88); }
.icon-btn.soft { background: var(--s2); }
.icon-btn.glass { background: rgb(var(--fg) / .1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.icon-btn.accent { background: var(--brand); color: var(--on-brand); }
.icon-btn.on { color: var(--brand-ink); }
.round-play {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 10px 28px -10px var(--brand);
  transition: transform var(--d-micro) var(--ease-soft), filter var(--d-micro);
}
.round-play .ic { width: 24px; height: 24px; margin-inline-end: -2px; }
.round-play:active { transform: scale(.92); }

/* heart */
.heart { color: var(--ink-3); position: relative; }
.heart .heart-f { position: absolute; color: var(--brand); opacity: 0; transform: scale(.4); transition: transform var(--d-reveal) var(--ease-soft), opacity var(--d-micro); }
.heart.on .heart-o { opacity: 0; }
.heart.on .heart-f { opacity: 1; transform: scale(1); }
.heart.pop .heart-f { animation: heartpop 520ms var(--ease-soft); }
.heart.big .ic { width: 28px; height: 28px; }
@keyframes heartpop { 0% { transform: scale(.4); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
.burst { position: fixed; z-index: var(--z-toast); pointer-events: none; }
.burst i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--brand); animation: burst 820ms var(--ease-soft) forwards; }
.burst i:nth-child(odd) { background: var(--brand-ink); }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ── search & chips ────────────────────────────────────────────────────── */
.search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px;
  background: var(--s1); border-radius: var(--r-md); color: var(--ink-3); margin-bottom: 18px;
  transition: background-color var(--d-micro), box-shadow var(--d-micro);
}
.search:focus-within { background: var(--s2); box-shadow: 0 0 0 1.5px var(--brand-24); }
.search .ic { width: 20px; height: 20px; }
.search-input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 16px; }
.search-input::placeholder { color: var(--ink-3); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--ink); }
.search-clear .ic { width: 14px; height: 14px; stroke-width: 2.6; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 12px; padding: 2px 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: var(--s2); color: var(--ink);
  transition: background-color var(--d-micro), color var(--d-micro), transform var(--d-micro) var(--ease-soft);
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); color: var(--bg); font-weight: 600; }

/* ── library home: quick tiles ─────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 26px; }
.tile {
  display: flex; align-items: center; gap: 10px; height: 56px; overflow: hidden;
  border-radius: var(--r-sm); background: var(--s1); text-align: start;
  transition: background-color var(--d-micro), transform var(--d-micro) var(--ease-soft);
}
.tile:active { transform: scale(.97); background: var(--s2); }
.tile-art { width: 56px; height: 56px; flex: none; }
.tile-art .art { border-radius: 0; }
.tile-ic { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; }
.tile-ic .ic { width: 24px; height: 24px; }
.tile-ic { background: var(--s2); color: var(--brand-ink); }
.tile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tile-text b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text small { font-size: 12px; color: var(--ink-2); }

/* ── shelves (horizontal art rows) ─────────────────────────────────────── */
.shelf { margin-bottom: 28px; }
.shelf-title { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.shelf-title h2 { font-size: 21px; font-weight: 650; }
.shelf-title .ic { width: 20px; height: 20px; color: var(--ink-3); stroke-width: 2.4; transition: transform var(--d-micro) var(--ease-soft); }
.shelf-title:active .ic { transform: translateX(-3px); }
.shelf-row {
  display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -18px; padding: 0 18px 4px;
  scroll-snap-type: x mandatory; scroll-padding-inline: 18px;
}
.shelf-row::-webkit-scrollbar { display: none; }
.tcard { flex: none; width: 150px; display: flex; flex-direction: column; text-align: start; scroll-snap-align: start; transition: transform var(--d-micro) var(--ease-soft); }
.tcard:active { transform: scale(.96); }
.tcard-art { position: relative; aspect-ratio: 1; margin-bottom: 8px; border-radius: var(--r-sm); box-shadow: 0 12px 28px -14px rgb(0 0 0 / calc(.9 * var(--shadow-k))); }
.tcard-art .art { border-radius: var(--r-sm); }
.tcard-title { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-badge { position: absolute; top: 8px; inset-inline-start: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tcard-badge .ic { width: 14px; height: 14px; }
.tcard-play {
  position: absolute; bottom: 8px; inset-inline-end: 8px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: var(--on-brand);
  box-shadow: 0 8px 18px -6px rgb(0 0 0 / calc(.7 * var(--shadow-k)));
  opacity: 0; transform: translateY(6px); transition: opacity var(--d-micro), transform var(--d-micro) var(--ease-soft);
}
.tcard-play .ic { width: 18px; height: 18px; }
.tcard.playing .tcard-play { opacity: 1; transform: none; }
@media (hover: hover) { .tcard:hover .tcard-play { opacity: 1; transform: none; } }

/* ── songs block ───────────────────────────────────────────────────────── */
.songs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.songs-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.songs-title h2 { font-size: 21px; font-weight: 650; }
.songs-actions { display: flex; align-items: center; gap: 10px; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); padding: 2px 0; }
.sort-btn .ic { width: 15px; height: 15px; }

/* ── list rows (Apple Music density) ───────────────────────────────────── */
.list-actions { display: flex; gap: 10px; margin: 4px 0 12px; }
.list-actions .btn { flex: 1; }
.list-actions.center { justify-content: center; align-items: center; }
.list-actions.center .btn { flex: 0 1 150px; }
.list { display: flex; flex-direction: column; }
.row {
  position: relative; overflow: hidden; margin: 0 -6px; border-radius: var(--r-sm); cursor: pointer;
  touch-action: pan-y; content-visibility: auto; contain-intrinsic-size: auto 64px;
}
.row-inner {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 6px; background: var(--bg); border-radius: inherit;
  transition: background-color var(--d-micro);
}
.row::after { content: ""; position: absolute; z-index: 2; bottom: 0; inset-inline-start: 72px; inset-inline-end: 6px; height: .5px; background: var(--hair); }
.row:last-child::after, .row.swiping::after { display: none; }
.row:active .row-inner, .row.pressed .row-inner { background: var(--press); }
@media (hover: hover) { .row:hover .row-inner { background: var(--hover); } }
.row-swipe {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  background: color-mix(in oklab, var(--brand) 35%, #0d0d10); color: #fff; font-size: 13px; font-weight: 600;
  opacity: 0; transition: background-color var(--d-micro);
}
.row-swipe span { flex: 1; text-align: center; opacity: 0; }
.row-swipe .ic { width: 24px; height: 24px; transition: transform var(--d-micro) var(--ease-soft); }
.row.swiping .row-swipe { opacity: 1; }
.row.armed .row-swipe { background: var(--brand); color: var(--on-brand); }
.row.armed .row-swipe .ic { transform: scale(1.18); }
.row-art { position: relative; width: 52px; height: 52px; flex: none; }
.art { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-xs); background: var(--s1); }
.art-fallback {
  display: grid; place-items: center; color: var(--ink-3);
  background: var(--fallback);
  box-shadow: inset 0 1px 0 rgb(var(--fg) / .06);
}
.art-fallback .ic { width: 40%; height: 40%; stroke-width: 1.6; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-size: 15.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.row.playing .row-title { color: var(--brand-ink); }
.row .icon-btn { width: 40px; height: 40px; color: var(--ink-3); }
.row .icon-btn .ic { width: 22px; height: 22px; }
.eq-bars { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 15px; border-radius: var(--r-xs); background: rgb(0 0 0 / .5); }
.eq-bars i { width: 3px; height: 17px; border-radius: 2px; background: #fff; transform-origin: bottom; animation: eqb .8s ease-in-out infinite alternate; }
.eq-bars i:nth-child(2) { animation-delay: -.3s; }
.eq-bars i:nth-child(3) { animation-delay: -.55s; }
.row.playing .eq-bars { display: flex; }
.np.paused ~ * .eq-bars i, body.is-paused .eq-bars i { animation-play-state: paused; }
@keyframes eqb { from { transform: scaleY(.22); } to { transform: scaleY(1); } }

/* ── empty states ──────────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 12px; color: var(--ink-2); }
.empty h3 { color: var(--ink); font-size: 22px; font-weight: 650; }
.empty p { max-width: 320px; font-size: 14.5px; }
.empty.small { padding: 32px 12px; }
.empty-ic { width: 40px; height: 40px; color: var(--ink-3); }
.hero-empty { padding-top: 24px; gap: 14px; }
.hero-empty .btn { margin-top: 8px; }
.empty-stack { position: relative; width: 210px; height: 190px; margin-bottom: 10px; }
.empty-stack i {
  position: absolute; top: 20px; left: 50%; width: 140px; height: 140px; margin-left: -70px; border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / calc(.9 * var(--shadow-k))), inset 0 1px 0 rgb(var(--fg) / .25);
}
.empty-stack i:nth-child(1) { background: linear-gradient(140deg, #3a3a42, #17171c); transform: translateX(-46px) rotate(-12deg) scale(.86); }
.empty-stack i:nth-child(3) { background: linear-gradient(140deg, #2c2c33, #121216); transform: translateX(46px) rotate(12deg) scale(.86); }
.empty-stack i:nth-child(2) {
  z-index: 1; background: linear-gradient(150deg, oklch(0.72 0.13 44), oklch(0.36 0.08 38));
  display: grid; place-items: center;
  animation: float 5s ease-in-out infinite;
}
.empty-stack i:nth-child(2)::after { content: ""; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle, #fff 0 8px, rgb(var(--fg) / .18) 9px 100%); box-shadow: 0 0 0 10px rgb(var(--fg) / .06); }
@keyframes float { 50% { transform: translateY(-8px); } }
.empty-hint { display: flex; align-items: center; gap: 8px; max-width: 320px; margin-top: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--s1); font-size: 13px; color: var(--ink-2); text-align: start; }
.empty-hint .ic { width: 18px; height: 18px; color: var(--brand-ink); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--s1); font-size: 13.5px; color: var(--ink-2); margin: 12px 0; }
.notice .ic { width: 20px; height: 20px; color: var(--brand-ink); margin-top: 1px; }
.notice span { flex: 1; }
.notice.warn { background: color-mix(in oklab, var(--warn) 10%, transparent); }
.notice.warn .ic { color: var(--warn); }
.notice.error { background: color-mix(in oklab, var(--danger) 12%, transparent); }
.notice.error .ic { color: var(--danger); }

/* ── progress ──────────────────────────────────────────────────────────── */
.progress { height: 5px; border-radius: 5px; background: var(--s2); overflow: hidden; position: relative; }
.progress.big { height: 8px; margin: 10px 0 4px; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: var(--brand); }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.progress-pct { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.indeterminate .progress-fill { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
[dir="rtl"] .indeterminate .progress-fill { animation-direction: reverse; }
.import-card { padding: 14px; border-radius: var(--r-md); background: var(--brand-12); margin-bottom: 18px; }
.import-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13.5px; }
.import-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.import-count { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--brand-24); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── playlists ─────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; }
.pl-card { display: flex; flex-direction: column; gap: 1px; text-align: start; transition: transform var(--d-micro) var(--ease-soft); }
.pl-card:active { transform: scale(.96); }
.mosaic { aspect-ratio: 1; width: 100%; border-radius: var(--r-md); overflow: hidden; display: grid; gap: 1px; background: var(--s1); margin-bottom: 8px; box-shadow: 0 16px 34px -18px rgb(0 0 0 / calc(.95 * var(--shadow-k))); }
.mosaic .art { border-radius: 0; }
.mosaic.n2, .mosaic.n3, .mosaic.n4 { grid-template-columns: 1fr 1fr; }
.mosaic.n2 .art { grid-row: span 2; }
.mosaic.n3 .art:first-child { grid-row: span 2; }
.fav-art { display: grid; place-items: center; background: linear-gradient(150deg, oklch(0.72 0.13 44), oklch(0.36 0.08 38)); }
.fav-ic { width: 42%; height: 42%; color: var(--on-brand); }
.add-art { display: grid; place-items: center; border: 1.5px dashed rgb(var(--fg) / .22); background: transparent; color: var(--ink-2); box-shadow: none; }
.add-art .ic { width: 34px; height: 34px; }
.pl-name { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-count { font-size: 12.5px; color: var(--ink-2); }

/* playlist detail — art-tinted page (Apple Music iOS 26 album page) */
.hero-wash {
  position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 720px; pointer-events: none;
  background: linear-gradient(180deg, rgb(var(--hero) / var(--wash-a)) 0%, rgb(var(--hero) / calc(var(--wash-a) * .45)) 45%, transparent 100%);
}
.album-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.album-art { width: min(64vw, 260px); margin: 4px auto 18px; }
.album-art > .art, .album-art > .mosaic { border-radius: var(--r-lg); box-shadow: 0 34px 70px -24px rgb(0 0 0 / calc(.9 * var(--shadow-k))); margin: 0; }
.album-art .mosaic.big { width: 100%; }
.album-art .mosaic .art { border-radius: 0; box-shadow: none; }
.album-hero h1 { font-size: 26px; font-weight: 700; line-height: 1.25; }
.album-artist { color: var(--brand-ink); font-size: 18px; font-weight: 500; margin-top: 2px; }
.album-hero .list-actions { margin-top: 18px; width: 100%; }
.page-tools { position: absolute; z-index: 2; top: calc(var(--safe-t) + 6px); inset-inline-end: 12px; }

.picker { display: flex; flex-direction: column; min-height: 0; }
.pick-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-radius: var(--r-sm); text-align: start; }
.pick-row .art { width: 44px; height: 44px; flex: none; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--s3); display: grid; place-items: center; flex: none; transition: background-color var(--d-micro), border-color var(--d-micro), transform var(--d-micro) var(--ease-soft); }
.check .ic { width: 16px; height: 16px; stroke-width: 3; opacity: 0; }
.pick-row[aria-pressed="true"] .check { background: var(--brand); border-color: var(--brand); }
.pick-row[aria-pressed="true"] .check .ic { opacity: 1; color: var(--on-brand); }

/* ── downloads ─────────────────────────────────────────────────────────── */
.dl-card { padding: 16px; border-radius: var(--r-lg); background: var(--s1); }
.url-row { display: flex; gap: 8px; align-items: center; }
.url-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px; border-radius: var(--r-md); background: var(--field); color: var(--ink-3); transition: box-shadow var(--d-micro); }
.url-wrap:focus-within { box-shadow: 0 0 0 1.5px var(--brand); }
.url-wrap .ic { width: 20px; height: 20px; }
.url-field { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: none !important; padding: 0 !important; box-shadow: none !important; text-align: left; }
.svc-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.svc-badge .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.svc-badge.ok { background: color-mix(in oklab, var(--ok) 16%, transparent); color: var(--ok); }
.svc-badge.bad { background: color-mix(in oklab, var(--danger) 14%, transparent); color: var(--danger); }
.dl-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 18px 2px 8px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--field); box-shadow: inset 0 0 0 1.5px var(--hair); text-align: start; transition: box-shadow var(--d-micro), background-color var(--d-micro), transform var(--d-micro) var(--ease-soft); }
.seg:active { transform: scale(.97); }
.seg span { display: flex; flex-direction: column; }
.seg b { font-size: 15px; font-weight: 600; }
.seg small { font-size: 12px; color: var(--ink-2); }
.seg.on { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-12); }
.seg.on .ic { color: var(--brand-ink); }
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q-opt { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 4px; border-radius: var(--r-sm); background: var(--field); box-shadow: inset 0 0 0 1.5px var(--hair); transition: box-shadow var(--d-micro), background-color var(--d-micro), transform var(--d-micro) var(--ease-soft); }
.q-opt:active { transform: scale(.95); }
.q-opt b { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.q-opt small { font-size: 12px; color: var(--ink-2); }
.q-opt.on { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-12); }
.dl-card .btn-block { margin-top: 18px; }
.dl-card .notice { margin-bottom: 0; background: rgb(0 0 0 / .25); }
.jobs { display: flex; flex-direction: column; gap: 4px; }
.job { display: flex; align-items: center; gap: 12px; padding: 10px 4px; animation: itemin var(--d-reveal) var(--ease-soft); }
.job + .job { border-top: .5px solid var(--hair); }
.job-art { width: 52px; height: 52px; flex: none; }
.job-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.job-title { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.job-btns { display: flex; }
.job[data-status="done"] .progress-fill { background: var(--ok); }
.job[data-status="error"] .job-meta, .job[data-status="cancelled"] .job-meta { color: var(--danger); }
.job[data-status="error"] .progress-fill { background: var(--danger); }

/* ── settings (iOS grouped list) ───────────────────────────────────────── */
.card { border-radius: var(--r-lg); background: var(--s1); margin-bottom: 16px; overflow: hidden; }
.card-title { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; font-weight: 650; font-size: 16px; }
.card-title .ic { width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: var(--brand); color: var(--on-brand); }
.danger-zone .card-title .ic { background: var(--danger); }
.card-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.storage-nums b { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.setting-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setting-line > span:first-child { display: flex; flex-direction: column; }
.setting-line b { font-weight: 550; }
.setting-line small { color: var(--ink-2); font-size: 12.5px; }
.pill { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--s2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: color-mix(in oklab, var(--ok) 16%, transparent); color: var(--ok); }
.row-btns { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.switch { width: 51px; height: 31px; border-radius: 99px; background: var(--s3); position: relative; flex: none; transition: background-color var(--d-micro); }
.switch i { position: absolute; top: 2px; right: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px var(--field); transition: transform var(--d-reveal) var(--ease-soft); }
.switch.on { background: var(--brand); }
.switch.on i { transform: translateX(-20px); }
.field { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-sm); background: var(--field); border: 0; box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink); font: inherit; font-size: 16px; outline: 0; transition: box-shadow var(--d-micro); }
.field:focus { box-shadow: inset 0 0 0 1.5px var(--brand); }
.field[dir="ltr"] { text-align: left; }
.field::placeholder { color: var(--ink-3); }
.field-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }

/* ── floating dock: mini player + tab bar (iOS 26) ─────────────────────── */
.dock {
  position: absolute; z-index: var(--z-dock); left: 0; right: 0; bottom: var(--dock-b);
  display: flex; flex-direction: column; gap: var(--dock-gap);
  padding: 0 12px; max-width: 560px; margin: 0 auto; pointer-events: none;
}
.dock > * { pointer-events: auto; }
.dock-row { display: flex; align-items: center; gap: 10px; }
.tabbar {
  flex: 1; display: grid; grid-template-columns: repeat(3, 1fr);
  height: var(--tab-h); padding: 6px; border-radius: 32px;
  --tab-index: 0;
}
.tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--ink-2); border-radius: 26px; transition: color var(--d-micro); }
.tab .ic { width: 25px; height: 25px; transition: transform var(--d-micro) var(--ease-soft); }
.tab.active { color: var(--brand-ink); }
.tab:active .ic { transform: scale(.86); }
.tab-indicator {
  position: absolute; top: 6px; bottom: 6px; width: calc((100% - 12px) / 3);
  inset-inline-start: 6px; border-radius: 26px; background: rgb(var(--fg) / .11);
  box-shadow: inset 0 1px 0 rgb(var(--fg) / .12);
  transform: translateX(calc(var(--tab-index) * -100%));
  transition: transform var(--spring-dur) var(--spring), opacity var(--d-micro) var(--ease-soft);
}
.tabbar.off .tab-indicator { opacity: 0; }
.search-fab { flex: none; width: var(--tab-h); height: var(--tab-h); border-radius: 50%; display: grid; place-items: center; }
.search-fab .ic { width: 26px; height: 26px; }
.search-fab.active { color: var(--brand-ink); }
.tab-badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 600; display: grid; place-items: center; }

.mini {
  height: var(--mini-h); display: flex; align-items: center; gap: 2px; padding: 0 6px 0 7px;
  border-radius: 29px; overflow: hidden;
  transition: transform var(--spring-dur) var(--spring), opacity var(--d-micro);
}
.mini.hidden { transform: translateY(calc(100% + var(--tab-h))); opacity: 0; pointer-events: none; position: absolute; }
.mini-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; text-align: start; touch-action: pan-y; }
.mini-art { width: 44px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px -4px rgb(0 0 0 / calc(.7 * var(--shadow-k))); }
.mini-art .art { border-radius: 8px; }
.mini-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mini-title { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .icon-btn { width: 42px; height: 42px; }
.mini .icon-btn .ic { width: 25px; height: 25px; }
.mini-progress { position: absolute; left: 24px; right: 24px; bottom: 0; height: 2px; border-radius: 2px; background: rgb(var(--fg) / .1); overflow: hidden; }
#mini-bar { height: 100%; width: 0; background: var(--ink); }

/* ── now playing ───────────────────────────────────────────────────────── */
.np { position: fixed; inset: 0; z-index: var(--z-player); background: #000; overflow: hidden; will-change: transform; }
.np.dragging { border-radius: 36px 36px 0 0; }

/* living mesh backdrop (palette from artwork, slowly drifting) */
.np-bg { position: absolute; inset: 0; overflow: hidden; background: var(--c3); }
.np-bg i { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; opacity: .95; }
.np-bg .m1 { width: 110vmax; height: 110vmax; top: -45vmax; right: -40vmax; background: radial-gradient(circle, var(--c1), transparent 65%); animation: mesh1 22s ease-in-out infinite alternate; }
.np-bg .m2 { width: 95vmax; height: 95vmax; bottom: -40vmax; left: -35vmax; background: radial-gradient(circle, var(--c2), transparent 65%); animation: mesh2 27s ease-in-out infinite alternate; }
.np-bg .m3 { width: 70vmax; height: 70vmax; top: 25%; left: 20%; background: radial-gradient(circle, color-mix(in oklab, var(--c1), var(--c2)), transparent 65%); animation: mesh3 31s ease-in-out infinite alternate; }
.np-bg .m4 { inset: 0; border-radius: 0; filter: none; background: linear-gradient(180deg, rgb(0 0 0 / .05) 0%, rgb(0 0 0 / .18) 55%, rgb(0 0 0 / .5) 100%); animation: none; }
.np.paused .np-bg i { animation-play-state: paused; }
@keyframes mesh1 { to { transform: translate3d(-18vmax, 22vmax, 0) scale(1.15); } }
@keyframes mesh2 { to { transform: translate3d(20vmax, -14vmax, 0) scale(.9); } }
@keyframes mesh3 { to { transform: translate3d(-12vmax, -20vmax, 0) scale(1.25); } }

.np-inner {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 4px) 24px calc(var(--safe-b) + 12px);
  max-width: 540px; margin: 0 auto;
}
.np-drag { touch-action: none; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.np-head { position: relative; display: flex; align-items: center; justify-content: space-between; height: 52px; padding-top: 6px; }
.np-head::before { content: ""; position: absolute; top: 4px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: rgb(255 255 255 / .35); }
.np-head .icon-btn { width: 38px; height: 38px; background: rgb(255 255 255 / .12); }
.np-head .icon-btn .ic { width: 22px; height: 22px; }
.np-head-title { display: flex; flex-direction: column; align-items: center; line-height: 1.25; min-width: 0; }
.np-head-title small { font-size: 12px; color: rgb(255 255 255 / .62); }
.np-head-title strong { font-size: 13.5px; font-weight: 600; max-width: 56vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-stage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 12px 0; }
.np-art-wrap { position: relative; width: min(86vw, 46vh, 420px); aspect-ratio: 1; transition: transform 700ms var(--ease-soft); touch-action: none; }
.np.paused .np-art-wrap { transform: scale(.82); }
.np-art-slot { width: 100%; height: 100%; }
.np-art-slot .art { border-radius: 14px; box-shadow: 0 34px 70px -18px rgb(0 0 0 / .75); transition: box-shadow var(--d-page) var(--ease-soft); }
.np.paused .np-art-slot .art { box-shadow: 0 16px 30px -18px rgb(0 0 0 / .6); }
.np-art-slot { transition: opacity var(--d-page) var(--ease-soft), transform var(--d-page) var(--ease-soft); }
.np-art-slot.swap .art { animation: artin 560ms var(--ease-soft); }
@keyframes artin { from { opacity: 0; transform: scale(.96); filter: blur(6px); } }
.np-titles.swap { animation: titlein var(--d-reveal) var(--ease-soft); }
@keyframes titlein { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
#np-video { display: none; width: 100%; height: 100%; object-fit: contain; border-radius: 14px; background: #000; box-shadow: 0 34px 70px -18px rgb(0 0 0 / .8); }
.np-art-wrap.show-video { width: min(94vw, 540px); aspect-ratio: 16 / 9; transform: none !important; }
.np-art-wrap.show-video .np-art-slot { display: none; }
.np-art-wrap.show-video #np-video { display: block; }
.np-fs { position: absolute; bottom: 10px; left: 10px; width: 38px; height: 38px; }
.np-fs .ic { width: 20px; height: 20px; }

.np-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.np-titles { flex: 1; min-width: 0; }
.np-titles h2 { font-size: 21px; font-weight: 650; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-titles p { color: rgb(255 255 255 / .66); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta .heart { color: rgb(255 255 255 / .7); background: rgb(255 255 255 / .12); width: 38px; height: 38px; }
.np-meta .heart .ic { width: 22px; height: 22px; }

/* Apple-style scrubber: thin bar that thickens while dragging, no thumb */
.scrubber { padding: 16px 0 6px; cursor: pointer; touch-action: none; }
.scrub-track { position: relative; height: 12px; border-radius: 7px; background: rgb(255 255 255 / .22); overflow: hidden; transform: scaleY(.58); transition: transform var(--d-micro) var(--ease-soft); }
.scrub-fill { position: absolute; inset-block: 0; left: 0; width: 0; background: rgb(255 255 255 / .82); }
.scrub-thumb { display: none; }
.scrubber.active .scrub-track { transform: scale(1.03, 1); }
.scrubber.active .scrub-fill { background: #fff; }
.np-times { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: rgb(255 255 255 / .6); font-variant-numeric: tabular-nums; }

.np-controls { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.np-controls .icon-btn { color: #fff; }
.ctl-sm { color: rgb(255 255 255 / .6) !important; position: relative; }
.ctl-sm .ic { width: 22px; height: 22px; }
.ctl-sm.on { color: #fff !important; background: rgb(255 255 255 / .16); }
.ctl-md { width: 64px; height: 64px; }
.ctl-md .ic { width: 38px; height: 38px; }
.ctl-play { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform var(--d-micro) var(--ease-soft), background-color var(--d-micro); }
.ctl-play .ic { width: 52px; height: 52px; }
.ctl-play:active { transform: scale(.86); background: rgb(255 255 255 / .1); }

.np-viz { width: 100%; height: 34px; margin: 2px 0 6px; opacity: .55; }
@media (max-height: 720px) { .np-viz { display: none; } }

.profiles { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px -24px 0; padding: 4px 24px 8px; scroll-snap-type: x proximity; }
.profiles::-webkit-scrollbar { display: none; }
.profile {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 999px; font-size: 13.5px; font-weight: 550; scroll-snap-align: center;
  background: rgb(255 255 255 / .1); color: rgb(255 255 255 / .86);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1);
  transition: background-color var(--d-micro), color var(--d-micro), transform var(--d-micro) var(--ease-soft);
}
.profile .ic { width: 17px; height: 17px; }
.profile:active { transform: scale(.94); }
.profile.on { background: #fff; color: #0b0b0f; }
.profile.tarsh .ic { color: var(--brand-ink); }
.profile.tarsh.on { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 26px -8px var(--brand); }
.profile.tarsh.on .ic { color: var(--on-brand); }
.profile.tarsh.on .ic { color: #fff; }

.np-tools { display: flex; justify-content: space-around; margin-top: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 4px; border-radius: var(--r-md); font-size: 12px; color: rgb(255 255 255 / .62); font-variant-numeric: tabular-nums; transition: color var(--d-micro), transform var(--d-micro) var(--ease-soft); }
.tool .ic { width: 22px; height: 22px; }
.tool:active { transform: scale(.9); }
.tool.on { color: #fff; }

/* ── car mode ──────────────────────────────────────────────────────────── */
.car {
  position: fixed; inset: 0; z-index: var(--z-car); background: #000; color: #fff;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(var(--safe-t) + 10px) 18px calc(var(--safe-b) + 14px);
  opacity: 0; transform: scale(1.03); transition: opacity var(--d-micro), transform var(--d-page) var(--ease-soft);
  overflow: hidden;
}
.car::before {
  content: ""; position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(60% 40% at 50% 25%, color-mix(in oklab, var(--c1) 80%, transparent), transparent 70%),
              radial-gradient(50% 40% at 80% 90%, color-mix(in oklab, var(--c2) 60%, transparent), transparent 70%);
}
.car > * { position: relative; }
.car.show { opacity: 1; transform: none; }
.car-head { display: flex; align-items: center; justify-content: space-between; }
.car-x { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .12); }
.car-x .ic { width: 28px; height: 28px; }
.car-clock { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.car-profile { min-width: 58px; padding: 9px 16px; border-radius: 999px; background: rgb(255 255 255 / .12); font-weight: 600; font-size: 14px; text-align: center; }
.car-track { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; touch-action: pan-y; will-change: transform; }
.car-art { width: min(54vw, 30vh, 300px); aspect-ratio: 1; }
.car-art .art { border-radius: 22px; box-shadow: 0 34px 80px -20px rgb(0 0 0 / .9); }
.car-titles { text-align: center; max-width: 100%; }
.car-titles h2 { font-size: clamp(26px, 7.5vw, 40px); font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.car-titles p { font-size: 19px; color: rgb(255 255 255 / .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-viz { width: 100%; height: 34px; flex: none; opacity: .6; }
.car-progress { height: 6px; border-radius: 3px; background: rgb(255 255 255 / .18); overflow: hidden; flex: none; }
#car-bar { height: 100%; width: 0; background: #fff; }
.car-controls { display: flex; align-items: center; gap: 12px; flex: none; }
.car-btn { flex: 1; height: 100px; border-radius: 30px; display: grid; place-items: center; background: rgb(255 255 255 / .1); transition: transform var(--d-micro) var(--ease-soft), background-color var(--d-micro); }
.car-btn .ic { width: 50px; height: 50px; }
.car-btn.main { flex: 1.3; background: #fff; color: #000; }
.car-btn.main .ic { width: 56px; height: 56px; }
.car-btn:active { transform: scale(.93); }
.car-tarsh {
  flex: none; height: 108px; border-radius: 32px; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .12);
  transition: transform var(--d-micro) var(--ease-soft), background var(--d-reveal), box-shadow var(--d-reveal);
}
.car-tarsh .ic { width: 44px; height: 44px; color: var(--brand-ink); }
.tarsh-label { font-size: 44px; font-weight: 700; }
.tarsh-state { font-size: 15px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: rgb(0 0 0 / .35); }
.car-tarsh:active { transform: scale(.97); }
.car-tarsh.on { background: var(--brand); color: var(--on-brand); box-shadow: 0 0 70px -12px var(--brand), inset 0 1px 0 rgb(255 255 255 / .35); }
.car-tarsh.on .tarsh-state { background: rgb(0 0 0 / .14); }
.car-tarsh.on .ic { color: var(--on-brand); }
.car-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: none; }
.car-quick button { height: 58px; border-radius: 20px; background: rgb(255 255 255 / .08); font-weight: 600; font-size: 15px; transition: background-color var(--d-micro), color var(--d-micro), transform var(--d-micro) var(--ease-soft); }
.car-quick button:active { transform: scale(.95); }
.car-quick button.on { background: #fff; color: #000; }
.car-hint { text-align: center; font-size: 13px; color: rgb(255 255 255 / .46); flex: none; }
@media (max-height: 760px) { .car-viz, .car-hint { display: none; } .car-btn { height: 86px; } .car-tarsh { height: 90px; } }
@media (max-height: 650px) { .car-art { display: none; } }

/* ── clipboard prompts ─────────────────────────────────────────────────── */
.clip-banner {
  position: fixed; z-index: var(--z-banner); top: calc(var(--safe-t) + 10px); left: 12px; right: 12px;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  padding: 14px; border-radius: 26px;
  background: var(--sheet-fill);
  backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%);
  box-shadow: inset 0 1px 0 rgb(var(--fg) / .2), 0 24px 60px -18px rgb(0 0 0 / calc(.9 * var(--shadow-k)));
  transform: translateY(calc(-100% - 40px)); transition: transform var(--spring-dur) var(--spring);
}
.clip-banner.show { transform: none; }
.clip-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); }
.clip-text { min-width: 0; display: flex; flex-direction: column; }
.clip-text b { font-size: 15px; font-weight: 600; }
.clip-text small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.clip-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.clip-actions .btn-primary { flex: 1; }
.clip-pill {
  position: fixed; z-index: var(--z-banner); bottom: calc(var(--tab-h) + var(--dock-b) + 14px); left: 50%;
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--toast-fill); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgb(var(--fg) / .16), 0 12px 30px -10px rgb(0 0 0 / calc(.8 * var(--shadow-k)));
  opacity: 0; transform: translate(-50%, 24px) scale(.94); transition: transform var(--spring-dur) var(--spring), opacity var(--d-micro);
}
body.has-mini .clip-pill { bottom: calc(var(--tab-h) + var(--mini-h) + var(--dock-gap) + var(--dock-b) + 12px); }
.clip-pill.show { opacity: 1; transform: translate(-50%, 0); }
.clip-pill-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: 14px; }
.clip-pill-btn .ic { width: 18px; height: 18px; }
.clip-pill-x { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink-2); }
.clip-pill-x .ic { width: 18px; height: 18px; }

/* ── sheets ────────────────────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: var(--z-backdrop); background: rgb(0 0 0 / .5); opacity: 0; transition: opacity var(--d-reveal); }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; z-index: var(--z-sheet); left: 8px; right: 8px; bottom: max(8px, var(--safe-b)); margin: 0 auto; max-width: 540px;
  max-height: calc(100% - var(--safe-t) - 48px);
  display: flex; flex-direction: column; border-radius: 34px;
  background: var(--sheet-fill);
  backdrop-filter: blur(40px) saturate(190%); -webkit-backdrop-filter: blur(40px) saturate(190%);
  box-shadow: inset 0 1px 0 rgb(var(--fg) / .16), 0 -10px 60px -20px rgb(0 0 0 / calc(.8 * var(--shadow-k)));
  transform: translateY(calc(100% + 40px)); transition: transform var(--spring-dur) var(--spring);
}
.sheet.show { transform: none; }
.sheet.dragging { transition: none; }
.sheet.tall { height: 84%; }
.sheet-head { flex: none; padding: 8px 20px 4px; touch-action: none; cursor: grab; }
.grip { width: 36px; height: 5px; border-radius: 3px; background: rgb(var(--fg) / .28); margin: 0 auto 10px; }
.sheet-title { font-size: 17px; font-weight: 650; text-align: center; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 14px 16px; }
.sheet-track { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; margin-bottom: 6px; border-bottom: .5px solid var(--hair); }
.sheet-track .art { width: 58px; height: 58px; flex: none; border-radius: 8px; }
.action-list { display: flex; flex-direction: column; gap: 10px; }
.action-group { border-radius: 18px; background: rgb(var(--fg) / .07); overflow: hidden; }
.action { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 8px 16px; text-align: start; transition: background-color var(--d-micro); }
.action + .action { border-top: .5px solid var(--hair); }
.action:active { background: var(--s2); }
.action .ic { width: 22px; height: 22px; color: var(--ink); margin-inline-start: auto; }
.action .action-text { flex: 1; }
.action-text { display: flex; flex-direction: column; font-size: 15.5px; font-weight: 500; line-height: 1.35; }
.action-text small { font-size: 12.5px; color: var(--ink-2); font-weight: 400; }
.action.danger { color: var(--danger); }
.action.danger .ic { color: var(--danger); }
.action.accent { color: var(--brand-ink); }
.action.accent .ic { color: var(--brand-ink); }
.dialog { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.dialog-msg { font-size: 17px; font-weight: 650; text-align: center; }
.dialog-detail { color: var(--ink-2); font-size: 14px; text-align: center; }
.dialog-actions { display: flex; flex-direction: column; gap: 8px; }
.dialog-actions .btn { width: 100%; height: 52px; }
.dialog-actions.sticky { position: sticky; bottom: -16px; padding: 12px 0 16px; background: linear-gradient(transparent, var(--sheet-solid) 30%); }
.bounce-head { display: flex; align-items: center; gap: 12px; }
.bounce-head .art { width: 60px; height: 60px; flex: none; }
.bounce .progress { height: 8px; }
.bounce .progress-row .dialog-detail { text-align: start; }
.bounce.error .dialog-detail { color: var(--danger); }
.editor { display: flex; flex-direction: column; gap: 14px; }
.edit-art-btn { position: relative; width: 150px; margin: 4px auto; border-radius: 16px; overflow: hidden; }
.edit-art { width: 150px; height: 150px; }
.edit-art .art { border-radius: 0; }
.edit-art-hint { position: absolute; inset-inline: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-size: 13px; font-weight: 600; background: rgb(0 0 0 / .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.edit-art-hint .ic { width: 16px; height: 16px; }

.eq { display: flex; flex-direction: column; gap: 4px; }
.eq > .muted { font-size: 13px; margin-bottom: 8px; }
.eq-row { display: grid; grid-template-columns: 56px 1fr 46px; align-items: center; gap: 10px; min-height: 40px; }
.eq-hz { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.eq-val { font-size: 13px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.eq-sep { height: .5px; background: var(--hair); margin: 6px 0; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: var(--s3); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: var(--s3); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10.5px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / calc(.45 * var(--shadow-k))); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; }

.queue { display: flex; flex-direction: column; }
.q-now small, .queue .section-head small { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.queue .section-head { margin: 18px 0 6px; }
.q-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.q-row .art { width: 46px; height: 46px; flex: none; }
.q-row.current { padding: 8px; margin-top: 6px; border-radius: var(--r-md); background: var(--brand-12); }
.q-row.current .row-title { color: var(--brand-ink); }
.q-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: start; }
.queue .muted.center { padding: 20px 0; }

/* ── toasts (iOS HUD style) ────────────────────────────────────────────── */
#toast-host { position: fixed; z-index: var(--z-toast); left: 0; right: 0; bottom: calc(var(--tab-h) + var(--dock-b) + 16px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
body.has-mini #toast-host { bottom: calc(var(--tab-h) + var(--mini-h) + var(--dock-gap) + var(--dock-b) + 14px); }
body.np-open #toast-host, body.car-open #toast-host { bottom: calc(var(--safe-b) + 24px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 460px;
  padding: 11px 16px; border-radius: 22px; font-size: 14px; font-weight: 500;
  background: var(--toast-fill); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(var(--fg) / .14), 0 16px 40px -14px rgb(0 0 0 / calc(.9 * var(--shadow-k)));
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity var(--d-micro), transform var(--d-reveal) var(--ease-soft);
}
.toast.show { opacity: 1; transform: none; }
.toast.error { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger) 50%, transparent), 0 16px 40px -14px rgb(0 0 0 / calc(.9 * var(--shadow-k))); }
.toast.ok { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ok) 45%, transparent), 0 16px 40px -14px rgb(0 0 0 / calc(.9 * var(--shadow-k))); }
.toast-act { color: var(--brand-ink); font-weight: 650; padding: 2px 4px; white-space: nowrap; }

/* ── larger screens ────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .view { padding-inline: 40px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tcard { width: 176px; }
  .chips, .shelf-row { margin-inline: -40px; padding-inline: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  /* No movement: everything becomes a plain cross-fade. */
  *, *::before, *::after { animation-name: rm-fade !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-property: opacity, background-color, color, box-shadow !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  body.sheet-open #app, body.np-open #app { transform: none; }
  .sheet:not(.show), .ctx:not(.show) > * { opacity: 0; }
}
@keyframes rm-fade { from { opacity: 0; } }

/* favourite marker in rows (Apple Music shows a small badge, not a toggle per row) */
.row-fav { color: var(--brand-ink); display: grid; place-items: center; width: 20px; }
.row-fav .ic { width: 15px; height: 15px; }
.clip-pill-btn span { white-space: nowrap; }
body.np-open .clip-pill, body.car-open .clip-pill { display: none; }

/* rows on tinted pages (playlist detail) sit on the wash, not on --bg */
.tinted .row-inner { background: transparent; }
.tinted .row.swiping .row-inner { background: var(--bg); }

/* compact navigation bar: back button on pushed pages; glass + title once the large title scrolls away */
.navbar {
  position: absolute; z-index: calc(var(--z-dock) - 1); top: 0; left: 0; right: 0;
  height: calc(var(--safe-t) + 50px); padding-top: var(--safe-t);
  display: grid; place-items: center; pointer-events: none;
}
.navbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bar-fill);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: .5px solid var(--hair);
  opacity: 0; transition: opacity var(--d-reveal) var(--ease-soft);
}
.nav-title { font-size: 16px; font-weight: 600; max-width: 62vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(6px); transition: opacity var(--d-reveal) var(--ease-soft), transform var(--d-reveal) var(--ease-soft); }
.navbar.show::before, .navbar.show .nav-title { opacity: 1; transform: none; }
.nav-back {
  position: absolute; top: calc(var(--safe-t) + 5px); inset-inline-start: 10px; width: 40px; height: 40px;
  pointer-events: auto; background: var(--glass-fill); color: var(--ink);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 6px 18px -8px rgb(0 0 0 / calc(.6 * var(--shadow-k)));
}
.nav-back .ic { width: 22px; height: 22px; stroke-width: 2.3; }
.navbar.show .nav-back { background: transparent; box-shadow: none; }
body.np-open .navbar, body.car-open .navbar { opacity: 0; }
.row.armed .row-swipe span { opacity: 1; }
.np-viz { transition: opacity var(--d-reveal) var(--ease-soft); } .np.paused .np-viz { opacity: 0; }

/* ════════════════════════════ Track A: navigation, home, library, search ════════════════════════════ */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-title { font-size: 21px; font-weight: 650; margin: 26px 2px 10px; }
.pad { padding: 24px 0; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ic { width: 19px; height: 19px; }
.row-chev { width: 18px; height: 18px; color: var(--ink-3); stroke-width: 2.2; flex: none; }
.row-num { width: 28px; flex: none; text-align: center; font-size: 15px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-num + .row-text { padding-block: 9px; }
/* Instant press-down, soft release: the press transition is short only while held. */
:is(.btn, .icon-btn, .chip, .tile, .tcard, .acard, .pl-card, .tool, .cat, .mix, .artist-cell, .item-row, .browse-tile, .recent-q, .replay, .avatar-btn, .seg-opt):active { transition-duration: 110ms; }

/* ── skeleton (before the library has loaded) ─────────────────────────── */
.skel-page { padding: calc(var(--safe-t) + 26px) 18px 0; display: flex; flex-direction: column; gap: 16px; }
.skel-page i, .sk-grid i, .sk-row i { display: block; border-radius: var(--r-sm); background: var(--s1); animation: skel 1.6s ease-in-out infinite; }
.sk-title { width: 46%; height: 34px; }
.sk-h { width: 34%; height: 22px; margin-top: 10px; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sk-grid i { height: 56px; }
.sk-row { display: flex; gap: 14px; }
.sk-row i { width: 150px; height: 150px; flex: none; }
@keyframes skel { 50% { opacity: .45; } }

/* ── home ─────────────────────────────────────────────────────────────── */
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand); color: var(--on-brand);
  transition: transform var(--d-micro) var(--ease-soft);
}
.avatar-btn .ic { width: 22px; height: 22px; stroke-width: 2.1; }
.avatar-btn:active { transform: scale(.9); }
.recent { margin-bottom: 26px; }
.recent .tiles { margin: 0; }
.tile { position: relative; padding-inline-end: 8px; }
.tile-text b { font-size: 13.5px; }
.tile-eq { display: none; position: absolute; inset-inline-end: 10px; bottom: 10px; gap: 2px; align-items: flex-end; height: 12px; }
.tile-eq i { width: 2.5px; height: 12px; border-radius: 2px; background: var(--brand-ink); transform-origin: bottom; animation: eqb .8s ease-in-out infinite alternate; }
.tile-eq i:nth-child(2) { animation-delay: -.3s; }
.tile-eq i:nth-child(3) { animation-delay: -.55s; }
.tile.playing .tile-eq { display: flex; }
.tile.playing .tile-text b { color: var(--brand-ink); }
body.is-paused .tile-eq i { animation-play-state: paused; }

.mix { flex: none; width: 150px; display: flex; flex-direction: column; gap: 8px; text-align: start; scroll-snap-align: start; transition: transform var(--d-micro) var(--ease-soft); }
.mix:active { transform: scale(.96); }
.mix .tcard-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.4; }
/* Generated covers: one clay hue, varied only in tone and geometry. */
.mix-cover {
  position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 12px;
  background: var(--brand); color: var(--on-brand);
  box-shadow: 0 12px 28px -14px rgb(0 0 0 / calc(.9 * var(--shadow-k)));
}
.mix-kicker { font-size: 12px; font-weight: 500; opacity: .78; }
.mix-name { font-size: 21px; font-weight: 700; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mix-mark { position: absolute; top: 10px; inset-inline-start: 12px; font-size: 12px; font-weight: 650; opacity: .7; }
.mix-shape { position: absolute; z-index: -1; border-radius: 50%; }
.mix-cover.v0 .mix-shape { width: 120%; height: 120%; top: -62%; inset-inline-end: -48%; border: 22px solid rgb(26 15 10 / .16); }
.mix-cover.v1 { background: oklch(0.34 0.07 38); color: oklch(0.86 0.08 50); }
.mix-cover.v1 .mix-shape { width: 92%; height: 92%; top: -30%; inset-inline-end: -30%; background: oklch(0.69 0.135 42 / .55); }
.mix-cover.v2 { background: oklch(0.8 0.09 48); }
.mix-cover.v2 .mix-shape { inset: -20% -40% auto auto; width: 140%; height: 46%; border-radius: 0; background: repeating-linear-gradient(-45deg, rgb(26 15 10 / .12) 0 8px, transparent 8px 18px); transform: rotate(-12deg); }
.mix-cover.v3 { background: #1d120d; color: oklch(0.8 0.1 48); }
.mix-cover.v3 .mix-shape { width: 130%; height: 130%; bottom: -78%; inset-inline-start: -30%; border: 2px solid oklch(0.69 0.135 42 / .6); box-shadow: 0 0 0 14px oklch(0.69 0.135 42 / .14), 0 0 0 30px oklch(0.69 0.135 42 / .08); }

.artist-shelf .artist-cell, .shelf-row .artist-cell { width: 116px; flex: none; scroll-snap-align: start; }
.replay {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px; margin: 4px 0 8px; text-align: start;
  border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, oklch(0.69 0.135 42 / .55), transparent 60%), oklch(0.27 0.05 38);
  transition: transform var(--d-micro) var(--ease-soft);
}
.replay:active { transform: scale(.98); }
.replay-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.replay-text small { font-size: 12.5px; font-weight: 650; color: oklch(0.86 0.08 50); }
.replay-text b { font-size: 20px; font-weight: 700; }
.replay-text span { font-size: 13.5px; color: rgb(255 255 255 / .78); }
.replay-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); flex: none; }

/* ── library ──────────────────────────────────────────────────────────── */
.cat-list { margin: 2px 0 22px; }
.cat { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 2px; text-align: start; transition: background-color var(--d-micro) var(--ease-soft); border-radius: var(--r-xs); }
.cat + .cat::before { content: ""; position: absolute; top: 0; inset-inline-start: 46px; inset-inline-end: 0; height: .5px; background: var(--hair); }
.cat:active { background: var(--s1); }
.cat-ic { width: 30px; display: grid; place-items: center; color: var(--brand-ink); flex: none; }
.cat-ic .ic { width: 26px; height: 26px; }
.cat-label { flex: 1; font-size: 19px; font-weight: 450; }
.cat-num { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.collection .section-head { margin-top: 6px; }
.chips { margin-bottom: 16px; }
.sort-btn { margin: -6px 2px 8px; }

.acard { display: flex; flex-direction: column; gap: 1px; text-align: start; min-width: 0; transition: transform var(--d-micro) var(--ease-soft); }
.acard:active { transform: scale(.96); }
.acard-art { position: relative; display: block; aspect-ratio: 1; margin-bottom: 7px; border-radius: var(--r-sm); box-shadow: 0 12px 28px -14px rgb(0 0 0 / calc(.9 * var(--shadow-k))); }
.acard-art .art { border-radius: var(--r-sm); }
.acard-title { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard.playing .acard-title { color: var(--brand-ink); }
.shelf-row .acard { flex: none; width: 150px; scroll-snap-align: start; }

.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
.artist-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; transition: transform var(--d-micro) var(--ease-soft); }
.artist-cell:active { transform: scale(.95); }
.avatar { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin-bottom: 6px; box-shadow: 0 12px 28px -16px rgb(0 0 0 / calc(.9 * var(--shadow-k))); }
.avatar .art { border-radius: 50%; }
.avatar-letter { display: grid; place-items: center; font-size: 34px; font-weight: 600; color: var(--brand-ink); background: color-mix(in oklab, var(--brand) 20%, var(--bg)); }
.artist-name { font-size: 14px; font-weight: 550; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-sub { font-size: 12px; color: var(--ink-2); }

.item-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 6px 0; text-align: start; }
.item-row::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 64px; inset-inline-end: 0; height: .5px; background: var(--hair); }
.item-row:last-child::after { display: none; }
.item-row:active { background: var(--s1); }
.item-row .row-art { width: 52px; height: 52px; }
.item-row .row-art .mosaic, .item-row .row-art .fav-art { margin: 0; width: 100%; border-radius: var(--r-xs); box-shadow: none; }
.item-row.add .row-art { display: grid; place-items: center; border-radius: var(--r-xs); }

/* ── pushed pages: artist (full-bleed hero) ───────────────────────────── */
.artist-page { padding-top: 0 !important; }
.artist-hero { position: relative; margin: 0 -18px; height: min(108vw, 460px); overflow: hidden; background: rgb(var(--hero) / .5); }
.artist-hero-art { position: absolute; inset: 0; }
.artist-hero-art .art { width: 100%; height: 100%; border-radius: 0; }
.artist-hero-art .avatar-letter { font-size: 120px; border-radius: 0; background: rgb(var(--hero) / .7); color: rgb(255 255 255 / .85); }
.artist-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .25), transparent 26%, transparent 48%, rgb(0 0 0 / .62)); pointer-events: none; }
.artist-hero-text { position: absolute; z-index: 1; inset-inline: 18px; bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; color: #fff; }
.artist-hero-text h1 { font-size: 38px; font-weight: 700; line-height: 1.15; text-shadow: 0 2px 18px rgb(0 0 0 / .35); }
.page-body { position: relative; margin: 0 -18px; padding: 16px 18px 0; }
/* The wash lives on its own layer so it always fades over its full 340 px, even when the
   content below the hero is shorter (otherwise the tint is cut off in a hard line). */
.page-body::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 340px; pointer-events: none;
  background: linear-gradient(rgb(var(--hero) / calc(var(--wash-a) * .35)), transparent);
}
.page-body > * { max-width: 760px; margin-inline: auto; }
.page-body .list-actions { align-items: center; justify-content: space-between; }
.page-body .list-actions .btn { flex: 0 0 auto; }

/* ── search ───────────────────────────────────────────────────────────── */
.browse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.browse-tile {
  position: relative; overflow: hidden; height: 98px; padding: 14px; border-radius: var(--r-md);
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: start;
  background: linear-gradient(150deg, var(--brand-24), var(--s1) 70%);
  transition: transform var(--d-micro) var(--ease-soft);
}
.browse-tile:active { transform: scale(.97); }
.browse-tile b { font-size: 16px; font-weight: 650; position: relative; z-index: 1; }
.browse-ic { color: var(--brand-ink); position: relative; z-index: 1; }
.browse-art { position: absolute; width: 64px; height: 64px; bottom: -8px; inset-inline-end: -10px; transform: rotate(-22deg); box-shadow: 0 8px 20px -6px rgb(0 0 0 / calc(.7 * var(--shadow-k))); border-radius: var(--r-xs); overflow: hidden; }
.browse-art .art { border-radius: 0; }
.recent-searches { margin-bottom: 8px; }
.recent-searches .section-head { margin-top: 4px; }
.recent-list { display: flex; flex-direction: column; }
.recent-q { display: flex; align-items: center; gap: 12px; min-height: 46px; text-align: start; color: var(--ink); }
.recent-q .ic:first-child { width: 20px; height: 20px; color: var(--ink-3); }
.recent-q span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-group { margin-bottom: 8px; }
.result-group .section-head { margin-top: 18px; }
.see-all { display: block; margin: 6px auto 0; }
.album-row .acard { width: 140px; }

/* ── context menu (long-press) ────────────────────────────────────────── */
.ctx-backdrop {
  position: fixed; inset: 0; z-index: var(--z-backdrop);
  background: rgb(0 0 0 / calc(.32 * var(--shadow-k) + .08));
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  opacity: 0; transition: opacity var(--d-reveal) var(--ease-soft);
}
.ctx-backdrop.show { opacity: 1; }
.ctx {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(var(--safe-t) + 16px) 20px calc(var(--safe-b) + 16px);
}
.ctx-preview, .ctx-menu { width: min(80vw, 300px); }
.ctx-preview {
  flex: none; padding: 12px; border-radius: 24px; background: var(--sheet-fill);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 30px 70px -20px rgb(0 0 0 / calc(.8 * var(--shadow-k)));
  opacity: 0; transform: scale(.9); filter: blur(4px);
  transition: transform var(--spring-dur) var(--spring), opacity var(--d-reveal) var(--ease-soft), filter var(--d-reveal) var(--ease-soft);
}
.ctx-track { display: flex; flex-direction: column; gap: 10px; }
.ctx-track .ctx-art { width: min(52vw, 210px); aspect-ratio: 1; height: auto; margin: 0 auto; border-radius: 14px; }
.ctx-track .row-text { text-align: center; }
.ctx-menu {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  transform-origin: 50% 0; opacity: 0; transform: translateY(-10px) scale(.94); filter: blur(4px);
  transition: transform var(--spring-dur) var(--spring) 40ms, opacity var(--d-reveal) var(--ease-soft) 40ms, filter var(--d-reveal) var(--ease-soft) 40ms;
}
.ctx-menu .action-group { background: var(--sheet-fill); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); flex: none; }
.ctx-menu .action { min-height: 46px; padding: 6px 16px; }
.ctx-menu .action-text { font-size: 15px; }
.ctx.show .ctx-preview, .ctx.show .ctx-menu { opacity: 1; transform: none; filter: none; }

/* ── Now Playing additions ────────────────────────────────────────────── */
.morph-art { position: fixed; left: 0; top: 0; z-index: calc(var(--z-player) + 5); transform-origin: 0 0; object-fit: cover; pointer-events: none; will-change: transform; box-shadow: 0 24px 50px -20px rgb(0 0 0 / .7); }
.np-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s var(--ease-soft); }
.np.has-canvas .np-canvas { opacity: 1; }
.np.has-canvas .np-bg .m4 { background: linear-gradient(180deg, rgb(0 0 0 / .4), rgb(0 0 0 / .08) 30%, rgb(0 0 0 / .55) 64%, rgb(0 0 0 / .86)); }
.np.has-canvas .np-art-slot { opacity: 0; transform: scale(.96); }
.art-heart { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; color: #fff; animation: likepop 1.05s var(--ease-soft) forwards; }
.art-heart .ic { width: 96px; height: 96px; filter: drop-shadow(0 8px 24px rgb(0 0 0 / .45)); }
@keyframes likepop { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; transform: scale(1.06); } 50% { transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: scale(1.12); } }
.np-meta-art { display: none; width: 58px; height: 58px; flex: none; }
.np-meta-art .art { border-radius: 8px; }
.np-queue { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 10px -8px 6px; padding: 0 8px; scrollbar-width: none; animation: itemin var(--d-reveal) var(--ease-soft); -webkit-mask: linear-gradient(transparent, #000 12px, #000 calc(100% - 16px), transparent); mask: linear-gradient(transparent, #000 12px, #000 calc(100% - 16px), transparent); }
.np-queue::-webkit-scrollbar { display: none; }
.np-queue .section-head { margin: 4px 0 6px; color: var(--ink-2); }
.np-queue .section-head b { display: block; color: #fff; font-size: 17px; font-weight: 650; }
.np-queue .section-head small { font-size: 12.5px; }
.np-queue .q-row .row-sub, .np-queue .muted { color: rgb(255 255 255 / .62); }
.np-queue .q-row .icon-btn { color: rgb(255 255 255 / .62); }
.np-queue .q-row .art { width: 46px; height: 46px; flex: none; }
.link-btn.on-art { color: #fff; }
.np.queue-open .np-inner > * { order: 3; }
.np.queue-open .np-drag { order: 0; flex: none; }
.np.queue-open .np-meta { order: 1; margin-top: 8px; }
.np.queue-open .np-queue { order: 2; }
.np.queue-open .np-stage, .np.queue-open .np-viz, .np.queue-open .profiles { display: none; }
.np.queue-open .np-meta-art { display: block; animation: itemin var(--d-reveal) var(--ease-soft); }
.np-tools { gap: 2px; }
.tool { min-width: 0; flex: 1; }
.tool[aria-pressed="true"], .tool.on { color: #fff; }

/* ── settings ─────────────────────────────────────────────────────────── */
.seg-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--s1); }
.seg-opt { height: 38px; border-radius: 10px; font-size: 14.5px; font-weight: 550; color: var(--ink-2); transition: background-color var(--d-micro) var(--ease-soft), color var(--d-micro) var(--ease-soft); }
.seg-opt.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 2px 8px -2px rgb(0 0 0 / calc(.5 * var(--shadow-k))); }

/* ── View Transitions: shared-element morph (card art → page hero) ────── */
::view-transition-group(hero) { animation-duration: var(--d-page); animation-timing-function: var(--ease-soft); }
::view-transition-old(hero), ::view-transition-new(hero) { animation-duration: var(--d-page); animation-timing-function: var(--ease-soft); height: 100%; }
.vt-push::view-transition-old(root) { animation: vt-out var(--d-page) var(--ease-soft) both; }
.vt-push::view-transition-new(root) { animation: vt-in var(--d-page) var(--ease-soft) both; }
@keyframes vt-out { to { opacity: 0; transform: translate3d(28px, 0, 0) scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translate3d(-36px, 0, 0); filter: blur(4px); } }

/* ── sheets: soft blur-in, depth ──────────────────────────────────────── */
.sheet { transition: transform var(--spring-dur) var(--spring), opacity var(--d-reveal) var(--ease-soft), filter var(--d-reveal) var(--ease-soft); }
.sheet:not(.show) { filter: blur(3px); }
.backdrop { transition: opacity var(--d-page) var(--ease-soft); }
.np.viz-idle .np-viz { opacity: 0 !important; }
.tool#np-lyrics.on { color: #fff; }
.pl-desc { font-size: 14px; color: var(--ink-2); max-width: 32ch; margin-top: 4px; }
.smart-sub { margin: -6px 2px 12px; }
.mix-cover.big { border-radius: var(--r-lg); padding: 20px; box-shadow: 0 34px 70px -24px rgb(0 0 0 / calc(.9 * var(--shadow-k))); }
.mix-cover.big .mix-name { font-size: 34px; }
.mix-kicker .ic { width: 22px; height: 22px; }
