:root {
  --bg: #ffffff;
  --side: #f6f6f8;
  --card: #f3f3f6;
  --raise: #ffffff;
  --text: #1c1c21;
  --muted: #6e6e7a;
  --faint: #a4a4b0;
  --line: #e7e7ed;
  --accent: #7166f0;
  --accent-ink: #ffffff;
  --panel: #403ee6;
  --panel-ink: #ffffff;
  --wave: #cfcfd8;
  --playhead: #e5484d;
  --shadow: 0 10px 40px rgba(20, 20, 40, .16);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 210px;
  --player-h: 88px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141418; --side: #1b1b20; --card: #212127; --raise: #26262d;
    --text: #ececf1; --muted: #9b9ba8; --faint: #6c6c78; --line: #2b2b33;
    --accent: #8d84ff; --panel: #3533c9; --wave: #3d3d47;
    --shadow: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141418; --side: #1b1b20; --card: #212127; --raise: #26262d;
  --text: #ececf1; --muted: #9b9ba8; --faint: #6c6c78; --line: #2b2b33;
  --accent: #8d84ff; --panel: #3533c9; --wave: #3d3d47;
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  height: 100dvh;
}

/* ---------- sidebar ---------- */
.sidebar {
  grid-row: 1; background: var(--side);
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 14px 0 12px;
}
.brand { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 14px; }
.wordmark { font-weight: 300; font-size: 28px; letter-spacing: -.5px; line-height: 1; }
.wordmark span { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-left: 4px; font-weight: 700; }
.nav-section { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--text); padding: 18px 16px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 16px; color: var(--muted); text-align: left; font-size: 14px;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--accent); }
.core-status { margin-top: auto; padding: 16px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: #30a46c; }

/* ---------- main ---------- */
.main { grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 20px; height: 56px; flex: none; }
.topbar-title { flex: 1; text-align: center; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title.show { opacity: 1; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--text); flex: none; }
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.search { position: relative; width: min(260px, 40vw); }
.search input {
  width: 100%; height: 36px; border-radius: 18px; border: 1px solid transparent;
  background: var(--card); padding: 0 14px 0 36px; outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--bg); }
