/* MertListens — Apple Music–style web player on Navidrome */
:root {
  --accent: #fa2d48;
  --accent-soft: rgba(250, 45, 72, .12);
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --sidebar: rgba(246, 246, 248, .86);
  --bar: rgba(250, 250, 252, .82);
  --lcd: rgba(0, 0, 0, .045);
  --fill: rgba(0, 0, 0, .05);
  --fill-2: rgba(0, 0, 0, .09);
  --text: #1d1d1f;
  --text-2: rgba(0, 0, 0, .56);
  --text-3: rgba(0, 0, 0, .34);
  --sep: rgba(0, 0, 0, .1);
  --row-hover: rgba(0, 0, 0, .04);
  --row-alt: rgba(0, 0, 0, .025);
  --shadow: 0 8px 30px rgba(0, 0, 0, .12);
  --art-shadow: 0 4px 16px rgba(0, 0, 0, .14);
  --radius: 8px;
  --sidebar-w: 260px;
  --bar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1f1f;
    --bg-elev: #2c2c2e;
    --sidebar: rgba(40, 40, 42, .86);
    --bar: rgba(34, 34, 36, .84);
    --lcd: rgba(255, 255, 255, .06);
    --fill: rgba(255, 255, 255, .07);
    --fill-2: rgba(255, 255, 255, .12);
    --text: #f5f5f7;
    --text-2: rgba(255, 255, 255, .55);
    --text-3: rgba(255, 255, 255, .32);
    --sep: rgba(255, 255, 255, .1);
    --row-hover: rgba(255, 255, 255, .06);
    --row-alt: rgba(255, 255, 255, .03);
    --shadow: 0 10px 34px rgba(0, 0, 0, .5);
    --art-shadow: 0 4px 18px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.35 var(--font); -webkit-font-smoothing: antialiased;
  overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; flex: none; }
img { display: block; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
::selection { background: var(--accent-soft); }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(250,45,72,.18), transparent 60%),
              radial-gradient(900px 600px at 100% 100%, rgba(120,80,255,.14), transparent 60%), var(--bg); }
.login-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-logo { width: 72px; height: 72px; margin: 0 auto 4px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(160deg, #fb5c74, #fa233b); color: #fff; font-size: 38px; box-shadow: 0 10px 30px rgba(250,45,72,.35); }
.login h1 { font: 700 28px/1.1 var(--font-display); margin: 6px 0 0; letter-spacing: -.02em; }
.login p { margin: 0 0 10px; }
.login input { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--sep);
  background: var(--bg-elev); color: var(--text); outline: none; }
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; padding: 12px; border-radius: 10px; font-size: 15px; }
.btn-primary:active { filter: brightness(.92); }
.login-err { color: var(--accent); min-height: 1.3em; font-size: 13px; }

/* ---------- layout ---------- */
.app { display: grid; height: 100dvh;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  grid-template-rows: var(--bar-h) 1fr;
  grid-template-areas: "side bar bar" "side main panel"; }
.sidebar { grid-area: side; background: var(--sidebar); backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px); border-right: 1px solid var(--sep);
  display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 20px var(--font-display); letter-spacing: -.02em; padding: 4px 10px 14px; }
.brand svg { color: var(--accent); font-size: 22px; }
.search-field { display: flex; align-items: center; gap: 6px; margin: 0 6px 12px; padding: 0 8px; height: 32px;
  border-radius: 8px; background: var(--fill); border: 1px solid transparent; color: var(--text-2); }
.search-field:focus-within { border-color: var(--accent); background: var(--bg-elev); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-field input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; border: 0; outline: 0; }
.search-field input::-webkit-search-cancel-button { filter: grayscale(1); }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav h3 { font-size: 11px; font-weight: 600; color: var(--text-3); margin: 16px 10px 4px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; font-size: 14px; }
.nav a svg { font-size: 18px; color: var(--accent); }
.nav a:hover { background: var(--row-hover); }
.nav a.on { background: var(--fill-2); font-weight: 500; }
.nav-playlists a svg { color: var(--text-2); }
.nav-playlists a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { padding: 8px 10px 0; border-top: 1px solid var(--sep); }
.linkish { color: var(--text-2); font-size: 12px; }
.linkish:hover { color: var(--accent); }

