/* ==========================================================================
   SpotiBai by Jhervy
   ========================================================================== */

:root {
  --accent: #1ed760;
  --accent-hover: #3be477;
  --bg: #000;
  --panel: #121212;
  --panel-2: #181818;
  --panel-3: #1f1f1f;
  --elevated: #242424;
  --hover: #2a2a2a;
  --line: #2a2a2a;

  --text: #fff;
  --subdued: #a7a7a7;
  --faint: #6a6a6a;

  --radius: 10px;
  --radius-lg: 14px;
  --player-h: 90px;
  --sidebar-w: 280px;
  --np-w: 320px;
  --logo-color: var(--accent);

  --ease: cubic-bezier(0.3, 0, 0, 1);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Appearance controls, overridden at runtime by the Settings panel. */
  --font-stack: "Circular Std", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ui-scale: 1;
  --row-pad: 8px;
  --wall-blur: 0px;
  --wall-dim: 45%;
  --wallpaper: none;
  --skel: rgba(255, 255, 255, 0.12);
}
[data-light="on"] { --skel: rgba(0, 0, 0, 0.09); }
.skel { background: var(--skel); }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body {
  overscroll-behavior: none;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
  display: block;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

::selection { background: var(--accent); color: #000; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Scrollbars -------------------------------------------------- */

.scroll, .view, .sidebar, .np-body, .playlist-list, .modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.scroll::-webkit-scrollbar, .view::-webkit-scrollbar, .sidebar::-webkit-scrollbar,
.np-body::-webkit-scrollbar, .playlist-list::-webkit-scrollbar, .modal-body::-webkit-scrollbar {
  width: 12px;
}
.scroll::-webkit-scrollbar-thumb, .view::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb,
.np-body::-webkit-scrollbar-thumb, .playlist-list::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}
.scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); background-clip: content-box; }

/* ---------- App grid ---------------------------------------------------- */

.app {
  /* Interface scale: `zoom` scales layout, so the box is divided back out to
     stay exactly one viewport tall and wide at any scale. */
  zoom: var(--ui-scale);
  width: calc(100% / var(--ui-scale));
  height: calc(100dvh / var(--ui-scale));
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "sidebar main"
    "player  player";
  gap: 8px;
  padding: 8px;
  transition: grid-template-columns 0.2s var(--ease);
}

.app.np-open {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--np-w);
  grid-template-areas:
    "sidebar main nowplaying"
    "player  player player";
}

/* ---------- Sidebar ----------------------------------------------------- */

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 6px;
}
.brand-mark { width: 32px; height: 32px; color: var(--logo-color); flex: none; display: block; }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; display: block; }
.brand-mark img { object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 19px; letter-spacing: -0.03em; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--subdued); letter-spacing: 0.06em; text-transform: uppercase; }

.nav {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--subdued);
  font-weight: 700;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  cursor: pointer;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); }
.nav-item .ico { width: 22px; height: 22px; }

.library-panel {
  flex: 1;
  min-height: 0;
  background: var(--panel);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 0;
  flex: none;
}
.library-head .nav-item { flex: 1; }
.library-head .icon-btn { margin-right: 8px; }

