:root {
  --bg: #ffffff;
  --sidebar: #f6f6f7;
  --surface: #fafafa;
  --card: #f4f4f5;
  --hover: #f0f0f2;
  --active: #e7f6ec;
  --border: #e4e4e7;
  --text: #09090b;
  --muted: #71717a;
  --accent: #16a34a;
  --accent-text: #ffffff;
  --danger: #dc2626;
  --warn: #b45309;
  --track: #d4d4d8;
  --shadow: 0 12px 32px rgba(0, 0, 0, .12);
  --radius: 8px;
  --player-h: 84px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --sidebar: #000000; --surface: #181818; --card: #1c1c1e;
    --hover: #222224; --active: #1a2a20; --border: #2a2a2d; --text: #fafafa;
    --muted: #a1a1aa; --accent: #1ed760; --accent-text: #000000; --danger: #f87171;
    --warn: #fbbf24; --track: #3f3f46; --shadow: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --sidebar: #000000; --surface: #181818; --card: #1c1c1e;
  --hover: #222224; --active: #1a2a20; --border: #2a2a2d; --text: #fafafa;
  --muted: #a1a1aa; --accent: #1ed760; --accent-text: #000000; --danger: #f87171;
  --warn: #fbbf24; --track: #3f3f46; --shadow: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon.fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-text { color: var(--danger); font-size: 13px; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 8px 16px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.sm .icon { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .icon { width: 16px; height: 16px; }

.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: none; border: 0; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.sm .icon { width: 16px; height: 16px; }
.icon-btn.lg .icon { width: 22px; height: 22px; }
.icon-btn.xl { width: 48px; height: 48px; }
.icon-btn.xl .icon { width: 28px; height: 28px; }
.icon-btn.heart.on .icon { fill: var(--accent); stroke: var(--accent); }
.badge {
  position: absolute; top: 3px; right: 2px;
  font-size: 9px; font-weight: 700; line-height: 1;
  background: var(--accent); color: var(--accent-text);
  border-radius: 999px; padding: 2px 3px;
}

.play-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--text); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn .icon { width: 16px; height: 16px; }
.play-btn.xl { width: 64px; height: 64px; }
.play-btn.xl .icon { width: 26px; height: 26px; }
.play-btn.accent { background: var(--accent); color: var(--accent-text); width: 52px; height: 52px; }
.play-btn.accent .icon { width: 22px; height: 22px; }

/* ---------- covers ---------- */
.cover, .thumb, .card-cover, .hero-cover, .np-cover {
  background: var(--track) center / cover no-repeat;
  position: relative; overflow: hidden; flex: none;
}
.cover, .thumb, .card-cover, .hero-cover, .np-cover { container-type: inline-size; }
.art {
  position: absolute; inset: 0; font-size: 30cqi;
  display: flex; align-items: flex-end; padding: 10%;
  color: rgba(255, 255, 255, .92); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1;
}

/* ---------- login ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.login-card h1 { margin: 8px 0 0; font-size: 28px; }
.login-card p { margin: 0 0 12px; }
.login-card input, .field input, .field select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); outline: 0;
}
.login-card input:focus, .field input:focus { border-color: var(--accent); }

/* ---------- layout ---------- */
/* Pinned to the screen edges. */
.app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 1fr var(--player-h);
}

