/* ═══════════════════════════════════════════════════════════════
   Wavelength — a Spotify-style player UI
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #000;
  --panel: #121212;
  --panel-2: #181818;
  --elev: #242424;
  --elev-2: #2a2a2a;
  --line: rgba(255, 255, 255, .08);
  --text: #fff;
  --muted: #a7a7a7;
  --muted-2: #6a6a6a;
  --accent: #1ed760;
  --accent-dim: #1db954;
  --radius: 8px;
  --sw: 288px;              /* sidebar width */
  --nw: 0px;                /* now-playing panel width */
  --player-h: 88px;
  --ease: cubic-bezier(.3, 0, 0, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Figtree, "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

.ico { width: 1em; height: 1em; fill: currentColor; display: block; }

/* ── App shell ───────────────────────────────────────────────── */
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sw) minmax(0, 1fr) var(--nw);
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  gap: 8px;
  padding: 8px 8px 0;
  /* No transition on the track list: animating it (directly or via the --sw /
     --nw custom properties) leaves the columns stuck at their previous width
     when a media query changes them, so the sidebar fails to collapse on
     resize. Snapping is correct at every width. */
}
.app.nowbar-open { --nw: 340px; }
.app.lib-collapsed { --sw: 76px; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.side-card {
  background: var(--panel);
  border-radius: var(--radius);
}

.nav-card { padding: 8px 12px 12px; flex: 0 0 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 6px;
  color: #fff;
}
.brand:hover { text-decoration: none; }
/* Sized by height; the mark is wider than it is tall. */
.brand-mark { height: 26px; width: auto; flex: none; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.lib-collapsed .brand-name { display: none; }

.nav-list { margin-top: 4px; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}
.nav-list a:hover { color: #fff; text-decoration: none; }
.nav-list a.on { color: #fff; }
.nav-ico { font-size: 22px; display: block; }
.lib-collapsed .nav-list a span:not(.nav-ico) { display: none; }

.library-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}
.library-head { padding: 8px 8px 4px; }
.library-title {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
  border-radius: 6px;
  width: 100%;
}
.library-title:hover { color: #fff; }
.lib-collapsed .library-title span:not(.nav-ico) { display: none; }

.library-filters {
  display: flex;
  gap: 8px;
  padding: 4px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.library-filters::-webkit-scrollbar { display: none; }
.lib-collapsed .library-filters { display: none; }

.chip {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--elev);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s;
}
.chip:hover { background: var(--elev-2); }
.chip.on { background: #fff; color: #000; }

.library-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 12px;
}

.lib-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.lib-item:hover { background: var(--elev); text-decoration: none; }
.lib-item.on { background: var(--elev); }
.lib-item .art { width: 48px; height: 48px; }
.lib-item.round .art { border-radius: 50%; }
.lib-name { font-weight: 500; color: #fff; }
.lib-sub { font-size: 13px; color: var(--muted); }
.lib-item.on .lib-name { color: var(--accent); }
.lib-item .lib-text { min-width: 0; }
.lib-name, .lib-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-collapsed .lib-item { grid-template-columns: 48px; }
.lib-collapsed .lib-text { display: none; }

.eq-mini { display: none; }
.lib-item.playing .eq-mini { display: inline-flex; }

/* ── Main column ─────────────────────────────────────────────── */
.main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 16px;
  background: rgba(18, 18, 18, calc(var(--scrolled, 0) * .92));
  backdrop-filter: blur(12px);
  transition: background .2s linear;
}
.topbar-nav { display: flex; gap: 8px; }
.topbar-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar-end { display: flex; align-items: center; gap: 12px; }

.topbar-title {
  font-size: 22px;
  font-weight: 800;
  opacity: var(--scrolled, 0);
  transition: opacity .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  color: var(--muted);
  font-size: 16px;
  flex: none;
}
.round-btn:hover { color: #fff; }
.round-btn:disabled { opacity: .35; cursor: default; }
.round-btn.sm { width: 28px; height: 28px; background: transparent; font-size: 14px; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(140deg, #6b46c1, #1ed760);
  color: #06110a;
  font-weight: 800;
  font-size: 12px;
  display: grid; place-items: center;
  flex: none;
}

.pill-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  transition: transform .12s var(--ease), background .15s;
}
.pill-btn:hover { transform: scale(1.04); }
.pill-btn.ghost { color: var(--muted); }
.pill-btn.ghost:hover { color: #fff; }
.pill-btn.solid { background: #fff; color: #000; }

.view-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.view { padding: 0 0 24px; }

.site-foot {
  padding: 40px 24px 32px;
  color: var(--muted-2);
  font-size: 12px;
  max-width: 720px;
  border-top: 1px solid var(--line);
  margin: 24px 24px 0;
}
.site-foot p { margin: 0; }

/* scrollbars */
.view-scroll::-webkit-scrollbar,
.library-scroll::-webkit-scrollbar,
.now-body::-webkit-scrollbar { width: 12px; }
.view-scroll::-webkit-scrollbar-thumb,
.library-scroll::-webkit-scrollbar-thumb,
.now-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.view-scroll::-webkit-scrollbar-thumb:hover,
.library-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); background-clip: content-box; }
.view-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Generated cover art ─────────────────────────────────────── */
.art {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  flex: none;
  background:
    linear-gradient(150deg,
      hsl(var(--h) 72% 52%) 0%,
      hsl(calc(var(--h) + 34) 62% 34%) 52%,
      hsl(calc(var(--h) + 68) 54% 16%) 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4);
}
.art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .6;
  mix-blend-mode: overlay;
}
.art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .3), transparent 60%);
}
.art[data-p="0"]::before {
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .5) 0 2px, transparent 2px 13px);
}
.art[data-p="1"]::before {
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .75) 0 12%, transparent 13%),
    radial-gradient(circle at 30% 72%, rgba(0, 0, 0, .6) 0 22%, transparent 23%);
}
.art[data-p="2"]::before {
  background:
    conic-gradient(from 210deg at 50% 50%, rgba(255, 255, 255, .55), transparent 35%, rgba(0, 0, 0, .5) 70%, rgba(255, 255, 255, .4));
}
.art[data-p="3"]::before {
  background:
    repeating-radial-gradient(circle at 50% 110%, rgba(255, 255, 255, .45) 0 3px, transparent 3px 16px);
}
.art[data-p="4"]::before {
  background:
    linear-gradient(0deg, rgba(0, 0, 0, .65) 0 34%, transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 6px, transparent 6px 20px);
}
.art[data-p="5"]::before {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .6) 0 25%, transparent 25% 50%, rgba(0, 0, 0, .55) 50% 75%, transparent 75%);
  background-size: 60% 60%;
}
.art.liked {
  background: linear-gradient(150deg, #4a34c9 0%, #9b6dff 55%, #d9c8ff 100%);
}
.art.liked::before { background: none; }
.art.liked .lk {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 42%;
  color: #fff;
  z-index: 2;
}

/* ── Home / shelves ──────────────────────────────────────────── */
.hero-tint {
  position: absolute;
  inset: 0 0 auto 0;
  height: 340px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, hsl(var(--h) 45% 26%) 0%, rgba(18, 18, 18, 0) 100%);
}