.playlist-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.pl-item:hover { background: var(--panel-3); }
.pl-item.active { background: var(--panel-3); }
.pl-item .pl-art {
  width: 48px; height: 48px; border-radius: 6px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #333, #555);
}
.pl-item .pl-art img { width: 100%; height: 100%; object-fit: cover; }
.pl-item.liked .pl-art { background: linear-gradient(135deg, #450af5, #c4efd9); color: #fff; }
.pl-item .pl-art .ico { width: 22px; height: 22px; }
.pl-item .pl-info { min-width: 0; display: flex; flex-direction: column; }
.pl-item .pl-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .pl-sub { font-size: 12px; color: var(--subdued); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.library-empty {
  padding: 8px 12px 24px;
  color: var(--subdued);
  font-size: 13px;
}
.library-empty strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }

/* ---------- Main -------------------------------------------------------- */

.main {
  grid-area: main;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  flex: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent);
  backdrop-filter: blur(4px);
}
.topbar-left { display: flex; gap: 8px; align-items: center; }

.round-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
  transition: transform 0.12s var(--ease), background 0.15s var(--ease);
}
.round-btn:hover { background: #000; transform: scale(1.05); }
.round-btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.round-btn .ico { width: 16px; height: 16px; }

#menuBtn, #searchToggle { display: none; }

.topbar-search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 40px;
  background: var(--panel-3);
  border: 1px solid transparent;
  border-radius: 500px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.topbar-search:focus-within { background: var(--elevated); border-color: rgba(255, 255, 255, 0.25); }
.topbar-search .ico { color: var(--subdued); width: 20px; height: 20px; }
.topbar-search input {
  flex: 1; min-width: 0;
  background: none; border: 0; color: var(--text); outline: none;
}
.topbar-search input::placeholder { color: var(--subdued); }
.topbar-search input::-webkit-search-cancel-button { display: none; }
.clear-btn { padding: 4px; color: var(--subdued); }
.clear-btn:hover { color: var(--text); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.chip-btn {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 500px;
  background: var(--panel-3);
  font-weight: 700;
  transition: background 0.15s var(--ease), transform 0.12s var(--ease);
}
.chip-btn:hover { background: var(--elevated); transform: scale(1.03); }
.chip-btn .ico { width: 16px; height: 16px; }
.user-chip { background: rgba(0, 0, 0, 0.7); padding-right: 14px; }
.user-chip:hover { background: var(--elevated); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #000;
  font-weight: 800; font-size: 12px;
}

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 40px;
  outline: none;
}

/* ---------- Content: generic ------------------------------------------- */

.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 24px; }
.section-head h2 a:hover { text-decoration: underline; }
.show-all {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--subdued);
}
.show-all:hover { text-decoration: underline; color: var(--text); }

.greeting { margin: 8px 0 4px; font-size: clamp(26px, 3.4vw, 36px); }
.greeting-sub { color: var(--subdued); margin-top: 2px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 20px 18px;
}

