/* ---------- Tokens ---------- */
:root {
  --bg: #111014;
  --bg-2: #17161b;
  --panel: #1c1b21;
  --panel-2: #24232a;
  --hover: rgba(255, 255, 255, .06);
  --hover-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .08);
  --text: #f2efe9;
  --muted: #a19c94;
  --faint: #6f6b66;
  --accent: #e8a54b;
  --accent-rgb: 232 165 75;
  --accent-ink: #1b1206;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --wash: .34;
  --radius: 14px;
  --row: 56px;
  --scale: 1;
  --side-w: 252px;
  --queue-w: 320px;
  color-scheme: dark;
}
:root[data-theme="black"] {
  --bg: #000;
  --bg-2: #0b0b0c;
  --panel: #121214;
  --panel-2: #1a1a1d;
  --wash: .22;
}
:root[data-theme="light"] {
  --bg: #efebe4;
  --bg-2: #f7f4ee;
  --panel: #ffffff;
  --panel-2: #f1ede6;
  --hover: rgba(0, 0, 0, .045);
  --hover-2: rgba(0, 0, 0, .08);
  --line: rgba(0, 0, 0, .09);
  --text: #1c1a17;
  --muted: #6a655c;
  --faint: #9c968b;
  --shadow: 0 18px 50px rgba(60, 40, 20, .18);
  --wash: .2;
  color-scheme: light;
}
:root[data-density="compact"] { --row: 44px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(15px * var(--scale)); }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
input { font: inherit; color: inherit; }
img { display: block; }
.muted { color: var(--muted); }
/* No focus rings or focus highlights anywhere: clicked buttons never stay lit up */
*, *:focus, *:focus-visible { outline: none !important; }
button::-moz-focus-inner { border: 0; }
* { -webkit-tap-highlight-color: transparent; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
kbd {
  font: 600 .72rem/1 "Manrope", sans-serif;
  padding: 3px 6px; border-radius: 5px;
  background: var(--hover-2); color: var(--muted);
}

/* ---------- Buttons ---------- */
.ib {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: var(--muted);
  transition: color .15s, background .15s, transform .1s;
}
.ib:hover { color: var(--text); background: var(--hover); }
.ib:active { transform: scale(.92); }
.ib:disabled { opacity: .35; pointer-events: none; }
.ib.round { background: var(--hover); }
.ib.lg .i { width: 26px; height: 26px; }
.ib.on { color: var(--accent); }
.ib.on::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.like.on { color: var(--accent); }
.like.on .i { fill: currentColor; }
.like.on::after { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--hover-2); font-weight: 600; font-size: .9rem;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--line); filter: brightness(1.15); }
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.lg { height: 50px; padding: 0 30px; font-size: 1rem; }

.play-big {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  transition: transform .12s, background .2s;
}
.play-big:hover { transform: scale(1.06); }
.play-big:active { transform: scale(.95); }
.play-big .i { width: 20px; height: 20px; }
.play-big.xl { width: 68px; height: 68px; }
.play-big.xl .i { width: 30px; height: 30px; }
.play-big.accent { background: var(--accent); color: var(--accent-ink); width: 56px; height: 56px; box-shadow: 0 8px 24px rgb(var(--accent-rgb) / .35); }
.play-big.accent .i { width: 24px; height: 24px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; padding: 6px 10px 18px; }
.brand-mark { display: flex; align-items: center; gap: 2.5px; height: 22px; }
.brand-mark i { display: block; width: 3.5px; border-radius: 3px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 35%; }
.brand-mark i:nth-child(2) { height: 75%; }
.brand-mark i:nth-child(3) { height: 100%; }
.brand-mark i:nth-child(4) { height: 60%; }
.brand-mark i:nth-child(5) { height: 30%; }
body:not(.is-paused) .brand .brand-mark i { animation: hum 1.1s ease-in-out infinite alternate; }
.brand-mark i:nth-child(2) { animation-delay: -.3s !important; }
.brand-mark i:nth-child(3) { animation-delay: -.6s !important; }
.brand-mark i:nth-child(4) { animation-delay: -.15s !important; }
.brand-mark i:nth-child(5) { animation-delay: -.45s !important; }
@keyframes hum { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
.brand-mark.big { height: 56px; gap: 6px; justify-content: center; }
.brand-mark.big i { width: 9px; border-radius: 6px; animation: hum 1.2s ease-in-out infinite alternate; }

/* ---------- Login ---------- */
.login {
  height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(60% 60% at 30% 20%, rgb(var(--accent-rgb) / .18), transparent 70%),
    radial-gradient(50% 50% at 80% 90%, rgb(var(--accent-rgb) / .10), transparent 70%),
    var(--bg);
}
.login-card { text-align: center; max-width: 420px; padding: 24px; }
.login-card h1 { font-size: 3.4rem; letter-spacing: -.05em; margin: 18px 0 4px; font-weight: 800; }
.login-tag { color: var(--muted); font-size: 1.1rem; margin: 0 0 32px; }
.login-fine { color: var(--faint); font-size: .82rem; margin-top: 22px; line-height: 1.5; }
.login-msg { background: rgba(255, 90, 90, .12); color: #ff9c8f; border-radius: 10px; padding: 12px 14px; font-size: .9rem; line-height: 1.45; margin: 0 0 22px; user-select: text; }
:root[data-theme="light"] .login-msg { color: #a1392b; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--queue-w);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "side main queue" "bar bar bar";
  gap: 8px; padding: 8px;
}
.app.no-queue { grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-areas: "side main" "bar bar"; }
.app.no-queue .queue-panel { display: none; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "side main" "bar bar"; }
  .app .queue-panel { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "bar"; }
  .sidebar { display: none !important; }
}

.artwash {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--art, none); background-size: cover; background-position: center;
  filter: blur(90px) saturate(1.3);
  opacity: var(--wash);
  transition: background-image .6s;
}
:root[data-artwash="off"] .artwash { display: none; }
.app > aside, .app > main {
  background: color-mix(in srgb, var(--bg-2) var(--panel-op, 86%), transparent);
  border-radius: var(--radius);
  min-height: 0; overflow: hidden;
}
:root[data-artwash="off"] .app > aside, :root[data-artwash="off"] .app > main { background: color-mix(in srgb, var(--bg-2) var(--panel-op, 100%), transparent); }