.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 0 10px 12px; min-height: 0;
}
.drag { height: 36px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; padding: 4px 10px 14px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; left: 8px; top: 6px;
  border-left: 8px solid var(--accent-text);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.brand-mark.lg { width: 56px; height: 56px; }
.brand-mark.lg::after { left: 21px; top: 16px; border-left-width: 20px; border-top-width: 12px; border-bottom-width: 12px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav.playlists { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: 6px;
  background: none; border: 0; cursor: pointer; text-align: left;
  color: var(--muted); font-weight: 500;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); background: var(--hover); }
.nav-item .cover { width: 32px; height: 32px; border-radius: 4px; }
.nav-item .grow { flex: 1; min-width: 0; }
.nav-item .src { width: 14px; height: 14px; color: var(--muted); }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.side-foot { padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px; }

.main { overflow-y: auto; min-width: 0; position: relative; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.omni {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid transparent; border-radius: 999px;
  padding: 0 14px; height: 40px; color: var(--muted);
}
.omni:focus-within { border-color: var(--border); background: var(--surface); }
.omni input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.hint { font: 11px/1 inherit; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 3px 5px; }
.dl-btn {
  position: relative; margin-left: auto;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--card); color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.dl-btn:hover { color: var(--text); }
/* Dot on the gear while songs are saving to the server. */
.dl-count {
  position: absolute; top: 4px; right: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--card);
  font-size: 0; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

.view { padding: 8px 24px 32px; }

/* ---------- headers ---------- */
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-title h2 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
.section-title button { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; }
.section-title button:hover { color: var(--text); }

.hero {
  display: flex; align-items: flex-end; gap: 24px;
  margin: -8px -24px 0; padding: 32px 24px 24px;
  background: linear-gradient(to bottom, var(--hero, #3f3f46) 0%, transparent 100%);
}
.hero-cover { width: 200px; height: 200px; border-radius: 8px; box-shadow: var(--shadow); }
.hero-cover.liked { background: linear-gradient(135deg, #4c1d95, #1ed760); display: grid; place-items: center; color: #fff; }
.hero-cover.liked .icon { width: 72px; height: 72px; fill: #fff; stroke: #fff; }
.hero-text { min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.eyebrow .icon { width: 14px; height: 14px; }
.hero h1 { font-size: clamp(28px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.03em; margin: 6px 0 10px; font-weight: 900; }
.hero-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.hero-meta b { color: var(--text); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 12px; padding: 20px 0; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; }
.toggle input { display: none; }
.toggle .sw {
  width: 34px; height: 20px; border-radius: 999px; background: var(--track); position: relative; transition: background .15s;
}
.toggle .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(14px); }
.toggle.on-text { color: var(--text); }

/* ---------- cards (home) ---------- */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.quick-item {
  display: flex; align-items: center; gap: 12px; height: 56px;
  background: var(--card); border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 0; padding: 0 12px 0 0; text-align: left; font-weight: 600;
}
.quick-item:hover { background: var(--hover); }
.quick-item .cover { width: 56px; height: 56px; }
.quick-item.liked .cover { background: linear-gradient(135deg, #4c1d95, #1ed760); display: grid; place-items: center; }
.quick-item.liked .cover .icon { fill: #fff; stroke: #fff; }

.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 180px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.card { background: none; border: 0; padding: 10px; margin: -10px; border-radius: 8px; text-align: left; cursor: pointer; min-width: 0; }
.card:hover { background: var(--hover); }
.card-cover { width: 100%; aspect-ratio: 1; border-radius: 6px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.card-title { font-weight: 600; }
.card-sub { color: var(--muted); font-size: 13px; }

/* ---------- track lists ---------- */
.list-head, .row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1.4fr) minmax(0, 1fr) 40px 56px 36px;
  align-items: center; gap: 12px; padding: 0 12px;
}
.list-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 8px; }
.list-head .icon { width: 14px; height: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.row { height: 56px; border-radius: 6px; }
.row:hover { background: var(--hover); }
.row.playing .t-title { color: var(--accent); }
.row.dim { opacity: .55; }
.row.dim:hover { opacity: .8; }

.idx { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; position: relative; }
.idx .row-play {
  display: none; position: absolute; inset: -10px -4px;
  background: none; border: 0; cursor: pointer; color: var(--text); align-items: center; justify-content: center;
}
.idx .row-play .icon { width: 14px; height: 14px; }
.row:hover .idx .num { visibility: hidden; }
.row:hover .idx .row-play { display: flex; }
.row.playing .num { color: var(--accent); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: var(--accent); animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.paused .eq i { animation-play-state: paused; }

.t-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-main .thumb { width: 40px; height: 40px; border-radius: 4px; }
.t-main .thumb.wide { width: 64px; height: 36px; }
.t-text { min-width: 0; }
.t-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-sub { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.t-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-album { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-len { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.t-like { opacity: 0; }
.row:hover .t-like, .t-like.on { opacity: 1; }
.t-more { opacity: 0; }
.row:hover .t-more { opacity: 1; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status.warn { color: var(--warn); }
.status .icon { width: 14px; height: 14px; }
.mini-bar { width: 48px; height: 3px; border-radius: 3px; background: var(--track); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--accent); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 11px; font-weight: 600; line-height: 16px; padding: 2px 8px; border-radius: 999px;
  background: var(--card); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.pill .icon { width: 12px; height: 12px; }
.pill.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* search + import rows */
.row.r-search { grid-template-columns: minmax(0, 1fr) 64px 220px; }
.row.r-import { grid-template-columns: 28px minmax(0, 1fr) 64px 80px; }
.row.r-import input[type=checkbox], .check-all input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.right { text-align: right; display: flex; justify-content: flex-end; }

.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; stroke-width: 1.5; margin-bottom: 8px; }
.empty h2 { color: var(--text); font-size: 18px; margin: 8px 0 6px; }
.empty p { max-width: 380px; margin: 0 auto 16px; }

.skeleton { height: 56px; border-radius: 6px; background: linear-gradient(90deg, var(--card), var(--hover), var(--card)); background-size: 200% 100%; animation: sk 1.2s linear infinite; margin-bottom: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

.chips { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 500; font-size: 13px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- downloads ---------- */
.job {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; background: var(--surface);
}
.job-title { font-weight: 500; }
.job-stage { color: var(--muted); font-size: 12px; }
.job.failed .job-stage { color: var(--danger); }
.job-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; }
.job-bar span { display: block; height: 100%; background: var(--accent); }

/* ---------- settings ---------- */
.settings { max-width: 640px; }
.panel { border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; background: var(--surface); }
.panel h2 { font-size: 16px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.panel h2 .icon { width: 20px; height: 20px; }
.panel > p { margin: 0 0 16px; color: var(--muted); }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.panel-row:first-of-type { border-top: 0; }
.panel-row .grow { min-width: 0; flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.meter { height: 6px; border-radius: 6px; background: var(--track); overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: var(--accent); }

/* ---------- player ---------- */
.player {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr);
  align-items: center; gap: 16px; padding: 0 16px;
  background: var(--sidebar); border-top: 1px solid var(--border);
  position: relative;
}
.p-progress { display: none; }
.now { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.now .cover { width: 56px; height: 56px; border-radius: 6px; }
.now-text { min-width: 0; }
.now-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.controls { display: flex; align-items: center; gap: 8px; }
.seek { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 600px; }
.time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 36px; }
.time:first-child { text-align: right; }
.right-tools { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.right-tools input { width: 100px; }

input[type="range"] {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 4px; margin: 0;
  background: linear-gradient(to right, var(--text) var(--p), var(--track) var(--p));
  cursor: pointer; outline: 0;
}
input[type="range"]:hover { background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); opacity: 0; }
input[type="range"]:hover::-webkit-slider-thumb { opacity: 1; }

.tabbar { display: none; }

/* ---------- now playing + lyrics ---------- */
.np {
  position: fixed; inset: 0; z-index: 50;
  color: #fff; background: #111;
  display: flex; flex-direction: column;
  animation: rise .25s ease;
  overflow: hidden;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.np-bg {
  position: absolute; inset: -20%;
  background: var(--np-color, #333) center / cover;
  filter: blur(80px) saturate(1.3) brightness(.42);
  transform: scale(1.2);
}
.np-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); }
.np > *:not(.np-bg) { position: relative; }
.np .icon-btn { color: rgba(255,255,255,.7); }
.np .icon-btn:hover, .np .icon-btn.on { color: #fff; }
.np .icon-btn.heart.on .icon { fill: #fff; stroke: #fff; }
/* Close on the left, tabs in the middle, lyrics timing on the right. */
.np-head { position: relative; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: max(16px, env(safe-area-inset-top)) 20px 8px; }
.np-head #np-close { grid-column: 1; }
.np-tabs { grid-column: 2; justify-self: center; display: none; background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px; }
.np-tabs button { border: 0; background: none; color: rgba(255,255,255,.75); padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; }
.np-tabs button.on { background: rgba(255,255,255,.22); color: #fff; }

.np-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 64px; padding: 16px 64px 40px; align-items: center;
  max-width: 1400px; width: 100%; margin: 0 auto;
}
.np-left { display: flex; flex-direction: column; gap: 18px; }
.np-cover { width: 100%; aspect-ratio: 1; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.np-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.np-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.np-artist { color: rgba(255,255,255,.7); font-size: 16px; }
.np-seek input[type=range] { width: 100%; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.25) var(--p)); }
.np-seek input[type=range]::-webkit-slider-thumb { background: #fff; opacity: 1; }
.np-times { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,.6); margin-top: 6px; font-variant-numeric: tabular-nums; }
.np-controls { display: flex; align-items: center; justify-content: space-between; }
.np .play-btn { background: #fff; color: #000; }

.np-lyrics {
  height: 100%; overflow-y: auto; scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
  padding: 30vh 0 40vh;
}
.np-lyrics::-webkit-scrollbar { display: none; }
.ly-line {
  font-size: clamp(24px, 3.2vw, 40px); font-weight: 800; line-height: 1.25; letter-spacing: -0.02em;
  margin: 0 0 22px; color: rgba(255,255,255,.28);
  cursor: pointer; transition: color .3s ease, transform .3s ease;
  transform-origin: left center;
}
.ly-line:hover { color: rgba(255,255,255,.6); }
.ly-line.past { color: rgba(255,255,255,.4); }
.ly-line.on { color: #fff; transform: scale(1.03); }
.ly-line.gap { font-size: 28px; letter-spacing: .3em; }
.np-lyrics.plain .ly-line { color: rgba(255,255,255,.85); cursor: default; font-size: clamp(20px, 2.4vw, 28px); }
.ly-empty { color: rgba(255,255,255,.7); text-align: center; padding-top: 10vh; }
.ly-empty > .icon { width: 40px; height: 40px; stroke-width: 1.5; }
.ly-credit { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 32px; }
.np > .np-head { z-index: 2; }


/* ---------- dialog + menu + toast ---------- */
.dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 48px));
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0,0,0,.5); }
.dlg-head { padding: 20px 20px 8px; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-head p { margin: 4px 0 0; color: var(--muted); }
.dlg-body { padding: 8px 20px; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; }
.cand {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px; background: var(--bg);
}
.cand.previewing { border-color: var(--accent); }
.cand-thumb { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 4px; overflow: hidden; }
.cand-thumb .vplay { width: 32px; height: 32px; opacity: 1; transform: translate(-50%, -50%); }
.cand-thumb .vplay .icon { width: 14px; height: 14px; }
.cand.previewing .vplay { background: var(--accent); color: var(--accent-text); }
.cand-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cand-bar { height: 3px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 6px; }
.cand-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.cand .thumb { width: 96px; height: 54px; border-radius: 4px; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.score.good { color: var(--accent); } .score.bad { color: var(--danger); } .score.mid { color: var(--warn); }
.src-song { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card); border-radius: 8px; margin-bottom: 14px; }
.src-song .cover { width: 48px; height: 48px; border-radius: 4px; }

.menu {
  position: fixed; z-index: 60; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px;
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: left;
}
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu .label { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* Notices: a small card that slides up above the player. */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); z-index: 70;
  display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: var(--text); border: 1px solid var(--border);
  padding: 10px 16px 10px 12px; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  transform: translate(-50%, 12px); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast > .icon { width: 18px; height: 18px; color: var(--accent); }
.toast-cover { width: 32px; height: 32px; flex: none; border-radius: 6px; background: var(--track) center / cover no-repeat; }

/* ---------- phone ---------- */
@media (max-width: 820px) {
  :root { --player-h: 64px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; }
  .sidebar, .desk, .hint, .t-album, .list-head .c-album, .t-like { display: none !important; }
  .topbar { padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .view { padding: 4px 16px 24px; }
  .page-title { font-size: 24px; margin: 4px 0 16px; }

  .list-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto 32px; gap: 8px; padding: 0 4px; }
  .row .idx, .row .t-len { display: none; }
  .row.r-search { grid-template-columns: minmax(0, 1fr) auto; }
  .row.r-search .t-len { display: none; }
  .row.r-import { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .t-more { opacity: 1; }

  .hero { flex-direction: column; align-items: flex-start; gap: 16px; margin: -4px -16px 0; padding: 16px; }
  .hero-cover { width: 160px; height: 160px; align-self: center; }
  .hero h1 { font-size: 26px; }

  /* mini player above tab bar */
  .player {
    grid-column: 1; margin: 0 8px 6px; border-radius: 10px; border: 0;
    grid-template-columns: 1fr auto; padding: 8px 10px 10px; gap: 8px;
    background: var(--card); overflow: hidden;
  }
  .p-progress { display: block; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; background: var(--track); border-radius: 2px; overflow: hidden; }
  .p-progress span { display: block; height: 100%; width: 0; background: var(--text); }
  .now .cover { width: 40px; height: 40px; border-radius: 4px; }
  .center { flex-direction: row; }
  .controls { gap: 0; }
  .play-btn { background: none; color: var(--text); }

  /* Sits on the bottom edge; icons stay just above the home indicator. */
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 6px 0 max(6px, calc(var(--safe-b) - 10px));
    background: var(--bg);
    border-top: 1px solid var(--border);
  }
  .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; cursor: pointer; padding: 4px 0;
  }
  .tabbar button .icon { width: 22px; height: 22px; }
  .tabbar button.active { color: var(--text); }

  .np-tabs { display: flex; }
  .np-body { grid-template-columns: 1fr; padding: 8px 24px calc(24px + var(--safe-b)); gap: 16px; }
  .np-body[data-mode="lyrics"] .np-cover { display: none; }
  .np-body[data-mode="lyrics"] { grid-template-rows: minmax(0, 1fr) auto; }
  .np-body[data-mode="lyrics"] .np-left { order: 2; }
  .np-body[data-mode="cover"] .np-lyrics { display: none; }
  .np-body[data-mode="cover"] .np-left { justify-content: center; }
  .np-lyrics { padding: 20vh 0 30vh; }
  .ly-line { font-size: 26px; margin-bottom: 18px; }

  .quick { grid-template-columns: 1fr 1fr; }
  .quick-item { height: 48px; font-size: 13px; }
  .quick-item .cover { width: 48px; height: 48px; }
  .shelf { grid-auto-columns: 140px; }
  .settings { max-width: none; }
  .panel { padding: 16px; }
}
.dl-btn.on { color: var(--text); background: var(--hover); }
.toggle input:disabled:not(:checked) + .sw { opacity: .35; cursor: not-allowed; }

/* ---------- videos ---------- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px 16px; }
.vcard { min-width: 0; }
.vthumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0;
  border-radius: 8px; cursor: pointer; overflow: hidden;
}
.vplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9);
  width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: grid; place-items: center; opacity: 0; transition: opacity .15s, transform .15s;
}
.vthumb:hover .vplay, .vcard[data-playing] .vplay { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.vdur {
  position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.vmeta { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; margin-top: 8px; }
.vtitle { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Video in the full screen player: wide stage instead of a square cover, no lyrics. */
.np-body[data-kind="video"] { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
.np-body[data-kind="video"] .np-lyrics { display: none; }
.np-body[data-kind="video"] .np-cover { aspect-ratio: 16 / 9; background: #000 !important; }
.np-body[data-kind="video"] .np-left { width: 100%; }
.vstage { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: rgba(255,255,255,.6); font-size: 14px; }
.vstage .icon { width: 48px; height: 48px; stroke-width: 1.5; }
@media (max-width: 820px) {
  .vgrid { grid-template-columns: 1fr; }
  .np-body[data-kind="video"] .np-cover, .np-body[data-kind="video"] .np-controls { display: flex !important; }
}

/* ---------- charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.chart-card {
  position: relative; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; cursor: pointer; overflow: hidden;
  display: flex; align-items: flex-end; padding: 12px; text-align: left;
  color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: -0.01em;
}
.chart-card:hover { filter: brightness(1.1); }
.chart-card span { text-shadow: 0 1px 8px rgba(0,0,0,.35); }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- misc ---------- */
.select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.np-video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.np-bg { background-size: cover; background-position: center; }
.toggle .icon { width: 16px; height: 16px; color: var(--accent); }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: var(--accent-text); }

/* Installed on a phone home screen: keep clear of the notch and the home bar. */
@media (display-mode: standalone) {
  .login { padding-top: max(24px, env(safe-area-inset-top)); }
  .np-head { padding-top: max(16px, env(safe-area-inset-top)); }
}
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; }

/* Pull to refresh */
.ptr {
  position: absolute; top: 0; left: 50%; z-index: 6;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); color: var(--muted); box-shadow: var(--shadow);
  transform: translate(-50%, -48px); opacity: 0; pointer-events: none;
}
.ptr.ready { color: var(--accent); }
.ptr.spinning { opacity: 1; color: var(--accent); }
.ptr.spinning .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.main { overscroll-behavior: none; }

/* iPhone zooms the page when a text field is under 16px. Keep fields at 16px on touch screens. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* Phones: no empty player bar before anything has played. */
@media (max-width: 820px) {
  .app.idle .player { display: none; }
}

/* Phones: a solid top bar, so no blurred band shows above the search box. */
@media (max-width: 820px) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Touch screens keep :hover stuck after a tap, leaving grey boxes behind cards and rows. */
@media (hover: none) {
  .card:hover, .row:hover, .nav-item:hover, .menu button:hover { background: none; }
  .quick-item:hover { background: var(--card); }
  .btn:hover { background: var(--surface); }
  .btn.primary:hover { filter: none; background: var(--accent); }
  .play-btn:hover { transform: none; }
  .chart-card:hover { filter: none; }
  .row:hover .idx .num { visibility: visible; }
  .row:hover .idx .row-play { display: none; }
  .row.playing { background: var(--active); }
  .card:active, .row:active, .quick-item:active { opacity: .7; }
}

/* Sideways shelves scroll sideways only; no bounce into empty space. */
/* overflow-x alone makes the row scroll vertically too when cards stick out, so lock it. */
.shelf { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x pan-y; padding-top: 10px; margin-top: -10px; }

/* Play/Pause in results keep one width, so the row doesn't jump. */
.row [data-act="r-play"] { min-width: 86px; justify-content: center; }
@media (max-width: 820px) {
  .row [data-act="r-play"] { min-width: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 0; gap: 0; }
  .row [data-act="r-play"] .icon { width: 14px; height: 14px; }
}

/* ---------- iPhone Home Screen app (set by fitIosHomeScreen in app.js) ---------- */
html.ios-pwa, html.ios-pwa body { overflow: visible; height: 100lvh; }
html.ios-pwa .app, html.ios-pwa .np { bottom: auto; height: 100lvh; }
/* Solid top bar under the status bar, so iPhone's blur there has nothing to smear. */
html.ios-pwa .topbar {
  padding-top: calc(var(--ios-top, 47px) + 16px);
  background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
}
html.ios-pwa .main { scroll-padding-top: calc(var(--ios-top, 47px) + 60px); }
/* Same distance from the status bar as the main top bar. */
html.ios-pwa .np-head { padding-top: calc(var(--ios-top, 47px) + 16px); }
/* An even tint under the status bar, so iPhone's own blur there has nothing to smear. */
html.ios-pwa .np::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--ios-top, 47px);
  background: rgba(0, 0, 0, .35); z-index: 1; pointer-events: none;
}
html.ios-pwa .login { padding-top: var(--ios-top, 47px); }
html.ios-pwa .ptr { top: calc(var(--ios-top, 47px) + 56px); }
/* iPhone reports no safe area here, so keep the tab labels clear of the home bar ourselves. */
html.ios-pwa .tabbar, html.ios-inset .tabbar { padding-bottom: 26px; }

/* Phone Now Playing: controls sit at the bottom like a music app; the cover centres above them. */
@media (max-width: 820px) {
  .np-body[data-mode="cover"] .np-left { align-self: stretch; height: 100%; justify-content: flex-start; }
  .np-body[data-mode="cover"] .np-cover { margin: auto 0; }
  html.ios-pwa .np-body, html.ios-inset .np-body { padding-bottom: 28px; }
}

/* Phones: notices sit above the mini player and tab bar. */
@media (max-width: 820px) {
  .toast { bottom: calc(150px + var(--safe-b)); left: 16px; right: 16px; max-width: none; transform: translateY(12px); }
  .toast.show { transform: translateY(0); }
  .app.idle ~ .toast { bottom: calc(90px + var(--safe-b)); }
  html.ios-pwa .toast { bottom: 160px; }
}

/* Vertical scrollers never scroll sideways: a tap-drag used to nudge content (lyrics, lists). */
.main, .np-lyrics, .dlg-body, .nav.playlists, .settings { overflow-x: hidden; }
.main, .np-lyrics, .dlg-body { touch-action: pan-y; overscroll-behavior: none; }
.vgrid, .list { max-width: 100%; }
/* The current lyric line grows a little; keep it inside the box. */
.np-lyrics { padding-right: 4%; }

/* More room above the search bar on phones. */
@media (max-width: 820px) {
  .topbar { padding-top: max(16px, env(safe-area-inset-top)); }
}

/* ---------- toolbar: one size for every secondary button ---------- */
.toolbar { gap: 12px; }
.circle-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1.5px solid var(--border); color: var(--text); cursor: pointer;
}
.circle-btn .icon { width: 18px; height: 18px; }
.circle-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.circle-btn:disabled { opacity: .4; }
.btn.outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn.tall { height: 40px; padding: 0 18px; }
@media (hover: hover) {
  .circle-btn:hover { border-color: var(--text); }
  .btn.outline:hover { border-color: var(--text); background: transparent; }
}

/* ---------- cover badge: saved (grey) / on this device (green) ---------- */
.thumb-wrap { position: relative; flex: none; }
.dl-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--track); color: var(--text); box-shadow: 0 0 0 2px var(--bg);
}
.dl-badge.on { background: var(--accent); color: var(--accent-text); }
.dl-badge .icon { width: 10px; height: 10px; stroke-width: 3; }

/* Phones: song rows are cover + text + ⋯ at the right edge. */
@media (max-width: 820px) {
  .row:not(.r-search):not(.r-import) { grid-template-columns: minmax(0, 1fr) 36px; padding-right: 0; }
  .row .t-more { justify-self: end; }
  .row.dim { grid-template-columns: minmax(0, 1fr) auto; }
  .row .t-status { display: block !important; }
  .row .t-gap { display: none; }
}
#np-artist { cursor: pointer; }

/* Lyrics timing: a clock button top right; − / + opens just under it. */
.np-timing { grid-column: 3; justify-self: end; }
#np-offset.on { background: rgba(255,255,255,.22); border-radius: 50%; }
.offset-ctrl {
  position: absolute; top: calc(100% - 4px); right: 16px; z-index: 3;
  display: flex; align-items: center; gap: 10px; padding: 6px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 999px;
}
.offset-ctrl[hidden] { display: none; }
.offset-ctrl button {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font-size: 18px; line-height: 1;
}
.offset-ctrl #offset-val { min-width: 40px; text-align: center; font-size: 13px; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }

/* Phones: less empty space above the first lyric line. */
@media (max-width: 820px) {
  .np-lyrics { padding-top: 6vh; }
}

/* Phones, Lyrics tab: a compact control row under the progress bar, so skipping doesn't need a tab switch. */
@media (max-width: 820px) {
  .np-body[data-mode="lyrics"] .np-left { gap: 10px; }
  .np-body[data-mode="lyrics"] .np-controls { padding: 0 8px; }
  .np-body[data-mode="lyrics"] .np-controls .play-btn.xl { width: 52px; height: 52px; }
  .np-body[data-mode="lyrics"] .np-controls .play-btn.xl .icon { width: 22px; height: 22px; }
  .np-body[data-mode="lyrics"] .np-controls .icon-btn.xl { width: 44px; height: 44px; }
}

/* ---------- Settings: grouped lists like iPhone Settings ---------- */
.set-back {
  display: inline-flex; align-items: center; gap: 2px; margin: 0 0 4px -6px; padding: 6px;
  border: 0; background: none; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer;
}
.set-back .icon { width: 20px; height: 20px; }
.set-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.set-group.set-pad { padding: 14px 16px; display: grid; gap: 8px; }
.set-note { color: var(--muted); font-size: 13px; margin: 0 4px 20px; }
/* A note under a group explains that group. */
.set-group + .set-note { margin-top: -12px; }
.set-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px;
  border: 0; border-top: 1px solid var(--border); background: none; color: var(--text);
  font: inherit; text-align: left;
}
.set-group > .set-row:first-child { border-top: 0; }
button.set-row { cursor: pointer; }
@media (hover: hover) { button.set-row:hover { background: var(--hover); } }
button.set-row:active { background: var(--hover); }
.set-row .grow { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.set-label { font-weight: 500; }
.set-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.set-value { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.set-chev { color: var(--muted); font-size: 20px; line-height: 1; margin-left: -4px; }
.set-row.danger { color: var(--danger); justify-content: center; }
.set-row.danger .grow { align-items: center; }
.set-ic { width: 30px; height: 30px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; }
.set-ic .icon { width: 18px; height: 18px; }
.set-me { padding-top: 14px; padding-bottom: 14px; }
.set-me .set-label { font-size: 17px; font-weight: 600; }
.set-avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.set-avatar.sm { width: 36px; height: 36px; }
.set-avatar { display: grid; place-items: center; }
.set-avatar .art { align-items: center; justify-content: center; padding: 0; font-size: 18px; }
.set-avatar.sm .art { font-size: 13px; }
.set-thumb { width: 40px; height: 40px; border-radius: 4px; flex: none; }
.seg { display: inline-flex; background: var(--card); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--bg); }

/* ---------- "Add to Home Screen" card on Home ---------- */
.install-card {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; padding: 12px 12px 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.install-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install-card .grow { min-width: 0; flex: 1; font-size: 14px; }
.install-card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.install-card p .icon { width: 15px; height: 15px; vertical-align: -2px; color: var(--accent); }
.install-card .icon-btn { flex: none; align-self: flex-start; }

/* ---------- Lyrics: other versions ---------- */
.ly-link { border: 0; background: none; padding: 0; color: rgba(255,255,255,.75); font: inherit; text-decoration: underline; cursor: pointer; }
.ly-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.ly-preview {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 8px 8px 8px 14px; border-radius: 12px; font-size: 13px; color: #fff;
  background: rgba(0,0,0,.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.ly-preview .grow { flex: 1; min-width: 0; }
.ly-ver {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; text-align: left;
  border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; cursor: pointer;
}
.ly-ver:first-child { border-top: 0; }
.ly-ver .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
@media (hover: hover) { .ly-ver:hover { background: var(--hover); } }

/* Long dialogs scroll in the middle; the title and buttons stay on screen. */
.dialog[open], .dialog[open] > form { display: flex; flex-direction: column; min-height: 0; }
.dialog[open] > form { flex: 1; }
.dialog .dlg-body { flex: 1; min-height: 0; }
/* The player is always dark, in both themes. */
.np .btn:not(.primary) { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }
@media (hover: hover) { .np .btn:not(.primary):hover { background: rgba(255,255,255,.24); } }
.ly-search { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.ly-search input {
  min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); font: inherit; font-size: 16px;
}
@media (max-width: 520px) { .ly-search { grid-template-columns: 1fr auto; } .ly-search input:first-child { grid-column: 1 / -1; } }