.page { position: relative; z-index: 1; padding: 76px 24px 0; }

.greet { font-size: 30px; font-weight: 800; margin-bottom: 20px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 34px;
}
.quick {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  height: 64px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
  transition: background .2s;
  padding-right: 12px;
}
.quick:hover { background: rgba(255, 255, 255, .17); text-decoration: none; }
.quick .art { width: 64px; height: 64px; border-radius: 5px 0 0 5px; }
.quick b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick .mini-play {
  opacity: 0;
  transform: translateY(6px);
  transition: .2s var(--ease);
}
.quick:hover .mini-play { opacity: 1; transform: none; }

.shelf { margin-bottom: 34px; }
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.shelf-head h2 { font-size: 24px; font-weight: 800; }
.shelf-head h2 a:hover { text-decoration: underline; }
.shelf-more { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.shelf-more:hover { color: #fff; text-decoration: underline; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}
.card-grid.tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card {
  position: relative;
  padding: 12px;
  border-radius: var(--radius);
  background: transparent;
  transition: background .3s var(--ease);
  display: block;
  text-align: left;
  width: 100%;
}
.card:hover { background: var(--elev); text-decoration: none; }
.card .art { margin-bottom: 14px; }
.card.round .art { border-radius: 50%; }
.card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.play-fab {
  position: absolute;
  right: 20px;
  bottom: 92px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid; place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(8px);
  transition: .25s var(--ease);
  z-index: 3;
}
.card:hover .play-fab,
.card:focus-within .play-fab { opacity: 1; transform: none; }
.play-fab:hover { transform: scale(1.06); background: #1fdf64; }
.play-fab .ico { margin-left: 2px; }
.play-fab[data-icon="pause"] .ico { margin-left: 0; }

/* ── Collection / artist header ──────────────────────────────── */
.c-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 96px 24px 24px;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, hsl(var(--h) 42% 30%) 0%, hsl(var(--h) 30% 16%) 100%);
}
.c-head .art {
  width: 216px; height: 216px;
  border-radius: 4px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6);
}
.c-head.round .art { border-radius: 50%; }
.c-kind { font-size: 12px; font-weight: 700; text-transform: capitalize; }
.c-title {
  font-size: clamp(32px, 6vw, 88px);
  font-weight: 900;
  letter-spacing: -.045em;
  margin: 8px 0 16px;
  line-height: 1.05;
}
.c-desc { color: rgba(255, 255, 255, .72); font-size: 14px; margin-bottom: 10px; max-width: 60ch; }
.c-meta { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.c-meta b { font-weight: 700; }
.dot { color: rgba(255, 255, 255, .6); }
.c-info { min-width: 0; padding-bottom: 6px; }

.c-body {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, hsl(var(--h) 30% 16%) 0, rgba(18, 18, 18, .96) 240px, var(--panel) 480px);
  padding: 0 24px 20px;
}