/* ---------- player bar (top) ---------- */
.playerbar { grid-area: bar; display: grid; grid-template-columns: 1fr minmax(320px, 620px) 1fr; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--bar); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-bottom: 1px solid var(--sep); z-index: 5; }
.pb-controls { display: flex; align-items: center; gap: 14px; justify-self: center; }
.pb-right { display: flex; align-items: center; gap: 12px; justify-self: end; }
.ib { display: inline-grid; place-items: center; font-size: 22px; color: var(--text); border-radius: 50%; position: relative;
  transition: transform .12s, color .15s, opacity .15s; }
.ib:hover { opacity: .8; }
.ib:active { transform: scale(.9); }
.ib.sm { font-size: 17px; color: var(--text-2); }
.ib.lg { font-size: 30px; }
.ib.on { color: var(--accent); }
.ib[disabled] { opacity: .3; pointer-events: none; }
.rep1 { display: none; position: absolute; right: -5px; bottom: -3px; font-size: 8px; font-weight: 800; color: #fff; background: var(--accent);
  border-radius: 6px; padding: 0 3px; line-height: 11px; }
.ib.one .rep1 { display: block; }

.lcd { position: relative; height: 44px; border-radius: 6px; background: var(--lcd); display: flex; align-items: center; overflow: hidden;
  border: 1px solid var(--sep); }
.lcd-art { width: 44px; height: 44px; object-fit: cover; flex: none; cursor: pointer; }
.lcd-text { flex: 1; min-width: 0; text-align: center; padding: 0 44px; line-height: 1.25; }
.lcd-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd-sub a:hover, .lcd-title a:hover { color: var(--accent); }
.lcd-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 20px; background: var(--lcd); }
.lcd.playing .lcd-empty { display: none; }
.lcd-time { position: absolute; bottom: 5px; font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lcd-time.l { left: 52px; } .lcd-time.r { right: 8px; }
.lcd-progress { position: absolute; left: 44px; right: 0; bottom: 0; height: 3px; cursor: pointer; }
.lcd-progress::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; }
.lcd-fill { height: 100%; width: 0; background: var(--text-2); }
.lcd:hover .lcd-progress { height: 5px; }
.vol { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 15px; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.vol input { width: 90px; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(var(--text-2), var(--text-2)) 0/var(--p, 100%) 100% no-repeat, var(--fill-2); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.3); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ---------- main ---------- */
.main { grid-area: main; overflow-y: auto; overflow-x: hidden; min-width: 0; outline: 0; scroll-behavior: auto; }
.view { padding: 28px 40px 60px; max-width: 1500px; margin: 0 auto; }
.page-title { font: 700 30px/1.15 var(--font-display); letter-spacing: -.02em; margin: 6px 0 22px; }
.section { margin: 0 0 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px;
  border-top: 1px solid var(--sep); padding-top: 14px; }
.section-head h2 { font: 700 20px var(--font-display); letter-spacing: -.01em; margin: 0; }
.section-head a { color: var(--accent); font-size: 14px; }
.section-head a:hover { text-decoration: underline; }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--text-3); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--text-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--text-2); padding: 60px 20px; }
.empty svg { font-size: 44px; color: var(--text-3); display: block; margin: 0 auto 10px; }

/* shelves & grids */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 20px) / 5); gap: 20px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 20px; }
.card { min-width: 0; cursor: pointer; }
.card-art { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--fill);
  box-shadow: var(--art-shadow); }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 40px; }
