/* ============================================================
   Spotify Web Player — faithful recreation
   ============================================================ */
@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --bg-base: #000000;
  --bg-panel: #121212;
  --bg-elevated: #1f1f1f;
  --bg-highlight: #1a1a1a;
  --bg-press: #000;
  --bg-tinted: hsla(0, 0%, 100%, .07);
  --bg-tinted-hi: hsla(0, 0%, 100%, .1);
  --bg-tinted-press: hsla(0, 0%, 100%, .04);
  --text: #ffffff;
  --text-sub: #b3b3b3;
  --text-subdued: #6a6a6a;
  --text-negative: #f15e6c;
  --accent: #1ed760;
  --accent-hi: #3be477;
  --essential: #1ed760;
  --heart: #1ed760;
  --border-subtle: hsla(0,0%,100%,.1);
  --scrollbar: hsla(0,0%,100%,.3);
  --sidebar-w: 320px;
  --sidebar-min: 72px;
  --player-h: 76px;
  --topbar-h: 64px;
  --radius-panel: 8px;
  --gap: 8px;
  --font: 'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --shadow-card: 0 8px 24px rgba(0,0,0,.5);
  --shadow-menu: 0 16px 24px rgba(0,0,0,.3), 0 6px 8px rgba(0,0,0,.2);
  --ease: cubic-bezier(.3,0,.4,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button { font-family: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; -webkit-user-drag: none; user-select: none; }
input { font-family: inherit; }
::selection { background: rgba(30, 215, 96, .3); }

/* scrollbars */
.scroll-area { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
.scroll-area::-webkit-scrollbar { width: 12px; }
.scroll-area::-webkit-scrollbar-thumb { background: hsla(0,0%,100%,.3); border: 3px solid transparent; background-clip: padding-box; border-radius: 6px; }
.scroll-area::-webkit-scrollbar-thumb:hover { background: hsla(0,0%,100%,.4); background-clip: padding-box; border: 3px solid transparent; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }

/* ============ APP GRID ============ */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-body {
  display: flex; flex: 1; min-height: 0;
  padding: var(--gap) var(--gap) 0 var(--gap);
  gap: var(--gap);
}
.app-body.no-player { padding-bottom: var(--gap); }

/* ============ SIDEBAR ============ */
#sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-min);
  display: flex; flex-direction: column; gap: var(--gap);
  flex-shrink: 0;
}
.side-panel {
  background: var(--bg-panel); border-radius: var(--radius-panel);
  display: flex; flex-direction: column; min-height: 0;
}
.side-panel.nav { padding: 8px 12px; }
.brand {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 12px 4px; height: 44px;
}
.brand svg { width: 32px; height: 32px; fill: var(--text); flex-shrink: 0; }
.brand .wordmark { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.nav-list { list-style: none; padding: 4px 0; }
.nav-item {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 12px; height: 48px;
  color: var(--text-sub); font-weight: 700; font-size: 15px;
  border-radius: 4px; cursor: pointer;
  transition: color .2s var(--ease);
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover, .nav-item.active { color: var(--text); }
.nav-item .nav-label { white-space: nowrap; overflow: hidden; }

/* Library panel */
.library { flex: 1; min-height: 0; }
.lib-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 6px; height: 56px; flex-shrink: 0;
}
.lib-title {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-sub); font-weight: 700; font-size: 15px;
  padding: 4px 8px; border-radius: 4px; cursor: pointer;
  transition: color .2s;
}
.lib-title:hover { color: var(--text); }
.lib-title svg { width: 24px; height: 24px; fill: currentColor; }
.lib-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-sub); transition: color .15s, background-color .15s, transform .1s;
  position: relative;
}
.icon-btn:hover { color: var(--text); background: var(--bg-tinted); }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }

