:root {
  --bg: #101217;
  --surface: #171a21;
  --surface-2: #1f232c;
  --hover: #262b36;
  --line: #2a2f3a;
  --text: #e9ebef;
  --muted: #9aa1ad;
  --accent: #ff8a3d;
  --accent-ink: #1a0f06;
  --danger: #ff5d5d;
  --radius: 10px;
  --nav-w: 220px;
  --player-h: 84px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f4;
    --surface: #ffffff;
    --surface-2: #efefec;
    --hover: #e7e7e3;
    --line: #dcdcd7;
    --text: #1b1d22;
    --muted: #626873;
    --accent: #d9601a;
    --accent-ink: #ffffff;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
     stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i .solid, .i path.solid, .i circle.solid { fill: currentColor; stroke: none; }
.on .i, .i.filled { fill: currentColor; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 500;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn .i { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- login */
.login { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(360px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; display: grid; gap: 14px;
}
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input, .field {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%;
}
.login-card .btn { justify-content: center; padding: 10px; }
.login-error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 14px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px;
         letter-spacing: -.01em; padding: 4px 10px 18px; }
.brand.big { font-size: 22px; padding: 0 0 8px; }
.logo { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); flex: none;
        box-shadow: inset 0 0 0 7px rgba(0,0,0,.3);
        box-shadow: inset 0 0 0 7px color-mix(in srgb, var(--accent) 70%, #000); }

/* ---------- shell */
.shell {
  height: 100vh; height: 100dvh; display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas: "nav main" "player player";
}
.nav { grid-area: nav; background: var(--surface); border-right: 1px solid var(--line);
       padding: 18px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
         color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active .i { color: var(--accent); }
.nav-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
            padding: 8px 4px 0 12px; border-top: 1px solid var(--line); }

.main { grid-area: main; overflow-y: auto; padding: 24px 32px 48px; outline: none;
        scroll-behavior: auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; margin-right: auto; }
.section { margin: 28px 0 0; }
.section > h2 { font-size: 19px; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.section > h2 a { font-size: 13px; color: var(--muted); font-weight: 500; }
.empty { color: var(--muted); padding: 24px 0; }
.loading { color: var(--muted); padding: 24px 0; }
.loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.searchbar { position: relative; flex: 1 1 320px; max-width: 520px; }
.searchbar .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar input { padding-left: 40px; border-radius: 999px; background: var(--surface); }

/* ---------- cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 18px;
         overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.shelf > * { scroll-snap-align: start; }
.card { position: relative; min-width: 0; }
.card .art { display: block; position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
             background: var(--surface-2); }
.card.round .art { border-radius: 50%; }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card .art .ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; color: var(--muted); }
.card .art .ph .i { width: 40%; height: 40%; stroke-width: 1.2; }
.card .title { display: block; margin-top: 8px; font-weight: 600; white-space: nowrap; overflow: hidden;
               text-overflow: ellipsis; }
.card .sub { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden;
             text-overflow: ellipsis; }
.card.round .title, .card.round .sub { text-align: center; }
.card .hover-play {
  /* sits on the bottom-right of the square artwork: % margins are relative to the card width */
  position: absolute; right: 8px; top: 0; margin-top: calc(100% - 52px); width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  cursor: pointer; opacity: 0; transform: translateY(6px); transition: .15s;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.card:hover .hover-play, .card .hover-play:focus { opacity: 1; transform: none; }
@media (hover: none) { .card .hover-play { opacity: 1; transform: none; width: 38px; height: 38px; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
        font-size: 14px; }
.chip:hover { background: var(--hover); text-decoration: none; }
.chip .n { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ---------- android app */
.app-banner { display: flex; align-items: center; justify-content: space-between; margin-top: 14px;
              padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.app-banner a { display: flex; align-items: center; color: inherit; }
.app-banner a .i { margin-right: 8px; color: var(--accent); }
.android-page { max-width: 680px; }
.android-page p, .android-page li { line-height: 1.55; }
.android-page .steps { padding-left: 20px; }
.android-page .steps li { margin-bottom: 10px; }
.copyline { display: flex; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.copyline code { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); margin: 0 8px 6px 0;
                 word-break: break-all; }
code.wrap { word-break: break-all; }
@media (max-width: 760px) { .nav .nav-android { display: none; } }

/* ---------- ask for music */
.ask { margin-top: 18px; max-width: 760px; }
.askbar { position: relative; display: flex; align-items: center; }
.askbar > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); }
.askbar input { flex: 1 1 auto; min-width: 0; padding-left: 42px; border-radius: 999px; background: var(--surface); }
.askbar .btn { margin-left: 8px; flex: none; }
.ask-examples { margin-top: 10px; }
.ask-examples .chip { cursor: pointer; color: inherit; font: inherit; font-size: 13px; padding: 4px 12px; }
#ask-result { margin: 10px 0 0; }
.ask-from-search { margin: 0 0 8px; }

/* ---------- mix cards (For You) */
.card.mix .art { border: 0; padding: 0; width: 100%; cursor: pointer; color: inherit; text-align: left; }
.card.mix .art .collage { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: grid;
                          grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.card.mix .art .collage img, .card.mix .art img.one { width: 100%; height: 100%; object-fit: cover; }
.card.mix .art img.one { position: absolute; top: 0; left: 0; }
.mix-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 10px 8px; color: #fff;
             font-weight: 800; font-size: 18px; letter-spacing: -.01em;
             background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.75)); }
.shelf-sub { margin: -6px 0 12px; }

/* ---------- hero (album / artist / playlist header) */
.hero { display: flex; gap: 28px; align-items: flex-end; margin-bottom: 24px; }
.hero .art { width: 220px; aspect-ratio: 1; flex: none; border-radius: 12px; overflow: hidden;
             background: var(--surface-2); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.hero.round .art { border-radius: 50%; }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero .art .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.hero .art .ph .i { width: 40%; height: 40%; stroke-width: 1.2; }
.hero .kind { text-transform: uppercase; font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.hero h1 { font-size: clamp(26px, 4vw, 44px); letter-spacing: -.02em; margin: 6px 0 8px; }
.hero .meta { color: var(--muted); }
.hero .meta a { color: var(--text); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.bio { color: var(--muted); max-width: 75ch; white-space: pre-line; }
.bio.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- track list */
.tracks { display: grid; }
.trow {
  display: grid; grid-template-columns: 36px minmax(0, 2fr) minmax(0, 1.2fr) 52px 76px;
  align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  min-height: 52px;
}
.trow:hover { background: var(--hover); }
.trow.playing .ttitle, .trow.playing .num { color: var(--accent); }
.trow .num { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.trow .cell { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .ttitle { font-weight: 500; }
.trow .tsub { font-size: 13px; color: var(--muted); }
.trow .dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.trow .acts { display: flex; justify-content: flex-end; }
.trow .acts .icon-btn { width: 32px; height: 32px; }
.trow .acts .star:not(.on) { opacity: 0; }
.trow:hover .acts .star, .trow .acts .star:focus { opacity: 1; }
@media (hover: none) { .trow .acts .star:not(.on) { display: none; } }
.trow .thumb { width: 36px; height: 36px; border-radius: 5px; object-fit: cover; background: var(--surface-2); }
.thead { padding: 0 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; cursor: default;
         min-height: 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.thead:hover { background: none; }
.disc { padding: 14px 8px 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.fmt { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--muted);
       border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }

/* ---------- letters */
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.letters a { min-width: 32px; text-align: center; padding: 4px 6px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.letters a.active { background: var(--accent); color: var(--accent-ink); }
.letters a:hover { text-decoration: none; background: var(--hover); }
.letters a.active:hover { background: var(--accent); }
select.field { width: auto; padding: 8px 12px; border-radius: 999px; background: var(--surface); }

/* ---------- player */
.player {
  grid-area: player; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: center; gap: 16px; padding: 10px 18px; min-height: var(--player-h);
  background: var(--surface); border-top: 1px solid var(--line); position: relative; z-index: 3;
}
.np { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-cover { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
.np-text { min-width: 0; display: grid; }
.np-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.np-artist { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.controls { display: grid; gap: 4px; justify-items: center; }
.buttons { display: flex; align-items: center; gap: 14px; }
.play-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg);
            display: grid; place-items: center; cursor: pointer; }
.play-btn:hover { transform: scale(1.05); }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.seek .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; }
.seek .t:first-child { text-align: right; }
.extras { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
         color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 16px;
                    flex: 1; min-width: 0; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text); margin-top: -4px; border: 0; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 0; }
#volume { max-width: 110px; }

/* ---------- queue drawer */
.queue {
  position: fixed; right: 0; top: 0; bottom: var(--player-h); width: min(400px, 100vw); z-index: 2;
  background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(0,0,0,.25);
}
.queue-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.queue-head h2 { font-size: 18px; margin-right: auto; }
.queue-list { overflow-y: auto; padding: 8px; flex: 1; }
.why { color: var(--accent); }
.queue-list .trow { grid-template-columns: 36px minmax(0, 1fr) 44px 32px; }
.queue-list .sep { padding: 12px 8px 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px;
                      border-radius: 50%; background: var(--text); transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- now playing (split: queue | track) */
.np-cover-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; flex: none; }
.nowplaying {
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--player-h); z-index: 4;
  background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
}
.np-bg { position: absolute; top: -10%; left: -10%; right: -10%; bottom: -10%; background-size: cover;
         background-position: center; filter: blur(60px) saturate(1.3); opacity: .35; transform: scale(1.1); }
.np-bg::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
                background: linear-gradient(to bottom, rgba(0,0,0,.15), var(--bg) 85%); }
.tv .np-bg { display: none; }   /* big blur filters stutter on TV GPUs */
.np-head { position: relative; display: flex; align-items: center; padding: 12px 20px 8px; }
.np-head h2 { font-size: 18px; margin: 0 auto 0 8px; }
.np-head > * + * { margin-left: 12px; }
.np-tabs { display: none; }
.np-split { position: relative; flex: 1; min-height: 0; display: grid;
            grid-template-columns: minmax(300px, 1fr) minmax(0, 1.25fr); }
.np-col { min-height: 0; overflow-y: auto; }
.np-queue-col { border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.np-queue-col .queue-list { overflow-y: auto; flex: 1; padding: 4px 10px 16px; }
.np-queue-col .trow { grid-template-columns: 40px minmax(0, 1fr) 48px 32px; }
.np-col-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; }
.np-col-head h3 { font-size: 15px; margin: 0; }
.np-info-col { padding: 8px 32px 40px; }

.np-hero { display: flex; align-items: flex-end; margin-bottom: 18px; }
.np-hero .art { width: 200px; height: 200px; flex: none; border-radius: 10px; overflow: hidden;
                background: var(--surface-2); box-shadow: 0 16px 40px rgba(0,0,0,.45); margin-right: 24px; }
.np-hero .art img { width: 100%; height: 100%; object-fit: cover; }
.np-hero .kind { text-transform: uppercase; font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.np-hero h1 { font-size: clamp(22px, 3vw, 36px); letter-spacing: -.02em; margin: 4px 0 6px; }
.np-hero .meta { color: var(--muted); }
.np-hero .meta a { color: var(--text); font-weight: 600; }
.np-why { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--accent);
          border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px; }

.viz-wrap { position: relative; margin: 6px 0 10px; }
.viz-bar { display: flex; align-items: center; justify-content: space-between; min-height: 22px; margin-bottom: 6px; }
.viz-styles button { border: 1px solid var(--line); background: none; color: var(--muted); font-size: 12px;
                     padding: 2px 10px; cursor: pointer; }
.viz-styles button:first-child { border-radius: 999px 0 0 999px; }
.viz-styles button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.viz-styles button.active { background: var(--surface-2); color: var(--text); }
.viz-mode { font-size: 11px; color: var(--muted); margin-left: auto; }
#np-viz { display: block; width: 100%; height: 150px; }

/* stereo VU meter: a coloured scale under a dark cover that slides away (transform only) */
.vu-row { display: flex; align-items: center; margin-bottom: 8px; }
.vu-ch { width: 18px; flex: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.vu-db { width: 38px; flex: none; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vu-track { position: relative; flex: 1; height: 18px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(to right, #2fbf71 0%, #2fbf71 66%, #e8c547 66%, #e8c547 83%, #ff5d4a 83%, #ff5d4a 100%); }
.vu-track::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(to right, transparent 0, transparent 7px, var(--bg) 7px, var(--bg) 9px); }
.vu-cover { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background: var(--surface-2);
            transform-origin: right center; transform: scaleX(1); will-change: transform; }
.vu-peak { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -3px; left: 0; background: var(--text); }
.vu-peak.hot { background: #ff5d4a; }
.vu-scale { margin-bottom: 0; }
.vu-ticks { position: relative; flex: 1; height: 14px; font-size: 10px; color: var(--muted); }
.vu-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.vu-ticks span:first-child { transform: none; }
.vu-ticks span:last-child { transform: translateX(-100%); }
#np-wave { display: block; width: 100%; height: 56px; cursor: pointer; }
.wave-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted);
              font-variant-numeric: tabular-nums; margin-top: 2px; }

.np-actions { display: flex; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.np-actions > * { margin: 0 10px 8px 0; }
.stars { display: inline-flex; align-items: center; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line); }
.stars button.on { color: var(--accent); }
.stars button.on .i { fill: currentColor; }
.stars .i { width: 22px; height: 22px; }

.np-section { margin-top: 22px; }
.np-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0; }
.facts dt { color: var(--muted); padding: 5px 18px 5px 0; font-size: 14px; }
.facts dd { margin: 0; padding: 5px 0; font-size: 14px; word-break: break-word; }
.facts dd .chip { margin: 0 6px 6px 0; display: inline-block; font-size: 13px; padding: 2px 10px; }
.np-album { display: flex; align-items: flex-start; }
.np-album img { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; margin-right: 14px; flex: none; background: var(--surface-2); }
.np-links a { display: inline-flex; align-items: center; margin: 0 14px 6px 0; font-size: 14px; color: var(--muted); }
.np-links a .i { width: 15px; height: 15px; margin-right: 5px; }

@media (max-width: 760px) {
  .nowplaying { bottom: calc(var(--player-h) + 56px + env(safe-area-inset-bottom)); }
  .np-tabs { display: flex; margin-left: auto; }
  .np-tabs button { border: 0; background: none; color: var(--muted); padding: 6px 10px; font-weight: 600; cursor: pointer; }
  .np-tabs button.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
  .np-head h2, .np-viz-switch { display: none; }
  .np-split { display: block; }
  .np-split .np-col { height: 100%; }
  .np-split[data-tab="info"] .np-queue-col, .np-split[data-tab="queue"] .np-info-col { display: none; }
  .np-queue-col { border-right: 0; }
  .np-info-col { padding: 4px 16px 32px; }
  .np-hero { flex-direction: column; align-items: flex-start; }
  .np-hero .art { width: 60vw; height: 60vw; max-width: 260px; max-height: 260px; margin: 0 0 14px; }
  #np-viz { height: 110px; }
}

/* ---------- menu / modal / toast */
.menu { position: fixed; z-index: 20; min-width: 210px; background: var(--surface-2); border: 1px solid var(--line);
        border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px;
        border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--hover); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .i { width: 18px; height: 18px; color: var(--muted); }
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(420px, 100%); max-height: 80vh; overflow: auto; background: var(--surface);
              border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; }
.modal-card h2 { font-size: 18px; }
.modal-card .pl-pick { display: grid; gap: 2px; }
.modal-card .pl-pick button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.modal-card .pl-pick button:hover { background: var(--hover); }
.modal-card form { display: flex; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); transform: translateX(-50%); z-index: 40;
         background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px;
         box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }

/* ---------- mobile */
@media (max-width: 760px) {
  :root { --player-h: 64px; }
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto;
           grid-template-areas: "main" "player" "nav"; }
  .nav { flex-direction: row; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
         border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .nav .brand, .nav-foot { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 2px; flex: 1; min-width: 0; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .nav a.active { background: none; }
  .main { padding: 16px 16px 32px; }
  .page-head h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px 14px; }
  .shelf { grid-auto-columns: 132px; gap: 14px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero .art { width: min(220px, 60vw); }
  .trow { grid-template-columns: 28px minmax(0, 1fr) 44px 40px; gap: 10px; }
  .trow .c-album, .thead .c-album { display: none; }
  .trow .acts .star { display: none; }
  .player { grid-template-columns: minmax(0, 1fr) auto auto; padding: 10px 8px 8px 12px; gap: 4px; }
  .np-cover { width: 44px; height: 44px; }
  .buttons { gap: 2px; }
  .buttons [data-act="prev"] { display: none; }
  .play-btn { width: 40px; height: 40px; }
  .seek { position: absolute; left: 0; right: 0; top: -8px; gap: 0; max-width: none; }
  .seek .t { display: none; }
  .extras { gap: 0; }
  .extras #volume, .extras .vol-i, .extras .badge, #np-star { display: none; }
  .queue { top: 0; bottom: calc(var(--player-h) + 56px + env(safe-area-inset-bottom)); width: 100vw; }
  .letters a { min-width: 28px; }
}

/* ---------- older browsers (LG / smart-TV browsers on Chrome 79 and similar):
   no aspect-ratio and no flexbox gap, so give square boxes and spacing another way. */
@supports not (aspect-ratio: 1) {
  .card .art { height: 0; padding-top: 100%; }
  .card .art img { position: absolute; top: 0; left: 0; }
  .hero .art { height: 220px; }
  /* gaps sit between an icon and bare text, so space the icons themselves */
  .btn > .i { margin-right: 8px; }
  .brand .logo { margin-right: 10px; }
  .nav a > .i { margin-right: 12px; }
  .menu .i { margin-right: 10px; }
  .switch span { margin-right: 8px; }
  .np > * + *, .modal-card form > * + * { margin-left: 8px; }
  .buttons > * + * { margin-left: 14px; }
  .seek > * + *, .extras > * + *, .queue-head > * + * { margin-left: 10px; }
  .hero > * + * { margin-left: 28px; }
  .section > h2 > a { margin-left: 12px; }
  .actions > *, .page-head > * { margin: 0 10px 10px 0; }
  .chips > *, .letters > * { margin: 0 6px 6px 0; }
  .nav a + a { margin-top: 2px; }
  @media (max-width: 760px) {
    .hero .art { height: 60vw; max-height: 220px; }
    .hero > * + * { margin-left: 0; margin-top: 16px; }
    .nav a + a { margin-top: 0; }
    .nav a > .i { margin-right: 0; margin-bottom: 2px; }
  }
}
