:root {
  --bg: #ffffff; --fg: #141414; --muted: #6b6b6b; --line: #dcdcdc;
  --wave: #c9c9c9; --wave-played: #141414; --wave-hover: #8a8a8a;
  --accent: #141414; --accent-fg: #ffffff;
}
.theme-dark {
  --bg: #161616; --fg: #f2f2f2; --muted: #a0a0a0; --line: #2c2c2c;
  --wave: #4a4a4a; --wave-played: #f2f2f2; --wave-hover: #8a8a8a;
  --accent: #f2f2f2; --accent-fg: #141414;
}
@media (prefers-color-scheme: dark) {
  .theme-auto {
    --bg: #161616; --fg: #f2f2f2; --muted: #a0a0a0; --line: #2c2c2c;
    --wave: #4a4a4a; --wave-played: #f2f2f2; --wave-hover: #8a8a8a;
    --accent: #f2f2f2; --accent-fg: #141414;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: transparent; }
body {
  font: 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
}
.card {
  display: grid; grid-template-columns: 168px 1fr; height: 170px; max-width: 700px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.cover { width: 168px; height: 168px; background: var(--line); }
.cover img, .cover-blank { display: block; width: 100%; height: 100%; object-fit: cover; }
.body { min-width: 0; padding: 14px 16px 14px 18px; display: flex; flex-direction: column; justify-content: space-between; }
header { display: flex; align-items: flex-start; gap: 12px; }
.titles { min-width: 0; flex: 1; }
h1 { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 700; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.artist { margin: 3px 0 0; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; align-items: center; gap: 12px; flex: none; }
a.cover, a.titles { color: inherit; text-decoration: none; }
a.cover img { transition: opacity .15s; }
a.cover:hover img { opacity: .88; }
a.titles:hover h1 { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.artist { display: flex; min-width: 0; }
.artist .by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
a.cover:focus-visible, a.titles:focus-visible, .mark:focus-visible, .play:focus-visible, .wave:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.mark {
  display: block; width: 38px; height: 26px; background: var(--fg); opacity: .8;
  -webkit-mask: url(/static/logo.svg) center / contain no-repeat; mask: url(/static/logo.svg) center / contain no-repeat;
}
.mark:hover { opacity: 1; }
.transport { display: flex; align-items: center; gap: 14px; }
.play {
  flex: none; width: 50px; height: 50px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-fg); display: grid; place-items: center;
}
.play svg { width: 24px; height: 24px; fill: currentColor; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: inline; }
.play.loading { opacity: .7; }
.wave { flex: 1; min-width: 0; height: 52px; cursor: pointer; position: relative; touch-action: none; }
.wave canvas { width: 100%; height: 100%; display: block; }
.time { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.locked { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.lock-label { color: var(--muted); font-size: 14px; }
.countdown { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

@media (max-width: 520px) {
  .card { grid-template-columns: 110px 1fr; }
  .cover { width: 110px; height: 168px; }
  .body { padding: 12px; }
  h1 { font-size: 16px; }
  .artist { font-size: 13px; }
  .time { display: none; }
  .play { width: 44px; height: 44px; }
  .mark { width: 30px; height: 20px; }
}
@media (max-width: 380px) {
  .actions .mark { display: none; }
}
.card.unavailable { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.card.unavailable .mark { width: 44px; height: 30px; }
.card.unavailable p { margin: 0; font-size: 15px; }

/* ---- albums (scoped: nothing here applies to a single's .card) ---- */
.card.album { display: block; height: auto; }
.album .top { display: grid; grid-template-columns: 168px 1fr; height: 168px; }
.album h1 { -webkit-line-clamp: 1; }
.album .body { padding: 12px 16px 12px 18px; }
.album .now { margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album .now .n { font-variant-numeric: tabular-nums; }
.album .now .t { color: var(--fg); font-weight: 600; }
.album .transport { gap: 8px; }
.album .play { width: 44px; height: 44px; }
.album .play svg { width: 22px; height: 22px; }
.skip { flex: none; width: 30px; height: 30px; border: 0; padding: 0; background: none; color: var(--fg); cursor: pointer; opacity: .75; display: grid; place-items: center; border-radius: 50%; }
.skip:hover { opacity: 1; }
.skip:disabled { opacity: .25; cursor: default; }
.skip svg { width: 18px; height: 18px; fill: currentColor; }
.skip:focus-visible, .row:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.album .wave { height: 44px; margin-left: 6px; }
.list { list-style: none; margin: 0; padding: 6px 0; border-top: 1px solid var(--line); overflow-y: auto; height: 252px; }
.rows-1 .list { height: 52px; } .rows-2 .list { height: 92px; } .rows-3 .list { height: 132px; }
.rows-4 .list { height: 172px; } .rows-5 .list { height: 212px; } .rows-6 .list { height: 252px; }
.row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; width: 100%; height: 40px;
  padding: 0 18px 0 14px; border: 0; background: none; color: var(--fg); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.row:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
.row:disabled { cursor: default; color: var(--muted); }
.row:disabled:hover { background: none; }
.row .n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .ta { color: var(--muted); margin-left: 6px; font-size: 13px; }
.row .d { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row.current { font-weight: 700; }
.row.current .n { color: var(--fg); }
.row.playing .n { font-size: 0; }
.row.playing .n::after { content: "▶"; font-size: 10px; color: var(--fg); }
@media (max-width: 520px) {
  .album .top { grid-template-columns: 110px 1fr; }
  .album .skip { display: none; }
  .album .wave { margin-left: 0; }
}