.c-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0 8px;
}
.big-play {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid; place-items: center;
  font-size: 24px;
  transition: transform .12s var(--ease), background .15s;
  flex: none;
}
.big-play:hover { transform: scale(1.05); background: #1fdf64; }
.big-play .ico { margin-left: 3px; }
.big-play[data-icon="pause"] .ico { margin-left: 0; }

.icon-btn {
  color: var(--muted);
  font-size: 16px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 50%;
  transition: color .15s, transform .12s var(--ease);
}
.icon-btn:hover { color: #fff; transform: scale(1.06); }
.icon-btn.on { color: var(--accent); }
.icon-btn.big { font-size: 32px; }
.icon-btn.like.on { color: var(--accent); }
.icon-btn.dim { color: var(--muted-2); }

.icon-btn.tog { position: relative; }
.icon-btn.on.tog::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

/* ── Track list ──────────────────────────────────────────────── */
.tl { margin-top: 8px; }
.tl-head, .tl-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 5fr) minmax(0, 3.4fr) minmax(80px, 1.4fr) 112px;
  gap: 16px;
  align-items: center;
  padding: 0 16px;
  height: 56px;
  border-radius: 4px;
}
.tl.no-album .tl-head, .tl.no-album .tl-row {
  grid-template-columns: 28px minmax(0, 6fr) minmax(80px, 1.6fr) 112px;
}
.tl-head {
  height: 36px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-transform: none;
  margin-bottom: 8px;
  border-radius: 0;
  position: sticky;
  top: 0;
  background: transparent;
}
.tl-head .num { text-align: right; }
.tl-row { cursor: pointer; }
.tl-row:hover { background: rgba(255, 255, 255, .09); }
.tl-row.current .t-name { color: var(--accent); }
.tl-row .num {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  position: relative;
}
.tl-row:hover .num-txt { visibility: hidden; }
.tl-row .row-play {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: 13px;
  color: #fff;
}
.tl-row:hover .row-play { display: grid; }
.tl-row.current .row-play { color: var(--accent); }