/* Sidebar */
.sidebar { grid-area: side; display: flex; flex-direction: column; padding: 14px 10px 0; }
.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .95rem;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--hover-2); color: var(--text); }
.nav-item.active .i { color: var(--accent); }
.nav-item kbd { margin-left: auto; opacity: 0; transition: opacity .15s; }
.nav-item:hover kbd { opacity: 1; }
.side-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 22px 12px 8px; }
.side-playlists { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px 16px; }
.side-pl {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 10px; color: var(--muted);
}
.side-pl:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-pl.active { background: var(--hover-2); color: var(--text); }
.side-pl img, .side-pl .ph { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex: none; }
.side-pl .t { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-pl .s { font-size: .76rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-pl > div { min-width: 0; }
.side-pl.playing .t { color: var(--accent); }
.side-empty { color: var(--faint); font-size: .85rem; padding: 6px 12px; }

.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 10px; color: var(--muted); text-align: left; }
.user-chip:hover { background: var(--hover); color: var(--text); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2) center/cover; flex: none; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--text); }
.user-name { flex: 1; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ph { display: grid; place-items: center; background: var(--panel-2); color: var(--faint); }
.ph .i { width: 40%; height: 40%; }

/* Main */
.main { grid-area: main; display: flex; flex-direction: column; position: relative; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; position: absolute; inset: 0 0 auto 0; z-index: 3; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .spacer { flex: 1; pointer-events: none; }
.topbar .ib.round { background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); }
.topbar .ib.round:disabled { opacity: 1; color: var(--faint); } /* same solid button as the others, just a dimmer arrow */
.searchbox {
  display: flex; align-items: center; gap: 10px;
  height: 44px; width: min(480px, 100%); padding: 0 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.searchbox:focus-within { border-color: var(--accent); color: var(--text); }
.searchbox input { flex: 1; border: 0; outline: 0; background: none; font-size: .95rem; min-width: 0; }
.searchbox input::-webkit-search-cancel-button { filter: grayscale(1); }
.view { flex: 1; overflow-y: auto; padding: 68px 28px 40px; scroll-behavior: smooth; }
.view:focus { outline: none; }
.view::-webkit-scrollbar, .side-playlists::-webkit-scrollbar, .queue::-webkit-scrollbar { width: 10px; }
.view::-webkit-scrollbar-track, .queue::-webkit-scrollbar-track { background: transparent; margin: 16px 0; } /* clear of the panels' rounded corners */
.side-playlists::-webkit-scrollbar-track { background: transparent; margin: 4px 0 16px; }

/* Queue panel */
.queue-panel { grid-area: queue; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 18px; }
.panel-head h3 { margin: 0; font-size: 1rem; }
.queue { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.q-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 8px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.q-item:hover { background: var(--hover); }
.q-item img, .q-item .ph { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; flex: none; }
.q-art { position: relative; flex: none; display: block; width: 42px; height: 42px; }
.q-art .q-play { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 6px; background: rgb(0 0 0 / .5); color: #fff; opacity: 0; transition: opacity .15s; }
.q-art .q-play .i { width: 18px; height: 18px; fill: currentColor; }
.q-item:hover .q-play { opacity: 1; }
.q-item > div { min-width: 0; flex: 1; }
.q-item .q-rm { flex: none; width: 30px; height: 30px; opacity: 0; transition: opacity .15s; color: var(--muted); }
.q-item .q-rm .i { width: 16px; height: 16px; }
.q-item:hover .q-rm { opacity: 1; }
.q-item .q-rm:hover { color: var(--text); background: var(--hover-2); }
.q-item .t { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .a { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item.now .t { color: var(--accent); }
.q-empty { color: var(--faint); font-size: .88rem; padding: 18px 8px; line-height: 1.5; }

/* Player bar */
.playerbar {
  grid-area: bar;
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.6fr) minmax(180px, 1fr);
  align-items: center; gap: 16px;
  height: 84px; padding: 0 12px;
}
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-art-btn { border-radius: 8px; flex: none; position: relative; }
.np-art { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.np-art-btn:hover::after { content: ""; position: absolute; inset: 0; border-radius: 8px; background: rgba(0, 0, 0, .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E") center/22px no-repeat; }
.np-text { min-width: 0; }
.np-title { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pb-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.controls { display: flex; align-items: center; gap: 10px; }
.controls .ib { position: relative; }
.prog { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.time { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.bar { --p: 0; position: relative; flex: 1; height: 16px; cursor: pointer; touch-action: none; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--hover-2); }
.bar .fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; width: calc(var(--p) * 100%); background: var(--text); }
.bar:hover .fill, .bar.drag .fill { background: var(--accent); }
.bar .knob { position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--text); opacity: 0; transition: opacity .12s; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.bar:hover .knob, .bar.drag .knob { opacity: 1; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.pb-right .ib { position: relative; }
.vol { display: flex; align-items: center; gap: 6px; width: 140px; }
.vbar { flex: 1; }
.device-note { font-size: .78rem; font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; display: inline-flex; align-items: center; gap: 6px; }
.device-note .i { width: 16px; height: 16px; }

.pop-wrap { position: relative; }
.popover {
  position: absolute; bottom: calc(100% + 12px); right: -40px; z-index: 30;
  width: 290px; padding: 10px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.popover h5 { margin: 4px 8px 10px; font-size: .9rem; }
.dev { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 10px; text-align: left; }
.dev:hover { background: var(--hover); }
.dev .t { font-weight: 600; font-size: .9rem; }
.dev .s { font-size: .76rem; color: var(--muted); }
.dev.active .t, .dev.active .i { color: var(--accent); }
.pop-note { font-size: .78rem; color: var(--faint); padding: 8px 10px 4px; line-height: 1.45; }

/* ---------- Views ---------- */
.greet h1 { font-size: 2.3rem; letter-spacing: -.04em; margin: 8px 0 2px; font-weight: 800; }
.greet p { margin: 0 0 26px; }
.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 0; font-weight: 800; }
.section-head a { font-size: .82rem; font-weight: 700; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tile {
  display: flex; align-items: center; gap: 12px; height: 60px; border-radius: 10px; overflow: hidden;
  background: var(--hover); position: relative; padding-right: 54px; cursor: pointer;
  transition: background .15s;
}
.tile:hover { background: var(--hover-2); }
.tile img, .tile .ph { width: 60px; height: 60px; object-fit: cover; flex: none; }
.tile .t { font-weight: 700; font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.tile .fab { right: 10px; bottom: 12px; width: 36px; height: 36px; }
.tile .fab .i { width: 16px; height: 16px; }
.liked-art { background: linear-gradient(135deg, rgb(var(--accent-rgb)), color-mix(in srgb, rgb(var(--accent-rgb)) 30%, #2a1f5e)); color: #fff; }
.liked-art .i { width: 42%; height: 42%; fill: currentColor; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px 16px; }
.card { padding: 12px; margin: -12px; border-radius: 14px; cursor: pointer; transition: background .2s; min-width: 0; }
.card:hover { background: var(--hover); }
.card-art { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); margin-bottom: 10px; }
.card-art img, .card-art .ph { width: 100%; height: 100%; object-fit: cover; }
.card-art.round { border-radius: 50%; }
.card-t { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-s { font-size: .8rem; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fab {
  position: absolute; right: 10px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s;
}
.fab .i { width: 20px; height: 20px; }
.card:hover .fab, .tile:hover .fab { opacity: 1; transform: none; }
.fab:hover { transform: scale(1.06) !important; }

.hero { display: flex; align-items: flex-end; gap: 26px; margin: 0 0 26px; }
.hero-art { width: 210px; height: 210px; flex: none; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.hero-art.round { border-radius: 50%; }
.hero-art img, .hero-art .ph { width: 100%; height: 100%; object-fit: cover; }
.hero-text { min-width: 0; }
.kicker { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(2rem, 4.6vw, 4.2rem); letter-spacing: -.05em; line-height: 1; margin: 8px 0 12px; font-weight: 800; overflow-wrap: anywhere; }
.hero .desc { color: var(--muted); font-size: .9rem; margin: 0 0 8px; line-height: 1.45; max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero .meta { color: var(--muted); font-size: .88rem; }
.hero .meta b { color: var(--text); }
.actions { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.notice { background: var(--hover); border-radius: 12px; padding: 16px 18px; color: var(--muted); font-size: .9rem; line-height: 1.5; max-width: 640px; }
.notice b { color: var(--text); }

/* Track list */
.tracks { --cols: 40px 44px minmax(0, 1.5fr) minmax(0, 1fr) 76px 52px; }
.tracks.no-art { --cols: 40px minmax(0, 1.5fr) minmax(0, 1fr) 76px 52px; }
body.hide-album-col .tracks { --cols: 40px 44px minmax(0, 1fr) 76px 52px; }
body.hide-album-col .tracks.no-art, .tracks.no-art.no-album { --cols: 40px minmax(0, 1fr) 76px 52px; }
.tracks.no-album { --cols: 40px 44px minmax(0, 1fr) 76px 52px; }
body.hide-album-col .c-album, .tracks.no-album .c-album { display: none; }
.tracks-head, .row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 14px; padding: 0 12px; }
.tracks-head { height: 34px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tracks-head .i { width: 16px; height: 16px; justify-self: end; margin-right: 6px; }
.row { height: var(--row); border-radius: 10px; cursor: default; }
.row:hover { background: var(--hover); }
.row:focus { outline: none; }
.row.disabled { opacity: .4; }
.c-num { position: relative; display: grid; place-items: center; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; height: 100%; }
.c-num .play-btn { display: none; color: var(--text); width: 32px; height: 32px; }
.c-num .play-btn .i { width: 18px; height: 18px; }
.row:hover .c-num .n { display: none; }
.row:hover .c-num .play-btn { display: grid; }
.row.disabled .play-btn { display: none !important; }
.row.disabled .c-num .n { display: inline !important; }
.c-num .eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.c-num .eq i { width: 3px; background: var(--accent); border-radius: 2px; height: 100%; animation: hum .8s ease-in-out infinite alternate; }
.c-num .eq i:nth-child(2) { animation-delay: -.4s; }
.c-num .eq i:nth-child(3) { animation-delay: -.2s; }
body.is-paused .c-num .eq i { animation-play-state: paused; transform: scaleY(.4); }
.row.playing .c-num .n { display: none; }
.row.playing:not(:hover) .c-num .eq { display: flex; }
.row.playing:not(:hover) .c-num .play-btn { display: none; } /* the bars show in place of the button, never under it */
.row.playing .c-title .t { color: var(--accent); }
.c-art, .c-art.ph { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
:root[data-density="compact"] .c-art { width: 34px; height: 34px; }
.c-title { min-width: 0; }
.c-title .t { font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-title .a, .c-album { font-size: .83rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-density="compact"] .c-title { display: flex; gap: 10px; align-items: baseline; }
:root[data-density="compact"] .c-title .t { flex: 0 1 auto; }
.c-title .a a, .c-album a, .np-artist a, .f-artist a { color: inherit; }
.c-title .a a:hover, .c-album a:hover, .np-artist a:hover, .f-artist a:hover { color: var(--text); }
.explicit { display: inline-grid; place-items: center; width: 15px; height: 15px; font-size: .6rem; font-weight: 800; border-radius: 3px; background: var(--muted); color: var(--bg); margin-right: 5px; vertical-align: 1px; }
.c-acts { display: flex; justify-content: flex-end; gap: 0; }
.c-acts .ib { width: 32px; height: 32px; opacity: 0; }
.c-acts .ib .i { width: 18px; height: 18px; }
.row:hover .c-acts .ib, .c-acts .like.on { opacity: 1; }
.c-dur { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; padding-right: 6px; }
.more-wrap { display: flex; justify-content: center; padding: 18px; }

/* Skeleton & errors */
.skel { animation: pulse 1.4s ease-in-out infinite; }
.skel .b { background: var(--hover-2); border-radius: 8px; }
@keyframes pulse { 50% { opacity: .45; } }
.err { max-width: 520px; margin: 60px auto; text-align: center; color: var(--muted); line-height: 1.5; }
.err h3 { color: var(--text); margin-bottom: 6px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.search-hint { color: var(--muted); padding-top: 30px; }
.search-hint h2 { color: var(--text); font-size: 1.6rem; letter-spacing: -.03em; margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--hover); font-weight: 600; font-size: .85rem; }
.chip:hover { background: var(--hover-2); }

/* ---------- Focus mode ---------- */
.focus { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.focus.closing { pointer-events: none; }
@keyframes fadein { from { opacity: 0; } }
.focus-bg { position: absolute; inset: -20%; background: var(--art, none) center/cover; filter: blur(80px) saturate(1.5) brightness(.55); transition: background-image .6s; animation: drift 38s ease-in-out infinite alternate; }
.focus-bg::after { content: ""; position: absolute; inset: 0; background: inherit; opacity: .55; transform: rotate(180deg) scale(1.25); animation: drift2 46s ease-in-out infinite alternate; }
@keyframes drift { 0% { transform: scale(1.1) rotate(0deg) translate(0, 0); } 50% { transform: scale(1.25) rotate(8deg) translate(3%, -2%); } 100% { transform: scale(1.15) rotate(-6deg) translate(-3%, 3%); } }
@keyframes drift2 { 0% { transform: rotate(180deg) scale(1.25) translate(0, 0); } 100% { transform: rotate(200deg) scale(1.45) translate(6%, 4%); } }
:root[data-theme="light"] .focus-bg { filter: blur(70px) saturate(1.3) brightness(1.05); opacity: .55; }
.focus-top { position: absolute; top: 18px; right: 18px; z-index: 3; display: flex; gap: 10px; }
.focus .focus-top .ib { background: rgba(255, 255, 255, .1); opacity: .85; }
.focus .focus-top .ib.on { background: rgba(255, 255, 255, .22); color: #fff; }
:root[data-theme="light"] .focus .focus-top .ib { background: rgba(0, 0, 0, .07); }
.focus-inner { position: relative; display: flex; align-items: center; gap: clamp(28px, 6vw, 90px); padding: 40px; max-width: 1200px; width: 100%; }
.focus-art-wrap { position: relative; flex: none; width: min(46vh, 42vw); aspect-ratio: 1; }
.focus-art { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); background: var(--panel-2); }
.focus-art-wrap .hole { display: none; }
.focus[data-style="vinyl"] .focus-art { border-radius: 50%; animation: spin 14s linear infinite; animation-play-state: paused; box-shadow: 0 0 0 10px #0d0d0f, 0 0 0 11px rgba(255, 255, 255, .06), 0 30px 80px rgba(0, 0, 0, .6); }
body:not(.is-paused) .focus[data-style="vinyl"] .focus-art { animation-play-state: running; }
.focus[data-style="vinyl"] .hole { display: block; position: absolute; left: 50%; top: 50%; width: 9%; height: 9%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .15); }
@keyframes spin { to { transform: rotate(360deg); } }
.focus-meta { flex: 1; min-width: 0; color: #fff; }
:root[data-theme="light"] .focus-meta { color: var(--text); }
.f-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); min-height: 1em; }
.focus-meta h2 { font-size: clamp(2rem, 4.4vw, 4rem); letter-spacing: -.05em; line-height: 1.02; margin: 10px 0 10px; font-weight: 800; overflow-wrap: anywhere; }
.f-artist { font-size: 1.2rem; opacity: .75; margin-bottom: 36px; }
.f-prog { max-width: none; }
.focus .time { color: inherit; opacity: .7; }
.focus .bar::before { background: rgba(255, 255, 255, .2); }
.focus .bar .fill, .focus .bar .knob { background: #fff; }
:root[data-theme="light"] .focus .bar::before { background: rgba(0, 0, 0, .15); }
:root[data-theme="light"] .focus .bar .fill, :root[data-theme="light"] .focus .bar .knob { background: var(--text); }
.f-controls { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.focus .ib { color: inherit; opacity: .8; position: relative; }
.focus .ib:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.focus .ib.on { color: var(--accent); opacity: 1; }
.focus .play-big { background: #fff; color: #111; }
:root[data-theme="light"] .focus .play-big { background: var(--text); color: var(--bg); }
.f-next { margin-top: 34px; font-size: .9rem; opacity: .7; min-height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-next b { opacity: 1; }
@media (max-width: 820px) {
  .focus-inner { flex-direction: column; text-align: center; }
  .focus-art-wrap { width: min(60vw, 40vh); }
  .f-controls { justify-content: center; }
}

/* ---------- Settings ---------- */
.settings {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
}
.settings::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); }
.settings[open] { animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.settings-inner { padding: 6px 26px 26px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--panel); padding: 18px 0 8px; z-index: 1; }
.settings-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.03em; }

/* Main settings window: tabs on the left, one section at a time on the right */
#settings { width: min(880px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); overflow: clip; border-radius: 22px; }
#settings .settings-inner { padding: 0; height: 100%; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 22px 12px; background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; }
.set-nav h2, .set-pane h3 { margin: 0; font-size: 1.35rem; font-weight: 700; line-height: 1.3; letter-spacing: -.03em; }
.set-nav h2 { padding: 0 12px; margin-bottom: 14px; }
.set-tab { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; color: var(--muted); text-align: left; transition: background .15s, color .15s; white-space: nowrap; }
.set-tab .i { width: 19px; height: 19px; flex: none; }
.set-tab:hover { background: var(--hover); color: var(--text); }
.set-tab.on { background: var(--hover-2); color: var(--text); }
.set-tab.on .i { color: var(--accent); }
.set-main { overflow-y: auto; padding: 22px 28px 28px; mask-image: linear-gradient(to bottom, transparent, #000 16px, #000 calc(100% - 16px), transparent); scrollbar-gutter: stable; scroll-behavior: smooth; }
#settings .settings-inner { position: relative; }
.set-main::-webkit-scrollbar { width: 10px; }
.set-main::-webkit-scrollbar-track { background: transparent; margin: 18px 0; }
.set-close { position: absolute; top: 16px; right: 38px; z-index: 2; background: var(--panel-2); }
.set-pane h3 { margin-bottom: 16px; }
.set-pane + .set-pane { margin-top: 38px; }
.set-pane:last-child { min-height: 100%; } /* lets every section scroll up level with "Settings" */
.set-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; margin-bottom: 14px; }
.set-card h4 { margin: 14px 0 2px; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.set-card h4 em { font-style: normal; font-weight: 600; letter-spacing: .06em; color: var(--faint); margin-left: 6px; }
.set-card > .set-row + .set-row, .set-card > .set-row + .keys { border-top: 1px solid var(--line); }
.set-card > h4 + .set-row { border-top: 0; }
.set-card .set-row.sub { border-top: 0; }
.set-card .keys { padding: 12px 0 14px; }
.set-card .btn { white-space: nowrap; }
:root[data-theme="light"] .set-nav { background: var(--bg); }
:root[data-theme="light"] .set-card { background: var(--bg-2); }
@media (max-width: 720px) {
  #settings { height: calc(100vh - 32px); }
  #settings .settings-inner { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .set-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 14px 12px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 6px; scrollbar-width: none; }
  .set-nav h2 { display: none; }
  .set-tab { height: 34px; border-radius: 999px; padding: 0 12px; font-size: .84rem; flex: none; }
  .set-main { padding: 16px 16px 24px; }
  .set-close { top: 64px; right: 20px; }
  .set-card { padding: 2px 14px; }
  .set-row:has(.range-wrap, .seg, .swatches, input[type="text"], input[type="url"], input[type="password"]) { flex-wrap: wrap; }
  .keys { grid-template-columns: 1fr; }
}
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; font-size: .92rem; font-weight: 600; cursor: default; }
.set-row.sub { min-height: 40px; margin-top: -6px; }
.set-row small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.seg { display: inline-flex; background: var(--hover); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; } /* sits on its own option, so selecting it never scrolls anything */
.seg span { display: block; padding: 7px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.swatches { display: flex; align-items: center; gap: 8px; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); transition: transform .12s; }
.swatches button:hover { transform: scale(1.15); }
.swatches button.sel { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--c); }
.swatches input[type="color"] { width: 28px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }
.swatches input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.swatches input[type="color"]::-webkit-color-swatch { border-radius: 50%; border: 2px dashed var(--muted); }
.toggle { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--hover-2); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(18px); background: var(--accent-ink); }
.range-wrap { display: flex; align-items: center; gap: 12px; }
.range-wrap input { accent-color: var(--accent); width: 180px; }
.range-wrap output { font-size: .82rem; color: var(--muted); width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: .86rem; color: var(--muted); padding: 8px 0; }
.keys kbd { color: var(--text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: .88rem; line-height: 1.4;
  box-shadow: var(--shadow); animation: toastin .2s ease; user-select: text;
}
.toast.error { background: #c9473b; color: #fff; }
.toast button { opacity: .7; font-weight: 800; }
.toast button:hover { opacity: 1; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}


/* ---------- Panel tabs ---------- */
.tabs { display: flex; gap: 4px; background: var(--hover); border-radius: 999px; padding: 3px; }
.tab { padding: 6px 14px; border-radius: 999px; font-size: .84rem; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.panel-head { padding-left: 12px; }

/* ---------- Lyrics ---------- */
:root { --ly-mult: 1; --ly-blur: 1; }
:root[data-lysize="s"] { --ly-mult: .82; }
:root[data-lysize="l"] { --ly-mult: 1.2; }
:root[data-lyblur="off"] { --ly-blur: 0; }
.lyrics { position: relative; overflow: hidden; min-height: 0; }
.lyrics.small { flex: 1; padding: 0 18px; --ly-size: calc(1.3rem * var(--ly-mult)); }
.lyrics.big { --ly-size: calc(clamp(1.7rem, 3.1vw, 3rem) * var(--ly-mult)); }
.ly-track { position: relative; padding: 0 0 70vh; }
/* The top/bottom fade is done per line (--f, set from each line's position) instead of a
   CSS mask: a mask on the container made browsers clip each line's glow to its box. */
.ly-line {
  --d: 0; --f: 1; --o: .3;
  position: relative;
  font-size: var(--ly-size); font-weight: 800; line-height: 1.22; letter-spacing: -.025em;
  padding: .32em 0; margin: 0;
  color: inherit; cursor: pointer;
  opacity: calc(var(--o) * var(--f));
  transform-origin: 0 50%;
  transform: translateY(var(--y, 0)) scale(.955);
  filter: blur(calc(var(--ly-blur) * min(var(--d), 5) * .6px));
  text-shadow: 0 0 .45em rgb(255 255 255 / 0);
  transition: transform .9s cubic-bezier(.2, .85, .25, 1), opacity .55s ease, filter .6s ease, text-shadow .6s ease;
  overflow-wrap: anywhere;
}
.ly-t { display: inline; }
.ly-line.past { --o: .2; }
.ly-line.on {
  --o: 1; filter: none;
  transform: translateY(var(--y, 0)) scale(1);
  text-shadow: 0 0 .45em rgb(255 255 255 / .35);
}
:root[data-theme="light"] .ly-line.on { text-shadow: none; }
.lyrics.free .ly-line { filter: none; --o: .5; transition-duration: .35s, .3s, .3s, .3s; }
.lyrics.free .ly-line.on { --o: 1; }
.ly-line:not(.on):hover { --o: .62; filter: none; transition-delay: 0ms !important; }
.ly-line.gap { display: flex; gap: .28em; align-items: center; height: 1.9em; padding: 0; font-size: calc(var(--ly-size) * .9); }
.ly-line.gap span { width: .36em; height: .36em; border-radius: 50%; background: currentColor; opacity: .35; transition: opacity .3s; }
.ly-line.gap.on span { animation: breathe 2.6s ease-in-out infinite; }
.ly-line.gap.on span:nth-child(2) { animation-delay: -.2s; }
.ly-line.gap.on span:nth-child(3) { animation-delay: -.4s; }
@keyframes breathe { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.15); } }
.ly-credit { font-size: .74rem; font-weight: 600; opacity: calc(.45 * var(--f, 1)); transition-property: transform, opacity; padding: 26px 0 0; transform: translate3d(0, var(--y, 0), 0); transition: transform .9s cubic-bezier(.2, .85, .25, 1); }
.ly-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; font-weight: 700; font-size: 1.05rem; opacity: .6; }
.lyrics[data-mode="loading"] .ly-msg { animation: pulse 1.4s ease-in-out infinite; }
.ly-plain { height: 100%; overflow-y: auto; padding: 8px 0 40px; user-select: text; }
.ly-plain p { margin: 0; font-size: calc(var(--ly-size) * .78); font-weight: 700; line-height: 1.5; opacity: .85; }
.ly-note { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.ly-plain::-webkit-scrollbar { width: 8px; }

/* Focus mode with lyrics: art + controls on the left, lyrics on the right */
#f-lyrics { display: none; }
.focus.lyrics-on .focus-inner {
  display: grid; grid-template-columns: minmax(280px, 34vw) minmax(0, 1fr);
  grid-template-rows: auto auto; align-content: center; column-gap: clamp(40px, 6vw, 110px); row-gap: 26px;
  max-width: 1500px; height: 100vh; padding: 60px clamp(28px, 5vw, 80px);
}
.focus.lyrics-on .focus-art-wrap { width: min(34vw, 42vh); grid-column: 1; grid-row: 1; }
.focus.lyrics-on .focus-meta { grid-column: 1; grid-row: 2; width: min(34vw, 42vh); min-width: 280px; }
.focus.lyrics-on .focus-meta h2 { font-size: clamp(1.4rem, 2vw, 2rem); letter-spacing: -.03em; margin: 6px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus.lyrics-on .f-artist { font-size: 1rem; margin-bottom: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus.lyrics-on .f-controls { justify-content: space-between; gap: 8px; }
.focus.lyrics-on .play-big.xl { width: 58px; height: 58px; }
.focus.lyrics-on .f-next { display: none; }
.focus.lyrics-on #f-lyrics { display: block; grid-column: 2; grid-row: 1 / span 2; height: calc(100vh - 120px); align-self: center; color: #fff; }
:root[data-theme="light"] .focus.lyrics-on #f-lyrics { color: var(--text); }
@media (max-width: 900px) {
  .focus.lyrics-on .focus-inner { grid-template-columns: 1fr; }
  .focus.lyrics-on .focus-art-wrap { display: none; }
  .focus.lyrics-on .focus-meta { grid-row: 2; width: 100%; }
  .focus.lyrics-on #f-lyrics { grid-column: 1; grid-row: 1; height: 62vh; }
}

/* ---------- Profile ---------- */
.greet { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.greet .avatar.xl { width: 64px; height: 64px; font-size: 1.6rem; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); transition: transform .15s; }
.greet .avatar.xl:hover { transform: scale(1.05); }
.greet h1 { margin-top: 0; }
.greet p { margin-bottom: 0; }
.avatar { background-size: cover; background-position: center; }
.avatar.lg { width: 44px; height: 44px; font-size: 1.1rem; }
.avatar-edit { display: flex; align-items: center; gap: 10px; }
.text-in { width: 220px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--hover); color: var(--text); font-size: .9rem; font-weight: 600; outline: none; }
.text-in:focus { border-color: var(--accent); }
.text-in::placeholder { color: var(--faint); }
.set-row:has(small) { padding: 8px 0; }

/* ---------- Focus-mode volume ---------- */
.f-vol { display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 2px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.f-vol .vbar { width: 110px; flex: none; }
.focus .f-vol .ib:hover { background: transparent; }
:root[data-theme="light"] .f-vol { background: rgba(0, 0, 0, .07); }

/* ---------- Context menu ---------- */
.ctx {
  position: fixed; z-index: 200; min-width: 220px; max-width: 300px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  animation: ctxin .12s ease-out; font-size: .88rem;
  max-height: 70vh; overflow-y: auto;
}
@keyframes ctxin { from { opacity: 0; transform: scale(.97); } }
.ctx-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; text-align: left; font-weight: 600; color: var(--text); white-space: nowrap; }
.ctx-item .i { width: 18px; height: 18px; color: var(--muted); }
.ctx-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ctx-item:hover, .ctx-item.open { background: var(--hover-2); outline: none; }
.ctx-item:hover .i { color: var(--text); }
.ctx-item.on .i { color: var(--accent); fill: currentColor; }
.ctx-item:disabled { opacity: .45; pointer-events: none; }
.ctx-item .chev { width: 14px; height: 14px; margin-right: -4px; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.ctx-head { padding: 8px 10px 6px; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-sub { position: fixed; max-height: 60vh; overflow-y: auto; }

/* Room around the lyrics so the halo never touches the clipped edge */
.focus.lyrics-on #f-lyrics { margin-left: -90px; padding: 0 90px; }
.lyrics.small { margin: 0 -6px; padding: 0 24px; }

/* ---------- Focus title actions ---------- */
.f-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.f-title-row h2 { min-width: 0; flex: 0 1 auto; }
.f-acts { display: flex; gap: 2px; flex: none; opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.f-title-row:hover .f-acts { opacity: 1; transform: none; }
.f-acts .like.on { opacity: 1; }
.focus .f-acts .ib { width: 40px; height: 40px; }
.focus .f-acts .ib .i { width: 24px; height: 24px; }
.focus.lyrics-on .f-acts .ib { width: 34px; height: 34px; }
.focus.lyrics-on .f-acts .ib .i { width: 20px; height: 20px; }

/* ---------- Recent searches ---------- */
.recent-head { display: flex; align-items: baseline; gap: 14px; margin-top: 26px; }
.recent-head h3 { margin: 0; font-size: 1rem; color: var(--text); }
.linkbtn { font-size: .82rem; font-weight: 700; color: var(--muted); }
.linkbtn:hover { color: var(--text); text-decoration: underline; }
.chips { margin-top: 12px; }
.chip { display: inline-flex; align-items: center; padding: 0; overflow: hidden; }
.chip-q { padding: 8px 4px 8px 14px; font-weight: 600; font-size: .85rem; }
.chip-x { display: grid; place-items: center; width: 28px; height: 32px; padding-right: 4px; color: var(--faint); }
.chip-x .i { width: 14px; height: 14px; }
.chip-x:hover { color: var(--text); }

/* ---------- Library header, filters, pins ---------- */
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 6px 12px; }
.side-head .side-label { padding: 0; }
.ib.sm { width: 30px; height: 30px; }
.ib.sm .i { width: 18px; height: 18px; }
.pl-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 10px; }
.pl-filter button { padding: 5px 11px; border-radius: 999px; background: var(--hover); font-size: .78rem; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.pl-filter button:hover { color: var(--text); background: var(--hover-2); }
.pl-filter button.on { background: var(--text); color: var(--bg); }
.side-pl .pin-mark { width: 14px; height: 14px; color: var(--accent); margin-left: auto; flex: none; }
.side-pl .shared-mark { width: 14px; height: 14px; color: var(--muted); margin-left: auto; flex: none; }
.side-pl.album img, .side-pl.album .ph { border-radius: 7px; }
.side-pl.artist img, .side-pl.artist .ph { border-radius: 50%; }
.side-sep { height: 1px; background: var(--line); margin: 6px 10px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--hover-2); color: var(--text); font-size: .74rem; font-weight: 700; vertical-align: 2px; }
.badge .i { width: 13px; height: 13px; }
.adder { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; margin-right: 6px; vertical-align: -4px; background: var(--panel-2) center/cover; color: var(--text); font-size: .6rem; font-weight: 800; box-shadow: 0 0 0 1.5px var(--bg-2); }
.adder.other { background-color: color-mix(in srgb, rgb(var(--accent-rgb)) 35%, var(--panel-2)); }
.card.track-card .card-art { border-radius: 10px; }
.pin-corner { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; }
.pin-corner .i { width: 13px; height: 13px; }

/* ---------- Small dialogs ---------- */
.small-dlg { width: min(460px, calc(100vw - 32px)); }
.field { display: grid; gap: 6px; margin: 10px 0 14px; font-size: .86rem; font-weight: 700; }
.field i { font-style: normal; font-weight: 500; color: var(--muted); }
.text-in.wide { width: 100%; height: 42px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- Toast action ---------- */
.toast .t-act { opacity: 1; padding: 5px 12px; border-radius: 999px; background: rgb(0 0 0 / .14); font-weight: 800; white-space: nowrap; }
.toast.error .t-act { background: rgb(255 255 255 / .2); }

.confirm-text { color: var(--muted); font-size: .92rem; line-height: 1.55; margin: 0 0 6px; }
.confirm-text b { color: var(--text); }
.btn.danger { background: #d2483b; color: #fff; }
.btn.danger:hover { filter: brightness(1.1); }
.ib.danger-hover:hover { color: #ff6b5e; }

/* ---------- Playlist covers ---------- */
.cover-pick { display: flex; align-items: center; gap: 10px; }
.cover-prev { width: 64px; height: 64px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2) center/cover; color: var(--faint); flex: none; }
.cover-prev.has .i { display: none; }
.hero-art.editable { position: relative; cursor: pointer; }
.hero-art .cover-edit { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: .92rem; opacity: 0; transition: opacity .2s; }
.hero-art .cover-edit .i { width: 34px; height: 34px; }
.hero-art.editable:hover .cover-edit { opacity: 1; }
.hero-art.uploading::after { content: "Uploading…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; }
.new-pl-btn { margin-left: 12px; }

/* ---------- Sort toggles & focus device picker ---------- */
.side-head-acts { display: flex; align-items: center; gap: 2px; }
.sort-btn { height: 26px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; color: var(--muted); }
.sort-btn:hover { background: var(--hover); color: var(--text); }
.popover.down { bottom: auto; top: calc(100% + 10px); right: 0; }
.focus .popover { text-align: left; color: var(--text); }
.focus .dev .i { color: var(--muted); }
.focus .dev.active .i { color: var(--accent); }
.greet .seg { margin-left: auto; align-self: center; }
.seg button { display: block; padding: 7px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- Smart radio ---------- */
.radio-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 8px 2px; padding: 9px 12px; border-radius: 10px; background: rgb(var(--accent-rgb) / .14); font-size: .8rem; color: var(--muted); }
.radio-head span { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-head b { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.radio-head .i { width: 16px; height: 16px; color: var(--accent); flex: none; }
.sugg { display: inline-grid; place-items: center; margin-right: 5px; vertical-align: -2px; color: var(--accent); }
.sugg .i { width: 13px; height: 13px; }
.lf-status { margin-top: 4px; color: var(--text) !important; font-weight: 600 !important; }

/* ---------- Artists page ---------- */
.view-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; align-self: center; flex-wrap: wrap; justify-content: flex-end; }
.seg.icons button { display: grid; place-items: center; padding: 6px 10px; }
.seg.icons .i { width: 18px; height: 18px; }
.artist-list { display: grid; gap: 2px; }
.artist-row { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.artist-row:hover { background: var(--hover); }
.artist-row .av { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.artist-row .av img, .artist-row .av .ph { width: 100%; height: 100%; object-fit: cover; }
.artist-row .t { font-weight: 700; font-size: .95rem; }
.artist-row .s { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.artist-row .grow { flex: 1; min-width: 0; }
.artist-row .row-play { opacity: 0; }
.artist-row:hover .row-play { opacity: 1; }
.btn.follow { height: 34px; padding: 0 16px; border: 1px solid var(--line); background: transparent; }
.btn.follow:hover { border-color: var(--text); }
.btn.follow.on { border-color: var(--line); color: var(--muted); }
.btn.follow.on:hover { color: var(--text); }
.btn.follow.lg { height: 40px; padding: 0 20px; border-color: var(--muted); }
.mini-play { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.mini-play .i { width: 16px; height: 16px; }

.search-sec { margin-top: 34px; }
.mfy-note { color: var(--muted); font-size: .86rem; line-height: 1.5; max-width: 680px; margin: 18px 0 0; }
.notice .mfy-note { margin: 0; }
.mfy-note b { color: var(--text); }

.artist-row .av.sq { border-radius: 8px; }
.page-filter { padding: 0 0 18px; margin-top: -10px; }
.view-tools .btn .i { width: 16px; height: 16px; }

/* Round (artist) cards: clip only the photo, so the play button isn't cut off by the circle */
.card-art.round { border-radius: 0; overflow: visible; box-shadow: none; }
.card-art.round > img, .card-art.round > .ph { border-radius: 50%; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.card-art.round .fab { right: 4%; bottom: 4%; }

.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -6px 0 20px; }
.page-toolbar .page-filter { padding: 0; margin: 0; }

.mfy-status { color: var(--faint); font-size: .8rem; margin: -6px 0 14px; }

/* ---------- Focus mode layout refinements ---------- */
.focus-art-wrap { cursor: pointer; }
.focus-art { transition: border-radius .45s cubic-bezier(.2, .85, .25, 1), box-shadow .45s ease; }
/* Without lyrics: art + details centred as a pair; controls spread across the progress bar */
.focus:not(.lyrics-on) .focus-inner { justify-content: center; }
.focus:not(.lyrics-on) .focus-meta { flex: 0 1 560px; }
.focus:not(.lyrics-on) .f-controls { justify-content: space-between; gap: 8px; margin-top: 26px; }
.focus:not(.lyrics-on) .f-prog { margin-top: 6px; }
.focus:not(.lyrics-on) .f-next { text-align: center; margin-top: 30px; }
/* With lyrics: keep the artwork and details together, centred vertically */
.focus.lyrics-on .focus-inner { grid-template-rows: 1fr auto auto 1fr; row-gap: 0; align-content: stretch; }
.focus.lyrics-on .focus-art-wrap { grid-row: 2; }
.focus.lyrics-on .focus-meta { grid-row: 3; margin-top: 28px; }
.focus.lyrics-on #f-lyrics { grid-row: 1 / 5; }
@media (max-width: 900px) {
  .focus.lyrics-on .focus-inner { grid-template-rows: 1fr auto; }
  .focus.lyrics-on #f-lyrics { grid-row: 1; }
  .focus.lyrics-on .focus-meta { grid-row: 2; margin-top: 16px; }
}

/* Focus mode: controls fade away when the mouse is idle */
.focus .focus-top { opacity: 0; transform: translateY(-6px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.focus.awake .focus-top { opacity: 1; transform: none; pointer-events: auto; transition-duration: .2s; }
.focus:not(.awake) { cursor: none; }

/* Focus mode, 10 s idle without lyrics: only the artwork, glided to the centre.
   The details only fade (they keep their space), so nothing reflows. */
/* Waking: the disc travels back first, then the info fades in once it's mostly home. */
.focus:not(.lyrics-on) .focus-meta { transition: opacity .6s ease .75s; }
.focus:not(.lyrics-on) .focus-art-wrap { transition: transform 1.43s cubic-bezier(.22, .8, .25, 1) 0s; }
/* Going idle: the info fades out quickly, then the disc glides to the centre. */
.focus.deep-idle:not(.lyrics-on) .focus-meta { opacity: 0; pointer-events: none; transition: opacity .3s ease 0s; }
.focus.deep-idle:not(.lyrics-on) .focus-art-wrap { transition-delay: .3s; }
.focus.deep-idle:not(.lyrics-on) .focus-art-wrap { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--grow, 1.15)); }

.ly-none { display: grid; gap: 16px; justify-items: center; }
.ly-genius { opacity: 1; font-size: .88rem; background: rgb(255 255 255 / .12); color: inherit; }
.ly-genius:hover { background: rgb(255 255 255 / .2); }
:root[data-theme="light"] .lyrics.small .ly-genius { background: var(--hover-2); }
.lyrics[data-mode="msg"] .ly-msg { opacity: 1; }
.lyrics[data-mode="msg"] .ly-none > div:first-child { opacity: .6; }

/* Plain (unsynced) lyrics: no scrollbar; soft fades show there's more above/below */
.ly-plain { scrollbar-width: none; --ft: 0px; --fb: 90px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--ft), #000 calc(100% - var(--fb)), transparent 100%); }
.ly-plain::-webkit-scrollbar { display: none; width: 0; }

/* Page transitions: the old page fades out quickly; the new one rises in, section by section */
#view > * { transition: opacity .16s ease; }
#view.page-leave > * { opacity: 0; }
#view.page-enter > * { animation: page-in .46s cubic-bezier(.2, .75, .2, 1) backwards; }
#view.page-enter > :nth-child(2) { animation-delay: .05s; }
#view.page-enter > :nth-child(3) { animation-delay: .1s; }
#view.page-enter > :nth-child(4) { animation-delay: .14s; }
#view.page-enter > :nth-child(n+5) { animation-delay: .18s; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  #view.page-enter > * { animation: none; }
  #view > * { transition: none; }
}

/* Same slim scrollbar as the Home page, in the settings pop-up (and the other dialogs) */
.settings::-webkit-scrollbar { width: 10px; }
.settings::-webkit-scrollbar-track { background: transparent; margin: 18px 0; } /* starts and ends clear of the rounded corners */

/* Capsule */
.cap-head { align-items: flex-end; flex-wrap: wrap; }
.cap-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; background: var(--hover); border-radius: 999px; padding: 4px; }
.cap-nav .ib { width: 34px; height: 34px; }
.cap-nav .ib[disabled] { opacity: .3; pointer-events: none; }
.cap-nav .i.flip { transform: scaleX(-1); }
.cap-month { min-width: 150px; text-align: center; font-weight: 700; letter-spacing: -.01em; }
.cap-hero { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.cap-stat { flex: 1 1 130px; background: var(--hover); border-radius: 16px; padding: 16px 18px; display: grid; gap: 2px; align-content: center; }
.cap-stat b { font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.cap-stat span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.cap-stat.wide { flex: 2 1 220px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 38%, transparent), var(--hover)); }
.cap-stat.wide b { font-size: 1.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-plays { white-space: nowrap; font-size: .82rem; color: var(--muted); font-weight: 600; text-align: right; }
.cap-rank { position: absolute; left: 8px; top: 8px; z-index: 2; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: rgb(0 0 0 / .62); color: #fff; backdrop-filter: blur(6px); }
.cap-note { margin: 28px 0 8px; font-size: .84rem; max-width: 60ch; }
.cap-stat b { white-space: nowrap; font-size: 1.7rem; }
.cap-artists { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.row-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-btns .text-in { width: 170px; }

/* One button for the queue/lyrics panel: it is the panel's close X when open, and morphs into a panel icon when closed */
.panel-toggle { position: absolute; top: 22px; right: 20px; z-index: 6; display: grid; place-items: center; transition: background .25s, backdrop-filter .25s; }
.panel-toggle .tg { grid-area: 1 / 1; transition: opacity .22s ease, transform .32s cubic-bezier(.2, .75, .2, 1); }
.panel-toggle .tg-open { opacity: 0; transform: rotate(-80deg) scale(.5); }
.app.no-queue .panel-toggle .tg-close { opacity: 0; transform: rotate(80deg) scale(.5); }
.app.no-queue .panel-toggle .tg-open { opacity: 1; transform: none; }
.app.no-queue .panel-toggle { background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); }
.app.no-queue .topbar { padding-right: 60px; }
@media (max-width: 1100px) {
  .panel-toggle .tg-close { opacity: 0; transform: rotate(80deg) scale(.5); }
  .panel-toggle .tg-open { opacity: 1; transform: none; }
  .panel-toggle { background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); }
  .app .topbar { padding-right: 60px; }
}
.topbar .ib.round.on { background: var(--accent); color: var(--accent-ink); }
.panel-head { padding-right: 60px; }

.cap-refresh { margin-left: auto; align-self: flex-end; height: 42px; padding: 0 20px; border-radius: 999px; box-sizing: border-box; }
.cap-refresh + .cap-nav { margin-left: -10px; }
.cap-refresh .i { width: 16px; height: 16px; }
.cap-refresh.spin .i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cap-songs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cap-songs .card-art { position: relative; }

/* Small-tile view on full pages */
.tile .grow { min-width: 0; flex: 1; }
.tile .s { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tile.round img, .tile.round .ph { border-radius: 50%; width: 46px; height: 46px; margin-left: 7px; }

.sec-tools { display: flex; align-items: center; gap: 10px; }
.sec-tools .seg.icons button { padding: 5px 9px; }
.tile-rank { flex: none; width: 24px; margin-left: 12px; margin-right: -4px; text-align: center; font-weight: 800; font-size: .85rem; color: var(--muted); }
.artist-row .rk { flex: none; width: 22px; text-align: center; font-weight: 800; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.artist-row .av.sq { border-radius: 8px; }

.login-id { text-align: left; margin: 0 0 20px; }
.login-id label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.login-id input { width: 100%; box-sizing: border-box; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--hover); color: var(--text); padding: 0 12px; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.login-id input:focus { box-shadow: 0 0 0 2px var(--accent); }
.login-how { margin-top: 10px; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.login-how summary { cursor: pointer; font-weight: 600; }
.login-how ol { margin: 8px 0 0; padding-left: 20px; }
.login-how li { margin: 4px 0; }
.login-how code { user-select: all; background: var(--hover-2); padding: 2px 6px; border-radius: 6px; font-size: .8rem; color: var(--text); }
.login-link { font-size: .82rem; color: var(--muted); cursor: pointer; text-decoration: underline; }
.login-link:hover { color: var(--text); }

/* Focus mode: single lyric line under the zoomed artwork */
.f-line { position: absolute; left: 0; right: 0; top: var(--line-top, 80vh); height: 3em; pointer-events: none; z-index: 2;
  font-size: clamp(.68rem, 1.15vw, 1.05rem); font-weight: 600; letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .4s ease; }
:root[data-theme="light"] .f-line { color: var(--text); text-shadow: none; }
.focus.line-on.has-line.deep-idle:not(.lyrics-on) .f-line { opacity: 1; transition: opacity .8s ease 1.1s; }
.f-line .fl { position: absolute; left: 50%; top: -32px; padding: 32px 48px; max-width: calc(86vw + 96px); /* room for the soft shadow, so it never gets cut into a box */ transform: translateX(-50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.f-line .fl.in { animation: fl-in .38s cubic-bezier(.2, .8, .2, 1) both; }
.f-line .fl.out { animation: fl-out .26s ease both; }
@keyframes fl-in { from { opacity: 0; filter: blur(6px); transform: translate(-50%, 10px); } to { opacity: 1; filter: blur(0); transform: translate(-50%, 0); } }
@keyframes fl-out { from { opacity: 1; filter: blur(0); transform: translate(-50%, 0); } to { opacity: 0; filter: blur(8px); transform: translate(-50%, -10px); } }
@media (prefers-reduced-motion: reduce) { .f-line .fl.in, .f-line .fl.out { animation-duration: .01s; } }

/* Normal focus mode: song title at most 3 lines, then an ellipsis */
.focus:not(.lyrics-on) .focus-meta h2 { line-height: 1.08; padding-bottom: .14em; margin-bottom: calc(10px - .14em); } /* trimmed to 3 lines by fitTitle() */

/* Grain (dither) over the blurred artwork backgrounds: breaks up colour banding in smooth gradients */
:root { --grain: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR type='linear' slope='3.2' intercept='-1.1'/><feFuncG type='linear' slope='3.2' intercept='-1.1'/><feFuncB type='linear' slope='3.2' intercept='-1.1'/><feFuncA type='linear' slope='0' intercept='1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.focus-grain, .app-grain { position: absolute; inset: 0; pointer-events: none; background-image: var(--grain); background-size: 200px 200px; }
.focus-grain { opacity: .06; }
.app-grain { z-index: -1; opacity: .045; }
:root[data-theme="light"] .focus-grain, :root[data-theme="light"] .app-grain { opacity: .035; }

/* Record change in idle / lyric-line full screen */
.disc-ghost { position: absolute; inset: 0; pointer-events: none; }
.disc-ghost .focus-art { width: 100%; height: 100%; }

/* Loading ring on the play button while Spotify catches up with a quick skip */
.js-play { position: relative; }
body.buffering .js-play::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--accent); border-right-color: var(--accent); animation: spin .8s linear infinite; pointer-events: none; }

/* Artist discography filter */
.disc-box[data-f="albums"] [data-kind="ep"], .disc-box[data-f="eps"] [data-kind="album"] { display: none !important; }
.actions .grow { flex: 1; }
/* Song name links to its album */
#np-title a, #f-title a { color: inherit; text-decoration: none; cursor: pointer; }
#np-title a:hover, #f-title a:hover { text-decoration: underline; text-underline-offset: .12em; text-decoration-thickness: from-font; }

/* Drag and drop */
.q-item .q-grip { flex: none; width: 26px; height: 30px; opacity: 0; transition: opacity .15s; color: var(--muted); cursor: grab; touch-action: none; }
.q-item .q-grip .i { width: 16px; height: 16px; }
.q-item:hover .q-grip { opacity: 1; }
.drag-shift { transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.drag-lift { position: relative; z-index: 20; background: var(--panel-2, var(--hover-2)) !important; box-shadow: 0 14px 34px rgba(0,0,0,.45); border-radius: 10px; cursor: grabbing; will-change: transform; }
body.dragging-item, body.dragging-item * { cursor: grabbing !important; user-select: none !important; }
[data-list-box] .row { touch-action: pan-y; }

/* Carrying a song to the queue or a playlist */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; background: var(--panel-2, #222); color: var(--text); box-shadow: 0 16px 40px rgba(0,0,0,.5); max-width: 280px; transition: box-shadow .15s, outline-color .15s; outline: 2px solid transparent; }
.drag-ghost img, .drag-ghost .ph { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.drag-ghost .sc-text, .f-upnext .sc-text { min-width: 0; flex: 1; } /* lets long titles end in … */
.drag-ghost .t { font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drag-ghost .a { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drag-ghost.ok { outline-color: var(--accent); }
.drag-slot { opacity: .35; background: var(--hover-2) !important; border-radius: 10px; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.drag-slot > * { visibility: hidden; }
.drop-on { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent) !important; }
.side-pl.drop-on { outline-offset: 0; }

/* All three panels: lists scroll right to the panel's bottom edge and fade out the same way there */
.side-playlists, .view, .queue { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }


/* ---------- Scrollbars: hidden until you scroll ----------
   Every scroll area keeps its slim bar, but the thumb is see-through until
   that area scrolls (app.js adds .sb-on), then fades out again shortly after. */
@property --sb { syntax: '<color>'; inherits: true; initial-value: transparent; }
* { --sb: transparent; transition: --sb .45s ease; }
.sb-on { --sb: color-mix(in srgb, var(--text) 24%, transparent); transition: --sb .12s ease; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--sb); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 34%, transparent); background-clip: padding-box; }

/* Full screen: "Up next" — a slim pill at the top left for the last 10 s of a song. The round art
   (a nod to the vinyl) has a thin ring that fills as the song runs out; hover it to skip ahead. */
.f-upnext { --un-p: 0; position: absolute; top: 24px; left: 24px; z-index: 4; display: flex; align-items: center; gap: 12px; max-width: min(340px, calc(100vw - 48px)); padding: 6px 20px 6px 6px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; background: color-mix(in srgb, var(--bg) 52%, transparent); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 12px 36px rgba(0, 0, 0, .28); color: var(--text); text-align: left; cursor: pointer; opacity: 0; transform: translateX(-28px); filter: blur(6px); pointer-events: none; }
:root[data-theme="light"] .f-upnext { border-color: rgba(0, 0, 0, .07); background: color-mix(in srgb, var(--panel) 70%, transparent); box-shadow: 0 12px 30px rgba(60, 40, 20, .14); }
.f-upnext.in { transition-delay: 0s; opacity: 1; transform: none; filter: none; pointer-events: auto; transition: opacity .7s ease, transform .9s cubic-bezier(.22, 1, .36, 1), filter .7s ease; }
.f-upnext.out { opacity: 0; transform: translateY(-10px); filter: blur(4px); transition: opacity .6s ease, transform .6s ease, filter .6s ease; }
.f-upnext .un-art { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; }
.f-upnext .un-art img, .f-upnext .un-art .ph { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.f-upnext .un-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.f-upnext .un-ring circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--un-p) * 100); transition: stroke-dashoffset .25s linear; }
.f-upnext .un-skip { position: absolute; inset: 5px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; opacity: 0; transition: opacity .2s; }
.f-upnext .un-skip .i { width: 16px; height: 16px; fill: currentColor; }
.f-upnext:hover .un-skip { opacity: 1; }
.f-upnext .un-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.f-upnext .un-k { font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.f-upnext .t { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-upnext .a { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Playlists Hum can't read (other people's): what Spotify queued last time, and why */
.pl-banner { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 18px; padding: 14px 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--hover)); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); font-size: .88rem; line-height: 1.5; max-width: 760px; }
.pl-banner > .i { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.pl-banner b { display: block; color: var(--text); font-size: .92rem; margin-bottom: 2px; }
.pl-banner span { color: var(--muted); }

/* Narrow or portrait windows: the queue / lyrics panel slides in over the right side of the page (same height as
   the page), and slides back out. The library and page stay where they are underneath. */
@media (max-width: 1100px) {
  .app.panel-over .queue-panel { display: flex; grid-area: main; justify-self: end; width: min(var(--queue-w), calc(100% - 24px)); z-index: 5;
    background: color-mix(in srgb, var(--bg-2) max(var(--panel-op, 86%), 94%), transparent); backdrop-filter: blur(24px);
    box-shadow: -18px 0 50px rgba(0, 0, 0, .45), inset 1px 0 0 var(--line); animation: panelIn .42s cubic-bezier(.2, .8, .2, 1); }
  .app.panel-over.panel-leaving .queue-panel { animation: panelOut .3s cubic-bezier(.4, 0, .9, .6) forwards; }
  .app.panel-over .panel-toggle .tg-close { opacity: 1; transform: none; }
  .app.panel-over .panel-toggle .tg-open { opacity: 0; transform: rotate(-80deg) scale(.5); }
  .app.panel-over.panel-leaving .panel-toggle .tg-close { opacity: 0; transform: rotate(80deg) scale(.5); }
  .app.panel-over.panel-leaving .panel-toggle .tg-open { opacity: 1; transform: none; }
}
@keyframes panelIn { from { transform: translateX(calc(100% + 16px)); } }
@keyframes panelOut { to { transform: translateX(calc(100% + 16px)); } }

/* Full screen in a portrait window: artwork on top, player underneath, everything the same size as in landscape
   (sizes use the screen's short / long side, which is what height / width are in landscape) */
@media (orientation: portrait) {
  .focus:not(.lyrics-on) .focus-inner { flex-direction: column; align-items: center; text-align: left; gap: clamp(28px, 4vmin, 48px); }
  .focus:not(.lyrics-on) .focus-art-wrap { width: min(46vmin, 42vmax); }
  .focus:not(.lyrics-on) .focus-meta { flex: none; width: min(560px, 90vw); } /* same width as in landscape */
  .focus:not(.lyrics-on) .focus-meta h2 { font-size: clamp(2rem, 4.4vmax, 4rem); }
  .focus:not(.lyrics-on) .f-title-row { justify-content: flex-start; }
}
/* Full lyrics in portrait: the same two columns as landscape. Art and player shrink into a left column (at the size
   they have in landscape, or less if the screen is too narrow) and the lyrics sit beside them, not over them. */
@media (orientation: portrait) and (min-width: 901px) {
  .focus.lyrics-on .focus-inner { --lcol: min(42vmin, 34vmax, 44vw); grid-template-columns: var(--lcol) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 80px); padding: 60px clamp(24px, 4vw, 60px); }
  .focus.lyrics-on .focus-art-wrap, .focus.lyrics-on .focus-meta { width: var(--lcol); min-width: 0; }
  .focus.lyrics-on .focus-meta h2 { font-size: clamp(1.4rem, 2vmax, 2rem); }
  .focus.lyrics-on #f-lyrics { margin-left: -40px; padding: 0 40px; }
}
}

/* Full screen (player and lyrics): the song title always stays on one line and ends in "…" when it's too long */
.focus .f-title-row { min-width: 0; }
.focus .focus-meta h2 { flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; padding-bottom: .14em; line-height: 1.08; }
.focus .focus-meta h2 a { display: inline; }

.pl-banner-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Settings > Changelog */
.changelog { display: grid; gap: 14px; }
.cl-rel { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px 12px; }
.cl-rel header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.cl-v { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cl-rel header b { font-size: .95rem; }
.cl-d { margin-left: auto; font-size: .78rem; color: var(--muted); }
.cl-badge { align-self: center; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.cl-badge.cur { background: var(--hover-2); color: var(--text); }
.cl-rel.hl { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--panel-2)); }
.cl-rel.hl .cl-v { color: var(--accent); }
.cl-k { margin: 10px 0 2px; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cl-rel ul { margin: 0; padding-left: 18px; font-size: .86rem; line-height: 1.5; color: var(--text); }
.cl-rel li { margin: 2px 0; }
.cl-rel li::marker { color: var(--faint); }
:root[data-theme="light"] .cl-rel { background: var(--bg-2); }
