/* ---------- 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); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.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) 86%, transparent);
  border-radius: var(--radius);
  min-height: 0; overflow: hidden;
}
:root[data-artwash="off"] .app > aside, :root[data-artwash="off"] .app > main { background: var(--bg-2); }

/* Sidebar */
.sidebar { grid-area: side; display: flex; flex-direction: column; padding: 14px 10px 10px; }
.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; }
.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); }
.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-thumb, .side-playlists::-webkit-scrollbar-thumb, .queue::-webkit-scrollbar-thumb { background: var(--hover-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* 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-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, .q-item .q-rm:focus-visible { 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, .fab:focus-visible { 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, .row:focus-within { background: var(--hover); }
.row:focus { outline: none; background: var(--hover-2); }
.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, .row:focus-within .c-num .n { display: none; }
.row:hover .c-num .play-btn, .row:focus-within .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 .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, .row:focus-within .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; animation: fadein .25s ease; }
@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; }
.set-group { padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.set-group:last-child { border-bottom: 0; }
.set-group h4 { margin: 12px 0 6px; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.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 { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.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); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }
.ly-plain::-webkit-scrollbar-thumb { background: rgb(128 128 128 / .3); border-radius: 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, .ctx-item:focus-visible { 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, .f-acts:focus-within { 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, .hero-art .cover-edit:focus-visible { 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 */
.settings::-webkit-scrollbar-thumb { background: var(--hover-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* 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 { outline: 2px solid var(--accent); outline-offset: 1px; }
.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: 0; max-width: 86vw; transform: translateX(-50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.f-line .fl.in { animation: fl-in .6s cubic-bezier(.2, .8, .2, 1) both; }
.f-line .fl.out { animation: fl-out .55s ease both; }
@keyframes fl-in { from { opacity: 0; filter: blur(10px); transform: translate(-50%, 14px); } 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(12px); transform: translate(-50%, -12px); } }
@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 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.08; padding-bottom: .12em; margin-bottom: calc(10px - .12em); }

/* 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; }