.t-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.t-main .art { width: 40px; height: 40px; }
.t-text { min-width: 0; }
.t-name {
  color: #fff;
  font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-sub {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-sub a:hover { color: #fff; }
.t-col {
  color: var(--muted);
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-col a:hover { color: #fff; }
.t-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.t-time { min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.t-end .icon-btn { opacity: 0; }
.tl-row:hover .t-end .icon-btn,
.tl-row:focus-within .t-end .icon-btn,
.t-end .icon-btn.on { opacity: 1; }

.tl-row:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  background: rgba(255, 255, 255, .09);
}

/* animated equaliser marks a playing row */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i {
  width: 2.5px;
  background: var(--accent);
  border-radius: 1px;
  animation: eq .9s ease-in-out infinite;
  height: 40%;
}
.eq i:nth-child(2) { animation-delay: .18s; height: 80%; }
.eq i:nth-child(3) { animation-delay: .36s; height: 60%; }
.eq i:nth-child(4) { animation-delay: .54s; height: 95%; }
.eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* ── Search ──────────────────────────────────────────────────── */
.search-box {
  position: relative;
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--elev);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  height: 44px;
  transition: border-color .15s, background .15s;
}
.search-box:focus-within { border-color: #fff; background: var(--elev-2); }
.search-box .ico { font-size: 20px; color: var(--muted); flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.search-box input::placeholder { color: var(--muted); }

.sec-title { font-size: 24px; font-weight: 800; margin: 26px 0 14px; }

.result-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .result-top { grid-template-columns: 1fr; } }

.top-card {
  position: relative;
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 20px;
  transition: background .3s;
  display: block;
}
.top-card:hover { background: var(--elev); text-decoration: none; }
.top-card .art { width: 92px; height: 92px; margin-bottom: 18px; }
.top-card.round .art { border-radius: 50%; }
.top-card h3 { font-size: 32px; font-weight: 900; letter-spacing: -.03em; margin-bottom: 8px; }
.top-card .kind {
  display: inline-block;
  margin-top: 6px;
  background: #000;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.empty {
  padding: 60px 8px;
  text-align: center;
  color: var(--muted);
}
.empty h3 { font-size: 22px; color: #fff; margin-bottom: 8px; }

.genre-card {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 16px;
  background: hsl(var(--h) 62% 38%);
  font-size: 20px;
  font-weight: 800;
  display: block;
}
.genre-card:hover { text-decoration: none; filter: brightness(1.12); }
.genre-card::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -12%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: linear-gradient(140deg, hsl(calc(var(--h) + 40) 70% 55%), hsl(calc(var(--h) - 20) 60% 22%));
  transform: rotate(25deg);
  box-shadow: -6px -6px 16px rgba(0, 0, 0, .35);
}

/* ── Now playing panel ───────────────────────────────────────── */
.nowbar {
  grid-column: 3;
  grid-row: 1;
  background: var(--panel);
  border-radius: var(--radius);
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.app.nowbar-open .nowbar { display: flex; }
.now-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 12px 18px;
}
.now-head h2 { font-size: 16px; font-weight: 700; }
.now-body { overflow-y: auto; padding: 0 18px 20px; flex: 1; }
.now-art { width: 100%; aspect-ratio: 1; border-radius: var(--radius); margin-bottom: 16px; }
.now-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.now-artist { color: var(--muted); font-size: 14px; margin-bottom: 18px; display: block; }
.now-panel {
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.now-panel h4 { font-size: 15px; margin-bottom: 10px; }
.now-panel .k { color: var(--muted); font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }

.viz {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
  margin-top: 10px;
}
.viz i {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), hsl(var(--h) 70% 45%));
  border-radius: 2px 2px 0 0;
  height: 3%;
  transition: height .07s linear;
}

.q-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
}
.q-row:hover, .q-row:focus-visible { background: var(--elev); outline: none; }
.q-row:focus-visible { box-shadow: inset 0 0 0 2px #fff; }
/* Tracks the listener queued by hand get a rail so they read as deliberate. */
.q-row.manual::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
}
.q-dur { font-variant-numeric: tabular-nums; }
.q-del { opacity: 0; font-size: 13px; }
.q-row:hover .q-del, .q-row:focus-within .q-del { opacity: 1; }
.q-row .art { width: 40px; height: 40px; }
.q-row .qn { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row .qa { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row.current .qn { color: var(--accent); }

/* ── Player bar ──────────────────────────────────────────────── */
.player {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(180px, 30%) minmax(0, 1fr) minmax(180px, 30%);
  align-items: center;
  gap: 16px;
  padding: 0 8px;
  height: var(--player-h);
}

.p-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.p-art { width: 56px; height: 56px; border-radius: 4px; flex: none; }
.p-art.art { box-shadow: none; }
.p-meta { min-width: 0; }
.p-title {
  display: block;
  font-size: 14px;
  color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-artist {
  display: block;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-artist:hover { color: #fff; }

.p-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.p-controls { display: flex; align-items: center; gap: 18px; }
.play-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: grid; place-items: center;
  font-size: 15px;
  transition: transform .12s var(--ease);
  flex: none;
}
.play-btn:hover { transform: scale(1.07); }
.play-btn .ico { margin-left: 2px; }
.play-btn[data-icon="pause"] .ico { margin-left: 0; }

.p-seek {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 620px;
}
.t-cur, .t-dur {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  flex: none;
}
.t-dur { text-align: left; }

.bar { flex: 1; padding: 6px 0; cursor: pointer; touch-action: none; }
.bar-track {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .28);
  overflow: visible;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: #fff;
  border-radius: 2px;
}
.bar:hover .bar-fill { background: var(--accent); }
.bar-knob {
  position: absolute;
  right: -6px; top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%) scale(0);
  transition: transform .12s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.bar:hover .bar-knob, .bar:focus-visible .bar-knob, .bar.dragging .bar-knob { transform: translateY(-50%) scale(1); }

.p-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.p-right .vol { flex: 0 1 100px; }

/* ── Context menu ────────────────────────────────────────────── */
.menu {
  position: fixed;
  z-index: 90;
  min-width: 220px;
  padding: 4px;
  background: var(--elev);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .7);
  animation: menu-in .12s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--elev-2); outline: none; }
.menu-item.danger { color: #f4726c; }
.mi-ico { font-size: 16px; width: 16px; display: grid; place-items: center; color: var(--muted); flex: none; }
.menu-item.danger .mi-ico { color: inherit; }
.menu-sep { height: 1px; margin: 4px 8px; background: rgba(255, 255, 255, .12); }

/* ── Unsupported-browser notice ──────────────────────────────── */
.unsupported {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(560px, calc(100vw - 32px));
  padding: 14px 18px;
  background: #3a1d1b;
  border: 1px solid #a8443c;
  border-radius: 8px;
  color: #ffd9d5;
  font-size: 14px;
  line-height: 1.5;
}
.unsupported strong { color: #fff; display: block; margin-bottom: 2px; }

/* ── Toast + modal ───────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 18px);
  transform: translate(-50%, 20px);
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: .25s var(--ease);
  z-index: 60;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--elev);
  border-radius: 10px;
  padding: 28px;
  width: min(460px, 100%);
  max-height: 80vh;
  overflow: auto;
}
.modal-card h2 { font-size: 22px; margin-bottom: 18px; }
.keys { margin-bottom: 22px; }
.keys li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.keys kbd {
  background: #000;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 4px;
  padding: 2px 8px;
  font: 600 12px/1.6 Figtree, monospace;
  color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .app.nowbar-open { --nw: 300px; }
}
@media (max-width: 1000px) {
  .app { --sw: 76px; }
  .brand-name, .nav-list a span:not(.nav-ico),
  .library-title span:not(.nav-ico), .library-filters, .lib-text { display: none; }
  .lib-item { grid-template-columns: 48px; }
  .app.nowbar-open { --nw: 0px; }
  .app.nowbar-open .nowbar {
    position: fixed;
    inset: 8px 8px calc(var(--player-h) + 8px);
    z-index: 40;
    width: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
  }
}
@media (max-width: 780px) {
  .tl-head, .tl-row { grid-template-columns: 28px minmax(0, 1fr) 112px; }
  .tl .col-album, .tl .col-plays { display: none; }
  .c-head { flex-direction: column; align-items: flex-start; padding-top: 80px; }
  .c-head .art { width: 148px; height: 148px; }
  .player { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; }
  .p-right { display: none; }
  .p-center { align-items: flex-end; }
  .p-seek { max-width: 260px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .c-head, .c-body { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 560px) {
  .app { --sw: 0px; padding: 6px 6px 0; }
  .sidebar { display: none; }
  .p-seek { display: none; }
  .greet { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