.lib-chips { display: flex; gap: 8px; padding: 4px 16px 10px; flex-shrink: 0; overflow: hidden; }
.chip {
  background: var(--bg-tinted); color: var(--text);
  font-size: 13px; font-weight: 500; padding: 6px 12px;
  border-radius: 9999px; white-space: nowrap; cursor: pointer;
  transition: background-color .15s;
}
.chip:hover { background: var(--bg-tinted-hi); }
.chip.active { background: var(--text); color: #000; }

.lib-tools { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 6px; flex-shrink: 0; }
.lib-search-btn { color: var(--text-sub); }
.lib-sort { display: flex; align-items: center; gap: 6px; color: var(--text-sub); font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.lib-sort:hover { color: var(--text); }
.lib-sort svg { width: 14px; height: 14px; fill: currentColor; }

.lib-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.lib-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px; border-radius: 6px; cursor: pointer;
}
.lib-row:hover { background: var(--bg-tinted); }
.lib-row.active { background: var(--bg-tinted-press); }
.lib-row img { width: 48px; height: 48px; border-radius: 4px; flex-shrink: 0; }
.lib-row img.round { border-radius: 50%; }
.lib-row .lr-text { min-width: 0; }
.lib-row .lr-name { font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row.playing .lr-name { color: var(--accent); }
.lib-row .lr-sub { font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.lib-row .lr-sub svg { width: 12px; height: 12px; fill: var(--accent); flex-shrink: 0; }
.lib-row .lr-eq { margin-left: auto; flex-shrink: 0; }

/* collapsed sidebar (icon rail) */
#sidebar.collapsed { width: var(--sidebar-min); }
#sidebar.collapsed .nav-item { justify-content: center; padding: 8px 0; }
#sidebar.collapsed .nav-label, #sidebar.collapsed .brand .wordmark,
#sidebar.collapsed .lib-title .nav-label, #sidebar.collapsed .lib-actions,
#sidebar.collapsed .lib-chips, #sidebar.collapsed .lib-tools { display: none; }
#sidebar.collapsed .brand { justify-content: center; }
#sidebar.collapsed .lib-head { justify-content: center; padding: 10px 8px 6px; }
#sidebar.collapsed .lib-title { padding: 4px; }
#sidebar.collapsed .lib-row { justify-content: center; padding: 6px; }
#sidebar.collapsed .lib-row .lr-text, #sidebar.collapsed .lib-row .lr-eq { display: none; }

/* ============ MAIN ============ */
#main {
  flex: 1; min-width: 0; position: relative;
  background: var(--bg-panel); border-radius: var(--radius-panel);
  overflow: hidden; display: flex; flex-direction: column;
}
#main .scroll-viewport { flex: 1; overflow-y: auto; min-height: 0; position: relative; }

/* topbar */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 16px 32px;
  transition: background-color .25s var(--ease);
}
.topbar.solid { background: var(--topbar-bg, #121212); box-shadow: 0 6px 10px rgba(0,0,0,.25); }
.topbar .nav-arrows { display: flex; gap: 8px; }
.arrow-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.arrow-btn svg { width: 16px; height: 16px; fill: currentColor; }
.arrow-btn.disabled { color: #727272; cursor: not-allowed; opacity: .6; }
.arrow-btn:not(.disabled):hover { transform: scale(1.04); }

.topbar .search-wrap { flex: 1; max-width: 364px; }
.search-input {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated); border: 1px solid transparent;
  border-radius: 9999px; height: 48px; padding: 0 14px;
  transition: background-color .15s, border-color .15s;
  width: 100%;
}
.search-input:hover { background: #2a2a2a; border-color: var(--border-subtle); }
.search-input:focus-within { border-color: var(--text); background: #2a2a2a; }
.search-input svg { width: 16px; height: 16px; fill: var(--text-sub); flex-shrink: 0; }
.search-input input {
  background: transparent; border: 0; outline: 0; color: var(--text);
  font-size: 14px; width: 100%;
}
.search-input input::placeholder { color: #757575; font-weight: 500; }
.search-input .clear-q { color: var(--text-sub); display: none; }
.search-input .clear-q:hover { color: var(--text); }

.topbar .top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill-btn {
  background: var(--text); color: #000; font-weight: 700; font-size: 14px;
  padding: 8px 16px; border-radius: 9999px;
}
.pill-btn:hover { transform: scale(1.04); background: #f0f0f0; }
.ghost-btn {
  color: var(--text-sub); font-weight: 700; font-size: 14px; padding: 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.ghost-btn:hover { color: var(--text); transform: scale(1.04); }
.ghost-btn svg { width: 16px; height: 16px; fill: currentColor; }
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%; background: #503a56;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  border: 4px solid rgba(0,0,0,.6); padding: 0; width: 40px; height: 40px;
  box-sizing: content-box; border-width: 0; outline: 4px solid rgba(0,0,0,.65); outline-offset: -4px;
}
.avatar-btn:hover { transform: scale(1.06); }

/* topbar inner page title (shown when scrolled on detail pages) */
.topbar .tb-title {
  display: none; align-items: center; gap: 16px; min-width: 0;
}
.topbar.with-title .tb-title { display: flex; animation: view-in .2s var(--ease); }
.tb-play {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 8px 8px rgba(0,0,0,.3);
}
.tb-play svg { width: 22px; height: 22px; fill: #000; margin-left: 2px; }
.tb-play:hover { transform: scale(1.06); background: var(--accent-hi); }
.topbar .tb-title h2 { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ VIEWS ============ */
.view { min-height: 100%; animation: view-in .22s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view-pad { padding: calc(var(--topbar-h) + 8px) 32px 48px; }

.greeting { font-size: 32px; font-weight: 700; letter-spacing: -1px; margin: 8px 0 16px; }

.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px; margin-bottom: 32px;
}
.quick-tile {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-tinted); border-radius: 4px; overflow: hidden;
  height: 64px; cursor: pointer; position: relative;
  transition: background-color .2s var(--ease);
}
.quick-tile:hover { background: var(--bg-tinted-hi); }
.quick-tile img { width: 64px; height: 64px; flex-shrink: 0; }
.quick-tile .qt-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 56px; }
.quick-tile .qt-play {
  position: absolute; right: 10px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s var(--ease);
  box-shadow: 0 8px 8px rgba(0,0,0,.3);
}
.quick-tile:hover .qt-play { opacity: 1; transform: translateY(0); }
.qt-play svg { width: 18px; height: 18px; fill: #000; margin-left: 2px; }

/* shelf */
.shelf { margin-bottom: 36px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.shelf-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.shelf-head h2 a:hover { text-decoration: underline; }
.shelf-head .show-all { font-size: 13px; font-weight: 700; color: var(--text-sub); letter-spacing: .5px; }
.shelf-head .show-all:hover { text-decoration: underline; color: var(--text); }
.shelf-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 180px;
  gap: 20px; overflow-x: auto; padding: 4px 4px 16px;
  scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row.grid-rows { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-columns: unset; }

.card {
  background: var(--bg-highlight); border-radius: 8px; padding: 16px;
  cursor: pointer; transition: background-color .25s var(--ease);
  position: relative; min-width: 0;
}
.card:hover { background: var(--bg-elevated); }
.card .card-art { position: relative; margin-bottom: 14px; }
.card .card-art img { width: 100%; aspect-ratio: 1; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.card .card-art img.round { border-radius: 50%; }
.card .card-play {
  position: absolute; right: 8px; bottom: 8px;
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s var(--ease), background-color .1s;
  box-shadow: 0 8px 8px rgba(0,0,0,.3);
}
.card:hover .card-play { opacity: 1; transform: translateY(0); }
.card .card-play:hover { transform: scale(1.06); background: var(--accent-hi); }
.card .card-play svg { width: 22px; height: 22px; fill: #000; margin-left: 2px; }
.card .card-play.playing { opacity: 1; transform: translateY(0); }
.card .card-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.card .card-sub {
  font-size: 13px; color: var(--text-sub); line-height: 1.45; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}

/* ============ SEARCH VIEW ============ */
.browse-title { font-size: 24px; font-weight: 700; margin: 8px 0 20px; }
.tiles-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.tile {
  border-radius: 8px; aspect-ratio: 1.78; padding: 16px; position: relative;
  overflow: hidden; cursor: pointer;
}
.tile h3 { font-size: 22px; font-weight: 700; letter-spacing: -.5px; position: relative; z-index: 1; }
.tile img {
  position: absolute; width: 100px; height: 100px; right: -16px; bottom: -4px;
  transform: rotate(25deg); border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* search results */
.search-layout { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; }
.sr-col h2 { font-size: 24px; font-weight: 700; margin-bottom: 14px; }
.top-result {
  background: var(--bg-highlight); border-radius: 8px; padding: 20px;
  cursor: pointer; position: relative; transition: background-color .25s;
}
.top-result:hover { background: var(--bg-elevated); }
.top-result img { width: 92px; height: 92px; border-radius: 6px; margin-bottom: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.top-result img.round { border-radius: 50%; }
.top-result h3 { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-bottom: 8px; }
.top-result .tr-sub { color: var(--text-sub); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.top-result .tr-kind { background: #000; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px; border-radius: 9999px; }
.top-result .card-play { right: 20px; bottom: 20px; }
.sr-songs { min-width: 0; }
.sr-song {
  display: flex; align-items: center; gap: 14px; padding: 6px 12px 6px 8px;
  border-radius: 6px; cursor: pointer;
}
.sr-song:hover { background: var(--bg-tinted); }
.sr-song img { width: 40px; height: 40px; border-radius: 4px; }
.sr-song .ss-text { min-width: 0; flex: 1; }
.sr-song .ss-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-song.playing .ss-title { color: var(--accent); }
.sr-song .ss-artist { font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-song .ss-artist:hover { text-decoration: underline; color: var(--text); }
.sr-song .ss-actions { display: flex; align-items: center; gap: 10px; }
.sr-song .ss-dur { color: var(--text-sub); font-size: 14px; font-variant-numeric: tabular-nums; }
.sr-section { margin-top: 36px; }
.result-tabs { display: flex; gap: 8px; margin: 4px 0 24px; }

.no-results { text-align: center; padding: 80px 20px; }
.no-results h2 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.no-results p { color: var(--text-sub); font-size: 15px; }

/* ============ DETAIL PAGE (album/playlist/artist/liked) ============ */
.detail-hero {
  position: relative; padding: calc(var(--topbar-h) + 24px) 32px 24px;
  display: flex; align-items: flex-end; gap: 24px;
}
.detail-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--hero-c, #535353) 0%, transparent 100%);
  opacity: .9; z-index: 0;
}
.detail-hero > * { position: relative; z-index: 1; }
.detail-hero .hero-art {
  width: 232px; height: 232px; flex-shrink: 0;
  box-shadow: 0 4px 60px rgba(0,0,0,.5); border-radius: 4px;
}
.detail-hero .hero-art.round { border-radius: 50%; }
.detail-hero .hero-text { min-width: 0; }
.detail-hero .hero-kind { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.detail-hero h1 {
  font-size: clamp(40px, 6vw, 88px); font-weight: 800; letter-spacing: -3px;
  line-height: 1.05; margin-bottom: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-hero h1.small { font-size: clamp(28px, 4vw, 56px); }
.detail-hero .hero-desc { color: hsla(0,0%,100%,.7); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.detail-hero .hero-meta { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; flex-wrap: wrap; }
.detail-hero .hero-meta img { width: 24px; height: 24px; border-radius: 50%; margin-right: 4px; }
.detail-hero .hero-meta .dot::before { content: '•'; margin: 0 4px; color: var(--text); }
.detail-hero .hero-meta .meta-strong { font-weight: 700; }
.detail-hero .hero-meta .meta-link { font-weight: 700; }
.detail-hero .hero-meta .meta-link:hover { text-decoration: underline; }
.detail-hero .hero-meta .meta-dim { color: hsla(0,0%,100%,.7); }

.detail-body { position: relative; }
.detail-body::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--hero-c, #535353) -140px, transparent 260px);
  opacity: .35; z-index: 0;
}
.detail-body > * { position: relative; z-index: 1; }

.action-bar { display: flex; align-items: center; gap: 24px; padding: 24px 32px 8px; }
.play-fab {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  transition: transform .1s, background-color .1s;
}
.play-fab svg { width: 26px; height: 26px; fill: #000; margin-left: 3px; }
.play-fab svg.pause-ic { margin-left: 0; }
.play-fab:hover { transform: scale(1.05); background: var(--accent-hi); }
.ab-btn {
  color: var(--text-sub); display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, transform .1s;
}
.ab-btn:hover { color: var(--text); transform: scale(1.06); }
.ab-btn svg { width: 32px; height: 32px; fill: currentColor; }
.ab-btn.heart-on svg { fill: var(--heart); }
.follow-btn {
  border: 1px solid var(--border-subtle); border-radius: 9999px;
  padding: 7px 16px; font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.follow-btn:hover { border-color: var(--text); transform: scale(1.04); }
.follow-btn.on { border-color: var(--text); }

/* track table */
.track-table { padding: 0 32px 32px; }
.tt-head, .tt-row {
  display: grid;
  grid-template-columns: 20px 6fr 4fr minmax(110px, 1fr);
  gap: 16px; align-items: center;
  padding: 0 16px;
}
.tt-head {
  color: var(--text-sub); font-size: 12px; font-weight: 500; letter-spacing: 1px;
  text-transform: uppercase; border-bottom: 1px solid var(--border-subtle);
  height: 36px; margin-bottom: 8px;
  position: sticky; top: 0; z-index: 5;
  background: rgba(18, 18, 18, .82); backdrop-filter: blur(10px);
}
.tt-head .tt-dur { justify-self: end; margin-right: 28px; }
.tt-head .tt-dur svg { width: 16px; height: 16px; fill: var(--text-sub); }
.tt-row {
  height: 56px; border-radius: 4px; cursor: default;
  transition: background-color .1s;
}
.tt-row:hover { background: var(--bg-tinted); }
.tt-row.playing .tt-title { color: var(--accent); }
.tt-num { color: var(--text-sub); font-size: 15px; font-variant-numeric: tabular-nums; position: relative; width: 20px; text-align: center; }
.tt-num .n-play, .tt-num .n-eq { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; }
.tt-num .n-play svg { width: 14px; height: 14px; fill: var(--text); }
.tt-row:hover .tt-num .n-idx { display: none; }
.tt-row:hover .tt-num .n-play { display: block; }
.tt-row.playing .tt-num .n-idx { display: none; }
.tt-row.playing .tt-num .n-eq { display: flex; }
.tt-row.playing:hover .tt-num .n-eq { display: none; }
.tt-row.playing:hover .tt-num .n-play { display: block; }
.tt-row.playing.paused .tt-num .n-eq { display: none; }
.tt-row.playing.paused .tt-num .n-play { display: block; }
.tt-row.playing.paused .tt-num .n-idx { display: none; }
.tt-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tt-main img { width: 40px; height: 40px; border-radius: 4px; flex-shrink: 0; }
.tt-main .tt-text { min-width: 0; }
.tt-title { font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-artist { font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-artist a:hover, .tt-album a:hover { text-decoration: underline; color: var(--text); }
.tt-row:hover .tt-artist { color: var(--text); }
.tt-album { font-size: 14px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-album a:hover { text-decoration: underline; }
.tt-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tt-right .tt-like, .tt-right .tt-more { opacity: 0; }
.tt-row:hover .tt-like, .tt-row:hover .tt-more { opacity: 1; }
.tt-right .tt-like.on { opacity: 1; }
.mini-btn { color: var(--text-sub); width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.mini-btn:hover { color: var(--text); }
.mini-btn svg { width: 16px; height: 16px; fill: currentColor; }
.mini-btn.on { color: var(--heart); }
.mini-btn.on svg { fill: var(--heart); }
.tt-dur { color: var(--text-sub); font-size: 14px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* equalizer bars */
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq span { width: 3px; background: var(--accent); animation: eqb 1s ease-in-out infinite; }
.eq span:nth-child(1) { animation-delay: -0.4s; height: 60%; }
.eq span:nth-child(2) { animation-delay: -0.9s; height: 100%; }
.eq span:nth-child(3) { animation-delay: -0.2s; height: 80%; }
.eq span:nth-child(4) { animation-delay: -0.7s; height: 40%; }
@keyframes eqb { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.paused .eq span, .eq.paused span { animation-play-state: paused; transform: scaleY(.3); }

/* artist page */
.artist-hero {
  position: relative; padding: calc(var(--topbar-h) + 100px) 32px 24px;
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 340px;
}
.artist-hero .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; z-index: 0; }
.artist-hero .hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.55) 100%); }
.artist-hero > *:not(.hero-bg) { position: relative; z-index: 1; }
.verified { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.verified svg { width: 20px; height: 20px; }
.artist-hero h1 { font-size: clamp(48px, 7vw, 96px); font-weight: 800; letter-spacing: -4px; line-height: 1; }
.artist-hero .listeners { margin-top: 12px; font-size: 15px; }
.popular-rank { font-size: 15px; color: var(--text-sub); width: 20px; text-align: center; }
.about-card {
  position: relative; border-radius: 8px; overflow: hidden; padding: 24px;
  min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center 20%;
}
.about-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8), transparent 70%); }
.about-card > * { position: relative; }
.about-card .listeners-big { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.about-card p { color: var(--text-sub); font-size: 14px; line-height: 1.55; max-width: 720px; }
.section-pad { padding: 8px 32px 0; }
.section-pad h2 { font-size: 24px; font-weight: 700; margin: 16px 0 14px; letter-spacing: -.5px; }

/* queue view */
.queue-sec h3 { font-size: 15px; font-weight: 700; color: var(--text-sub); margin: 24px 0 8px; letter-spacing: .3px; }
.queue-sec h3:first-child { margin-top: 8px; }

/* library view */
.lib-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.empty-state { text-align: center; padding: 90px 20px; color: var(--text-sub); }
.empty-state h2 { color: var(--text); font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.empty-state p { font-size: 15px; margin-bottom: 22px; }
.empty-state .pill-btn { display: inline-block; }

/* genre/category view */
.cat-hero { padding: calc(var(--topbar-h) + 60px) 32px 40px; }
.cat-hero h1 { font-size: clamp(40px, 6vw, 88px); font-weight: 800; letter-spacing: -3px; }

/* footer legal-ish */
.view-foot { padding: 48px 32px 40px; margin-top: 40px; border-top: 1px solid var(--border-subtle); }
.view-foot .foot-links { display: flex; gap: 32px; flex-wrap: wrap; color: var(--text-sub); font-size: 12px; font-weight: 500; }
.view-foot .foot-col { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.view-foot .foot-col b { color: var(--text); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.view-foot .foot-copy { margin-top: 32px; color: var(--text-subdued); font-size: 12px; }

/* skeleton loading */
.skel { position: relative; overflow: hidden; background: var(--bg-tinted-press); border-radius: 4px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, hsla(0,0%,100%,.05), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ============ NOW PLAYING BAR ============ */
#playerbar {
  height: var(--player-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; position: relative; z-index: 40;
}
.pb-left { display: flex; align-items: center; gap: 12px; width: 30%; min-width: 180px; }
.pb-art { width: 56px; height: 56px; border-radius: 4px; flex-shrink: 0; cursor: pointer; position: relative; }
.pb-art img { width: 100%; height: 100%; border-radius: 4px; }
.pb-text { min-width: 0; }
.pb-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-title a:hover { text-decoration: underline; }
.pb-artist { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist a:hover { text-decoration: underline; color: var(--text); }
.pb-like { flex-shrink: 0; }
.pb-empty { color: var(--text-subdued); font-size: 13px; }

.pb-center { flex: 1; max-width: 722px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pb-controls { display: flex; align-items: center; gap: 20px; }
.ctl-btn { color: var(--text-sub); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; position: relative; transition: color .15s, transform .1s; }
.ctl-btn:hover { color: var(--text); }
.ctl-btn svg { width: 16px; height: 16px; fill: currentColor; }
.ctl-btn.disabled { color: #535353; cursor: not-allowed; }
.ctl-btn.disabled:hover { color: #535353; }
.ctl-btn.active { color: var(--accent); }
.ctl-btn.active:hover { color: var(--accent-hi); }
.ctl-btn.active::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.play-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--text);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform .1s;
}
.play-btn svg { width: 16px; height: 16px; fill: #000; margin-left: 1px; }
.play-btn svg.pause-ic { margin-left: 0; }
.play-btn:hover { transform: scale(1.06); }

.pb-seek { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 560px; }
.pb-time { font-size: 11px; color: var(--text-sub); font-variant-numeric: tabular-nums; min-width: 40px; }
.pb-time:last-child { text-align: right; }

/* slider (seek + volume) */
.slider { position: relative; flex: 1; height: 12px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.slider .track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: hsla(0,0%,100%,.3); }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--text); width: 0%; }
.slider .thumb {
  position: absolute; top: 50%; left: 0%; width: 12px; height: 12px;
  border-radius: 50%; background: var(--text); transform: translate(-50%,-50%);
  opacity: 0; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.slider:hover .fill, .slider.dragging .fill { background: var(--accent); }
.slider:hover .thumb, .slider.dragging .thumb { opacity: 1; }

.pb-right { display: flex; align-items: center; gap: 4px; width: 30%; min-width: 180px; justify-content: flex-end; }
.pb-right .slider { width: 96px; flex: 0 1 96px; }
.vol-icon { color: var(--text-sub); }
.vol-icon:hover { color: var(--text); }

/* ============ NOW PLAYING SIDE PANEL ============ */
#np-panel {
  width: 0; overflow: hidden; flex-shrink: 0;
  transition: width .25s var(--ease);
}
#np-panel.open { width: 336px; }
.np-inner {
  width: 336px; height: 100%; background: var(--bg-panel);
  border-radius: var(--radius-panel); display: flex; flex-direction: column;
}
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.np-head h3 { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-scroll { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.np-art { width: 100%; aspect-ratio: 1; border-radius: 8px; margin-bottom: 16px; }
.np-track-name { font-size: 20px; font-weight: 700; }
.np-track-artist { color: var(--text-sub); font-size: 15px; margin-bottom: 20px; }
.np-card { background: var(--bg-elevated); border-radius: 8px; overflow: hidden; margin-bottom: 16px; position: relative; }
.np-card .np-card-img { width: 100%; height: 180px; object-fit: cover; object-position: center 25%; }
.np-card .np-card-body { padding: 16px; }
.np-card .np-card-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.np-card p { color: var(--text-sub); font-size: 13px; line-height: 1.5; }
.np-card .np-stats { font-size: 13px; color: var(--text); font-weight: 600; margin-top: 10px; }

/* ============ CONTEXT MENU ============ */
#ctx-menu {
  position: fixed; z-index: 200; min-width: 196px;
  background: #282828; border-radius: 4px; padding: 4px;
  box-shadow: var(--shadow-menu); display: none;
}
#ctx-menu.open { display: block; }
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; font-size: 14px; font-weight: 500; color: var(--text);
  border-radius: 2px; text-align: left; white-space: nowrap;
}
.ctx-item:hover { background: hsla(0,0%,100%,.1); }
.ctx-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.ctx-item .ctx-ic { color: var(--text-sub); }
.ctx-item.on .ctx-ic, .ctx-item.on { color: var(--accent); }
.ctx-item.on .ctx-ic svg { fill: var(--accent); }
.ctx-sep { height: 1px; background: hsla(0,0%,100%,.1); margin: 4px 10px; }
.ctx-label { padding: 8px 12px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-sub); }

/* ============ TOAST ============ */
#toasts { position: fixed; left: 50%; bottom: calc(var(--player-h) + 24px); transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #2e77d0; color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toast-in .25s var(--ease); display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
}
.toast.green { background: var(--accent); color: #000; }
.toast.dark { background: #282828; color: var(--text); }
.toast svg { width: 16px; height: 16px; fill: currentColor; }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
  .detail-hero h1 { letter-spacing: -2px; }
}
@media (max-width: 1100px) {
  #np-panel.open { width: 300px; }
  .np-inner { width: 300px; }
  .tt-head, .tt-row { grid-template-columns: 20px 6fr 3fr minmax(90px, 1fr); }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 240px; }
  .view-pad { padding: calc(var(--topbar-h) + 8px) 20px 40px; }
  .detail-hero { padding: calc(var(--topbar-h) + 16px) 20px 20px; }
  .action-bar, .track-table, .section-pad, .cat-hero { padding-left: 20px; padding-right: 20px; }
  .topbar { padding: 16px 20px; }
  .search-layout { grid-template-columns: 1fr; }
  .tt-head, .tt-row { grid-template-columns: 20px 1fr minmax(90px, auto); }
  .tt-album { display: none; }
}
@media (max-width: 720px) {
  :root { --sidebar-w: 76px; --player-h: 64px; }
  #sidebar .nav-label, #sidebar .brand .wordmark, #sidebar .lib-title .nav-label,
  #sidebar .lib-actions, #sidebar .lib-chips, #sidebar .lib-tools { display: none; }
  #sidebar .nav-item { justify-content: center; padding: 8px 0; }
  #sidebar .brand { justify-content: center; }
  #sidebar .lib-head { justify-content: center; padding: 10px 8px 6px; }
  #sidebar .lib-title { padding: 4px; }
  #sidebar .lib-row { justify-content: center; padding: 6px; }
  #sidebar .lib-row .lr-text, #sidebar .lib-row .lr-eq { display: none; }
  .pb-right .slider { display: none; }
  .pb-right { width: auto; min-width: 0; }
  .pb-right #ctl-lyrics, .pb-right #ctl-devices, .pb-right #ctl-np { display: none; }
  .pb-left { width: auto; min-width: 0; }
  .pb-seek .pb-time { display: none; }
  .ghost-btn .txt { display: none; }
  .greeting { font-size: 26px; }
  .detail-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .detail-hero .hero-art { width: 160px; height: 160px; }
  .detail-hero h1 { white-space: normal; }
  .shelf-row { grid-auto-columns: 150px; gap: 12px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .quick-grid { grid-template-columns: 1fr; }
  .pb-center { gap: 4px; min-width: 0; }
  .pb-controls { gap: 14px; }
  .pb-text { max-width: 140px; }
  .pb-right #ctl-queue { display: none; }
  .topbar .search-wrap { max-width: none; }
  .topbar { gap: 10px; }
  .pill-btn.hide-sm { display: none; }
  .tt-right .tt-like { display: none; }
  .tt-head, .tt-row { grid-template-columns: 20px 1fr minmax(70px, auto); gap: 10px; }
  .detail-hero .hero-art { width: 140px; height: 140px; }
}
@media (max-width: 480px) {
  /* compact mobile player: art + text + like + play, like Spotify's phone UI */
  #playerbar { padding: 0 10px; gap: 8px; }
  .pb-left { flex: 1; min-width: 0; }
  .pb-art { width: 48px; height: 48px; }
  .pb-center { flex: 0 0 auto; }
  .pb-center .pb-seek { display: none; }
  .pb-controls #ctl-shuffle, .pb-controls #ctl-prev, .pb-controls #ctl-repeat { display: none; }
  .pb-controls { gap: 8px; }
  .pb-right { display: none; }
  .pb-text { max-width: none; }
  .topbar { padding: 12px 14px; }
  .view-pad { padding: calc(var(--topbar-h) + 4px) 14px 32px; }
  .detail-hero, .action-bar, .track-table, .section-pad, .cat-hero { padding-left: 14px; padding-right: 14px; }
  .greeting { font-size: 24px; }
  .top-result h3 { font-size: 24px; }
  .tile h3 { font-size: 19px; }
}