.search-icon { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search-icon svg { width: 18px; height: 18px; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; outline: none; scroll-behavior: auto; }
.page { max-width: 1440px; margin: 0 auto; padding: 24px 56px 64px; }
.page.narrow { max-width: 1180px; }

.page-title { font: 600 clamp(36px, 5vw, 60px)/1.1 var(--serif); margin: 20px 0 6px; letter-spacing: -.5px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.section-title { font-size: 19px; font-weight: 400; margin: 40px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* buttons */
.split { display: inline-flex; border-radius: 22px; overflow: hidden; background: var(--accent); color: var(--accent-ink); }
.split button { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 20px; font-size: 14px; }
.split button + button { border-left: 1px solid rgba(255,255,255,.35); padding: 0 12px; }
.split button:hover { background: rgba(255,255,255,.12); }
.split svg { width: 16px; height: 16px; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; }
.round-btn svg { width: 18px; height: 18px; }
.actions-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 26px 0 8px; color: var(--muted); font-size: 14px; }
.filter { display: flex; align-items: center; gap: 6px; }
.filter input { border: 0; border-bottom: 1px solid transparent; background: none; outline: none; width: 120px; padding: 4px 0; }
.filter input:focus { border-bottom-color: var(--accent); }
.filter svg { width: 16px; height: 16px; }

/* ---------- grid cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 26px; }
.card { text-align: left; min-width: 0; position: relative; }
.art-wrap { position: relative; }
button.art { display: block; cursor: pointer; }
.card-text { display: block; width: 100%; text-align: inherit; }
.np-mini span.thumb { display: block; }
.zstate svg { width: 12px; height: 12px; }
body.busy { cursor: progress; }
body.busy .view { opacity: .75; transition: opacity .15s .1s; }
.art {
  position: relative; aspect-ratio: 1; width: 100%; background: var(--card);
  overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.art img { width: 100%; height: 100%; object-fit: cover; }
.art.placeholder::after {
  content: ""; position: absolute; inset: 20%; border-radius: 50%;
  background: radial-gradient(circle, var(--card) 0 9%, var(--faint) 9.5% 100%);
  opacity: .7;
}
.card.round .art { border-radius: 50%; }
.card.round .art.placeholder { display: grid; place-items: center; }
.card.round .art.placeholder::after { content: none; }
.initials { font: 600 clamp(28px, 3vw, 48px)/1 var(--serif); color: var(--text); }
.card.round { text-align: center; }
.card-title { font-size: 14px; margin-top: 10px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .hover-play {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  opacity: 0; transform: translateY(6px); transition: .18s; box-shadow: var(--shadow);
}
.card.round .hover-play { right: 50%; margin-right: -22px; bottom: 12px; }
.card .hover-play svg { width: 18px; height: 18px; }
.card:hover .hover-play, .card:focus-within .hover-play { opacity: 1; transform: none; }
@media (hover: none) { .card .hover-play { display: none; } }

/* genre tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile {
  position: relative; aspect-ratio: 1.4; overflow: hidden; background: #3a3850; color: #fff;
  display: grid; place-items: center; text-align: center; padding: 12px;
}
.tile:nth-child(6n+1) { grid-column: span 2; aspect-ratio: auto; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(113,102,240,.28), rgba(30,28,60,.45)); z-index: 1; }
.tile span { position: relative; z-index: 2; font: 500 clamp(22px, 2.6vw, 36px)/1.1 var(--serif); text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.tile:hover img { transform: scale(1.03); transition: transform .4s; }

/* ---------- rows (tracks / generic lists) ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; width: 100%;
}
.row:hover { background: var(--card); }
.row .num { color: var(--muted); width: 28px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.row .thumb { width: 44px; height: 44px; background: var(--card); object-fit: cover; }
.row-main { min-width: 0; display: block; }
.row-main > span { display: block; }
.row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.row-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev, .row .more { color: var(--faint); }
.row .more { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.row .more:hover { background: var(--line); color: var(--text); }
.row .chev svg, .row .more svg { width: 18px; height: 18px; }
.row.playing .row-title { color: var(--accent); }
.list-header { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 22px 6px 8px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; background: #222;
  min-height: 340px; display: flex; align-items: flex-end; margin: 0 0 30px;
}
.hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2); opacity: .9; transform: scale(1.1); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55)); }
.hero-inner { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 32px; padding: 40px 48px; width: 100%; }
.hero-art { width: 220px; height: 220px; flex: none; box-shadow: 0 16px 50px rgba(0,0,0,.45); background: rgba(255,255,255,.1); object-fit: cover; }
.hero.artist .hero-art { border-radius: 50%; }
.hero-text { min-width: 0; }
.hero-kicker { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .8; margin-bottom: 6px; }
.hero-title { font: 600 clamp(32px, 4.5vw, 60px)/1.05 var(--serif); margin: 0 0 8px; text-shadow: 0 2px 20px rgba(0,0,0,.3); overflow-wrap: anywhere; }
.hero-sub { font-size: 15px; opacity: .9; margin-bottom: 20px; }
.hero .round-btn { color: #fff; }

/* ---------- home ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 34px 0 44px; }
.stat { background: var(--card); padding: 26px 24px; display: flex; align-items: center; gap: 16px; text-align: left; }
.stat:hover { background: var(--line); }
.stat svg { width: 36px; height: 36px; color: var(--text); stroke-width: 1.3; }
.stat b { display: block; font-size: 26px; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.panel { background: var(--panel); color: var(--panel-ink); padding: 26px 28px 34px; }
.panel-head { display: flex; align-items: baseline; gap: 26px; border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 10px; margin-bottom: 22px; }
.panel-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.panel-head span { font-size: 13px; opacity: .8; }
.zone-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px; }
.zone-card { text-align: left; color: inherit; }
.zone-card .art { background: rgba(255,255,255,.12); }
.zone-card .card-sub { color: rgba(255,255,255,.75); }
.zone-card .zstate { font-size: 12px; opacity: .8; margin-top: 10px; display: flex; gap: 6px; align-items: center; }
.zone-card.selected .art { outline: 3px solid #fff; outline-offset: 3px; }
.panel + .panel { margin-top: 28px; }
.panel.light { background: var(--card); color: var(--text); }
.panel.light .panel-head { border-bottom-color: var(--line); }
.panel.light .zone-card .art { background: var(--line); }
.panel.light .zone-card .card-sub { color: var(--muted); }
.panel.light .zone-card.selected .art { outline-color: var(--accent); }
.panel-head .ptab { font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: rgba(255,255,255,.8); padding: 2px 0 8px; margin-bottom: -11px; border-bottom: 2px solid transparent; }
.panel-head .ptab.on { color: #fff; border-bottom-color: #fff; }
.panel-head .ptab:hover { color: #fff; }
.panel-nav { margin-left: auto; display: flex; gap: 8px; opacity: 1 !important; }
.pnav { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; }
.pnav:hover { background: rgba(255,255,255,.3); }
.pnav svg { width: 16px; height: 16px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, calc((100% - 4 * 24px) / 5)); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.strip::-webkit-scrollbar { display: none; }
.strip-card { text-align: left; scroll-snap-align: start; color: inherit; min-width: 0; }
.strip-card .art { background: rgba(255,255,255,.12); }
.strip-card .kicker { font-size: 12px; opacity: .8; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-card .card-title { font-weight: 700; margin-top: 2px; -webkit-line-clamp: 1; }
.strip-card .card-sub { color: rgba(255,255,255,.85); }
.later { margin-top: 28px; background: linear-gradient(90deg, #ecebfb, #f8f0f5 60%, #fbf8f6); color: #1c1c21; padding: 34px 40px; display: flex; align-items: center; gap: 40px; }
:root[data-theme="dark"] .later { background: linear-gradient(90deg, #26243e, #2a2230); color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .later { background: linear-gradient(90deg, #26243e, #2a2230); color: var(--text); } }
.later h3 { font: 600 clamp(34px, 4vw, 56px)/1 var(--serif); margin: 0; flex: none; }
.later p { margin: 0; font-size: 16px; }
.later .actions-row { margin-top: 14px; }
.chip { border: 1px solid currentColor; border-radius: 16px; padding: 6px 14px; font-size: 13px; opacity: .85; }
.chip:hover { opacity: 1; background: rgba(113,102,240,.1); }

/* ---------- bios, reviews ---------- */
.deep-info { margin: -6px 0 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.gchip { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; background: var(--card); border-radius: 16px; padding: 7px 14px; color: var(--text); }
.gchip:hover { background: var(--line); }
.deep-cols { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; }
.deep-cols > div:only-child { grid-column: 1 / -1; }
.longtext { max-width: 820px; font-size: 15px; line-height: 1.65; }
.longtext p { margin: 0 0 12px; }
.longtext.clamped .lt-body { max-height: 6.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.lt-more { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; margin-top: 4px; }
.lt-more svg { width: 16px; height: 16px; transition: transform .2s; }
.longtext:not(.clamped) .lt-more svg { transform: rotate(180deg); }
.lt-by { font-size: 12px; color: var(--muted); margin-top: 10px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 14px; align-content: start; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }
.album-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.stars { color: var(--accent); letter-spacing: 2px; }
.similar { display: grid; grid-auto-flow: column; grid-auto-columns: 120px; gap: 20px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.sim { text-align: center; min-width: 0; }
.sim-art { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: var(--card); }
.sim-art img { width: 100%; height: 100%; object-fit: cover; }
.sim-art .initials { font-size: 30px; }
.sim-name { display: block; font-size: 13px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 820px) {
  .deep-cols { grid-template-columns: 1fr; gap: 18px; }
  .similar { grid-auto-columns: 96px; gap: 14px; }
  .sim-art { width: 96px; height: 96px; }
}

/* ---------- history ---------- */
.page.history { max-width: 1240px; }
.htable { margin-top: 30px; }
.hhead, .hrow {
  display: grid; align-items: center; column-gap: 16px;
  grid-template-columns: 96px 58px minmax(0, 2.2fr) 92px minmax(0, 1.3fr) minmax(0, 1.4fr) 36px;
}
.hhead { font-size: 14px; color: var(--text); padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.hrow { padding: 11px 0; }
.hrow:hover { background: linear-gradient(90deg, transparent, var(--card) 4%, var(--card) 96%, transparent); }
.h-when { font-size: 12px; color: var(--muted); }
.h-art { width: 58px; height: 58px; object-fit: cover; background: var(--card); display: block; }
.h-title { min-width: 0; }
.h-name { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-mobile { display: none; }
.h-pct { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-artist, .h-album { font-size: 14px; min-width: 0; line-height: 1.35; }
.link { color: var(--accent); text-align: left; }
.link:hover { text-decoration: underline; }
.sep { color: var(--muted); }
.h-more { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.h-more:hover { background: var(--line); }
.h-more svg { width: 20px; height: 20px; }
@media (max-width: 1100px) {
  .hhead, .hrow { grid-template-columns: 84px 52px minmax(0, 2fr) 84px minmax(0, 1.3fr) 36px; }
  .hhead span:nth-child(6), .h-album { display: none; }
  .h-art { width: 52px; height: 52px; }
}
@media (max-width: 820px) {
  .hhead { display: none; }
  .hrow { grid-template-columns: 52px minmax(0, 1fr) 36px; column-gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .h-when, .h-pct, .h-artist, .h-album { display: none; }
  .h-mobile { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .h-small { font-size: 12px; }
  .htable { margin-top: 14px; }
}

/* empty / loading */
.empty { display: grid; place-items: center; text-align: center; padding: 80px 20px; color: var(--muted); }
.empty h2 { font: 600 32px/1.2 var(--serif); color: var(--text); margin: 0 0 10px; }
.empty ol { text-align: left; line-height: 1.8; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }

/* ---------- player bar ---------- */
.player {
  grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 880px) minmax(180px, 1fr);
  align-items: center; gap: 16px; padding: 0 16px; border-top: 1px solid var(--line); background: var(--bg); z-index: 5;
}
.np-mini { display: flex; align-items: center; gap: 14px; min-width: 0; text-align: left; }
.np-mini .thumb { width: 62px; height: 62px; background: var(--card); object-fit: cover; flex: none; }
.np-mini .t { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-mini .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-mini > div { min-width: 0; }
.transport { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.transport-buttons { display: flex; align-items: center; gap: 18px; }
.tbtn { width: 34px; height: 34px; display: grid; place-items: center; color: var(--text); border-radius: 50%; position: relative; }
.tbtn svg { width: 20px; height: 20px; }
.tbtn.main svg { width: 26px; height: 26px; }
.tbtn.small svg { width: 17px; height: 17px; }
.tbtn:hover { background: var(--card); }
.tbtn.on { color: var(--accent); }
.tbtn.on::after { content: ""; position: absolute; bottom: 1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.tbtn[disabled] { opacity: .3; pointer-events: none; }
.seek { display: flex; align-items: center; gap: 12px; width: 100%; }
.time { font-size: 12px; color: var(--muted); width: 40px; text-align: center; font-variant-numeric: tabular-nums; flex: none; }
#wave { flex: 1; height: 26px; min-width: 0; cursor: pointer; touch-action: none; }
.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.zone-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); max-width: 140px; padding: 4px 8px; border-radius: 8px; }
.zone-btn:hover { background: var(--card); }
.zone-btn svg { width: 30px; height: 26px; color: var(--text); }
.zone-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- popover / menus ---------- */
.popover {
  position: fixed; z-index: 50; background: var(--raise); color: var(--text); border-radius: 12px; box-shadow: var(--shadow);
  min-width: 240px; max-width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 8px 0;
  border: 1px solid var(--line);
}
.pop-title { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 16px 6px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; text-align: left; font-size: 14px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--card); }
.menu-item svg { width: 18px; height: 18px; color: var(--muted); }
.menu-item.sel { color: var(--accent); }
.menu-item.sel svg { color: var(--accent); }
.zitem { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.zitem img, .zitem .ph { width: 44px; height: 44px; object-fit: cover; background: var(--card); }
.zitem small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zitem > div { min-width: 0; }
.vol-out { padding: 10px 16px 14px; }
.vol-out + .vol-out { border-top: 1px solid var(--line); }
.vol-name { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; color: var(--muted); }
.vol-ctl { display: flex; align-items: center; gap: 10px; }
.vol-ctl input[type=range] { flex: 1; accent-color: var(--accent); }
.vol-ctl .icon-btn { width: 32px; height: 32px; }
.vol-ctl .icon-btn.on { color: var(--accent); }

/* ---------- queue drawer ---------- */
.drawer {
  position: fixed; right: 0; top: 0; bottom: var(--player-h); width: min(400px, 100vw); z-index: 40;
  background: var(--raise); box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 1px solid var(--line);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 600 24px/1.2 var(--serif); }
.drawer-body { overflow-y: auto; flex: 1; }
.qitem { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 20px; width: 100%; text-align: left; }
.qitem:hover { background: var(--card); }
.qitem img, .qitem .ph { width: 44px; height: 44px; object-fit: cover; background: var(--card); }
.qitem > div { min-width: 0; }
.qitem .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.qitem .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted); }
.qitem .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qitem.current .t { color: var(--accent); }

/* ---------- now playing ---------- */
.nowplaying { position: fixed; inset: 0 0 var(--player-h) 0; z-index: 30; background: #111; color: #fff; overflow: hidden; display: flex; flex-direction: column; }
.np-bg { position: absolute; inset: -80px; background-size: cover; background-position: center; filter: blur(60px) brightness(.55) saturate(1.3); transform: scale(1.15); transition: background-image .6s; }
.np-bg.photo { inset: 0; filter: brightness(.6); transform: none; background-position: center 25%; }
.np-bg.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 60%), linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 45%); }
.np-top { position: relative; z-index: 1; display: flex; justify-content: space-between; padding: 14px 18px; }
.np-top .icon-btn { color: #fff; }
.np-top .icon-btn:hover { background: rgba(255,255,255,.12); }
.np-stage { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; padding: 0 48px 30px; min-height: 0; }
.np-left { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.np-cover { width: min(36vh, 360px, 70vw); aspect-ratio: 1; object-fit: cover; box-shadow: 0 30px 80px rgba(0,0,0,.5); background: rgba(255,255,255,.08); margin-bottom: 30px; }
.np-title { font: 600 clamp(28px, 4vw, 52px)/1.1 var(--serif); color: #b8b2ff; margin: 0 0 10px; }
.np-line { font-size: 17px; opacity: .85; margin: 2px 0; }
.np-line b { font-weight: 400; opacity: 1; color: #fff; }
.np-side { width: 340px; display: flex; flex-direction: column; min-height: 0; }
.np-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: .7; margin: 0 0 10px; font-weight: 400; }
.np-side .list { overflow-y: auto; min-height: 0; background: rgba(0,0,0,.2); border-radius: 10px; padding: 6px 0; }
.np-side .qitem { color: #fff; padding: 8px 14px; }
.np-side .qitem:hover { background: rgba(255,255,255,.08); }
.np-side .qitem .s, .np-side .qitem .d { color: rgba(255,255,255,.6); }
.np-side .qitem img, .np-side .qitem .ph { background: rgba(255,255,255,.1); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 18px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* ---------- connect screen (hosted mode) ---------- */
.connect { position: fixed; inset: 0; z-index: 80; background: var(--side); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.connect-card { width: min(440px, 100%); background: var(--bg); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 28px; display: flex; flex-direction: column; gap: 14px; }
.connect-card h1 { font: 600 32px/1.15 var(--serif); margin: 8px 0 0; }
.connect-lead, .connect-hint { color: var(--muted); font-size: 14px; margin: 0; }
.connect-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.connect-card input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--card); font-weight: 400; font-size: 15px; outline: none; }
.connect-card input:focus { border-color: var(--accent); background: var(--bg); }
#connectCode { letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.connect-error { margin: 0; color: var(--playhead); font-size: 14px; white-space: pre-line; }
.connect-btn { height: 46px; border-radius: 23px; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-top: 6px; }
.connect-btn[disabled] { opacity: .6; }
.core-status .linkish { color: var(--accent); margin-left: auto; font-size: 12px; }

.only-mobile { display: none; }
.scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .page { padding: 18px 28px 56px; }
  .np-side { display: none; }
  .np-stage { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --player-h: 128px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 45; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 44; }
  .only-mobile { display: grid; }
  .topbar { padding: 8px 10px; gap: 4px; }
  .search { width: auto; flex: 1; max-width: 220px; margin-left: auto; }
  .topbar-title { display: none; }
  .page { padding: 10px 16px 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); margin: 20px 0 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 16px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile:nth-child(6n+1) { grid-column: span 2; }
  .hero { min-height: 0; margin: 0 -16px 24px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 20px; }
  .hero-art { width: 160px; height: 160px; }
  .later { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px; }
  .player {
    grid-template-columns: 1fr auto; grid-template-rows: 64px 1fr; gap: 0 8px; padding: 0 12px 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .np-mini { grid-column: 1; grid-row: 1; }
  .np-mini .thumb { width: 46px; height: 46px; }
  .player-right { grid-column: 2; grid-row: 1; }
  .zone-btn { max-width: 96px; }
  .transport { grid-column: 1 / -1; grid-row: 2; flex-direction: column-reverse; gap: 2px; }
  .transport-buttons { gap: 14px; }
  .np-stage { padding: 0 20px 20px; }
  .np-cover { width: min(80vw, 46vh); }
  .drawer { width: 100vw; }
}
@media (max-width: 420px) {
  .stat { padding: 18px 14px; gap: 10px; }
  .stat svg { width: 28px; height: 28px; }
  .stat b { font-size: 20px; }
}