.card-play { position: absolute; left: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.5); color: #fff; font-size: 15px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: scale(.9); transition: .15s; }
.card-play svg { margin-left: 2px; }
.card:hover .card-play { opacity: 1; transform: none; }
.card-play:hover { background: var(--accent); }
.card-art::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.12); opacity: 0; transition: .15s; pointer-events: none; }
.card:hover .card-art::after { opacity: 1; }
.card-title { margin-top: 7px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub a:hover { text-decoration: underline; }
.card.round .card-art { border-radius: 50%; }
.card.round { text-align: center; }

/* ---------- detail header (album/playlist) ---------- */
.hero { display: flex; gap: 32px; align-items: flex-end; margin: 4px 0 26px; }
.hero-art { width: 270px; height: 270px; flex: none; border-radius: var(--radius); overflow: hidden; background: var(--fill); box-shadow: var(--shadow); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art.mosaic { display: grid; grid-template-columns: 1fr 1fr; }
.hero-art.round { border-radius: 50%; }
.hero-info { min-width: 0; padding-bottom: 4px; }
.hero-title { font: 700 30px/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; }
.hero-artist { font: 400 24px/1.25 var(--font-display); color: var(--accent); margin: 2px 0 0; }
.hero-artist a:hover { text-decoration: underline; }
.hero-meta { color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; }
.hero-desc { color: var(--text-2); font-size: 13px; margin-top: 12px; max-width: 640px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 22px; border-radius: 8px; font-weight: 600; font-size: 14px;
  background: var(--accent); color: #fff; }
.pill svg { font-size: 13px; }
.pill:hover { filter: brightness(1.06); }
.pill:active { transform: scale(.97); }
.hero-actions .ib { font-size: 19px; color: var(--accent); width: 32px; height: 32px; background: var(--fill); }
.hero-foot { color: var(--text-2); font-size: 13px; margin-top: 18px; }

/* ---------- track list ---------- */
.tracks { width: 100%; border-collapse: collapse; }
.tr { display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px 56px 28px; align-items: center; gap: 8px; height: 46px;
  padding: 0 10px; border-radius: 6px; cursor: default; user-select: none; -webkit-user-select: none; }
.tracks.with-art .tr { grid-template-columns: 44px minmax(0, 1.4fr) minmax(0, 1fr) 32px 56px 28px; height: 56px; }
.tracks.with-art.no-album .tr { grid-template-columns: 44px minmax(0, 1fr) 32px 56px 28px; }
.tr:nth-child(odd) { background: var(--row-alt); }
.tr:hover { background: var(--row-hover); }
.tr.sel { background: var(--accent); color: #fff; }
.tr.sel .t-sub, .tr.sel .t-num, .tr.sel .t-dur, .tr.sel .t-album, .tr.sel .ib { color: rgba(255,255,255,.85); }
.t-num { color: var(--text-2); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; position: relative; }
.t-art { width: 40px; height: 40px; border-radius: 4px; overflow: hidden; background: var(--fill); position: relative; }
.t-art img { width: 100%; height: 100%; object-fit: cover; }
.t-main { min-width: 0; }
.t-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub a:hover, .t-album a:hover { text-decoration: underline; }
.t-album { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dur { color: var(--text-2); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.tr .ib { font-size: 16px; color: var(--accent); opacity: 0; }
.tr .ib.starred { opacity: 1; }
.tr .ib.more { color: var(--text-2); }
.tr:hover .ib { opacity: 1; }
.t-hoverplay { display: none; position: absolute; inset: 0; place-items: center; color: var(--text); font-size: 14px; }
.t-art .t-hoverplay { background: rgba(0,0,0,.4); color: #fff; }
.tr:hover .t-hoverplay { display: grid; }
.tr:hover .t-num > span { visibility: hidden; }
.tr.current .t-title { color: var(--accent); font-weight: 500; }
.tr.sel.current .t-title { color: #fff; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; height: 40%; }
.eq i:nth-child(2) { animation-delay: -.4s; } .eq i:nth-child(3) { animation-delay: -.7s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%,100% { height: 30%; } 50% { height: 100%; } }
.t-art .eq { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; background: rgba(0,0,0,.45); height: auto; }
.t-art .eq i { background: #fff; height: 10px; }
.disc-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 18px 10px 6px; }

/* artist */
.artist-hero { position: relative; margin: -28px -40px 26px; height: 340px; overflow: hidden; display: flex; align-items: flex-end; padding: 0 40px 26px;
  background: var(--fill); }
.artist-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.artist-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.6)); }
.artist-hero h1 { position: relative; z-index: 1; color: #fff; font: 700 44px/1.05 var(--font-display); letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 14px; }
.artist-hero .pill { position: relative; z-index: 1; }
.artist-hero .play-round { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 20px; }
.artist-hero .play-round svg { margin-left: 3px; }
.bio { color: var(--text-2); max-width: 760px; font-size: 14px; line-height: 1.5; }

/* artists list (letters) */
.alist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 20px; }

/* search / chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 500; }
.chip.on { background: var(--accent); color: #fff; }
.mobile-search { display: none; }
.genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.genre { position: relative; height: 110px; border-radius: 10px; overflow: hidden; color: #fff; padding: 12px 14px; font: 700 17px var(--font-display);
  display: flex; align-items: flex-end; cursor: pointer; }
.genre small { position: absolute; top: 10px; right: 12px; font: 500 12px var(--font); opacity: .8; }
.genre:hover { filter: brightness(1.08); }

/* ---------- side panel ---------- */
.panel { grid-area: panel; width: 340px; border-left: 1px solid var(--sep); background: var(--sidebar); display: flex; flex-direction: column; min-height: 0;
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); }
.panel-tabs { display: flex; margin: 14px; padding: 2px; border-radius: 8px; background: var(--fill); }
.panel-tabs button { flex: 1; padding: 5px; border-radius: 6px; font-size: 13px; font-weight: 500; }
.panel-tabs button.on { background: var(--bg-elev); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.panel-body { flex: 1; overflow-y: auto; padding: 0 8px 20px; }
.q-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin: 12px 8px 6px; }
.q-head button { color: var(--accent); font-weight: 400; }
.q-item { display: grid; grid-template-columns: 40px 1fr 20px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.q-item:hover { background: var(--row-hover); }
.q-item img, .q-item .t-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; }
.q-item .t-title { font-size: 13px; }
.q-item .x { opacity: 0; color: var(--text-2); font-size: 12px; }
.q-item:hover .x { opacity: 1; }
.q-item.now { background: var(--fill); }
.q-item.past { opacity: .45; }

/* lyrics */
.lyrics { padding: 10px 14px 40vh; }
.lyrics p { font: 700 22px/1.3 var(--font-display); letter-spacing: -.01em; margin: 0 0 18px; color: var(--text-3); transition: color .3s, transform .3s;
  cursor: pointer; transform-origin: left center; }
.lyrics.synced p.on { color: var(--text); transform: scale(1.02); }
.lyrics.plain p { color: var(--text); font-weight: 600; font-size: 18px; cursor: default; }
.lyrics .src { font: 400 11px var(--font); color: var(--text-3); margin-top: 30px; }

/* ---------- context menu / toast ---------- */
.menu { position: fixed; z-index: 50; min-width: 220px; padding: 5px; border-radius: 10px; background: var(--bg-elev); box-shadow: var(--shadow), 0 0 0 .5px var(--sep); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 6px; text-align: left; font-size: 13px; }
.menu button:hover, .menu a:hover { background: var(--accent); color: #fff; }
.menu hr { border: 0; border-top: 1px solid var(--sep); margin: 4px 6px; }
.menu .sub-title { font-size: 11px; color: var(--text-3); padding: 6px 10px 2px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: rgba(30,30,30,.92); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px; transition: .25s; backdrop-filter: blur(10px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- now playing (full screen) ---------- */
.np { position: fixed; inset: 0; z-index: 40; color: #fff; overflow: hidden; background: #222; animation: npIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes npIn { from { transform: translateY(100%); } }
.np.closing { animation: npOut .3s ease-in forwards; }
@keyframes npOut { to { transform: translateY(100%); } }
.np-bg { position: absolute; inset: -20%; background-size: cover; background-position: center; filter: blur(70px) saturate(1.6) brightness(.62); transform: scale(1.2); }
.np-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); }
.np-inner { position: relative; height: 100%; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 32px max(20px, env(safe-area-inset-bottom)); }
.np-close { align-self: center; font-size: 30px; opacity: .7; padding: 4px 20px; }
.np-stage { flex: 1; min-height: 0; display: flex; gap: 48px; align-items: center; justify-content: center; }
.np-art { width: min(440px, 70vw, 48vh); aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
  transition: transform .4s cubic-bezier(.3,1.4,.5,1); }
.np.paused .np-art { transform: scale(.86); }
.np-side { display: none; flex: 1; height: 100%; overflow-y: auto; scrollbar-width: none; mask-image: linear-gradient(transparent, #000 12%, #000 80%, transparent); }
.np-side::-webkit-scrollbar { display: none; }
.np.with-side .np-side { display: block; }
.np-side .lyrics p { color: rgba(255,255,255,.35); font-size: 28px; }
.np-side .lyrics.synced p.on { color: #fff; }
.np-side .lyrics.plain p { color: rgba(255,255,255,.9); font-size: 22px; }
.np-side .q-item:hover { background: rgba(255,255,255,.1); }
.np-side .t-sub, .np-side .q-head { color: rgba(255,255,255,.6); }
.np-side .q-head button { color: #fff; }
.np-meta, .np-scrub, .np-controls, .np-bottom { width: min(440px, 100%); margin: 0 auto; }
.np.with-side .np-meta, .np.with-side .np-scrub, .np.with-side .np-controls, .np.with-side .np-bottom { margin-left: max(0px, calc(50% - 440px - 24px)); }
.np-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.np-meta > div { min-width: 0; }
.np-title { font: 700 20px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 18px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.np .ib { color: #fff; }
.np .ib.sm { color: rgba(255,255,255,.7); }
.np .ib.on { color: #fff; background: rgba(255,255,255,.22); border-radius: 6px; padding: 5px; margin: -5px; }
.np .rep1 { background: #fff; color: #000; }
.np-scrub { margin-top: 16px; }
.np-scrub input { width: 100%; }
.np input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 0/var(--p, 0%) 100% no-repeat, rgba(255,255,255,.22); }
.np input[type=range]::-webkit-slider-thumb { width: 0; height: 0; box-shadow: none; margin-top: 3px; }
.np input[type=range]:active::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -5px; }
.np input[type=range]::-moz-range-track { height: 6px; background: rgba(255,255,255,.22); }
.np input[type=range]::-moz-range-progress { height: 6px; background: rgba(255,255,255,.85); border-radius: 3px; }
.np-times { display: flex; justify-content: space-between; font-size: 11px; opacity: .6; margin-top: 4px; font-variant-numeric: tabular-nums; }
.np-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 0 6px; }
.ib.xl { font-size: 38px; } .ib.xxl { font-size: 50px; }
.np-bottom { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.np-vol { flex: 1; color: rgba(255,255,255,.7); }
.np-vol input { flex: 1; width: auto; }

/* ---------- mobile ---------- */
.mini, .tabbar { display: none; }
@media (max-width: 1100px) {
  .shelf { grid-auto-columns: calc((100% - 3 * 18px) / 4); gap: 18px; }
  .panel { position: fixed; right: 0; top: var(--bar-h); bottom: 0; z-index: 20; box-shadow: var(--shadow); }
  .vol input { width: 70px; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; grid-template-areas: "main" "mini" "tabs"; }
  .sidebar, .playerbar { display: none; }
  .panel { display: none !important; }
  .view { padding: max(16px, env(safe-area-inset-top)) 16px 30px; }
  .page-title { font-size: 30px; margin-top: 12px; }
  .shelf { grid-auto-columns: 42%; gap: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .alist { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; }
  .card-play { display: none; }
  .hero { flex-direction: column; align-items: center; text-align: center; gap: 18px; margin-top: 8px; }
  .hero-art { width: min(240px, 66vw); height: min(240px, 66vw); }
  .hero-title { font-size: 22px; }
  .hero-artist { font-size: 20px; }
  .hero-actions { justify-content: center; }
  .hero-actions .pill { flex: 1; justify-content: center; max-width: 160px; background: var(--fill); color: var(--accent); }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .tr, .tracks.with-art .tr, .tracks.with-art.no-album .tr { grid-template-columns: 28px minmax(0, 1fr) 28px; height: 50px; padding: 0 4px; }
  .tracks.with-art .tr, .tracks.with-art.no-album .tr { grid-template-columns: 44px minmax(0, 1fr) 28px; height: 58px; }
  .t-album, .t-dur, .tr .ib.star { display: none; }
  .tr:nth-child(odd) { background: none; }
  .tr { border-bottom: 1px solid var(--sep); border-radius: 0; }
  .tr .ib { opacity: 1; }
  .tr:hover { background: none; }
  .tr:hover .t-hoverplay { display: none; } .tr:hover .t-num > span { visibility: visible; }
  .artist-hero { margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 20px; height: 300px; padding: 0 16px 18px; }
  .artist-hero h1 { font-size: 32px; }
  .mobile-search { display: flex; margin: 0 0 18px; height: 38px; }
  .mini { grid-area: mini; display: grid; grid-template-columns: 48px 1fr 40px 40px; gap: 12px; align-items: center; position: relative;
    margin: 0 8px 6px; padding: 8px; border-radius: 12px; background: var(--bar); box-shadow: 0 4px 24px rgba(0,0,0,.18), 0 0 0 .5px var(--sep);
    backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); }
  .mini-art { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--fill); box-shadow: var(--art-shadow); }
  .mini-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini .ib { font-size: 24px; }
  .mini-progress { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; }
  .mini-progress div { height: 100%; width: 0; background: var(--accent); border-radius: 1px; }
  .tabbar { grid-area: tabs; display: flex; justify-content: space-around; padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    background: var(--bar); border-top: 1px solid var(--sep); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--text-3); min-width: 64px; }
  .tabbar a svg { font-size: 24px; }
  .tabbar a.on { color: var(--accent); }
  .np-inner { padding-left: 24px; padding-right: 24px; }
  .np-stage { flex-direction: column; gap: 0; }
  .np.with-side .np-art { display: none; }
  .np.with-side .np-side { width: 100%; }
  .np.with-side .np-meta, .np.with-side .np-scrub, .np.with-side .np-controls, .np.with-side .np-bottom { margin-left: auto; }
  .np-art { width: min(86vw, 46vh); }
  .np-side .lyrics p { font-size: 26px; }
  .np-vol { display: none; }
  .np-bottom { justify-content: space-around; }
  .menu { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; border-radius: 14px; padding: 8px; }
  .menu button, .menu a { padding: 12px; font-size: 15px; }
  .toast { bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* artwork sits above its placeholder icon; empty LCD shows only the logo */
.card-art img, .hero-art img, .t-art img { position: relative; z-index: 1; }
.card-play { z-index: 2; }
.card-art::after { z-index: 1; }
.tr.sel .eq i { background: #fff; }
.lcd:not(.playing) .lcd-art, .lcd:not(.playing) .lcd-time { visibility: hidden; }
