/* RiftCaster — warm "ember at home" dark theme */
:root {
  --bg: #121110;
  --bg-2: #181614;
  --surface: #1f1c19;
  --surface-2: #29251f;
  --surface-3: #342f28;
  --line: #3a342c;
  --text: #f5efe6;
  --muted: #a89e90;
  --faint: #978d7f;
  --accent: #ff9d3d;
  --accent-2: #ffb766;
  --accent-ink: #1d1206;
  --danger: #ff6b5b;
  --ok: #7fd18b;
  /* Colours of the record that is playing (set by theme.js); amber until something plays. */
  --art-1: #ff9d3d;
  --art-2: #a63d12;
  --art-ink: #1d1206;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar: 240px;
  --nowpane: 320px;
  --player-h: 84px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; font-weight: 700; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 4px rgba(18,17,16,.9); }

.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) 0; grid-template-rows: 1fr auto; height: 100dvh; }
body.np-visible .app { grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--nowpane); }
.sidebar { grid-row: 1; grid-column: 1; background: #0c0b0a; padding: 16px 12px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; border-right: 1px solid #1d1a17; }
.main { grid-row: 1; grid-column: 2; overflow-y: auto; overflow-x: hidden; position: relative; background: linear-gradient(180deg, var(--bg-2) 0, var(--bg) 340px); }
.view { --view-pt: 24px; --view-px: 32px; padding: var(--view-pt) var(--view-px) 48px; max-width: 1400px; margin: 0 auto; min-height: 100%; container: view / inline-size; }
.playerbar { grid-row: 2; grid-column: 1 / -1; }
.tabbar { display: none; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; padding: 4px 10px 0; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-link .badge { margin-left: auto; }
.side-section { display: flex; flex-direction: column; min-height: 0; flex: 1; border-top: 1px solid #1d1a17; padding-top: 14px; }
.side-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 12px 8px; }
.side-playlists { overflow-y: auto; display: flex; flex-direction: column; }
.side-playlists a { padding: 7px 12px; color: var(--muted); border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.side-playlists a:hover, .side-playlists a.active { color: var(--text); background: var(--surface); }

.badge { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 7px; min-width: 20px; text-align: center; }

/* ---------- Common bits ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.link:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; transition: transform .08s, background .15s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .icon { width: 20px; height: 20px; }
.btn.small .icon { width: 18px; height: 18px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); transition: color .15s, background .15s, transform .08s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small .icon { width: 20px; height: 20px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.liked { color: var(--accent); }

.play-fab { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(255, 140, 40, .25); transition: transform .1s, background .15s; }
.play-fab:hover { background: var(--accent-2); transform: scale(1.04); }
.play-fab .icon { width: 26px; height: 26px; }

.input { width: 100%; height: 44px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 0 14px; color: var(--text); }
.input:focus { outline: none; border-color: var(--accent); }
.label { font-size: 13px; color: var(--muted); font-weight: 600; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.notice { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, rgba(255,157,61,.14), rgba(255,157,61,.04)); border: 1px solid rgba(255,157,61,.3); border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 24px; }
.notice .icon { color: var(--accent); }
.notice p { margin: 0; flex: 1; min-width: 200px; }
.notice { flex-wrap: wrap; }
.notice > .btn { flex: none; margin-left: auto; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.section { margin-bottom: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.section-head a { color: var(--muted); font-size: 13px; font-weight: 700; }
.section-head a:hover { color: var(--text); }

.tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; }
.chip:hover { background: var(--surface-3); }
.chip.active { background: var(--text); color: var(--bg); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .icon { width: 48px; height: 48px; color: var(--faint); margin-bottom: 12px; }
.empty h2 { color: var(--text); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty p { max-width: 460px; margin: 0 auto 18px; line-height: 1.5; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Covers & grids ---------- */
.cover { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, var(--surface-3), var(--surface)); display: flex; align-items: center; justify-content: center; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .placeholder { width: 40%; height: 40%; color: var(--faint); }
.cover.round { border-radius: 50%; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.grid.scroll { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 170px; overflow-x: auto; overflow-y: hidden; padding: 12px 12px 18px; margin: -12px -12px -12px; scrollbar-width: none; align-items: start; }
/* Side-scrolling rows run all the way to the pane's edge (under the page padding) and fade out there in a thin band,
   instead of being cut off at the padding. The extra right padding means the last tile clears the fade when scrolled to the end. */
.grid.scroll { margin-right: calc(-1 * var(--view-px, 32px)); padding-right: var(--view-px, 32px); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 14px), transparent); }
.grid.scroll::-webkit-scrollbar { display: none; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin: -12px; border-radius: 12px; transition: background .2s; position: relative; min-width: 0; }
.tile:hover { background: var(--surface); }
.tile .cover { box-shadow: 0 8px 22px rgba(0,0,0,.4); }
.tile-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.tile .tile-play { position: absolute; right: 20px; top: calc(100% - 100px); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; width: 46px; height: 46px; }
.tile:hover .tile-play { opacity: 1; transform: none; }
.tag-needs { position: absolute; left: 20px; top: 20px; background: rgba(0,0,0,.7); color: var(--accent); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(6px); }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 34px; }
.quick a, .quick button { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; font-weight: 700; text-align: left; height: 60px; transition: background .2s; }
.quick a:hover, .quick button:hover { background: var(--surface-2); }
.quick .cover { width: 60px; height: 60px; border-radius: 0; }
.quick .q-icon { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), #c2571c); color: var(--accent-ink); }

/* ---------- Hero (album / artist / playlist pages) ---------- */
.hero { display: flex; align-items: flex-end; gap: 28px; margin-bottom: 26px; }
.hero .cover { width: 220px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.hero-text { min-width: 0; flex: 1; }
.hero-kind { font-size: 13px; font-weight: 700; color: var(--muted); }
.hero h1 { font-size: clamp(28px, 6.5cqi, 56px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.04; margin: 6px 0 12px; word-break: break-word; }
.hero-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hero-meta a { color: var(--text); font-weight: 700; }
.hero-meta .dot::before { content: "•"; margin: 0 2px; }
.actions { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- Track list ---------- */
.tracks { display: flex; flex-direction: column; }
.track { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, .7fr) 36px 52px 36px; align-items: center; gap: 12px; padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; min-height: 44px; position: relative; }
.track:focus-visible { outline-offset: -2px; }
.track:hover { background: var(--surface); }
.track.playing .t-title { color: var(--art-1); }
.track.playing { background: color-mix(in srgb, var(--art-1) 10%, transparent); }
.track.playing:hover { background: color-mix(in srgb, var(--art-1) 16%, transparent); }
.t-num { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; position: relative; }
.t-num .icon { width: 18px; height: 18px; display: none; }
.track:hover .t-num .n { display: none; }
.track:hover .t-num .icon { display: inline-flex; }
.track.playing .t-num .n { color: var(--art-1); }
.t-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-main .cover { width: 36px; border-radius: 4px; }
.t-text { min-width: 0; }
.t-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.t-album { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-album:hover { color: var(--text); text-decoration: underline; }
.t-dur { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.t-like, .t-more { opacity: 0; }
.track:hover .t-like, .track:focus-within .t-like, .t-like.liked, .track:hover .t-more, .track:focus-within .t-more { opacity: 1; }
.t-flag { display: inline-flex; color: var(--accent); width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.t-dl { color: var(--ok); width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.tracks.no-album .track { grid-template-columns: 34px minmax(0, 1fr) 36px 52px 36px; }
.tracks.no-album .t-album { display: none; }
.track-head { color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); cursor: default; min-height: 36px; margin-bottom: 8px; }
.track-head:hover { background: none; }

.list-rows { display: flex; flex-direction: column; gap: 4px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); }
.list-row:hover { background: var(--surface); }
.list-row .cover { width: 56px; }
.list-row .cover.round { width: 56px; }

/* ---------- Search ---------- */
.search-box { position: relative; max-width: 560px; margin-bottom: 26px; }
.search-box .icon { position: absolute; left: 14px; top: 13px; color: var(--muted); width: 20px; height: 20px; }
.search-box .input { height: 48px; padding-left: 44px; border-radius: 999px; font-size: 16px; background: var(--surface-2); }

/* ---------- Player bar ---------- */
.playerbar { height: var(--player-h); background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 14%, #0c0b0a), #0c0b0a 55%, color-mix(in srgb, var(--art-2) 8%, #0c0b0a)); border-top: 1px solid #1d1a17; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr); align-items: center; padding: 0 16px; gap: 16px; transition: background .8s; }
.pb-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-now .cover { width: 56px; border-radius: 6px; cursor: pointer; }
.pb-text { min-width: 0; cursor: pointer; }
.pb-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pb-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pb-controls { display: flex; align-items: center; gap: 8px; }
.pb-controls .icon-btn.small { width: 36px; height: 36px; }
.pb-controls .icon-btn.small .icon { width: 24px; height: 24px; }
.pb-controls .icon-btn.on { color: var(--art-1); }
.pb-play { width: 38px; height: 38px; border-radius: 50%; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; transition: transform .08s; }
.pb-play:hover { transform: scale(1.06); }
.pb-play .icon { width: 24px; height: 24px; }
.pb-progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pb-progress span { width: 40px; text-align: center; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.pb-center { min-width: 0; }
.pb-quality { font-size: 11px; color: var(--faint); margin-right: 6px; white-space: nowrap; }
/* Narrower windows: nothing is dropped — the quality label moves onto its own line above the icons, the icon row
   keeps lyrics, mini player, speakers, volume and the Now-playing button, and the volume slider gets shorter. */
@media (max-width: 1240px) and (min-width: 761px) {
  .pb-right { flex-wrap: wrap; row-gap: 2px; justify-content: flex-end; }
  .pb-quality { flex-basis: 100%; text-align: right; margin-right: 2px; }
  .playerbar { grid-template-columns: minmax(150px, 1fr) minmax(300px, 2fr) minmax(250px, 1fr); }
}
@media (max-width: 1040px) and (min-width: 761px) { .pb-right .range.volume { max-width: 64px; } .pb-progress span { width: 34px; } }
@media (max-width: 1320px) and (min-width: 761px) { body.np-visible .pb-right .range.volume { max-width: 64px; } }
@media (max-width: 900px) and (min-width: 761px) { .pb-progress span { width: 34px; } }
.pb-mini-progress { display: none; }

.range { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--text) var(--p, 0%), var(--surface-3) var(--p, 0%)); cursor: pointer; }
.range:hover { background: linear-gradient(to right, var(--art-1) var(--p, 0%), var(--surface-3) var(--p, 0%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); opacity: 0; transition: opacity .15s; }
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { opacity: 1; }
.range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--text); }
.range.volume { max-width: 100px; }

/* ---------- Full-screen player ---------- */
.fullplayer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.fullplayer.grow { animation: grow .22s cubic-bezier(.2,.8,.2,1); }
@keyframes grow { from { transform: scale(.3); opacity: 0; } }
.fullplayer.fp-in-up { animation: fpInUp .28s cubic-bezier(.2,.8,.2,1); }
.fullplayer.fp-in-right { animation: fpInRight .28s cubic-bezier(.2,.8,.2,1); }
.fullplayer.fp-out-up { animation: fpInUp .24s cubic-bezier(.4,0,.8,.4) reverse forwards; }
.fullplayer.fp-out-right { animation: fpInRight .24s cubic-bezier(.4,0,.8,.4) reverse forwards; }
@keyframes fpInUp { from { transform: translateY(100%); opacity: .6; } }
@keyframes fpInRight { from { transform: translateX(100%); opacity: .6; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.fp-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.3) brightness(.45); transform: scale(1.2); z-index: 0; }
.fp-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; padding: max(16px, env(safe-area-inset-top)) 24px max(24px, var(--safe-b)); max-width: 560px; width: 100%; margin: 0 auto; }
.fp-top { display: flex; align-items: center; justify-content: space-between; }
.fp-top .label { font-size: 13px; color: var(--text); opacity: .8; text-align: center; }
.fp-art { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 18px 0; }
.fp-art .cover { width: min(100%, 52vh); box-shadow: 0 24px 60px rgba(0,0,0,.55); border-radius: 12px; }
.fp-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fp-info .t { min-width: 0; flex: 1; }
.fp-title { font-size: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-artist { color: rgba(255,255,255,.75); font-size: 16px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-artist a:hover { text-decoration: underline; }
.fp-progress .range { width: 100%; height: 5px; background: linear-gradient(to right, var(--text) var(--p, 0%), rgba(255,255,255,.2) var(--p, 0%)); }
.fp-progress .range::-webkit-slider-thumb { opacity: 1; width: 14px; height: 14px; }
.fp-times { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,.7); margin-top: 8px; font-variant-numeric: tabular-nums; }
.fp-controls { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.fp-controls .icon-btn { width: 52px; height: 52px; color: var(--text); }
.fp-controls .icon-btn .icon { width: 28px; height: 28px; }
.fp-controls .icon-btn.side .icon { width: 24px; height: 24px; }
.fp-controls .icon-btn.side { color: rgba(255,255,255,.7); }
.fp-controls .icon-btn.on { color: var(--art-1); }
.fp-play { width: 72px; height: 72px; border-radius: 50%; background: var(--text); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.fp-play .icon { width: 32px; height: 32px; }
.fp-bottom { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.65); font-size: 12px; }
.fp-queue { flex: 1; overflow-y: auto; margin: 10px -10px; }
.fp-queue h3 { font-size: 15px; margin: 14px 10px 6px; color: var(--muted); }
.q-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.q-row:hover { background: rgba(255,255,255,.06); }
.q-row .cover { width: 44px; border-radius: 4px; }
.q-row.current .t-title { color: var(--art-1); }

/* ---------- Menus, modals, toasts ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,0); transition: background .2s; }
.menu-backdrop.open { background: rgba(0,0,0,.45); }
.menu { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 6px 8px calc(14px + var(--safe-b)); display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,.4); animation: rise .2s ease-out; max-height: 80vh; overflow-y: auto; transition: transform .16s ease-out; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 10px; }
.menu.popover { right: auto; bottom: auto; width: 240px; border-radius: var(--radius); padding: 6px; animation: none; box-shadow: 0 16px 40px rgba(0,0,0,.6); border: 1px solid var(--line); }
.menu-backdrop:has(.popover).open { background: transparent; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 10px 14px; border-radius: var(--radius-sm); text-align: left; font-weight: 600; font-size: 16px; }
.menu.popover .menu-item { padding: 8px 12px; min-height: 40px; font-size: 14px; }
.menu-item:hover { background: var(--surface-3); }
.menu-item .icon { width: 20px; height: 20px; color: var(--muted); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .icon { color: var(--danger); }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); width: 100%; max-width: 440px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 20px; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; }

.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--radius); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

.offline-banner { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; background: #3a2a14; color: var(--accent-2); font-size: 13px; font-weight: 600; padding: 8px 12px; }
.offline-banner .icon { width: 16px; height: 16px; }

/* ---------- Auth ---------- */
.auth { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 28px 20px; overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, rgba(255,157,61,.18), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; margin: auto 0; display: flex; flex-direction: column; gap: 16px; }
.auth-card .logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 4px; box-shadow: 0 12px 40px rgba(255,140,40,.25); }
.auth-card h1 { text-align: center; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.auth-card .sub { text-align: center; color: var(--muted); margin: -8px 0 6px; line-height: 1.5; }
.auth-card .btn { height: 48px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 18px; }
.hint { color: var(--faint); font-size: 12px; line-height: 1.5; }

/* ---------- Review / tagging ---------- */
.prop-card { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; }
.prop-card .covers { display: flex; align-items: center; gap: 8px; flex: none; }
.prop-card .covers .cover { width: 64px; }
.prop-card .arrow { color: var(--faint); }
.prop-list { display: flex; flex-direction: column; gap: 10px; }
.status-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); text-transform: capitalize; }
.status-pill.applied { background: rgba(127,209,139,.15); color: var(--ok); }
.status-pill.pending { background: rgba(255,157,61,.15); color: var(--accent); }
.status-pill.rejected, .status-pill.undone { background: var(--surface-3); color: var(--faint); }

.compare { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; }
.compare > div { background: var(--surface); padding: 10px 12px; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.compare .h { background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--muted); }
.compare .k { color: var(--muted); font-weight: 600; }
.compare .changed { color: var(--accent-2); font-weight: 700; }
.cover-compare { display: flex; gap: 24px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.cover-compare figure { margin: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.cover-compare .cover { width: 160px; }
.cover-compare figcaption { font-size: 13px; color: var(--muted); font-weight: 700; }

.tchange { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); align-items: start; }
.tchange:last-child { border-bottom: 0; }
.tchange input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; }
.tchange .file { font-size: 12px; color: var(--faint); margin-bottom: 6px; overflow-wrap: anywhere; }
.diff { display: grid; grid-template-columns: 80px 1fr; gap: 3px 10px; font-size: 14px; }
.diff .k { color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 2px; }
.diff .old { color: var(--faint); text-decoration: line-through; margin-right: 8px; }
.diff .new { color: var(--accent-2); font-weight: 600; }
.diff .same { color: var(--text); }
.tchange.unmatched { opacity: .55; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 26px 0 8px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }

.cand { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.cand .cover { width: 60px; }
.cand-list { display: flex; flex-direction: column; gap: 8px; }
.score { font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.progress-bar { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- Settings ---------- */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: none; }
.settings h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.setting-row { display: grid; grid-template-columns: 1fr 240px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row p { margin: 3px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.folder { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 8px 8px 8px 12px; font-size: 14px; }
.folder .p { flex: 1; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.folder .warn { color: var(--danger); font-size: 12px; font-weight: 700; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.steps { margin: 6px 0 0; padding-left: 20px; line-height: 1.7; color: var(--muted); }
.steps b { color: var(--text); }

/* ---------- Phones & small tablets ---------- */
@media (max-width: 760px) {
  .app, body.np-visible .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto auto; }
  .sidebar, .nowpane { display: none !important; }
  /* The desktop app keeps the Now-playing pane even this narrow: a slim column on the right, above the player bar,
     shown and hidden with the Now-playing button. (Phones don't do this — the pane becomes the expanded player there.) */
  body.desktop-app.np-visible .app { grid-template-columns: minmax(0, 1fr) clamp(200px, 44vw, 300px); grid-template-rows: auto minmax(0, 1fr) auto auto; }
  body.desktop-app.np-visible .nowpane { display: flex !important; grid-column: 2; grid-row: 1 / 3; min-height: 0; border-left: 1px solid rgba(255,255,255,.08); }
  body.desktop-app.np-visible .playerbar, body.desktop-app.np-visible .tabbar { grid-column: 1 / -1; }
  body.desktop-app.np-visible .np-inner { padding: 12px 12px 0; gap: 8px; }
  body.desktop-app.np-visible .np-art .cover { width: 100%; }
  .phone-head { display: flex; grid-row: 1; grid-column: 1; }
  .main { grid-column: 1; grid-row: 2; }
  .view { --view-pt: 16px; --view-px: 16px; padding: 16px 16px 28px; }
  .playerbar { grid-row: 3; grid-column: 1; height: auto; margin: 0 8px 6px; border-radius: var(--radius); border: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 28%, var(--surface-2)), color-mix(in srgb, var(--art-2) 18%, var(--surface-2))); display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 0; position: relative; overflow: hidden; touch-action: pan-y; will-change: transform; }
  .pb-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; }
  .pb-now .cover { width: 42px; border-radius: 5px; }
  .pb-center, .hide-sm { display: none !important; }
  .pb-now { flex: 1; }
  .pb-right { gap: 0; }
  .pb-mini-progress { display: block; height: 2px; background: rgba(255,255,255,.12); margin: 0 8px; }
  /* The desktop app squeezed narrow: phone layout, but the player keeps its buttons and sits flush like the wide bar. */
  body.desktop-app .playerbar { margin: 0; border-radius: 0; border-top: 1px solid rgba(255,255,255,.08); }
  body.desktop-app .pb-center { display: flex !important; flex-direction: row; }
  body.desktop-app .pb-progress { display: none; }
  body.desktop-app .pb-controls { gap: 2px; }
  body.desktop-app .pb-controls .icon-btn.small { width: 32px; height: 32px; }
  body.desktop-app .pb-play { width: 34px; height: 34px; }
  body.desktop-app .pb-right .show-sm, body.desktop-app .pb-right .pb-play-sm { display: none !important; }
  body.desktop-app .pb-now { flex: 1 1 0; min-width: 0; }
  body.desktop-app .pb-center { flex: 0 0 auto; }
  body.desktop-app .pb-right { flex: 1 1 0; justify-content: flex-end; gap: 4px; }
  /* …and the same two-row right side as a narrow desktop window: quality label above, all the icons below. */
  body.desktop-app .pb-right { flex-wrap: wrap; row-gap: 0; justify-content: flex-end; }
  body.desktop-app .pb-right [aria-label="Mini player"], body.desktop-app .pb-right [aria-label="Play on another speaker"], body.desktop-app .pb-right .pb-pane { display: inline-flex !important; }
  /* top line: the volume slider (the quality label is left out here; it's in the full player) */
  body.desktop-app .pb-right .pb-quality { display: none !important; }
  body.desktop-app .pb-right .row { display: inline-flex !important; flex-basis: 100%; justify-content: flex-end; gap: 4px !important; order: 9; }
  body.desktop-app .pb-right .row .range.volume { max-width: 84px; }
  body.desktop-app .pb-right .icon-btn.small { width: 26px; height: 26px; }
  body.desktop-app .pb-mini-progress { margin: 0; }
  body.desktop-app .tabbar { padding-top: 0; }
  .pb-mini-progress > div { height: 100%; background: var(--text); width: 0; }
  .tabbar { display: flex; grid-row: 4; grid-column: 1; background: linear-gradient(transparent, #0a0908 35%); padding: 4px 0 calc(4px + var(--safe-b)); }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 6px 0; position: relative; }
  .tab .icon { width: 24px; height: 24px; }
  .tab.active { color: var(--text); }
  .tab .badge { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; padding: 1px 5px; min-width: 16px; }
  .toast { bottom: calc(var(--tabbar-h) + 78px + var(--safe-b)); }
  body:has(#playerbar[hidden]) .toast { bottom: calc(var(--tabbar-h) + 16px + var(--safe-b)); }

  .page-head h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
  .grid.scroll { grid-auto-columns: 140px; }
  .tile .tile-play { display: none; }
  .quick { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick a, .quick button { height: 52px; font-size: 13px; gap: 10px; }
  .quick .cover, .quick .q-icon { width: 52px; height: 52px; }

  .hero { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .hero .cover { width: min(64vw, 260px); }
  .hero-meta { justify-content: center; }
  .hero h1 { font-size: 26px; margin: 4px 0 8px; }
  .actions { justify-content: center; }

  .track, .tracks.no-album .track { grid-template-columns: minmax(0, 1fr) 40px 40px; gap: 4px; padding: 6px 4px; min-height: 56px; }
  .t-num, .t-album, .t-dur { display: none !important; }
  .t-like, .t-more { opacity: 1; }
  .t-main .cover { width: 44px; }
  .track.playing .t-eq-sm { display: inline-flex; }
  .track-head { display: none; }

  .compare { grid-template-columns: 90px 1fr 1fr; }
  .setting-row { grid-template-columns: 1fr; }
  .prop-card { flex-wrap: wrap; }
}

@media (min-width: 761px) {
  .pb-row { display: contents; }
  .show-sm { display: none !important; }
}
.flip { transform: rotate(180deg); }

/* Touch screens have no hover: don't leave buttons highlighted after a tap. */
@media (hover: none) {
  .icon-btn:hover, .btn.ghost:hover, .tile:hover, .track:hover, .list-row:hover { background: transparent; }
  .btn:hover { background: var(--surface-2); }
  .btn.primary:hover { background: var(--accent); }
}

/* ---------- Sync calibration ---------- */
.cal-page { max-width: 880px; }
.cal { display: flex; flex-direction: column; gap: 18px; }
.cal-stage { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 7; max-width: 100%; background: #0d0c0b; }
.cal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cal-start { position: absolute; inset: 0; margin: auto; width: max-content; height: 56px; display: inline-flex; align-items: center; gap: 10px; padding: 0 24px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; box-shadow: 0 10px 30px rgba(255, 140, 40, .3); }
.cal-start:hover { background: var(--accent-2); }
.cal-help { margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.7; }
.cal-help b { color: var(--text); }
.cal-controls { display: flex; align-items: center; justify-content: center; gap: 22px; }
.cal-btn { width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 38px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none; transition: transform .06s, background .15s; }
.cal-btn:hover { background: var(--surface-3); }
.cal-btn:active { transform: scale(.94); background: var(--accent); color: var(--accent-ink); }
.cal-readout { display: flex; flex-direction: column; align-items: center; min-width: 150px; }
.cal-value { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cal-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.cal-hint { text-align: center; color: var(--faint); font-size: 13px; margin: -6px 0 0; }
.cal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .cal-stage { aspect-ratio: 4 / 3; }
  .cal-btn { width: 68px; height: 68px; }
  .cal-actions { justify-content: stretch; }
  .cal-actions .btn { flex: 1; }
}

/* ---------- Get music, downloads, inbox, organizer ---------- */
.gm-search { display: flex; gap: 10px; align-items: center; max-width: 720px; margin-bottom: 26px; flex-wrap: wrap; }
.gm-search .btn { height: 48px; }
.gm-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.gm-pill.ok { background: rgba(127, 209, 139, .14); color: var(--ok); }
.gm-pill.warn { background: rgba(255, 107, 91, .14); color: #ff9a8c; }
.gm-pill.accent { background: rgba(255, 157, 61, .16); color: var(--accent); }
.tag-needs.ok { color: var(--ok); }
.gm-initials { background: linear-gradient(135deg, #3a2a18, #6b3f17); color: var(--accent-2); font-size: 34px; font-weight: 800; letter-spacing: .02em; }
.gm-track { grid-template-columns: 34px minmax(0, 1fr) 0 52px 150px !important; }
.gm-owned { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; margin-left: 6px; }
.gm-owned .icon { width: 14px; height: 14px; }
.gm-owned.warn { color: #ffb08a; }
.gm-get-track .icon { width: 16px; height: 16px; }
.gm-jobhead { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.gm-jobhead .cover { width: 96px; }
.gm-jobtitle { font-size: 28px; font-weight: 800; margin: 2px 0 4px; }
.gm-source { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px; }
.gm-source.best { border-color: rgba(255, 157, 61, .55); box-shadow: 0 0 0 1px rgba(255, 157, 61, .25) inset; }
.gm-source-main { flex: 1; min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.gm-source-main > .btn { align-self: flex-start; }
.gm-source-act { flex: none; }
.gm-folder { display: flex; align-items: center; gap: 6px; font-size: 14px; max-width: 100%; }
.gm-folder .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
.gm-warn, .gm-ok { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: #ffb08a; line-height: 1.4; }
.gm-ok { color: var(--ok); }
.gm-warn .icon, .gm-ok .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.warn-text { color: #ffb08a; }
.gm-files { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 6px; }
.gm-file { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); min-width: 0; }
.gm-job { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; }
.gm-job > .cover { width: 64px; }
.gm-folder-icon { width: 64px; }
.gm-folder-icon .icon { width: 30px; height: 30px; color: var(--muted); }
.gm-dest { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; margin: 2px 0 4px; }
.gm-dest .icon { width: 15px; height: 15px; color: var(--accent); flex: none; }
.gm-org summary { cursor: pointer; }
.gm-move { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.gm-move:first-of-type { margin-top: 10px; }
.page-head .spacer { flex: 1; }
@media (max-width: 760px) {
  .gm-search .btn { width: 100%; }
  .gm-source { flex-direction: column; }
  .gm-source-act, .gm-source-act .btn { width: 100%; }
  .gm-job { flex-wrap: wrap; }
  .gm-job > .cover, .gm-folder-icon { width: 52px; }
  .gm-track { grid-template-columns: minmax(0, 1fr) 136px !important; }
  .gm-track .t-dur, .gm-gap { display: none; }
  .tab span:not(.badge):not(.icon) { font-size: 10px; }
}

/* ===================================================================== */
/* Toggles, segmented buttons, small shared pieces                        */
/* ===================================================================== */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; justify-self: end; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.seg-btn .icon { width: 18px; height: 18px; }
.seg-btn.on { background: var(--text); color: var(--bg); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-x { margin-left: 6px; margin-right: -6px; opacity: .6; display: inline-flex; }
.chip-x .icon { width: 16px; height: 16px; }
.chip-ic { width: 16px; height: 16px; margin-right: 6px; }
.tile-why { font-size: 12px; color: var(--faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-x { position: absolute; right: 18px; top: 18px; z-index: 2; background: rgba(0,0,0,.6); border-radius: 50%; opacity: 0; }
.tile:hover .tile-x { opacity: 1; }
.home-bell { position: relative; }
.home-bell .badge { position: absolute; top: 2px; right: 0; font-size: 10px; padding: 1px 5px; min-width: 16px; }
.icon-btn.on, .icon-btn.small.on { color: var(--accent); }

/* Mix tiles get a label on the cover */
.mix-cover { position: relative; }
.mix-cover::after { content: ""; position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(160deg, rgba(255,157,61,.0) 30%, rgba(18,17,16,.85)); }
.mix-label { position: absolute; left: 10px; bottom: 10px; right: 10px; z-index: 1; font-weight: 800; font-size: 17px; line-height: 1.1; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

/* ===================================================================== */
/* Lyrics (full player, stage lyrics mode, Singer view)                  */
/* ===================================================================== */
.fp-lyrics { flex: 1; min-height: 0; display: flex; padding: 8px 0; overflow: hidden; }
.lyrics { position: relative; display: flex; flex-direction: column; width: 100%; min-height: 0; flex: 1; }
.lyrics-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 12% 4px 45%; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 80%, transparent); }
.lyrics-body::-webkit-scrollbar { display: none; }
.lyric-line { margin: 0 0 16px; font-size: 24px; font-weight: 800; line-height: 1.3; color: rgba(255,255,255,.38); cursor: pointer; transition: color .25s, transform .25s, opacity .25s; transform-origin: left center; }
.lyric-line:hover { color: rgba(255,255,255,.6); }
.lyric-line.past { color: rgba(255,255,255,.55); }
.lyric-line.on { color: rgba(255,255,255,.5); transform: scale(1.03); }
.lw { --p: 0%; }
.lyric-line.on .lw, .lyric-line.past .lw {
  background: linear-gradient(90deg, #fff var(--p), rgba(255,255,255,.45) var(--p));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lyric-line.past .lw { --p: 100% !important; background: none; color: rgba(255,255,255,.55); }
.lyrics.big .lyric-line { font-size: clamp(30px, 4.4vw, 64px); margin-bottom: .45em; }
.lyrics.big .lyric-line.on .lw { background: linear-gradient(90deg, var(--accent-2) var(--p), rgba(255,255,255,.5) var(--p)); -webkit-background-clip: text; background-clip: text; }
.lyrics-plain p { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: rgba(255,255,255,.8); line-height: 1.35; }
.lyrics-msg { text-align: center; color: rgba(255,255,255,.7); margin: auto; padding: 30px 10px; }
.lyrics-msg p { margin: 0 0 8px; }
.lyrics-tools { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 6px; color: rgba(255,255,255,.7); font-size: 12px; }
.lyrics-tools .icon-btn { font-size: 20px; font-weight: 700; width: 34px; height: 34px; }
.lyrics-offset { min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }
.fp-tools { display: flex; gap: 2px; align-items: center; }
.fp-q { display: flex; flex-direction: column; gap: 2px; }
.fp-sleep { color: var(--accent); font-weight: 700; }

/* ===================================================================== */
/* Karaoke controller page                                               */
/* ===================================================================== */
/* Karaoke / Party: heading stays at the left edge; the intro line and cards sit centred in an 820px column. */
.karaoke-page .page-head { flex-wrap: wrap; }
.karaoke-page > p, .karaoke-page > .card, .karaoke-page > .stack, .karaoke-page > .party-body { max-width: 820px; margin-left: auto; margin-right: auto; }
.karaoke-page .card { margin-bottom: 16px; }
.k-display-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.k-now { display: flex; align-items: center; gap: 12px; }
.k-now .cover { width: 56px; border-radius: 6px; }
.k-controls { display: flex; align-items: center; gap: 14px; }
.k-syncpad { background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.k-syncpad .btn:not(.small) { min-width: 56px; font-size: 22px; font-weight: 800; }
.k-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.k-choice { text-align: left; background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.k-choice span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.k-choice.on { border-color: var(--accent); background: rgba(255,157,61,.08); }
.k-choice:disabled { opacity: .5; cursor: not-allowed; }
.stage-code-input { font-size: 30px; letter-spacing: .25em; text-align: center; height: 60px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .k-choices { grid-template-columns: 1fr; } }

/* ===================================================================== */
/* Stage display                                                         */
/* ===================================================================== */
body.stage-only { overflow: hidden; }
body.stage-open > :not(.stage):not(.toast-wrap):not(.modal-backdrop) { visibility: hidden; }
.stage { position: fixed; inset: 0; z-index: 200; background: #05030a; color: #fff; overflow: hidden; outline: none; font-family: var(--font); user-select: none; }
.stage-bg, .stage-layer, .stage-vhs { position: absolute; inset: 0; }
.stage-layer { display: flex; align-items: center; justify-content: center; z-index: 2; }
.stage-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; filter: saturate(1.15) brightness(.62); }
.stage-bg video.on { opacity: 1; }
.bg-art-img { position: absolute; inset: -10%; background: center/cover no-repeat #1a0f05; filter: blur(42px) brightness(.45) saturate(1.3); animation: kenburns 40s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05); } to { transform: scale(1.25) translate(2%, -2%); } }
.stage-bg canvas { width: 100%; height: 100%; display: block; }
.bg-retro { background: linear-gradient(#12002b, #3b0a4d 55%, #ff4f8b 56%, #12002b 57%); }
.retro-sky { position: absolute; inset: 0 0 45% 0; display: flex; justify-content: center; align-items: flex-end; }
.retro-sun { width: 34vmin; height: 34vmin; border-radius: 50%; margin-bottom: -10vmin; background: linear-gradient(#ffd23f, #ff6b3d 60%, #ff2e88); -webkit-mask-image: linear-gradient(#000 55%, transparent 55% 59%, #000 59% 67%, transparent 67% 71%, #000 71% 79%, transparent 79% 83%, #000 83%); mask-image: linear-gradient(#000 55%, transparent 55% 59%, #000 59% 67%, transparent 67% 71%, #000 71% 79%, transparent 79% 83%, #000 83%); filter: drop-shadow(0 0 40px rgba(255,80,140,.6)); }
.retro-grid { position: absolute; left: -50%; right: -50%; bottom: 0; height: 46%; transform: perspective(300px) rotateX(62deg); transform-origin: bottom; background-image: linear-gradient(rgba(255,70,200,.8) 2px, transparent 2px), linear-gradient(90deg, rgba(255,70,200,.8) 2px, transparent 2px); background-size: 60px 60px; animation: grid 1.4s linear infinite; }
@keyframes grid { to { background-position: 0 60px; } }
.bg-waves { background: #0b0420; }
.waves-a, .waves-b { position: absolute; inset: -40%; background: radial-gradient(circle at 30% 30%, rgba(255,91,170,.55), transparent 40%), radial-gradient(circle at 70% 60%, rgba(70,120,255,.55), transparent 42%), radial-gradient(circle at 40% 80%, rgba(255,170,60,.45), transparent 40%); filter: blur(30px); animation: drift 22s ease-in-out infinite alternate; }
.waves-b { animation-duration: 31s; animation-direction: alternate-reverse; opacity: .7; }
@keyframes drift { from { transform: rotate(0) scale(1); } to { transform: rotate(40deg) scale(1.2); } }
.stage-vhs { z-index: 3; pointer-events: none; display: none; }
.stage.vhs-on .stage-vhs { display: block; background: repeating-linear-gradient(rgba(0,0,0,.18) 0 2px, transparent 2px 4px); animation: vhsflick .12s steps(2) infinite; }
.stage.vhs-on .stage-vhs::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(255,255,255,.05), transparent 3%, transparent 97%, rgba(255,255,255,.04)); animation: vhsroll 7s linear infinite; }
@keyframes vhsflick { 50% { opacity: .85; } }
@keyframes vhsroll { from { transform: translateY(-100%); } to { transform: translateY(100%); } }
.stage.vhs-on .k-title { text-shadow: 2px 0 rgba(255,0,80,.55), -2px 0 rgba(0,200,255,.55), 0 4px 18px rgba(0,0,0,.8); }
.stage.vhs-on .k-line { filter: drop-shadow(2px 0 rgba(255,0,80,.6)) drop-shadow(-2px 0 rgba(0,200,255,.6)) drop-shadow(0 3px 0 rgba(0,0,0,.9)); }
.stage-osd { position: absolute; z-index: 4; left: 5vw; top: 5vh; font: 800 clamp(22px, 3.2vw, 46px)/1 ui-monospace, "Consolas", monospace; color: #9cff6e; text-shadow: 2px 2px 0 #000; opacity: 0; transition: opacity .3s; letter-spacing: .05em; }
.stage-osd.on { opacity: 1; }
.stage-corner { position: absolute; z-index: 4; right: 2.4vw; bottom: 2vh; font-size: clamp(12px, 1.2vw, 18px); color: rgba(255,255,255,.45); font-weight: 700; }
.stage-fs, .stage-exit { position: absolute; z-index: 5; top: 16px; height: 40px; padding: 0 12px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; opacity: .55; }
.stage-fs { right: 16px; width: 40px; padding: 0; justify-content: center; }
.stage-exit { left: 16px; }
.stage-fs:hover, .stage-exit:hover, .stage-fs:focus-visible, .stage-exit:focus-visible { opacity: 1; }
.stage-idle { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2.4vh; padding: 20px; }
.stage-logo { width: clamp(64px, 9vw, 120px); border-radius: 22%; }
.stage-brand { font-size: clamp(28px, 4vw, 60px); font-weight: 800; letter-spacing: -.02em; }
.stage-brand span { color: var(--accent); }
.stage-code-label { font-size: clamp(16px, 1.8vw, 28px); color: rgba(255,255,255,.75); max-width: 30em; }
.stage-code { font-size: clamp(64px, 12vw, 190px); font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 40px rgba(255,157,61,.5); margin-top: 1vh; }
.stage-unlock { background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: clamp(16px, 1.8vw, 26px); padding: .7em 1.3em; border-radius: 999px; display: inline-flex; align-items: center; gap: .5em; }
.stage-unlock.floating { position: absolute; bottom: 8vh; left: 50%; transform: translateX(-50%); z-index: 5; }
.stage-small-btn { color: rgba(255,255,255,.65); display: inline-flex; gap: 6px; align-items: center; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.08); }
.stage-card { text-align: center; }
.stage-card-kicker { color: var(--accent); font-weight: 800; font-size: clamp(16px, 2vw, 30px); }
.stage-card-title { font-size: clamp(36px, 6vw, 96px); font-weight: 800; margin-top: 1vh; }
.stage-card-artist { font-size: clamp(20px, 2.6vw, 40px); color: rgba(255,255,255,.75); }
.stage-prep { margin-top: 4vh; font-size: clamp(16px, 1.6vw, 24px); color: rgba(255,255,255,.7); }
.stage-lyrics-mode { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(200px, 28vw) 1fr; gap: 4vw; padding: 7vh 6vw; align-items: center; }
.stage-now img { width: 100%; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.stage-now-title { font-size: clamp(22px, 2.4vw, 40px); font-weight: 800; margin-top: 18px; }
.stage-now-artist { font-size: clamp(16px, 1.6vw, 26px); color: rgba(255,255,255,.7); }
.stage-lyrics-mode .lyrics { height: 86vh; }
@media (max-aspect-ratio: 1/1) { .stage-lyrics-mode { grid-template-columns: 1fr; } .stage-now { display: none; } }
.stage-cal { position: absolute; inset: 0; z-index: 6; background: rgba(5,3,10,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4vh 4vw; gap: 10px; text-align: center; }
.stage-cal h2 { font-size: clamp(24px, 3vw, 44px); }
.stage-cal p { color: rgba(255,255,255,.75); max-width: 40em; margin: 0 0 10px; }
.stage-cal .cal { width: min(900px, 92vw); }

/* Classic two-line karaoke */
.k-stage { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 6vw 12vh; }
.k-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: opacity .8s, transform .8s; z-index: 1; padding: 0 6vw; }
.k-title.gone { opacity: 0; transform: scale(.96); pointer-events: none; }
.k-title-song { font-size: clamp(44px, 7.5vw, 130px); font-weight: 900; letter-spacing: -.02em; line-height: 1.02; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.7); }
.k-title-artist { font-size: clamp(22px, 3vw, 50px); font-weight: 700; color: var(--accent-2); margin-top: 1.5vh; }
.k-title-singer { margin-top: 5vh; font-size: clamp(20px, 2.4vw, 40px); font-weight: 800; background: rgba(0,0,0,.45); padding: .35em 1em; border-radius: 999px; }
.k-title-singer span { color: rgba(255,255,255,.65); font-weight: 600; }
.k-lines { display: flex; flex-direction: column; gap: 2.2vh; position: relative; }
.k-line { min-height: 1.25em; font-size: clamp(34px, 5vw, 86px); font-weight: 900; line-height: 1.15; letter-spacing: -.01em; color: #fff; filter: drop-shadow(0 3px 0 rgba(0,0,0,.9)) drop-shadow(0 6px 16px rgba(0,0,0,.6)); transition: opacity .3s; }
.k-line:nth-child(2) { text-align: left; }
.k-line:nth-child(3) { text-align: right; }
.k-line.empty { opacity: 0; }
.kw { --p: 0%; background: linear-gradient(90deg, var(--accent) var(--p), #fff var(--p)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.k-stage.titling .k-lines { opacity: 0; }
.k-lines { transition: opacity .6s; }
.k-dots { position: absolute; top: -6vh; left: 0; display: flex; gap: 1.6vw; opacity: 0; transition: opacity .3s; }
.k-dots.on { opacity: 1; }
.k-dots span { width: clamp(14px, 1.6vw, 26px); height: clamp(14px, 1.6vw, 26px); border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); transition: opacity .2s, transform .2s; }
.k-dots span.off { opacity: .15; transform: scale(.7); }
.k-plain { margin: auto; font-size: clamp(18px, 2vw, 30px); color: rgba(255,255,255,.75); text-align: center; }
.k-next { position: absolute; right: 4vw; top: 6vh; background: rgba(0,0,0,.55); padding: .6em 1.1em; border-radius: 14px; font-size: clamp(16px, 1.8vw, 28px); backdrop-filter: blur(8px); }
.k-next-label { color: var(--accent); font-weight: 800; font-size: .75em; }

/* Singer view (teleprompter) */
.singer { position: fixed; inset: 0; z-index: 150; background: #000; display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 14px max(14px, var(--safe-b)); }
.singer-top { display: flex; align-items: center; gap: 6px; }
.singer-title { flex: 1; font-weight: 700; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.singer-body { flex: 1; min-height: 0; display: flex; }
.singer .lyrics.big .lyric-line { font-size: calc(clamp(30px, 8.5vw, 72px) * var(--singer-scale, 1)); }
.singer.mirror .singer-body { transform: scaleX(-1); }

/* ===================================================================== */
/* Car mode                                                              */
/* ===================================================================== */
body.car-on #playerbar, body.car-on #tabbar, body.car-on #sidebar { display: none !important; }
.car { position: fixed; inset: 0; z-index: 120; background: #000; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 20px max(18px, var(--safe-b)); gap: 18px; }
.car-top { display: flex; justify-content: space-between; align-items: center; }
.car-exit { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); padding: 10px 4px; }
.car-clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.car-now { display: flex; gap: 20px; align-items: center; flex: 1; min-height: 0; }
.car-art { width: min(38vw, 42vh); flex: none; }
.car-art .cover { border-radius: 14px; }
.car-text { flex: 1; min-width: 0; }
.car-title { font-size: clamp(26px, 5vw, 46px); font-weight: 800; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.car-artist { font-size: clamp(16px, 3vw, 24px); color: var(--muted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-progress { height: 6px; background: var(--surface-3); border-radius: 6px; margin-top: 20px; overflow: hidden; }
.car-progress > div { height: 100%; background: var(--accent); }
.car-controls { display: flex; justify-content: space-around; align-items: center; }
.car-btn { width: 84px; height: 84px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; }
.car-btn .icon { width: 40px; height: 40px; }
.car-btn.main { width: 110px; height: 110px; background: var(--accent); color: var(--accent-ink); }
.car-btn.main .icon { width: 52px; height: 52px; }
.car-btn.on { color: var(--accent); }
.car-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.car-tile { background: var(--surface-2); border-radius: 16px; height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 15px; }
@media (max-width: 600px) and (orientation: portrait) {
  .car-now { flex-direction: column; text-align: center; }
  .car-art { width: min(70vw, 34vh); }
  .car-tile { height: 74px; font-size: 13px; }
}

/* ===================================================================== */
/* Notifications, wishlist, recap                                        */
/* ===================================================================== */
.notif.unread { background: rgba(255,157,61,.06); }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--accent); flex: none; }
.wish { margin-bottom: 12px; display: flex; flex-direction: column; gap: 12px; }
.wish-main { display: flex; align-items: center; gap: 12px; }
.wish-main .cover, .wish-main img { width: 64px; height: 64px; border-radius: 6px; flex: none; object-fit: cover; }
.wish-opts { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.recap-hero { background: linear-gradient(135deg, #ff9d3d, #ff3d7a 60%, #6b3dff); color: #fff; border-radius: var(--radius-lg); padding: 28px; margin-bottom: 18px; }
.recap-personality .k { font-size: 13px; font-weight: 700; opacity: .85; }
.recap-personality .v { font-size: 38px; font-weight: 900; letter-spacing: -.02em; }
.recap-personality p { margin: 4px 0 0; opacity: .9; }
.recap-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.recap-stat .n { font-size: 30px; font-weight: 900; }
.recap-stat .l { font-size: 13px; opacity: .85; }
.recap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.recap-list ol { margin: 8px 0 0; padding-left: 22px; }
.recap-list li { margin: 8px 0; }
.recap-row { display: flex; align-items: center; gap: 10px; }
.recap-row .cover { width: 40px; border-radius: 4px; flex: none; }
.recap-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-col .bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-col span { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { .recap-stats { grid-template-columns: repeat(2, 1fr); } .recap-personality .v { font-size: 30px; } }

/* ===================================================================== */
/* Review feedback: compact Get music header, one-line import actions     */
/* ===================================================================== */
@media (max-width: 760px) {
  .gm-head { margin-bottom: 12px; }
  .gm-inbox-btn { width: 44px; padding: 0; justify-content: center; position: relative; }
  .gm-inbox-btn .badge { position: absolute; top: -4px; right: -4px; font-size: 10px; padding: 1px 5px; min-width: 16px; }
  .gm-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
  .gm-tabs::-webkit-scrollbar { display: none; }
  .gm-tabs .chip { flex: none; height: 32px; }
  .gm-search { gap: 8px; margin-bottom: 14px; }
  .gm-search-btn { width: 46px; padding: 0; justify-content: center; flex: none; }
  .gm-import-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .gm-import-hint { text-align: center; }
  .gm-import-btns { display: flex; gap: 10px; }
  .gm-import-btns .btn { flex: 1; justify-content: center; }
}
.gm-import-btns { display: flex; gap: 10px; }
@media (max-width: 760px) {
  .gm-search { flex-wrap: nowrap !important; }
  .page-head.row.between { flex-wrap: nowrap; }
  .page-head.row.between h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 24px; }
}
@media (max-width: 760px) {
  .gm-tabs { margin: 0 0 12px; padding: 0; max-width: 100%; }
  .gm-search .search-box { min-width: 0; }
  .gm-search .search-box input { min-width: 0; width: 100%; }
  .page-head.row.between > .row { flex-wrap: nowrap; flex: none; }
}
#main { overflow-x: hidden; }
@media (max-width: 760px) {
  .gm-search .gm-search-btn { flex: 0 0 48px !important; width: 48px !important; min-width: 0; padding: 0; }
  .gm-search .search-box { flex: 1 1 auto !important; }
}

.setup-opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 6px 0 4px; }
.setup-opt input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.setup-opt .hint { margin: 0; }
.stage-cal { background: #05030a; overflow-y: auto; justify-content: flex-start; padding-top: 3vh; }
.stage-cal h2 { font-size: clamp(20px, 2.4vw, 36px); }
.stage-cal .cal { width: min(760px, 92vw); }
.stage-cal ol, .stage-cal ul { text-align: left; }
/* Review round 4 */
.stage-code-label { white-space: nowrap; }
.k-display-btns { flex-wrap: nowrap; }
.k-display-btns .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 10px; white-space: nowrap; gap: 6px; }
.k-display-btns .btn .icon { width: 18px; height: 18px; }
.singer .stage-bg { position: absolute; inset: 0; z-index: 0; }
.singer-shade { position: absolute; inset: 0; z-index: 0; background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.35) 40%, rgba(0,0,0,.6)); }
.singer.vhs-on .singer-shade { background: repeating-linear-gradient(rgba(0,0,0,.6) 0 2px, rgba(0,0,0,.42) 2px 4px); }
.singer-top, .singer-body { position: relative; z-index: 1; }
.singer .lyric-line { filter: drop-shadow(0 2px 6px rgba(0,0,0,.85)); }
.singer.mirror .stage-bg { transform: scaleX(-1); }
/* Car mode, round 4 */
.car { overflow: hidden; }
.car-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.car-bg .bg-art-img { filter: blur(48px) brightness(.38) saturate(1.35); }
.car > :not(.car-bg) { position: relative; z-index: 1; }
.car-top { gap: 12px; }
.car-clock { margin-left: auto; }
.car-top-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.1); font-weight: 700; }
.car-top-btn.on { background: var(--accent); color: var(--accent-ink); }
.car-art { display: block; }
.car-link { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); font-size: clamp(15px, 2.6vw, 21px); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 0; }
.car-link .icon { width: 18px; height: 18px; flex: none; }
.car-link.car-artist { color: #fff; font-weight: 700; }
.car-source { color: var(--accent-2); font-weight: 700; }
.car-now.lyrics-on { flex-direction: column; align-items: stretch; gap: 10px; }
.car-lyrics { flex: 1; min-height: 0; display: flex; }
.car-lyrics .lyrics.big .lyric-line { font-size: clamp(26px, 6vw, 52px); }
.car-text.small .car-title { font-size: 20px; }
.car-text.small .car-progress { margin-top: 10px; }
.car-btn { background: rgba(255,255,255,.12); }
.car-tile { background: rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.car-tile.on { color: var(--accent); }
.k-note { margin-top: 3vh; max-width: 40em; font-size: clamp(14px, 1.4vw, 22px); color: rgba(255,255,255,.8); background: rgba(0,0,0,.45); padding: .5em 1em; border-radius: 12px; }
.car-exit { white-space: nowrap; font-size: 15px; }
.car-clock { white-space: nowrap; }
@media (max-width: 420px) { .car-exit > span:not(.icon), .car-top-btn > span:not(.icon) { display: none; } .car-top-btn { width: 48px; padding: 0; justify-content: center; } }
@media (max-width: 600px) and (orientation: portrait) { .car-link { justify-content: center; } }
.car-exit .icon { width: 26px; height: 26px; }
@media (max-width: 760px) { .k-display-btns { gap: 6px; } .k-display-btns .btn { font-size: 14px; padding: 0 8px; gap: 4px; height: 44px; } }
@media (max-width: 360px) { .k-display-btns .btn .icon { display: none; } }
/* Review round 5: display buttons as equal tiles on phones, so labels never overflow */
@media (max-width: 760px) {
  .k-display-btns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  .k-display-btns .btn { flex-direction: column; height: auto; min-height: 64px; padding: 10px 4px; gap: 4px; font-size: 13px; line-height: 1.15; white-space: normal; text-align: center; border-radius: 14px; }
  .k-display-btns .btn .icon { display: inline-flex !important; width: 22px; height: 22px; }
}
.k-ready-pill { height: 18px; font-size: 10.5px; padding: 0 7px; margin-right: 6px; vertical-align: 1px; }
.k-ready-list { max-height: 420px; overflow-y: auto; }
/* Car mode lyrics layout */
.car-now.lyrics-on { gap: 12px; }
.car-mini { display: flex; align-items: center; gap: 14px; text-align: left; }
.car-mini .car-art { width: 76px; flex: none; }
.car-mini .car-art .cover { border-radius: 8px; }
.car-mini-text { min-width: 0; flex: 1; }
.car-mini-text .car-title { font-size: 22px; -webkit-line-clamp: 1; }
.car-mini-text .car-link { justify-content: flex-start !important; margin-top: 2px; padding: 2px 0; font-size: 15px; }
.car-now.lyrics-on > .car-progress { margin-top: 0; }
.car-now.lyrics-on .car-lyrics { flex: 1; min-height: 0; }
/* Singer view: song title on top, lyrics start below it */
.singer-top .spacer { flex: 1; }
.singer-head { position: relative; z-index: 1; text-align: center; padding: 4px 8px 10px; }
.singer-song { font-size: calc(clamp(26px, 7vw, 48px) * var(--singer-scale, 1)); font-weight: 900; line-height: 1.1; letter-spacing: -.01em; filter: drop-shadow(0 2px 6px rgba(0,0,0,.8)); }
.singer-sub { margin-top: 4px; color: rgba(255,255,255,.75); font-weight: 600; font-size: 15px; }
.singer .lyrics-body { padding-top: 12px; -webkit-mask-image: linear-gradient(#000, #000 82%, transparent); mask-image: linear-gradient(#000, #000 82%, transparent); }

/* ===================================================================== */
/* Desktop app: mini player and drag-and-drop                            */
/* ===================================================================== */
.mini { display: none; }
body.mini-on #app, body.mini-on #auth, body.mini-on #fullplayer, body.mini-on #nowplaying { display: none !important; }
body.mini-on { background: #141210; }
body.mini-on .mini { display: block; height: 100vh; position: relative; overflow: hidden; }
.mini-drag { position: absolute; inset: 0; -webkit-app-region: drag; z-index: 1; }
.mini-art { position: absolute; inset: 0; opacity: 1; transition: opacity .35s; z-index: 0; }
/* "Accent colour" mode follows the Appearance setting, scaled down: Low = a flat tint, Medium = the two-colour wash,
   High = the cover blurred the way the main window does it (Crisp / Blur / Blur zoom), just with smaller blur radii. */
body.mini-accent .mini-art { opacity: 0; }
body.mini-accent .mini { background: color-mix(in srgb, var(--art-1) 28%, #141210); }
.art-mode body.mini-accent .mini { background: linear-gradient(135deg, color-mix(in srgb, var(--art-1) 55%, #141210), color-mix(in srgb, var(--art-2) 40%, #141210)); }
.art-high body.mini-accent .mini-art { opacity: 1; }
.art-high body.mini-accent .mini-art .cover img { filter: blur(14px) saturate(1.4) brightness(.5); transform: scale(1.15); }
.art-high.art-zoom body.mini-accent .mini-art .cover img { filter: blur(10px) saturate(1.5) brightness(.5); transform: scale(1.9); }
.art-high.art-crisp body.mini-accent .mini-art .cover img { filter: blur(3px) saturate(1.2) brightness(.45); transform: scale(1.08); }
.mini-art .cover { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; }
.mini-art .cover img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(1.1); }
.mini-body { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding-bottom: 4px; pointer-events: none; }
.mini-controls { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.mini-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); -webkit-app-region: no-drag; background: rgba(0,0,0,.25); }
.mini-btn:hover { background: rgba(255,255,255,.18); }
.mini-btn.mini-main { background: var(--text); color: var(--bg); width: 44px; height: 44px; }
.mini-btn.mini-main:hover { background: #fff; }
.mini-text { text-align: center; max-width: 92%; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.mini-title { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { color: rgba(255,255,255,.75); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-restore { position: absolute; top: 4px; right: 4px; z-index: 3; width: 26px; height: 26px; opacity: 0; transition: opacity .35s; color: rgba(255,255,255,.8); }
.mini-restore .icon { width: 16px; height: 16px; }
.mini:hover .mini-restore { opacity: 1; }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.12); z-index: 3; }
.mini-progress > div { height: 100%; background: var(--art-1); }
body.dropping::after { content: "Drop music files or folders to add them"; position: fixed; inset: 12px; z-index: 300; border: 3px dashed var(--accent); border-radius: 18px; background: rgba(18, 17, 16, .82); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: var(--accent); pointer-events: none; }

/* Remote access card */
.ok-text { color: var(--ok); }
.remote-name { display: flex; align-items: center; gap: 4px; background: var(--surface-2, #1f1c18); border: 1px solid var(--line, #2c2823); border-radius: 12px; padding: 0 12px; min-width: 0; }
.remote-name .input { border: 0; background: transparent; padding-left: 2px; padding-right: 2px; min-width: 0; flex: 1; box-shadow: none; }
.remote-name span { font-size: 14px; white-space: nowrap; }
.remote-url { display: flex; gap: 16px; align-items: center; }
.remote-qr { width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 6px; flex: none; }
.remote-link { font-weight: 700; font-size: 17px; color: var(--accent); word-break: break-all; }
.remote-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.remote-facts dt { color: var(--faint, #6f675d); }
.remote-facts dd { margin: 0; color: var(--muted); }
.remote-lan summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.remote-lan[open] summary { margin-bottom: 6px; }
@media (max-width: 520px) { .remote-url { flex-direction: column; align-items: flex-start; } .remote-facts { grid-template-columns: 1fr; gap: 2px; } .remote-facts dd { margin-bottom: 6px; } }

/* Install banner (phones) */
.install-banner { position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 60; display: flex; gap: 12px; align-items: flex-start; padding: 14px 12px 14px 14px; border-radius: var(--radius-lg); background: var(--surface-2, #1f1c18); border: 1px solid var(--line); box-shadow: 0 16px 48px rgba(0,0,0,.5); transform: translateY(-140%); transition: transform .3s ease; max-width: 520px; margin: 0 auto; }
.install-banner.on { transform: none; }
.install-icon { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-text { display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.45; color: var(--muted); min-width: 0; flex: 1; }
.install-text b { color: var(--text); }
.install-text > b:first-child { font-size: 15px; }
.install-close { flex: none; margin: -4px -2px 0 0; }

/* Home: library bar and loading tiles */
.library-bar { flex-wrap: wrap; margin-bottom: 22px; }
.library-bar p { line-height: 1.5; }
.library-bar .bar-path { display: block; margin-top: 2px; }
.library-bar code { font-size: 12px; word-break: break-all; color: var(--faint); background: none; padding: 0; }
@media (max-width: 640px) { .library-bar { padding: 10px 14px; gap: 10px; font-size: 14px; margin-bottom: 18px; } .library-bar p { min-width: 0; flex: 1 1 calc(100% - 44px); } .library-bar > .row { margin-left: 34px; } .library-bar .btn.small { height: 34px; padding: 0 14px; } }
.tile-skeleton { pointer-events: none; }
.tile-skeleton .skel-cover { aspect-ratio: 1; border-radius: var(--radius, 12px); background: var(--surface-2); animation: skel 1.4s ease-in-out infinite; }
.tile-skeleton .skel-line { height: 12px; border-radius: 6px; background: var(--surface-2); margin-top: 10px; width: 80%; animation: skel 1.4s ease-in-out infinite; }
.tile-skeleton .skel-line.short { width: 50%; }
@keyframes skel { 50% { opacity: .45; } }

/* Home discover rows */
.artist-tile .cover.round { position: relative; overflow: hidden; display: grid; place-items: center; aspect-ratio: 1; }
.artist-tile .cover.round img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.artist-tile { text-align: center; }
.song-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(4, auto); grid-auto-columns: minmax(280px, 340px); gap: 4px 18px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px;  overflow-y: hidden;}
.song-grid::-webkit-scrollbar { display: none; }
.song-cell { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; text-align: left; min-width: 0; color: inherit; background: none; border: 0; cursor: pointer; }
.song-cell:hover { background: var(--surface-2); }
.song-cell .cover { width: 48px; height: 48px; flex: none; border-radius: 6px; }
.song-rank { width: 20px; flex: none; text-align: right; color: var(--faint); font-weight: 700; font-size: 14px; }
.song-text { min-width: 0; flex: 1; }
.song-title { font-weight: 700; }
.song-owned { color: var(--accent); flex: none; }
.genre-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 96px); grid-auto-columns: 170px; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px;  overflow-y: hidden;}
.genre-grid::-webkit-scrollbar { display: none; }
.genre-tile { border-radius: var(--radius); padding: 14px; display: flex; align-items: flex-end; color: #fff; font-weight: 800; font-size: 18px; text-shadow: 0 1px 8px rgba(0,0,0,.35); transition: transform .12s; }
.genre-tile:hover { transform: scale(1.02); }
.genre-hero { border-radius: var(--radius-lg, 18px); padding: 56px 24px 24px; margin-bottom: 24px; color: #fff; }
.genre-hero h1 { font-size: 44px; font-weight: 800; margin: 4px 0 0; }
@media (max-width: 640px) { .song-grid { grid-auto-columns: 82%; } .genre-grid { grid-auto-columns: 140px; grid-template-rows: repeat(2, 84px); } .genre-hero h1 { font-size: 34px; } }
.format-wrap { display: flex; gap: 6px; margin-right: 10px; }
.format-pick { height: 40px; border: 0; color: var(--text); cursor: pointer; padding-right: 30px; appearance: none; -webkit-appearance: none; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a89e90'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 18px; font-family: inherit; }
.format-pick:disabled { opacity: .5; }

.naming-note { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.naming-note code { font-size: 13px; color: var(--text); word-break: break-word; }
.naming-note code span { color: var(--faint); }

/* Soulseek health */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.stat-value { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-weight: 700; font-size: 13px; margin-top: 2px; }
.stat-sub { color: var(--faint); font-size: 12px; margin-top: 2px; }
.slsk-note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.slsk-note .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.slsk-note.warn { background: rgba(255, 107, 91, .1); color: #ffb0a5; }
.slsk-note.warn .icon { color: #ff8a7a; }
.slsk-note.ok .icon { color: var(--ok); }
.slsk-note.info .icon { color: var(--accent); }
.slsk-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.slsk-row { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.slsk-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .slsk-row { grid-template-columns: minmax(0, 1fr) auto; } .stat-value { font-size: 19px; } }

/* Sideways rows on a computer: drag to scroll, ‹ › buttons, columns that fit exactly */
.section-head { display: flex; align-items: center; gap: 8px; }
.section-head h2 { flex: 1; min-width: 0; }
.row-nav { display: flex; gap: 4px; }
.row-nav-btn:disabled { opacity: .3; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .grid.scroll, .song-grid, .genre-grid { cursor: grab; }
  .dragging { cursor: grabbing; user-select: none; }
  .dragging * { pointer-events: none; }
  .song-grid { grid-auto-columns: calc((100% - 2 * 18px) / 3); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1500px) { .song-grid { grid-auto-columns: calc((100% - 3 * 18px) / 4); } }
@media (hover: hover) and (pointer: fine) and (max-width: 900px) { .song-grid { grid-auto-columns: calc((100% - 18px) / 2); } }

/* Feedback */
.side-feedback { margin-top: auto; width: 100%; text-align: left; flex: none; }
.sidebar .icon { width: 20px; height: 20px; }
.fb-form .seg { align-self: flex-start; }
.fb-include { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.fb-include input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.fb-preview { max-height: 240px; overflow: auto; background: #0c0b0a; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.45; color: var(--muted); white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
.fb-preview.tall { max-height: 60vh; }
.fb-list { display: flex; flex-direction: column; gap: 8px; }
.fb-item { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.fb-item.done { opacity: .55; }
.fb-text { margin: 0; white-space: pre-wrap; line-height: 1.5; word-break: break-word; }

/* In library: green = on this album, yellow = you have it from a different album */
.gm-pill.amber { background: rgba(242, 196, 61, .16); color: #f2c43d; }
.gm-owned.other { color: #f2c43d; }
.gm-owned.other.prefer { color: #f2c43d; font-style: italic; }
.gm-owned.low { color: #ffb08a; }
.tag-needs.have { background: rgba(242, 196, 61, .92); color: #1d1606; }

/* Get it / Search variants on album tiles (inside the cover, bottom right) */
.cover .tile-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; z-index: 2; }
.tile:hover .tile-actions, .tile:focus-within .tile-actions { opacity: 1; transform: none; }
@media (hover: none) { .cover .tile-actions { opacity: 1; transform: none; } }
.tile-act { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(18, 17, 16, .82); color: var(--text); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.tile-act:first-child { background: var(--accent); color: #1d1206; border: 0; }
.tile-act .icon { width: 18px; height: 18px; }
.tile-act:disabled { opacity: .5; }

.follow-list { display: flex; flex-direction: column; gap: 2px; }
.follow-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.follow-row:last-child { border-bottom: 0; }
.follow-auto { height: 36px; }

/* Duplicates & library health */
.dup-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.dup-group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.dup-copy { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.dup-copy:hover { background: var(--surface-2); }
.dup-copy input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.dup-copy-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dup-copy-main a { font-weight: 600; }
.dup-skip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.health-card { margin-bottom: 12px; }
.health-card .row > .icon { color: var(--accent); }
.health-card.ok .row > .icon { color: var(--ok); }
.health-items { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.health-item { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; min-width: 0; }
.health-item:last-child { border-bottom: 0; }

/* Smart playlists */
.smart-rules { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.smart-rule { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-radius: 10px; background: var(--surface-2); width: 100%; }
.small-select { height: 36px; width: auto; padding: 0 10px; }
.small-num { height: 36px; width: 84px; padding: 0 10px; }
.smart-text { height: 36px; width: 180px; padding: 0 10px; }
.smart-preview { padding: 12px; border-radius: 12px; border: 1px solid var(--line, rgba(127,127,127,.2)); display: flex; flex-direction: column; gap: 8px; }
.smart-sample { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.smart-summary { margin-top: 6px; max-width: 60ch; }
.q-auto-head { margin-top: 14px; font-size: 13px; color: var(--muted, #999); font-weight: 600; }
.q-keep { display: flex; gap: 10px; align-items: center; padding: 14px 4px 6px; cursor: pointer; }

/* Your week */
.week-card { display: flex; flex-wrap: wrap; gap: 16px 28px; padding: 18px; border-radius: 16px; background: var(--surface-2); align-items: center; }
.week-stats { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.week-stat { display: flex; flex-direction: column; }
.week-stat b { font-size: 26px; line-height: 1.1; }
.week-stat span { font-size: 13px; color: var(--muted, #999); }
.week-tops { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; min-width: 0; flex: 1; max-width: 100%; }
.week-tops > * { min-width: 0; max-width: 100%; }
.week-song { display: flex; gap: 10px; align-items: center; text-align: left; min-width: 0; max-width: 100%; }
.week-song .cover { width: 48px; flex: none; }
/* Customize Home */
.home-rows { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.home-row-item { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.home-row-item.off { opacity: .55; }
.home-row-item .arrow { font-size: 16px; font-weight: 700; }
.gm-track-acts { display: flex; align-items: center; gap: 2px; flex: none; }
.gm-track-acts .icon-btn .icon { width: 18px; height: 18px; }
.gm-track-acts { justify-content: flex-end; }

/* Library: Liked mode */
.liked-toggle { gap: 0; }
.liked-toggle.on { background: var(--accent); color: #1a1208; }
.liked-toggle.on:hover { background: var(--accent); filter: brightness(1.05); }
.liked-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; margin-bottom: 18px; border-radius: 12px; background: rgba(255,157,61,.1); border: 1px solid rgba(255,157,61,.3); }
.liked-bar > .icon { color: var(--accent); width: 18px; height: 18px; }
.liked-bar > span { flex: 1; min-width: 160px; }

/* Artist and album names as links */
.t-link { color: inherit; }
.t-link:hover, .pb-artist a:hover { color: var(--text); text-decoration: underline; }
.pb-artist a { color: inherit; }
.t-album-inline { display: none; }
@media (max-width: 760px) {
  .t-album-inline { display: inline; }
  .pb-album { display: none; }
}
.fp-source { color: inherit; } .fp-source:hover b { text-decoration: underline; }

/* ---------- Resume bar, stats, long lists, advanced settings ---------- */
.resume-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 8px 14px; font-size: 14px; font-weight: 600; }
.resume-bar > .icon { color: var(--accent); width: 18px; height: 18px; }
.resume-bar > span { flex: 1; }
.stats-chart { width: 100%; height: auto; margin-top: 10px; display: block; overflow: visible; }
.stats-chart .bar { fill: var(--accent); }
.stats-chart .grid { stroke: var(--line); stroke-width: 1; }
.stats-chart .lbl { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.stats-row { width: 100%; text-align: left; min-width: 0; }
.stats-row .t-text { min-width: 0; }
.list-more { display: flex; justify-content: center; padding: 12px; min-height: 1px; }
details.advanced { margin-top: 6px; }
details.advanced > summary { cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); list-style: none; }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary h2 { font-size: 20px; }
details.advanced > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.advanced[open] > summary::after { transform: rotate(180deg); }
details.advanced[open] > summary { margin-bottom: 14px; }
details.advanced .card { margin-bottom: 14px; }
.alarm-days { display: flex; gap: 6px; flex-wrap: wrap; }
.alarm-days button { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--muted); }
.alarm-days button.on { background: var(--accent); color: var(--accent-ink); }
.car-voice.listening { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) { .stats-page .page-head { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* wave 2 (agent G) */
.setup-restore-link { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted, #888); text-decoration: underline; }
.setup-restore { margin-top: 10px; padding: 12px; border-radius: 10px; background: rgba(127, 127, 127, 0.08); display: flex; flex-direction: column; gap: 8px; }
.export-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(127, 127, 127, 0.2); }
.export-row > div:first-child { flex: 1 1 260px; min-width: 0; }

/* wave 2 (agent F) */
.pl-import-input { height: auto; padding: 10px 14px; resize: vertical; font: inherit; line-height: 1.4; }
.pl-import-list { max-height: min(42vh, 420px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.pl-import-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.pl-import-row:last-child { border-bottom: 0; }
.pl-import-ic { width: 18px; height: 18px; flex: none; }
.pl-import-row.ok .pl-import-ic { color: var(--ok); }
.pl-import-row.missing .pl-import-ic { color: #f2c43d; }
.pl-import-row.missing { background: rgba(242, 196, 61, .05); }
.id-sound .progress-bar { margin-top: 2px; }


/* ===================================================================== */
/* V1 layout: panes, role tag, hero, transitions, settings shell          */
/* ===================================================================== */

/* Role tag: one short line under the logo saying where this copy runs */
.role-tag { font-size: 12px; color: var(--muted); padding: 0 10px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.role-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.role-tag[data-kind="server"]::before { background: var(--accent); }
.role-tag[data-kind="home"]::before { background: var(--ok); }
.role-tag[data-kind="away"]::before { background: #f2c43d; }
.role-tag:empty { display: none; }

/* Phone header (hidden on computers) */
@media (min-width: 761px) { .phone-head { display: none !important; } }
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px; background: var(--bg); }
.phone-head .brand { padding: 0; font-size: 16px; }
.phone-head .brand img { width: 26px; height: 26px; }
.phone-head .role-tag { padding: 0; font-size: 12px; min-width: 0; }

/* Pull down on Home to search */
.pull-hint { position: absolute; left: 0; right: 0; top: 0; z-index: 4; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px; opacity: 0; transform: translateY(-20px); pointer-events: none; }
.pull-hint.on { opacity: calc(var(--pull, 0) * 1); transform: translateY(calc(var(--pull, 0) * 24px - 20px)); }

/* Now playing pane (right column) */
.nowpane { grid-row: 1; grid-column: 3; position: relative; overflow: hidden; border-left: 1px solid #1d1a17; background: var(--bg); display: flex; flex-direction: column; min-width: 0; }
.np-backdrop { position: absolute; inset: -30%; z-index: 0; background: radial-gradient(60% 50% at 30% 20%, color-mix(in srgb, var(--art-1) 55%, transparent), transparent 70%), radial-gradient(50% 60% at 75% 70%, color-mix(in srgb, var(--art-2) 55%, transparent), transparent 70%), var(--bg); filter: blur(40px) saturate(1.1); opacity: .55; transition: background .8s; }
.np-backdrop.drift { animation: np-drift 36s ease-in-out infinite alternate; }
@keyframes np-drift { from { transform: translate(-3%, -2%) scale(1); } to { transform: translate(3%, 3%) scale(1.12); } }
.np-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; padding: 16px 16px 0; gap: 12px; min-height: 0; } /* no bottom padding: the list scrolls right down to the player bar */
.np-head { display: flex; align-items: center; justify-content: space-between; }
.np-kicker { font-size: 13px; font-weight: 700; color: var(--muted); }
.np-art { width: 100%; max-width: 288px; margin: 0 auto; }
.np-art .cover { width: 100%; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.np-info { display: flex; align-items: center; gap: 8px; }
.np-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.np-title { font-size: 17px; font-weight: 700; }
.np-title:hover, .np-artist:hover { text-decoration: underline; }
.np-artist { color: var(--muted); font-size: 14px; }
.np-from { color: var(--faint); font-size: 13px; }
.np-acts { display: flex; align-items: center; gap: 2px; flex: none; }
.np-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.np-tab { padding: 8px 12px 10px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.np-tab:hover { color: var(--text); }
.np-tab.on { color: var(--text); border-bottom-color: var(--art-1); }
.np-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; margin: 0 -8px; padding: 0 8px 10px; }
.np-body.np-lyrics .lyrics { flex: 1; }
.np-body.np-lyrics .lyric-line { font-size: 18px; margin-bottom: 10px; }
.np-list { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.np-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: var(--radius-sm); cursor: pointer; min-height: 48px; }
.np-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.np-row .cover { width: 36px; border-radius: 4px; }
.np-row .t-text { flex: 1; min-width: 0; }
.np-row .icon-btn { opacity: 0; }
.np-row:hover .icon-btn, .np-row:focus-within .icon-btn { opacity: 1; }
.np-grip { color: var(--faint); cursor: grab; display: inline-flex; opacity: 0; }
.np-row:hover .np-grip { opacity: .8; }
.np-grip .icon { width: 16px; height: 16px; }
.np-row.dragging { opacity: .4; }
.np-row.over { box-shadow: inset 0 2px 0 var(--art-1); }
.np-dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.np-sub { color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 6px 4px; }
.np-empty { text-align: center; color: var(--muted); padding: 24px 8px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.np-empty p { margin: 0; }
.np-keep { display: flex; gap: 10px; align-items: center; padding: 14px 6px 6px; cursor: pointer; font-size: 14px; }
.np-keep input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
/* Now-playing / queue button: the album colour, dimmed while the pane is closed, full strength while it's open. */
.pb-right .icon-btn { flex: none; }
.pb-pane.icon-btn.small { width: 30px; height: 30px; border-radius: 50%; }
body.np-visible .pb-pane { color: var(--text); background: color-mix(in srgb, var(--text) 14%, transparent); }
@media (max-width: 1099px) { body:not(.desktop-app) .nowpane { display: none !important; } body:not(.desktop-app) .pb-pane .icon { transform: rotate(180deg); } }
@media (max-width: 1099px) { body:not(.desktop-app).np-visible .app { grid-template-columns: var(--sidebar) minmax(0, 1fr) 0; } }

/* Equaliser on the playing row (CSS only; stands still while paused) */
.eq { display: none; align-items: flex-end; gap: 2px; width: 16px; height: 14px; }
.eq i { display: block; width: 3px; height: 100%; background: var(--art-1); border-radius: 1px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.33s; }
.eq i:nth-child(3) { animation-delay: -.66s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
body.is-paused .eq i { animation-play-state: paused; }
.track.playing .t-num .n, .track.playing .t-num > .icon { display: none; }
.track.playing .t-num .eq { display: inline-flex; margin: 0 auto; }
.track.playing:hover .t-num .eq { display: none; }
.track.playing:hover .t-num > .icon.t-pa { display: inline-flex; }          /* the song that's playing: hover shows pause */
body.is-paused .track.playing:hover .t-num > .icon.t-pa { display: none; }
body.is-paused .track.playing:hover .t-num > .icon.t-pl { display: inline-flex; }
.track:not(.playing):hover .t-num > .icon.t-pa { display: none; }
.t-eq-sm { display: none; }
@media (max-width: 760px) {
  .track.playing .t-main .t-eq-sm { display: inline-flex; }
  .t-eq-sm { flex: none; width: 24px; height: 16px; margin-right: 0; justify-content: center; } /* a small slot so the bars sit centred, not jammed left */
}

/* Page transitions: cross-fade on computers, slide on phones */
.view.enter-forward { animation: view-fade .16s ease-out; }
.view.enter-back { animation: view-fade .16s ease-out; }
@keyframes view-fade { from { opacity: 0; } }
@media (max-width: 760px) {
  .view.enter-forward { animation: view-right .16s ease-out; }
  .view.enter-back { animation: view-left .16s ease-out; }
}
@keyframes view-right { from { transform: translateX(28px); opacity: 0; } }
@keyframes view-left { from { transform: translateX(-28px); opacity: 0; } }

/* Confirmations: a small pop on like / add-to-playlist buttons */
.pop { animation: pop .4s cubic-bezier(.2,.8,.2,1.4); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.t-more.pop { color: var(--ok); opacity: 1; }

/* Home: heading band and the hero card */
.home-band { position: relative; margin: calc(-1 * var(--view-pt, 24px)) calc(-1 * var(--view-px, 32px)) 20px; padding: var(--view-pt, 24px) var(--view-px, 32px) 18px; background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 18%, transparent), color-mix(in srgb, var(--art-2) 10%, transparent) 60%, transparent); transition: background .8s; }
.hero-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px; margin-bottom: 24px; border-radius: var(--radius-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--art-1) 14%, var(--surface)), var(--surface) 70%); border: 1px solid var(--line); }
.hero-card .cover { width: 180px; border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.hero-card-link { display: block; }
.hero-card-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hero-card-reason { font-size: 13px; font-weight: 700; color: var(--art-1); }
.hero-card-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero-card-title a:hover { text-decoration: underline; }
.hero-card-sub { color: var(--muted); font-size: 15px; }
.hero-card-acts { margin-top: 8px; }
.hero-play { height: 44px; padding: 0 22px; }
@media (max-width: 760px) {
  .home-band { margin: -16px -16px 16px; padding: 14px 16px 12px; }
  .page-head.row.between.home-band h1 { font-size: 22px; }
  .page-head.row.between > .row { gap: 0 !important; }
  .home-band .icon-btn { width: 36px; height: 36px; }
  .hero-card { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .hero-card .cover { width: 112px; }
  .hero-card-title { font-size: 20px; }
  .hero-card-sub { font-size: 13px; }
  .hero-play { height: 40px; padding: 0 18px; }
}

/* First-run tour (phones) */
.tour { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 20px; padding: 0 16px 6px; scrollbar-width: none; }
.tour::-webkit-scrollbar { display: none; }
.tour-card { flex: 0 0 calc(100% - 44px); scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px 12px; }
.tour-ic { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); display: grid; place-items: center; }
.tour-text b { font-size: 15px; }
.tour-text p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tour-acts { grid-column: 2; display: flex; gap: 8px; }

/* Settings shell */
.settings-shell { display: flex; flex-direction: column; gap: 12px; max-width: 900px; width: 100%; margin: 0 auto; } /* cards sit centred; the page heading above stays left */
.scard-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scard-tools .search-box { flex: 1 1 240px; margin: 0; max-width: none; }
.scard-tools .search-box .input { height: 42px; font-size: 15px; }
.scard-tools .search-box .icon { top: 11px; }
.scards { display: flex; flex-direction: column; gap: 12px; }
.scard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.scard-head { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; min-height: 56px; cursor: pointer; }
.scard-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.scard-toggle { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; flex: 1; min-width: 0; text-align: left; padding: 8px 12px; border-radius: var(--radius); }
.scard-title { font-size: 17px; font-weight: 700; }
.scard-help { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.scard.collapsed .scard-help { display: block; }
.scard-extra { display: flex; align-items: center; gap: 8px; flex: none; }
.scard-chev { color: var(--muted); transition: transform .16s; flex: none; margin-right: 4px; }
.scard.collapsed .scard-chev { transform: rotate(-90deg); }
.scard-moves { display: none; gap: 2px; }
.settings-shell.customizing .scard-moves { display: inline-flex; }
.settings-shell.customizing .scard-body { display: none; }
.settings-shell.customizing .scard-chev { display: none; }
.scard-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 0; }
.scard-part { display: flex; flex-direction: column; }
.scard-part > * { display: flex; flex-direction: column; gap: 12px; }
.scard-part > *:not(.stack) { display: block; }
.scard-part + .scard-part { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.scard-body h2 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.scard-sub { font-size: 15px !important; font-weight: 700 !important; margin: 0 0 8px !important; }
.scard-sub + p { margin-top: 0; }
.sw-hide { display: none !important; }
.scard.sw-off .scard-body { padding-bottom: 8px; }
.scard.bump { animation: bump .25s ease-out; }
@keyframes bump { 50% { transform: scale(1.01); } }
.scard-nohits { margin: 8px 0; }
.scard .setting-row:first-of-type { border-top: 0; }
.scard .card { background: transparent; border: 0; padding: 0; }
.scard details.advanced > summary { background: transparent; }
@media (max-width: 760px) { .scard-head { min-height: 52px; } .scard-title { font-size: 16px; } .scard-body { padding: 0 12px 12px; } }

/* Keyboard shortcuts sheet */
.keys { display: flex; flex-direction: column; gap: 4px; }
.key-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; padding: 6px 0; font-size: 15px; }
kbd { font-family: var(--font); font-size: 13px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 8px; text-align: center; white-space: nowrap; }

/* Sortable track headers */
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; font-weight: 600; padding: 4px 0; border-radius: 4px; }
.th-sort:hover, .th-sort.on { color: var(--text); }
.th-arrow { font-size: 12px; min-width: 10px; }
.t-dur .th-sort { justify-content: flex-end; width: 100%; }
.t-h-tools { display: flex; justify-content: center; }
.th-menu { opacity: .7; }
.track-head:hover .th-menu { opacity: 1; }
.disc-head { color: var(--muted); font-size: 13px; font-weight: 700; padding: 14px 10px 6px; }
.q-empty { padding: 6px 10px 10px; }

/* No horizontal scroll at phone width; long words wrap */
@media (max-width: 760px) {
  .view, .page-head, .section { max-width: 100%; min-width: 0; }
  .page-head h1 { font-size: 26px; }
  .scard-tools { flex-wrap: nowrap; }
  .scard-tools .search-box { flex: 1 1 auto; min-width: 0; }
}

/* Motion only answers actions; reduced motion turns the rest off */
@media (prefers-reduced-motion: reduce) {
  .np-backdrop.drift, .eq i, .view.enter-forward, .view.enter-back, .fullplayer.grow, .fullplayer.fp-in-up, .fullplayer.fp-in-right, .fullplayer.fp-out-up, .fullplayer.fp-out-right, .pop, .scard.bump, .menu, .tile .tile-play, .bg-art-img { animation: none !important; }
  .playerbar, .home-band, .np-backdrop, .scard-chev, .btn, .icon-btn, .tile, .menu-backdrop { transition: none !important; }
}

/* === theme & rows (agent V2) === */

/* Art colours animate between records; the accent follows when "From the album art" is on. */
@property --art-1 { syntax: '<color>'; inherits: true; initial-value: #ff9d3d; }
@property --art-2 { syntax: '<color>'; inherits: true; initial-value: #8a4a12; }
@property --art-ink { syntax: '<color>'; inherits: true; initial-value: #1d1206; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #ff9d3d; }
@property --accent-2 { syntax: '<color>'; inherits: true; initial-value: #ffb766; }
:root { --art-1: #ff9d3d; --art-2: #8a4a12; --art-ink: #1d1206; }
:root.art-animated { transition: --art-1 .6s ease, --art-2 .6s ease, --accent .6s ease, --accent-2 .6s ease; }
@media (prefers-reduced-motion: reduce) { :root.art-animated { transition: none; } }

/* ---------- Light: a cool neutral room, art colours used thinly ---------- */
[data-theme="light"] {
  --bg: #f3f3f1; --bg-2: #ebebe8; --surface: #ffffff; --surface-2: #ececea; --surface-3: #e0e0dd; --line: #d6d5d0;
  --text: #1b1a18; --muted: #5f5a53; --faint: #726a60;
  --accent: #a85508; --accent-2: #9a4c06; --accent-ink: #ffffff;
  --danger: #c0341d; --ok: #1f7a3a;
  color-scheme: light;
}
[data-theme="light"] .sidebar { background: #e9e9e6; border-right-color: #d6d5d0; }
[data-theme="light"] .side-section { border-top-color: #d6d5d0; }
[data-theme="light"] .main { background: linear-gradient(180deg, var(--bg-2) 0, var(--bg) 340px); }
[data-theme="light"] .tile .cover, [data-theme="light"] .hero .cover { box-shadow: 0 6px 18px rgba(20, 16, 10, .16); }
[data-theme="light"] .cover { background: linear-gradient(135deg, #e4e3df, #f1f0ed); }
[data-theme="light"] .play-fab { box-shadow: 0 8px 22px rgba(168, 85, 8, .22); }
[data-theme="light"] .notice { background: linear-gradient(90deg, rgba(168, 85, 8, .10), rgba(168, 85, 8, .03)); border-color: rgba(168, 85, 8, .28); }
[data-theme="light"] .tag-needs { color: #ffb766; }
[data-theme="light"] .tag-needs.ok { color: #8fe39b; }
[data-theme="light"] .gm-pill.warn { background: rgba(192, 52, 29, .10); color: #a52a16; }
[data-theme="light"] .gm-pill.amber { background: rgba(176, 120, 0, .14); color: #7a5200; }
[data-theme="light"] .gm-pill.accent { background: rgba(168, 85, 8, .12); color: var(--accent); }
[data-theme="light"] .gm-owned.low, [data-theme="light"] .gm-owned.warn { color: #a3400f; }
[data-theme="light"] .gm-owned.other, [data-theme="light"] .gm-owned.other.prefer { color: #7a5200; }
[data-theme="light"] .pl-import-row.missing .pl-import-ic { color: #7a5200; }
[data-theme="light"] .slsk-note.warn { background: rgba(192, 52, 29, .08); color: #8c2412; }
[data-theme="light"] .slsk-note.warn .icon { color: #c0341d; }
[data-theme="light"] .gm-initials { background: linear-gradient(135deg, #f0dcc3, #d9a46e); color: #5a2e05; }
[data-theme="light"] .mix-cover::after { background: linear-gradient(160deg, rgba(0,0,0,0) 30%, rgba(20, 16, 10, .72)); }
[data-theme="light"] .mix-label { color: #fff; }
[data-theme="light"] .recap-hero { color: #fff; }
[data-theme="light"] .car-top-btn, [data-theme="light"] .car-btn, [data-theme="light"] .car-tile { color: #fff; }

/* ---------- Black (OLED): true black, the art does the lighting ---------- */
[data-theme="oled"] {
  --bg: #000000; --bg-2: #000000; --surface: #0d0d0d; --surface-2: #161616; --surface-3: #202020; --line: #242424;
  color-scheme: dark;
}
[data-theme="oled"] .sidebar { background: #000; border-right-color: #1a1a1a; }
[data-theme="oled"] .side-section { border-top-color: #1a1a1a; }
[data-theme="oled"] .main { background: #000; }

/* ---------- Appearance card ---------- */
.theme-seg { flex-wrap: wrap; }
.appearance-card .setting-row { grid-template-columns: 1fr; gap: 8px; }
.appearance-card .setting-row .seg { justify-self: start; }
.theme-seg .seg-btn { min-height: 34px; justify-content: center; }
@media (max-width: 480px) { .theme-seg.theme-seg-4 { display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; } .theme-seg.theme-seg-4 .seg-btn { border-radius: 10px; } }
.theme-preview { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.tp-art { width: 64px; height: 64px; flex: none; border-radius: 10px; background: linear-gradient(135deg, var(--art-1), var(--art-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--art-1) 35%, transparent); }
.tp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-line { height: 10px; border-radius: 5px; background: var(--surface-3); width: 70%; }
.tp-line.short { width: 42%; }
.tp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.tp-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 700; font-size: 12px; }
.tp-text { color: var(--accent); font-weight: 800; font-size: 15px; }

/* ---------- Genre tiles: gradients by family, grain, name bottom-left ---------- */
.genre-tile, .genre-hero {
  --g1: #b3261e; --g2: #f08a24;
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 62%),
    linear-gradient(135deg, var(--g1), var(--g2));
}
.genre-tile { align-items: flex-end; justify-content: flex-start; padding: 12px 14px; text-shadow: 0 1px 10px rgba(0,0,0,.45); }
.genre-tile > span { font-size: 19px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.genre-tile::after { content: ""; position: absolute; right: -18%; top: -40%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), rgba(255,255,255,0) 70%); pointer-events: none; }
.genre-tile:hover { transform: none; filter: brightness(1.06); }
@media (prefers-reduced-motion: no-preference) { .genre-tile { transition: filter .15s, transform .12s; } .genre-tile:hover { transform: scale(1.015); } }
.genre-hero { padding: 64px 28px 26px; }
.genre-hero .hero-kind { color: rgba(255,255,255,.78); }
.genre-hero h1 { text-shadow: 0 2px 14px rgba(0,0,0,.4); }

/* ---------- Home rows ---------- */
.artist-row .artist-tile .cover.round { box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.artist-tile .tile-title { font-size: 14px; }
.gm-initials.art-grad { background: linear-gradient(135deg, var(--g1, #3a2a18), var(--g2, #6b3f17)); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.artist-tile .cover.round.has-img { color: transparent; }

/* The Top songs chart: numbered rows in columns of five that scroll sideways. */
.chart-row { display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, auto); grid-auto-columns: minmax(300px, 360px); gap: 2px 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 6px; }
.chart-row::-webkit-scrollbar { display: none; }
.chart-cell { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; text-align: left; min-width: 0; color: inherit; }
.chart-cell:hover { background: var(--surface-2); }
.chart-cell .cover { width: 44px; height: 44px; flex: none; border-radius: 6px; }
.chart-cell .song-text { flex: 1; min-width: 0; }
.chart-cell .song-title { font-weight: 600; font-size: 14px; }
.chart-rank { width: 26px; flex: none; text-align: right; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--muted); }
.chart-cell:nth-child(-n+3) .chart-rank { color: var(--accent); }
.chart-move { flex: none; width: 46px; text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--faint); white-space: nowrap; }
.chart-move.up { color: var(--ok); }
.chart-move.down { color: var(--danger); }
.chart-move.new { color: var(--accent); }
.chart-cell .song-owned { width: 18px; height: 18px; color: var(--accent); flex: none; }
.chart-more { display: flex; justify-content: center; margin-top: 8px; }
@media (max-width: 640px) { .chart-row { grid-auto-columns: 86%; } }
@media (hover: hover) and (pointer: fine) { .chart-row { grid-auto-columns: calc((100% - 2 * 18px) / 3); cursor: grab; } }
@media (hover: hover) and (pointer: fine) and (min-width: 1500px) { .chart-row { grid-auto-columns: calc((100% - 3 * 18px) / 4); } }
@media (hover: hover) and (pointer: fine) and (max-width: 900px) { .chart-row { grid-auto-columns: calc((100% - 18px) / 2); } }

/* New releases: a small date ribbon on the cover. */
.tile .date-ribbon { position: absolute; right: 20px; top: 20px; z-index: 1; display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 4px 7px 5px; border-radius: 8px; background: rgba(12, 11, 10, .78); color: #fff; backdrop-filter: blur(6px); line-height: 1; pointer-events: none; }
.tile .date-ribbon b { font-size: 15px; font-weight: 800; }
.tile .date-ribbon span { font-size: 10px; font-weight: 700; letter-spacing: .02em; color: rgba(255,255,255,.8); margin-top: 2px; }
.tile .date-ribbon.soon { background: var(--accent); color: var(--accent-ink); }
.tile .date-ribbon.soon span { color: inherit; opacity: .8; }

/* Your week: seven bars, the numbers beside them. */
.week-card { gap: 18px 28px; align-items: stretch; }
.week-chart { flex: 1 1 260px; min-width: 0; max-width: 460px; display: flex; flex-direction: column; gap: 8px; }
.week-chart svg { width: 100%; height: auto; aspect-ratio: 320 / 96; display: block; overflow: visible; }
.week-chart .wk-bar { fill: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); }
.week-chart .wk-bar.today { fill: var(--accent); }
.week-chart .wk-lbl { fill: var(--muted); font-size: 11px; font-family: var(--font); font-weight: 600; }
.week-chart .wk-val { fill: var(--text); font-size: 11px; font-family: var(--font); font-weight: 700; }
.week-chart .wk-base { stroke: var(--line); stroke-width: 1; }
.week-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.week-head b { font-size: 26px; line-height: 1.1; }
.week-head span { font-size: 13px; color: var(--muted); }
.week-side { display: flex; flex-direction: column; gap: 12px; justify-content: center; flex: 0 1 260px; min-width: 0; }
.week-mini { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.week-mini .week-stat b { font-size: 17px; }
.week-mini .week-stat span { font-size: 12px; }
@media (max-width: 640px) { .week-card { flex-direction: column; } .week-chart { flex: none; max-width: none; } .week-side { flex: none; } }

/* ---------- Stats page ---------- */
.stats-chart .bar { fill: var(--accent); transition: opacity .15s; }
.stats-chart .bar:hover { opacity: .78; }
.stats-chart .bar.today { fill: var(--art-1); }
.stats-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface-3); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.25); transform: translate(-50%, calc(-100% - 10px)); }
.stats-list ol { list-style: none; counter-reset: rank; margin: 0; padding: 0; }
.stats-list li { counter-increment: rank; }
.stats-row { display: flex; align-items: center; gap: 10px; }
.stats-row::before { content: counter(rank); width: 22px; flex: none; text-align: right; font-weight: 800; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats-list li:nth-child(-n+3) .stats-row::before { color: var(--accent); }
.stats-row .cover { width: 44px; flex: none; }
.stats-row .stats-bar { height: 3px; border-radius: 2px; background: var(--accent); opacity: .7; margin-top: 5px; max-width: 100%; }
.stat-value { color: var(--text); }
.stat.accent .stat-value { color: var(--accent); }

/* ---------- Pickers & pills shared by Get music and the tools ---------- */
.format-wrap { display: inline-flex; align-items: center; gap: 6px; }
.format-wrap .seg { flex-wrap: nowrap; }
.format-wrap .seg-btn { height: 32px; padding: 0 12px; }
.format-wrap .format-pick { height: 36px; font-size: 13px; }
.format-wrap[aria-busy="true"] { opacity: .5; pointer-events: none; }
.quality-note { color: var(--faint); font-size: 12px; }
@media (max-width: 640px) { .format-wrap .seg { display: none; } }
@media (min-width: 641px) { .format-wrap select.format-pick { display: none; } }
.gm-pill .icon { width: 14px; height: 14px; margin-right: 4px; }
.health-card.ok .icon { color: var(--ok); }
.health-card .row > .icon { color: var(--accent); }
.health-card.ok h2 { color: var(--muted); }

/* ---------- Extras: car mode, Soulseek health, alarm ---------- */
.car-bg { background: radial-gradient(120% 90% at 20% 10%, var(--art-1), transparent 60%), radial-gradient(100% 90% at 85% 90%, var(--art-2), transparent 60%), #000; }
.car-bg .bg-art-img { position: absolute; inset: -10%; background-color: transparent; background-size: cover; background-position: center; filter: blur(60px) brightness(.45) saturate(1.25); opacity: .85; mix-blend-mode: luminosity; }
.car-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); }
.car { color: #fff; }
.car .car-artist, .car .car-album { color: rgba(255,255,255,.9); }
.car .car-source { color: #fff; }
.car-btn { width: 96px; height: 96px; background: rgba(255,255,255,.14); color: #fff; }
.car-btn .icon { width: 44px; height: 44px; }
.car-btn.main { width: 124px; height: 124px; background: var(--art-1); color: var(--art-ink); box-shadow: 0 12px 40px color-mix(in srgb, var(--art-1) 45%, transparent); }
.car-btn.main .icon { width: 58px; height: 58px; }
.car-btn.on { color: var(--art-1); }
.car-progress { background: rgba(255,255,255,.18); height: 8px; }
.car-progress > div { background: var(--art-1); }
.car-tile { height: 96px; font-size: 16px; color: #fff; background: rgba(255,255,255,.12); }
.car-tile .icon { width: 28px; height: 28px; }
.car-tile.on { color: var(--art-1); }
.car-top-btn { color: #fff; }
.car-top-btn.on { background: var(--art-1); color: var(--art-ink); }
.car-voice.listening { background: var(--art-1); color: var(--art-ink); }
.car-exit { color: rgba(255,255,255,.85); }
.car-clock { color: #fff; }
@media (max-width: 600px) and (orientation: portrait) { .car-btn { width: 80px; height: 80px; } .car-btn.main { width: 104px; height: 104px; } .car-tile { height: 80px; font-size: 14px; } }

.slsk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.slsk-tile { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slsk-tile .v { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slsk-tile .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.slsk-tile .s { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slsk-tile.good .v { color: var(--ok); }
.slsk-tile.bad .v { color: var(--danger); }
.slsk-tile.accent .v { color: var(--accent); }

.alarm-card .alarm-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alarm-card .alarm-time { width: 150px; height: 38px; padding: 0 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alarm-card .alarm-days { gap: 4px; }
.alarm-card .alarm-days button { width: 32px; height: 32px; font-size: 12px; }
.alarm-card .alarm-what { height: 38px; flex: 1 1 160px; min-width: 150px; }
.alarm-card .alarm-summary { color: var(--muted); font-size: 13px; }
.alarm-card .alarm-summary b { color: var(--text); }
@media (max-width: 640px) { .stats-chart .lbl { font-size: 17px; } }
/* Light theme: the player bar is a light surface too (the art colour as a light wash, text in ink). */
[data-theme="light"] .playerbar { background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 16%, var(--surface)), var(--surface) 55%, color-mix(in srgb, var(--art-2) 10%, var(--surface))); border-top: 1px solid var(--line); color: var(--text); }
[data-theme="light"] .playerbar .pb-title, [data-theme="light"] .playerbar .icon-btn { color: var(--text); }
[data-theme="light"] .playerbar .pb-artist, [data-theme="light"] .playerbar .faint, [data-theme="light"] .playerbar .muted { color: var(--muted); }

/* Your week: short and wide (one band, not a tall card) */
.week-card.compact { padding: 12px 18px; gap: 10px 28px; align-items: center; flex-wrap: nowrap; }
@container view (max-width: 924px) { .week-card.compact { flex-wrap: wrap; } .week-card.compact .week-chart { flex: 1 1 100%; max-width: none; min-width: 0; } .week-card.compact .week-chart svg { flex: 1 1 0; min-width: 0; width: auto; height: auto; max-height: 64px; } .week-card.compact .week-side { flex: 1 1 100%; } }
.week-card.compact .week-chart { flex: 1 1 300px; max-width: 420px; flex-direction: row; align-items: flex-end; gap: 16px; }
.week-card.compact .week-head { flex: none; flex-direction: column; align-items: flex-start; gap: 0; }
.week-card.compact .week-head b { font-size: 24px; }
.week-card.compact .week-head span { font-size: 12px; max-width: 110px; line-height: 1.2; }
.week-card.compact .week-chart { min-width: 0; }
.week-card.compact .week-chart svg { aspect-ratio: 320 / 96; height: 60px; width: auto; max-width: 100%; flex: 1 1 160px; min-width: 120px; }
.week-card.compact .week-side { flex: 1 1 auto; flex-direction: row; align-items: center; gap: 24px; flex-wrap: wrap; }
.week-card.compact .week-tops { gap: 10px 24px; }
.week-card.compact .week-song .cover { width: 40px; }
@media (max-width: 760px) { .week-card.compact { flex-wrap: wrap; } .week-card.compact .week-side { flex-direction: column; align-items: flex-start; gap: 8px; } }
/* A narrow main pane (sidebar + Now playing open on a small window): stats in two columns, tops stacked under them. */
@container view (max-width: 600px) {
  .week-card.compact { padding: 14px 16px; gap: 12px; }
  .week-card.compact .week-chart { gap: 12px; }
  .week-card.compact .week-side { flex-direction: column; align-items: stretch; gap: 10px; }
  .week-card.compact .week-mini { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 12px; }
  .week-card.compact .week-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
}
@container view (max-width: 440px) { .week-card.compact .week-mini { grid-template-columns: 1fr 1fr; } .week-card.compact .week-tops { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .week-card.compact { flex-direction: row; flex-wrap: wrap; align-items: flex-end; } .week-card.compact .week-chart { flex: 1 1 200px; max-width: none; } .week-card.compact .week-chart { min-width: 0; } .week-card.compact .week-chart svg { flex: 1 1 0; min-width: 0; width: auto; height: auto; max-height: 72px; } }

/* Accent from the album art: the colour reaches the backgrounds, not only the player bar.
   Mixed with the theme's own surfaces so text contrast holds; transitions with the art variables. */
.art-mode .main { background: linear-gradient(180deg, color-mix(in srgb, var(--art-1) 26%, var(--bg)) 0, color-mix(in srgb, var(--art-2) 12%, var(--bg)) 360px, color-mix(in srgb, var(--art-1) 7%, var(--bg)) 100%); transition: background .8s; }
.art-mode .sidebar { background: color-mix(in srgb, var(--art-2) 14%, #0c0b0a); transition: background .8s; }
.art-mode .card, .art-mode .week-card, .art-mode .quick a, .art-mode .quick button { background: color-mix(in srgb, var(--art-1) 9%, var(--surface)); }
.art-mode .nowpane { background: color-mix(in srgb, var(--art-2) 12%, var(--bg)); }
.art-mode .playerbar { background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 32%, #0c0b0a), color-mix(in srgb, var(--art-2) 18%, #0c0b0a) 55%, color-mix(in srgb, var(--art-2) 26%, #0c0b0a)); }
.art-mode .tabbar { background: color-mix(in srgb, var(--art-2) 14%, var(--bg)); }
.art-mode[data-theme="light"] .main { background: linear-gradient(180deg, color-mix(in srgb, var(--art-1) 16%, var(--bg)) 0, color-mix(in srgb, var(--art-2) 7%, var(--bg)) 360px, var(--bg) 100%); }
.art-mode[data-theme="light"] .sidebar { background: color-mix(in srgb, var(--art-2) 8%, var(--surface)); }
.art-mode[data-theme="light"] .playerbar { background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 22%, var(--surface)), color-mix(in srgb, var(--art-2) 14%, var(--surface))); }
.art-mode[data-theme="light"] .card, .art-mode[data-theme="light"] .week-card { background: color-mix(in srgb, var(--art-1) 5%, var(--surface)); }
.art-mode[data-theme="oled"] .main { background: linear-gradient(180deg, color-mix(in srgb, var(--art-1) 18%, #000) 0, #000 420px); }
.art-mode[data-theme="oled"] .sidebar, .art-mode[data-theme="oled"] .tabbar { background: #000; }
@media (max-width: 760px) { .art-mode .main { background: linear-gradient(180deg, color-mix(in srgb, var(--art-1) 28%, var(--bg)) 0, color-mix(in srgb, var(--art-2) 10%, var(--bg)) 320px, var(--bg) 100%); } }

/* Full-screen player on a wide screen: the cover fills the backdrop like it does on a phone, content centred */
@media (min-width: 761px) {
  .fullplayer .fp-inner { max-width: 560px; margin: 0 auto; width: 100%; }
  .fullplayer .fp-bg { filter: blur(70px) saturate(1.4) brightness(.5); }
}

/* High: the cover, blurred and zoomed, behind everything; panels go translucent so it shows through */
.art-high body::before, .art-high body::after { content: ''; position: fixed; inset: -8%; z-index: 0; pointer-events: none; background: center / cover no-repeat; filter: blur(56px) saturate(1.4) brightness(.55); transform: scale(1.12); transition: opacity .8s ease; }
.art-zoom body::before, .art-zoom body::after { transform: scale(1.9); filter: blur(44px) saturate(1.5) brightness(.55); }
.art-crisp body::before, .art-crisp body::after { transform: scale(1.35); filter: blur(16px) saturate(1.2) brightness(.42); }
.art-high body::before { background-image: var(--art-url-a); opacity: 1; }
.art-high body::after { background-image: var(--art-url-b); opacity: 0; }
.art-high.art-b body::before { opacity: 0; }
.art-high.art-b body::after { opacity: 1; }
.art-high .app { position: relative; z-index: 1; }
.art-high .main { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 28%, transparent) 420px, color-mix(in srgb, var(--bg) 45%, transparent)); }
.art-high .sidebar { background: color-mix(in srgb, #0c0b0a 30%, transparent); backdrop-filter: blur(10px); }
.art-crisp .main { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 40%, transparent) 300px, color-mix(in srgb, var(--bg) 60%, transparent)); }
.art-high .nowpane { background: color-mix(in srgb, var(--bg) 25%, transparent); }
.art-high .np-backdrop { opacity: .5; }
.art-high .card, .art-high .week-card, .art-high .quick a, .art-high .quick button, .art-high .notice { background: color-mix(in srgb, var(--surface) 58%, transparent); backdrop-filter: blur(8px); }
.art-high .playerbar { background: rgba(12,11,10,.35); backdrop-filter: blur(10px); border-top-color: rgba(255,255,255,.08); }
.art-high body.desktop-frame .titlebar { background: transparent; backdrop-filter: blur(6px); border-bottom-color: rgba(255,255,255,.08); }
[data-theme="light"] body.desktop-frame .titlebar { border-bottom-color: var(--line); }
.art-high.art-zoom[data-theme="light"] body::before, .art-high.art-zoom[data-theme="light"] body::after { filter: blur(44px) saturate(1.3) brightness(1.2); }
.art-high.art-crisp[data-theme="light"] body::before, .art-high.art-crisp[data-theme="light"] body::after { filter: blur(16px) saturate(1.1) brightness(1.05); }
.art-high.art-crisp[data-theme="light"] .main { background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(243,243,241,.55) 300px, rgba(243,243,241,.68)); }
/* Phones: a square cover on a tall screen would show only its middle, so draw it to fit the screen's height after the
   zoom (no top or bottom cut off); the sides spill past the edges. Blur zoom keeps the zoomed-in look. */
@media (max-width: 760px) {
  .art-high body:not(.desktop-app)::before, .art-high body:not(.desktop-app)::after { background-size: auto calc(100dvh / 1.12); background-color: var(--art-1); }
  .art-high.art-crisp body:not(.desktop-app)::before, .art-high.art-crisp body:not(.desktop-app)::after { background-size: auto calc(100dvh / 1.35); }
  .art-high.art-zoom body:not(.desktop-app)::before, .art-high.art-zoom body:not(.desktop-app)::after { background-size: cover; transform: scale(1.35); }
}
.art-high[data-theme="light"] body.desktop-frame .titlebar { background: rgba(255,255,255,.35); }
.art-high .tabbar, .art-high .phone-head { background: color-mix(in srgb, var(--bg) 40%, transparent); backdrop-filter: blur(12px); }
.art-high[data-theme="light"] .tabbar, .art-high[data-theme="light"] .phone-head { background: rgba(255,255,255,.45); }
.art-high .home-band { background: linear-gradient(90deg, color-mix(in srgb, var(--art-1) 22%, transparent), transparent); }
.art-high[data-theme="light"] body::before, .art-high[data-theme="light"] body::after { filter: blur(64px) saturate(1.2) brightness(1.25); }
.art-high[data-theme="light"] .main { background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(243,243,241,.78) 420px, rgba(243,243,241,.9)); }
.art-high[data-theme="light"] .sidebar { background: rgba(255,255,255,.62); }
.art-high[data-theme="light"] .card, .art-high[data-theme="light"] .week-card { background: rgba(255,255,255,.72); }
.art-high[data-theme="light"] .playerbar { background: rgba(255,255,255,.45); }
@media (prefers-reduced-motion: reduce) { .art-high body::before, .art-high body::after { transition: none; } }

/* Full-screen player on a wide screen: art in the middle, controls low and wide like the player bar */
.fp-bar { display: contents; }
.pb-art-wrap { position: relative; flex: none; }
.playerbar .pb-expand.icon-btn.small { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 30px; height: 18px; z-index: 3; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--surface-3) 92%, transparent); opacity: .6; transition: opacity .15s; }
.pb-expand .icon { width: 16px; height: 16px; }
.playerbar:hover .pb-expand.icon-btn.small, .pb-expand.icon-btn.small:focus-visible { opacity: 1; }
@media (min-width: 761px) {
  .fullplayer .fp-inner { max-width: none; padding: 16px 24px 0; }
  .fullplayer .fp-art .cover { width: min(100%, 56vh); }
  .fp-bar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(220px, 1fr); grid-template-areas: "info controls bottom" "info progress bottom"; align-items: center; column-gap: 24px; row-gap: 2px; margin: 0 -24px; padding: 10px 24px 14px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.28)); }
  .fp-bar .fp-info { grid-area: info; margin: 0; }
  .fp-bar .fp-title { font-size: 16px; }
  .fp-bar .fp-artist { font-size: 13px; margin-top: 1px; }
  .fp-bar .fp-progress { grid-area: progress; }
  .fp-bar .fp-controls { grid-area: controls; justify-content: center; gap: 10px; margin: 0; }
  .fp-bar .fp-controls .icon-btn { width: 44px; height: 44px; }
  .fp-bar .fp-controls .icon-btn .icon { width: 24px; height: 24px; }
  .fp-bar .fp-play { width: 52px; height: 52px; }
  .fp-bar .fp-bottom { grid-area: bottom; justify-content: flex-end; gap: 14px; }
  .fp-bar .fp-q { white-space: nowrap; }
}

/* Scrollbars: a thin translucent thumb on a transparent track, so the background shows through.
   Chrome, Edge and the desktop app use the -webkit rules; Firefox uses scrollbar-color. */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 40%, transparent); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.main::-webkit-scrollbar-thumb, .nowpane::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--art-1) 45%, color-mix(in srgb, var(--text) 25%, transparent)); background-clip: padding-box; border: 3px solid transparent; }

/* Desktop app on Windows: our own title bar (the OS draws only its three caption buttons on the right) */
:root { --tb: 34px; }
.titlebar { display: none; }
body.desktop-frame .titlebar { position: fixed; top: 0; left: 0; right: 0; height: env(titlebar-area-height, var(--tb)); z-index: 60; display: flex; align-items: center; gap: 8px; padding-left: 10px; padding-right: 0; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--titlebar-bg, var(--bg)); border-bottom: 1px solid #1d1a17; box-sizing: border-box; -webkit-app-region: drag; user-select: none; transition: background .8s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.desktop-frame .titlebar img { width: 16px; height: 16px; border-radius: 4px; }
body.desktop-frame .app { height: calc(100dvh - env(titlebar-area-height, var(--tb))); margin-top: env(titlebar-area-height, var(--tb)); }
body.desktop-frame .auth { top: env(titlebar-area-height, var(--tb)); }
body.desktop-frame .fullplayer { top: env(titlebar-area-height, var(--tb)); }
body.desktop-frame .toast { bottom: calc(var(--player-h, 72px) + 16px); }
body.desktop-frame.mini-on .titlebar { display: none; }
body.desktop-frame.mini-on .mini-restore { right: auto; left: 4px; }

/* === libraries (agent M) === */
/* Per-person libraries: scope control, "not yours yet" badges, add buttons, family (blue) state in Get music. */
:root { --fam: #6db3f2; --fam-bg: rgba(109, 179, 242, .16); --fam-line: rgba(109, 179, 242, .35); }
[data-theme="light"] { --fam: #1f6fb2; --fam-bg: rgba(31, 111, 178, .12); --fam-line: rgba(31, 111, 178, .3); }
.lib-scope-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-scope-wrap .seg { padding: 2px; }
.lib-scope-wrap .seg-btn { height: 30px; padding: 0 12px; }
.lib-viewas { width: auto; height: 34px; padding: 0 30px 0 12px; border-radius: 999px; background: var(--surface-2); border: 0; font-weight: 600; font-size: 14px; max-width: 200px; }
.tag-needs.fam { color: var(--fam); }
.tile-add-wrap { position: absolute; right: 8px; top: 8px; z-index: 2; }
.tile-act.tile-add, .tile-act.tile-add:first-child { background: var(--fam); color: #0d1a26; border: 0; width: 34px; height: 34px; }
.tile-act.tile-add .icon { width: 18px; height: 18px; }
.fam-bar { background: var(--fam-bg); border-color: var(--fam-line); }
.fam-bar > .icon { color: var(--fam); }
.fam-bar .btn.primary { background: var(--fam); color: #0d1a26; }
.fam-bar .btn.primary:hover { filter: brightness(1.08); }
/* Track rows in a family view: the heart column widens so "+ Add" fits and durations still line up. */
.tracks.fam .track { grid-template-columns: 34px minmax(0, 1fr) minmax(0, .7fr) 78px 52px 36px; }
.tracks.fam.no-album .track { grid-template-columns: 34px minmax(0, 1fr) 78px 52px 36px; }
.tracks.fam .t-like { justify-self: center; }
.t-add { height: 28px; padding: 0 10px 0 7px; font-size: 12px; gap: 3px; border-radius: 999px; background: var(--fam-bg); color: var(--fam); border: 1px solid var(--fam-line); white-space: nowrap; justify-self: center; }
.t-add .icon { width: 14px; height: 14px; }
.t-add:hover { background: var(--fam); color: #0d1a26; }
.t-owners { color: var(--faint); }
@media (max-width: 760px) {
  .tracks.fam .track, .tracks.fam.no-album .track { grid-template-columns: minmax(0, 1fr) 78px 40px; }
  .lib-scope-wrap { width: 100%; }
  .lib-viewas { max-width: 160px; }
  .fam-bar > span { flex: 1 1 200px; }
  .fam-bar > .btn { margin-left: 28px; }
}
/* Get music: blue "someone else has it" state */
.gm-pill.fam { background: var(--fam-bg); color: var(--fam); }
.gm-owned.fam { color: var(--fam); }
.gm-owned.fam.prefer { color: var(--fam); }
.fam-add { background: var(--fam-bg); color: var(--fam); border-color: var(--fam-line); white-space: nowrap; }
.fam-add:hover { background: var(--fam); color: #0d1a26; }
.fam-add .icon { width: 16px; height: 16px; }
.fam-state { flex: none; flex-wrap: wrap; justify-content: flex-end; }
.gm-track-end { display: flex; justify-content: flex-end; min-width: 0; }
.fam-note { display: flex; align-items: center; gap: 6px; color: var(--fam); margin-top: 4px; }
.fam-note .icon { width: 14px; height: 14px; flex: none; }
@media (max-width: 760px) {
  .fam-state { flex: 1 1 100%; justify-content: flex-start; }
  .list-row:has(.fam-state) { flex-wrap: wrap; }
  .gm-track-end .fam-add { height: 30px; padding: 0 10px; font-size: 12px; }
}

/* Desktop title bar: our own caption buttons. Whole bar is one colour; buttons go light brown on hover, dark when pressed. */
body.desktop-frame .titlebar #titlebar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tb-controls { display: flex; align-self: stretch; margin-left: auto; -webkit-app-region: no-drag; }
.tb-btn { width: 46px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: default; transition: background .12s, color .12s; border-radius: 0; padding: 0; }
.tb-btn:hover { background: color-mix(in srgb, var(--accent) 38%, var(--titlebar-bg, var(--bg))); color: var(--text); }
.tb-btn:active { background: color-mix(in srgb, black 45%, var(--titlebar-bg, var(--bg))); color: var(--text); }
.tb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tb-btn[data-win="close"]:hover { background: #c42b1c; color: #fff; }
.tb-btn[data-win="close"]:active { background: #8f1d12; color: #fff; }
.tb-btn .tb-restore { display: none; }
body.win-max .tb-btn .tb-max { display: none; }
body.win-max .tb-btn .tb-restore { display: block; }

/* A sub-setting shown under the one it belongs to */
.setting-row.setting-sub { margin-left: 18px; padding-left: 14px; border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }

/* Get music, before the first search */
.gm-intro { display: flex; gap: 16px; align-items: flex-start; padding: 22px 20px; border-radius: 16px; background: var(--surface); margin-top: 8px; }
.gm-intro-icon { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); display: grid; place-items: center; flex: none; }
.gm-intro-icon .icon { width: 24px; height: 24px; }
.gm-intro b { display: block; font-size: 16px; margin-bottom: 4px; }
.gm-intro p { margin: 0 0 6px; }
.gm-intro a { color: var(--accent); font-weight: 600; }

/* ===================================================================== */
/* Layout review: pages use the width they have (narrow main pane, wide   */
/* windows, the desktop app squeezed with the Now playing pane open).     */
/* Page content keys off the .view container; app chrome off the window.  */
/* ===================================================================== */
.seg-btn { white-space: nowrap; }

/* Only on the three-pane layout (the phone layout at 760px and under has its own rules and keeps them). */
@media (min-width: 761px) {
  /* Narrow main pane (sidebar + Now playing on a small window, or a window around 800px wide):
     smaller tiles so three fit a row, quick links in two columns, the track list drops its Album column
     (the album name sits after the artist instead). */
  @container view (max-width: 560px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .grid.scroll { grid-auto-columns: 140px; }
    .track, .tracks.no-album .track { grid-template-columns: 34px minmax(0, 1fr) 36px 52px 36px; }
    .tracks.fam .track, .tracks.fam.no-album .track { grid-template-columns: 34px minmax(0, 1fr) 78px 52px 36px; }
    .t-album { display: none !important; }
    .t-album-inline { display: inline; }
  }
  @container view (min-width: 400px) and (max-width: 640px) {
    .quick { grid-template-columns: 1fr 1fr; }
  }
  /* Album / artist / playlist header: side by side with a smaller cover from about 420px of content,
     stacked and centred below that (the same shape as on a phone). */
  @container view (min-width: 420px) and (max-width: 640px) {
    .hero { flex-direction: row; align-items: flex-end; text-align: left; gap: 20px; }
    .hero .cover { width: 160px; }
    .hero h1 { font-size: clamp(26px, 6.5cqi, 56px); margin: 6px 0 10px; }
    .hero-meta, .actions { justify-content: flex-start; }
  }
  @container view (max-width: 419px) {
    .hero { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
    .hero .cover { width: min(60cqi, 220px); }
    .hero-meta, .actions { justify-content: center; }
  }
  /* Get music header: title and inbox button on the first line, the format picker on its own line below. */
  @container view (max-width: 640px) {
    .gm-head { flex-wrap: wrap; row-gap: 10px; }
    .gm-head h1 { white-space: nowrap; }
    .gm-head .format-wrap { order: 3; flex: 1 1 100%; }
  }
  /* Sideways song charts: how many columns fit depends on the main pane, not the window. */
  @container view (max-width: 700px) {
    .song-grid, .chart-row { grid-auto-columns: calc((100% - 18px) / 2); }
  }
  @container view (max-width: 440px) {
    .song-grid, .chart-row { grid-auto-columns: 100%; }
  }
}

/* The phone layout on a wider window (a tablet, or the desktop app between about 560 and 760px): the album
   header sits beside a smaller cover instead of a tall centred stack, so the songs start higher. Phones (430px
   and under) are too narrow for this and keep the stacked header. */
@media (max-width: 760px) {
  @container view (min-width: 500px) {
    .hero { flex-direction: row; align-items: flex-end; text-align: left; gap: 20px; }
    .hero .cover { width: 168px; }
    .hero h1 { font-size: clamp(26px, 6cqi, 44px); margin: 6px 0 10px; }
    .hero-meta, .actions { justify-content: flex-start; }
  }
}

/* Desktop app between 761 and 1099px wide with the Now playing pane open: the sidebar and the pane give
   up a little so the page in the middle keeps a usable width (it was down to 240px at 800px wide). */
@media (max-width: 1099px) and (min-width: 761px) {
  body.desktop-app.np-visible { --sidebar: 200px; --nowpane: 280px; }
  body.desktop-app.np-visible .view { --view-pt: 20px; --view-px: 20px; }
}
@media (max-width: 900px) and (min-width: 761px) {
  body.desktop-app.np-visible { --sidebar: 188px; --nowpane: 260px; }
  body.desktop-app.np-visible .nav-link { padding: 10px 10px; gap: 12px; }
}
/* Full-screen player on a window under 1000px: the three-column bar keeps to the width it has. */
@media (max-width: 1000px) and (min-width: 761px) {
  .fp-bar { grid-template-columns: minmax(150px, 1fr) minmax(260px, 2fr) minmax(150px, 1fr); column-gap: 14px; }
  .fp-bar .fp-bottom { flex-wrap: wrap; row-gap: 2px; }
  .fp-bar .fp-q { order: 2; flex: 1 1 100%; align-items: flex-end; }
}

/* Search on Home, and the Back link on pages you drilled into */
.home-search { flex: 1 1 220px; max-width: 420px; margin: 0 12px; position: relative; }
.home-search .input { padding-right: 36px; }
.home-search .search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: none; align-items: center; justify-content: center; color: var(--muted); }
.home-search .search-clear .icon { width: 16px; height: 16px; }
.home-search:has(input:not(:placeholder-shown)) .search-clear { display: inline-flex; }
.home-search .search-clear:hover { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }
.page-head.home-band { flex-wrap: wrap; gap: 10px 0; }
.page-head.home-band h1 { margin-right: 8px; }
.search-results { margin-top: 4px; }
@media (max-width: 760px) {
  .page-head.row.between.home-band { flex-wrap: wrap; }
  .page-head.row.between.home-band .home-search { flex: 1 1 100%; max-width: none; margin: 6px 0 0; order: 3; }
  .page-head.row.between.home-band .home-tools { margin-left: auto; }
}
.page-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; padding: 4px 10px 4px 6px; border-radius: 999px; margin: -8px 0 10px -6px; }
.page-back .icon { width: 18px; height: 18px; }
.page-back:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }

.lyrics-paste { width: 100%; min-height: 220px; resize: vertical; font-family: inherit; line-height: 1.4; }
/* The Home header's shortcut buttons are for phones (no sidebar there). On a PC the sidebar already has Karaoke and
   Notifications, and Car mode is for a phone on a dashboard — so only "Customize Home" stays. */
@media (min-width: 761px) { .home-tools a[href="#/car"], .home-tools a[href="#/karaoke"], .home-tools .home-bell { display: none; } }
body.desktop-app .home-tools a[href="#/car"], body.desktop-app .home-tools a[href="#/karaoke"], body.desktop-app .home-tools .home-bell { display: none; }
/* Library: search box in the heading, same look as Home's */
.lib-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lib-head .home-search { flex: 1 1 240px; max-width: 420px; margin: 0; }
@media (max-width: 760px) { .lib-head .home-search { flex-basis: 100%; max-width: none; } }
.gm-panel { margin-top: 8px; }
.gm-panel .gm-results { margin-top: 8px; }
.gm-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-panel .search-box { position: relative; }
.gm-panel .search-box .input { padding-right: 36px; }
.gm-panel .search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: none; align-items: center; justify-content: center; color: var(--muted); }
.gm-panel .search-clear .icon { width: 16px; height: 16px; }
.gm-panel .search-box:has(input:not(:placeholder-shown)) .search-clear { display: inline-flex; }
.home .gm-panel { margin: 0 0 8px; }

input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; } /* we draw our own clear button */

/* Lyrics timing nudge in the Now-playing pane's tab row */
.np-tab-tools { margin-left: 10px; display: inline-flex; align-items: center; }
.lyrics-tools.compact { padding: 0; gap: 0; font-size: 11px; color: var(--muted); }
.lyrics-tools.compact .icon-btn { width: 20px; height: 20px; font-size: 15px; line-height: 1; }
.lyrics-tools.compact .lyrics-offset { min-width: 36px; margin: 0 -3px; }
.lyrics-tools.compact .lyrics-ai { margin-left: 6px; }
/* "AI Lyric Sync" while the AI runs: the name carries a slow sweeping shine; a short progress note follows it. */
.ai-sync { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: 11px; }
.ai-sync-name { font-weight: 800; letter-spacing: .02em; background: linear-gradient(100deg, var(--muted) 0 38%, var(--text) 50%, var(--muted) 62% 100%); background-size: 240% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-shine 2.2s linear infinite; }
.ai-sync-prog { color: var(--muted); }
@keyframes ai-shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .ai-sync-name { animation: none; color: var(--text); background: none; } }
.lyrics.compact .lyrics-body { padding-top: 8%; }

/* Expanded player, lyrics mode: a centred column, text aligned left, small cover + timing controls above */
.fp-lyrics .lyrics { text-align: left; }
/* On a PC the lyrics sit in the same middle column as the controls and progress bar below them (same grid as .fp-bar). */
@media (min-width: 761px) {
  .fp-lyrics { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(220px, 1fr); column-gap: 24px; }
  .fp-lyrics .lyrics { grid-column: 2; min-width: 0; }
}
.lyrics-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 4px 14px; }
.lyrics-head-row { display: flex; align-items: center; gap: 14px; max-width: 100%; }
.lyrics-head .cover { width: 84px; flex: none; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.lyrics-head-text { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; text-align: left; }
.lyrics-head-text b { font-size: 17px; }
.lyrics-head-text .muted { font-size: 13px; }
.fp-lyrics .lyrics-body { padding-top: 76px; } /* clears the top fade so the first line is readable */
@media (max-width: 760px) { .lyrics-head .cover { width: 72px; } }
.lyrics-tools.compact .lyrics-ai .icon { width: 15px; height: 15px; }
.lyrics-tools.compact .lyrics-ai { color: var(--accent); }

.home-notices:empty { display: none; }
.home-notices { margin-bottom: 8px; }
.home-notices .notice { margin-bottom: 8px; }
.np-tabs > button { white-space: nowrap; flex: none; }
.np-tab-tools { min-width: 0; overflow: hidden; }
.ai-sync-prog { overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
/* The format picker inside a Settings row: wraps if the row is narrow, no stray right margin */
.setting-row .format-wrap { margin-right: 0; flex-wrap: wrap; justify-content: flex-end; }

/* The desktop app reaches lyrics through the Now-playing pane's tab (or the expanded player), so no Lyrics button in the bar. */
body.desktop-app .pb-right [aria-label="Lyrics"] { display: none !important; }
/* The narrow desktop window keeps the expand chevron above the cover (phones open the player by tapping the bar). */
@media (max-width: 760px) {
  body.desktop-app .playerbar .pb-expand.icon-btn.small { display: inline-flex !important; top: -6px; }
  body.desktop-app .playerbar { overflow: visible; }
  body.desktop-app .pb-art-wrap { position: relative; }
}
/* The page itself never scrolls (panes do); without this a focus() or scrollIntoView could shift the whole app up by the title bar's height. */
html { overflow: hidden; }