.card {
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: background 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card:hover { background: var(--elevated); }
.card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #2b2b2b, #454545);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.round .card-art { border-radius: 50%; box-shadow: none; }
.card-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-title:hover { text-decoration: underline; }
.card-sub {
  font-size: 13px; color: var(--subdued);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.play-fab {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid; place-items: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background 0.15s var(--ease);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}
.play-fab .ico { width: 20px; height: 20px; margin-left: 2px; }
.card:hover .play-fab, .card:focus-within .play-fab { opacity: 1; transform: translateY(0); }
.play-fab:hover { background: var(--accent-hover); transform: scale(1.06); }

/* Brick row (Spotify's compact 8-tile grid) */
.brick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.brick {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: background 0.2s var(--ease);
}
.brick:hover { background: rgba(255, 255, 255, 0.16); }
.brick-art { width: 72px; height: 72px; flex: none; background: linear-gradient(135deg, #2b2b2b, #454545); }
.brick-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brick.round .brick-art { border-radius: 50%; margin: 4px; width: 64px; height: 64px; }
.brick-title {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 56px;
}
.brick-title:hover { text-decoration: underline; }
.brick .play-fab { right: 12px; bottom: auto; top: 50%; translate: 0 -50%; opacity: 0; }
.brick:hover .play-fab { opacity: 1; }

/* ---------- Track list -------------------------------------------------- */

.tracklist { display: flex; flex-direction: column; }
.tl-head, .tl-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 3.2fr) minmax(0, 2fr) minmax(0, 1.6fr) 60px 40px;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.tl-head {
  height: 36px;
  border-bottom: 1px solid var(--line);
  color: var(--subdued);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  position: sticky; top: 0;
  background: var(--panel);
  z-index: 2;
}
.tl-head .tl-num { display: flex; justify-content: flex-end; }
.tl-head .tl-dur { display: flex; justify-content: flex-end; padding-right: 12px; }

.tl-row {
  height: 56px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--subdued);
  transition: background 0.12s var(--ease);
}
.tl-row:hover { background: rgba(255, 255, 255, 0.08); }
.tl-row.is-current .tl-title { color: var(--accent); }

/* A song listed on an album whose audio has not been uploaded yet. */
.tl-row.is-ghost { cursor: default; color: var(--faint); }
.tl-row.is-ghost:hover { background: none; }
.tl-row.is-ghost .tl-title { color: var(--subdued); }
.tl-row.is-ghost .tl-cover { background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 255, 255, 0.04) 5px 10px); }
.ghost-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 500px; vertical-align: middle; margin-left: 8px;
  background: rgba(255, 176, 32, 0.16);
  color: #ffb020;
  border: 1px solid rgba(255, 176, 32, 0.38);
}
.ghost-note {
  display: flex; align-items: center; gap: 7px;
  margin: 10px 0 0; font-size: 13px; color: var(--subdued);
}
.ghost-note .ico { width: 15px; height: 15px; color: #ffb020; flex: none; }
.detail-actions .big-play[disabled],
.detail-actions .icon-btn[disabled] { opacity: 0.35; cursor: default; }

.tl-num { display: flex; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.tl-row .tl-num .tl-play { display: none; color: var(--text); }
.tl-row:hover .tl-num .tl-index { display: none; }
.tl-row:hover .tl-num .tl-play { display: block; }
.tl-row.is-current .tl-num .tl-index { display: none; }
.tl-row.is-current:hover .tl-num .tl-play { display: block; }

.tl-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tl-cover {
  width: 40px; height: 40px; border-radius: 4px; flex: none;
  overflow: hidden; background: linear-gradient(135deg, #2b2b2b, #454545);
}
.tl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-text { min-width: 0; display: flex; flex-direction: column; }
.tl-title {
  color: var(--text); font-weight: 500; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-artist {
  font-size: 13px; color: var(--subdued);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-artist a:hover { color: var(--text); text-decoration: underline; }
.tl-album, .tl-date { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-album:hover { color: var(--text); text-decoration: underline; cursor: pointer; }
.tl-dur { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding-right: 12px; }
.tl-actions { display: flex; justify-content: flex-end; gap: 4px; }
.tl-actions .icon-btn { opacity: 0; }
.tl-row:hover .tl-actions .icon-btn, .tl-row .icon-btn.on, .tl-row .icon-btn.liked { opacity: 1; }

.badge-320 {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(30, 215, 96, 0.15); color: var(--accent);
  border: 1px solid rgba(30, 215, 96, 0.35);
  flex: none;
}
.badge-low {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255, 183, 0, 0.14); color: #ffb700;
  border: 1px solid rgba(255, 183, 0, 0.35);
  flex: none;
}

/* Equalizer bars on the playing row */
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq span {
  width: 3px; background: var(--accent); border-radius: 1px;
  animation: eq 0.9s ease-in-out infinite;
}
.eq span:nth-child(1) { height: 40%; animation-delay: -0.5s; }
.eq span:nth-child(2) { height: 90%; animation-delay: -0.2s; }
.eq span:nth-child(3) { height: 60%; animation-delay: -0.7s; }
.eq.paused span { animation-play-state: paused; }
@keyframes eq { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* ---------- Detail headers (album / artist / playlist) ------------------ */

.detail-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 24px 4px 24px;
  margin: 0 -20px;
  padding-inline: 24px;
}
.detail-art {
  width: 232px; height: 232px; flex: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  background: linear-gradient(135deg, #2b2b2b, #454545);
  display: grid; place-items: center;
}
.detail-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-art.round { border-radius: 50%; }
.detail-art .ico { width: 72px; height: 72px; color: rgba(255, 255, 255, 0.25); }
.detail-art.liked-art { background: linear-gradient(135deg, #450af5, #8e8ee5 70%, #c4efd9); }
.detail-art.liked-art .ico { color: #fff; width: 88px; height: 88px; }

.detail-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.detail-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.detail-title {
  font-size: clamp(30px, 5vw, 60px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.detail-sub { color: rgba(255, 255, 255, 0.75); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-sub .dot { opacity: 0.6; }
.detail-sub strong { color: #fff; }
.detail-sub a:hover { text-decoration: underline; color: #fff; }

.detail-info .artist-bio {
  max-width: 62ch;
  color: var(--subdued);
  font-size: 14px;
  margin: 6px 0 0;
}
.artist-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.artist-links a {
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 12px;
  border-radius: 500px;
}
.artist-links a:hover { background: rgba(255, 255, 255, 0.22); }

.detail-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 4px 8px;
}
.big-play {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: grid; place-items: center;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.big-play:hover { transform: scale(1.06); background: var(--accent-hover); }
.big-play .ico { width: 24px; height: 24px; margin-left: 3px; }
.big-play.playing .ico { margin-left: 0; }

.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--subdued);
  transition: color 0.15s var(--ease), transform 0.12s var(--ease), background 0.15s var(--ease);
}
.icon-btn:hover { color: var(--text); transform: scale(1.06); }
.icon-btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn.lg { width: 40px; height: 40px; }
.icon-btn.lg .ico { width: 28px; height: 28px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.on::after {
  content: ""; position: absolute; margin-top: 30px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.icon-btn.liked { color: var(--accent); }

/* ---------- Player bar -------------------------------------------------- */

.player {
  grid-area: player;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--panel-2);
  border-radius: var(--radius);
}

.player-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-toggle { display: none; }
.pt-art {
  width: 56px; height: 56px; border-radius: 6px; flex: none;
  overflow: hidden;
  background: linear-gradient(135deg, #2b2b2b, #454545);
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.3);
}
.pt-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-meta { min-width: 0; display: flex; flex-direction: column; }
.pt-title {
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.pt-title:hover { text-decoration: underline; cursor: pointer; }
.pt-artist {
  font-size: 12px; color: var(--subdued);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-artist:hover { text-decoration: underline; color: var(--text); cursor: pointer; }
.like-btn { opacity: 0.9; }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.transport { display: flex; align-items: center; gap: 8px; }
.play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: #000;
  display: grid; place-items: center;
  transition: transform 0.12s var(--ease);
}
.play-btn:hover { transform: scale(1.07); }
.play-btn .ico { width: 18px; height: 18px; }
.play-btn.playing .ico { margin-left: 0; }
.play-btn:not(.playing) .ico { margin-left: 2px; }

.scrub { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.time { font-size: 12px; color: var(--subdued); font-variant-numeric: tabular-nums; min-width: 40px; }
.time:last-child { text-align: right; }

/* Sliders */
.slider {
  position: relative;
  height: 16px;
  flex: 1;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  --pct: 0%;
}
.slider::before {
  content: "";
  position: absolute; inset-inline: 0;
  height: 4px; border-radius: 2px;
  background: var(--hover);
}
.slider-fill {
  position: absolute; left: 0;
  height: 4px; width: var(--pct);
  border-radius: 2px;
  background: #fff;
  transition: background 0.15s var(--ease);
}
.slider-knob {
  position: absolute;
  left: var(--pct);
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.slider:hover .slider-fill, .slider.active .slider-fill { background: var(--accent); }
.slider:hover .slider-knob, .slider.active .slider-knob { opacity: 1; }
.slider.disabled { opacity: 0.4; pointer-events: none; }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.slider.vol { max-width: 100px; }

/* ---------- Now playing panel ------------------------------------------ */

.nowplaying {
  grid-area: nowplaying;
  background: var(--panel-2);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.app.np-open .nowplaying { display: flex; }

.np-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px;
  font-weight: 700;
  flex: none;
}
.np-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.np-art {
  width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #2b2b2b, #454545);
  display: grid; place-items: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-art .ico { width: 64px; height: 64px; color: rgba(255, 255, 255, 0.2); }
.np-meta { display: flex; flex-direction: column; }
.np-title { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.np-title:hover { text-decoration: underline; cursor: pointer; }
.np-artist { color: var(--subdued); }
.np-artist:hover { text-decoration: underline; color: var(--text); cursor: pointer; }

.np-next h3 { font-size: 15px; margin-bottom: 8px; }
.queue-list { display: flex; flex-direction: column; gap: 2px; }
.q-row {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.q-row:hover { background: var(--panel-3); }
.q-row.is-current .q-title { color: var(--accent); }
.q-art { width: 40px; height: 40px; border-radius: 4px; overflow: hidden; flex: none; background: linear-gradient(135deg, #2b2b2b, #454545); }
.q-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-text { min-width: 0; display: flex; flex-direction: column; }
.q-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-artist { font-size: 12px; color: var(--subdued); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Toasts ------------------------------------------------------ */

.toast-stack {
  position: fixed;
  left: 24px; bottom: calc(var(--player-h) + 20px);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--accent); color: #000;
  padding: 12px 18px; border-radius: 6px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s var(--ease);
  max-width: 360px;
}
.toast.muted { background: #fff; }
.toast.error { background: #f15e6c; color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast.leaving { animation: toast-out 0.2s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Modals & menus --------------------------------------------- */

.modal-root { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.modal-root.open { pointer-events: auto; }

.scrim {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade-in 0.15s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(520px, 100%);
  max-height: 80vh;
  background: var(--elevated);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop-in 0.18s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 4px;
  font-size: 20px; font-weight: 700;
}
.modal-body { padding: 14px 22px 22px; overflow-y: auto; }
.modal-foot { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--subdued); background: #2b2b2b; }

.btn {
  padding: 10px 20px;
  border-radius: 500px;
  font-weight: 700;
  background: var(--panel-3);
  transition: transform 0.12s var(--ease), background 0.15s var(--ease);
}
.btn:hover { transform: scale(1.04); background: var(--elevated); }
.btn.primary { background: var(--accent); color: #000; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: #e91429; color: #fff; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 14px;
  cursor: pointer;
}
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.field input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }

.ctx-menu {
  position: fixed;
  z-index: 400;
  min-width: 220px;
  background: var(--elevated);
  border-radius: 6px;
  padding: 4px;
  box-shadow: var(--shadow);
  animation: fade-in 0.12s var(--ease);
}
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  color: var(--text);
  text-align: left;
  font-size: 14px;
}
.ctx-item:hover { background: rgba(255, 255, 255, 0.1); }
.ctx-item .ico { width: 16px; height: 16px; color: var(--subdued); }
.ctx-item.danger { color: #f15e6c; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 8px; }
.ctx-sub { padding: 10px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subdued); }
.ctx-scroll { max-height: 240px; overflow-y: auto; }

/* ---------- Misc states ------------------------------------------------- */

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--subdued);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-state .ico { width: 44px; height: 44px; opacity: 0.35; }
.empty-state h3 { color: var(--text); font-size: 20px; }
.empty-state code {
  background: var(--panel-3); padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: var(--accent);
}

.search-tabs { display: flex; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.search-tab {
  padding: 6px 14px; border-radius: 500px;
  background: var(--panel-3); font-weight: 600; font-size: 13px;
}
.search-tab.active { background: #fff; color: #000; }

.muted { color: var(--subdued); }
.hidden { display: none !important; }

/* ---------- Mobile nav -------------------------------------------------- */

.mobile-nav { display: none; }

/* ---------- Release types, saving and lyrics ----------------------------- */

.type-chip {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  vertical-align: middle;
}
.type-chip.sm { margin-right: 6px; }

.save-fab {
  position: absolute;
  right: 12px; top: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), background 0.15s var(--ease);
}
.save-fab .ico { width: 18px; height: 18px; }
.card:hover .save-fab, .card:focus-within .save-fab, .save-fab.saved { opacity: 1; transform: none; }
.save-fab:hover { background: rgba(0, 0, 0, 0.82); transform: scale(1.06); }
.save-fab.saved { background: var(--accent); color: #000; border-color: transparent; }

.pin-badge {
  position: absolute; left: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #000;
}
.pin-badge .ico { width: 14px; height: 14px; }

/* ---------- Lyrics ------------------------------------------------------- */

.lyrics { display: flex; flex-direction: column; gap: 16px; max-height: 60vh; }
.lyrics-loading { padding: 40px 0; text-align: center; }
.lyrics-meta { display: flex; align-items: center; gap: 14px; }
.lyrics-art {
  width: 56px; height: 56px; border-radius: 6px; overflow: hidden; flex: none;
  background: linear-gradient(135deg, #2b2b2b, #454545);
  display: grid; place-items: center;
}
.lyrics-art img { width: 100%; height: 100%; object-fit: cover; }
.lyrics-info { min-width: 0; display: flex; flex-direction: column; }
.lyrics-info strong { font-size: 16px; }
.lyrics-info span { color: var(--subdued); font-size: 13px; }
.lyrics-tag {
  margin-left: auto; flex: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(30, 215, 96, 0.4);
  border-radius: 4px; padding: 2px 6px;
}
.lyrics-scroll { overflow-y: auto; flex: 1; min-height: 200px; padding-right: 8px; }
.lyric-line {
  padding: 7px 10px; border-radius: 6px;
  font-size: 17px; line-height: 1.4; color: var(--subdued);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.lyric-line.active { color: var(--text); background: rgba(255, 255, 255, 0.06); font-weight: 600; }
.lyrics-empty { padding: 40px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lyrics-empty .ico { width: 40px; height: 40px; opacity: 0.35; }
.lyrics-empty h3 { color: var(--text); font-size: 18px; }

/* ---------- Appearance (settings-driven) --------------------------------- */

/* Roundness. Circles keep their own 50% because those selectors are more
   specific than the ones below. */
.card-art, .detail-art, .tl-cover, .brick, .brick-art, .q-art, .np-art, .lyrics-art,
.pl-item .pl-art, .modal, .ctx-menu, .search-tab, .cover-preview, .dropzone, .box,
.deck, .album-block, .artist-card, .file-row, .panel, .type-chip, .toast {
  border-radius: var(--radius);
}
.field input, .field textarea, .field select { border-radius: calc(var(--radius) * 0.6); }
.badge-320, .badge-low, .lyric-line, .pl-item, .track-row, .q-row, .tl-row { border-radius: calc(var(--radius) * 0.6); }
.tl-row, .track-row { padding-top: var(--row-pad); padding-bottom: var(--row-pad); }
.card-grid { gap: calc(var(--radius) * 1.4 + 8px); }

/* Density */
[data-density="compact"] { --row-pad: 4px; }
[data-density="compact"] .q-row { padding-top: 3px; padding-bottom: 3px; }
[data-density="compact"] .card-grid { gap: 10px; }

/* Glass panels */
[data-glass="on"] .sidebar .library-panel,
[data-glass="on"] .sidebar .nav,
[data-glass="on"] .main,
[data-glass="on"] .player,
[data-glass="on"] .nowplaying,
[data-glass="on"] .box,
[data-glass="on"] .album-block,
[data-glass="on"] .artist-card,
[data-glass="on"] .file-row {
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}
[data-glass="on"] .sidebar .library-panel,
[data-glass="on"] .sidebar .nav,
[data-glass="on"] .main { background: color-mix(in srgb, var(--panel) 72%, transparent); }
[data-glass="on"] .player,
[data-glass="on"] .nowplaying { background: color-mix(in srgb, var(--bg) 70%, transparent); }

/* Wallpaper */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image: var(--wallpaper);
  background-size: cover;
  background-position: center;
  filter: blur(var(--wall-blur));
  opacity: var(--wall-dim);
}
body::after { background: color-mix(in srgb, var(--bg) calc(100% - var(--wall-dim)), transparent); }
.app { position: relative; z-index: 1; }

/* Light themes: the stylesheet leans on white overlays, so the ones that would
   vanish on a pale background are re-derived from the text colour instead. */
[data-light="on"] .type-chip,
[data-light="on"] .local-badge {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 18%, transparent);
}
[data-light="on"] .brick,
[data-light="on"] .icon-btn:hover,
[data-light="on"] .tl-row:hover,
[data-light="on"] .q-row:hover,
[data-light="on"] .pl-item:hover,
[data-light="on"] .pl-item.active { background: color-mix(in srgb, var(--text) 6%, transparent); }
[data-light="on"] .brick:hover { background: color-mix(in srgb, var(--text) 11%, transparent); }
[data-light="on"] .ctx-item:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
[data-light="on"] .ctx-sep { background: color-mix(in srgb, var(--text) 14%, transparent); }
[data-light="on"] .lyric-line.active { background: color-mix(in srgb, var(--text) 7%, transparent); }
[data-light="on"] .search-tab.active { background: var(--text); color: var(--bg); }
[data-light="on"] .scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 25%, transparent); }
[data-light="on"] .table-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }

/* Accent glow */
[data-glow="on"] .big-play,
[data-glow="on"] .play-fab,
[data-glow="on"] .pin-badge,
[data-glow="on"] .brand-mark { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 55%, transparent)); }
[data-glow="on"] .badge-320,
[data-glow="on"] .local-pill { box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 30%, transparent); }
[data-glow="on"] .tl-row.is-current { box-shadow: inset 3px 0 0 var(--accent); }
[data-glow="on"] .slider-fill { box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
[data-glow="on"] .nav-item.active,
[data-glow="on"] .pl-item.active { box-shadow: inset 0 0 22px color-mix(in srgb, var(--accent) 12%, transparent); }

/* Artist portraits: circle (default) or match the corner roundness */
[data-artist-shape="square"] .card.round .card-art,
[data-artist-shape="square"] .detail-art.round,
[data-artist-shape="square"] .brick.round .brick-art { border-radius: var(--radius); }

/* Custom player height, desktop only: the mobile layout sets its own. */
@media (min-width: 881px) {
  :root { --player-h: var(--player-h-custom, 90px); }
}

/* Motion */
[data-motion="off"] * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* ---------- Stream counts ------------------------------------------------ */

.play-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin-left: 10px;
  font-size: 11px;
  color: var(--subdued);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.play-count .ico { width: 11px; height: 11px; opacity: 0.75; }

/* Daily mixes get a subtle sheen so they read differently from playlists. */
.card-art.mix-art::after,
.detail-art.mix-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 34%, transparent), transparent 62%);
  mix-blend-mode: screen;
}
.card-art.mix-art { position: relative; }
.detail-art.mix-art { position: relative; }

/* ---------- Local files (easter egg) ------------------------------------- */

.local-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--subdued);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.local-drop.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.local-drop .ico { width: 40px; height: 40px; opacity: 0.4; }
.local-drop strong { display: block; color: var(--text); font-size: 16px; margin: 8px 0 4px; }
.local-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; flex: none;
  background: rgba(255, 255, 255, 0.12); color: var(--text);
}
.local-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 500px; vertical-align: middle; margin-left: 8px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.local-usage { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }

/* Settings dialog */
.set-section { margin-top: 22px; }
.set-section:first-child { margin-top: 0; }
.set-section > h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--subdued); margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.set-range { display: flex; align-items: center; gap: 10px; }
.set-range input[type="range"] { flex: 1; accent-color: var(--accent); }
.set-range output { font-variant-numeric: tabular-nums; color: var(--subdued); font-size: 12px; min-width: 38px; text-align: right; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.theme-swatch {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 8px; border-radius: calc(var(--radius) * 0.7);
  border: 2px solid var(--line); cursor: pointer; text-align: left;
}
.theme-swatch:hover { border-color: var(--subdued); }
.theme-swatch.active { border-color: var(--accent); }
.theme-dots { display: flex; gap: 4px; }
.theme-dots span { width: 16px; height: 16px; border-radius: 50%; }
.logo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-chip {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  padding: 8px;
  border-radius: calc(var(--radius) * 0.7);
  border: 2px solid var(--line);
  color: var(--logo-color);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.logo-chip:hover { border-color: var(--subdued); transform: translateY(-1px); }
.logo-chip.active { border-color: var(--accent); }
.logo-chip svg, .logo-chip img { width: 100%; height: 100%; display: block; object-fit: contain; }
.logo-chip .ico { width: 20px; height: 20px; color: var(--subdued); }

.theme-swatch small { font-size: 11px; font-weight: 600; color: var(--subdued); }
.theme-swatch.active small { color: var(--text); }

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 1100px) {
  .app.np-open { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-areas: "sidebar main" "player player"; }
  .app.np-open .nowplaying {
    position: fixed; inset: 8px 8px calc(var(--player-h) + 16px); z-index: 150;
    display: flex;
  }
}

@media (max-width: 880px) {
  :root { --player-h: 118px; --mobile-nav-h: 58px; }

  .app, .app.np-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "main" "player";
    padding: 6px 6px calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    gap: 6px;
    height: 100dvh;
  }

  /* Full-bleed now-playing sheet that stops just above the player bar. */
  .app.np-open .nowplaying {
    position: fixed;
    left: 6px; right: 6px; top: 6px;
    bottom: calc(var(--player-h) + var(--mobile-nav-h) + 12px + env(safe-area-inset-bottom));
    display: flex;
    z-index: 150;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 84vw);
    z-index: 160;
    padding: 8px;
    background: var(--bg);
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
    overflow-y: auto;
  }
  .app.drawer-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, 0.8); }
  .app.drawer-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 155;
  }

  #menuBtn, #searchToggle { display: grid; }
  #backBtn, #fwdBtn { display: none; }

  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar-search { max-width: none; }
  .topbar-right { gap: 6px; }
  .topbar-right .chip-btn span { display: none; }
  #shuffleAllBtn { display: none; }

  .view { padding: 0 12px 24px; }

  .detail-head { flex-direction: column; align-items: flex-start; gap: 16px; padding: 12px 0 18px; margin: 0; }
  .detail-art { width: 150px; height: 150px; }
  .detail-art .ico { width: 52px; height: 52px; }

  .tl-head { display: none; }
  .tl-row {
    grid-template-columns: 28px minmax(0, 1fr) 48px;
    gap: 10px; padding: 0 8px;
  }
  .tl-album, .tl-date { display: none; }
  .tl-num { font-size: 13px; }

  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    padding: 8px 12px;
    height: var(--player-h);
    border-radius: 12px;
    overflow: hidden;
  }
  .player-track { grid-column: 1; grid-row: 1; gap: 10px; }
  .player-track .like-btn { display: none; }
  .player-center { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .transport { order: 2; }
  .scrub { order: 1; max-width: none; gap: 8px; }
  .time { min-width: 34px; font-size: 11px; }
  .player-right { grid-column: 2; grid-row: 1; }
  #npToggleDesktop { display: none; }
  .slider.vol { display: none; }

  .transport { gap: 14px; justify-content: center; width: 100%; }
  .play-btn { width: 44px; height: 44px; }
  .play-btn .ico { width: 22px; height: 22px; }
  #npToggle { display: grid; }
  .np-toggle { display: grid; order: -1; }
  .pt-art { width: 42px; height: 42px; }

  .mobile-nav {
    display: grid;
    grid-auto-flow: column;
    position: fixed;
    inset: auto 0 0 0;
    height: 58px;
    background: rgba(12, 12, 12, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 140;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--subdued); font-size: 10px;
  }
  .mobile-nav a.active { color: var(--text); }
  .mobile-nav .ico { width: 22px; height: 22px; }

  .toast-stack {
    left: 12px; right: 12px;
    bottom: calc(var(--player-h) + var(--mobile-nav-h) + 16px + env(safe-area-inset-bottom));
  }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 12px; }
  .brick-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brick-title { font-size: 14px; }
  .detail-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .eq span { animation: none; transform: scaleY(0.7); }
}
