:root {
  --bg: #f3f2ef;
  --ink: #141414;
  --muted: #6b6965;
  --line: rgba(20, 20, 20, 0.08);
  --glass: rgba(255, 255, 255, 0.55);
  /* clear frosted glass used on every control */
  --frost: rgba(255, 255, 255, 0.55);
  --frost-hover: rgba(255, 255, 255, 0.85);
  --frost-edge: rgba(255, 255, 255, 0.9);
  /* album colour, rewritten per record */
  --accent: 150 150 150;
  --vinyl: 30 30 34;
  --pulse: 0;
  /* paper grain for printed surfaces */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .18 0 0 0 0 .15 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper: 246 244 238;
  --paper-ink: 34 32 30;
  /* sleeve edge length; everything in the flow scales from it */
  --s: min(340px, 62vw, 40vh);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* side sleeves reach past the viewport; never let the page itself scroll sideways */
html { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", "Noto Sans TC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* a crowded header must not widen the whole page past the screen */
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
}

button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }

.wash {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 42%, rgb(var(--accent) / 0.16), transparent 70%),
    radial-gradient(120% 80% at 50% 120%, rgba(255, 255, 255, 0.9), transparent 60%);
}

.glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 12px 40px -18px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

/* ---------- icons ---------- */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fi { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* ---------- clear frosted-glass controls ---------- */
.btn, .ctl {
  border: 1px solid var(--frost-edge);
  background: var(--frost);
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  cursor: pointer;
  transition: transform 0.18s, background 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover, .ctl:hover { background: var(--frost-hover); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.2); }
.btn:active, .ctl:active { transform: scale(0.96); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px; font-size: 14px; white-space: nowrap;
}
.btn.icon { width: 38px; height: 38px; padding: 0; justify-content: center; }
.btn.lang { font-size: 13px; font-weight: 500; }
.btn.wide { display: flex; justify-content: center; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #33333a; }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: #bdbdbd; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.live .sp-dot { background: #1ed760; box-shadow: 0 0 0 3px rgb(30 215 96 / 0.18); }

.ctl {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; position: relative;
  color: #2a2a2e;
}
.ctl.small { width: 34px; height: 34px; }
.ctl.small .ic { width: 16px; height: 16px; }
/* the one coloured control: tinted by the album */
.ctl.play {
  width: 54px; height: 54px; color: #fff;
  background: rgb(var(--accent) / 0.92);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 22px -10px rgb(var(--accent) / 0.9);
}
.ctl.play:hover { background: rgb(var(--accent)); }
.ctl.play .fi { width: 20px; height: 20px; }
.i-pause { display: none; }
.playing .i-play { display: none; }
.playing .i-pause { display: block; }

/* toggles: shuffle / repeat light up in the album colour */
.ctl.on { color: rgb(var(--accent)); }
.ctl.on::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: currentColor;
}
.repeat .one { position: absolute; top: 9px; right: 8px; font-size: 8px; font-weight: 700; display: none; }
.repeat-one .repeat .one { display: block; }
.ctl[disabled] { opacity: 0.4; cursor: default; }

.i-mute { display: none; }
.muted .i-vol { display: none; }
.muted .i-mute { display: block; }

.link-btn { border: 0; background: none; padding: 0; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 20px clamp(16px, 4vw, 44px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#loginBtn[hidden] { display: none; }
/* the browser's own clear button is blue and off-style; Esc clears instead */
#searchInput::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* a clean page: the bar stays out of sight until the mouse comes near the top */
@media (hover: hover) {
  body:not(.on-landing) .topbar:not(.show) { opacity: 0; transform: translateY(-6px); pointer-events: none; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
/* the S is cut from a record's grooves; its stroke takes the album colour */
.logo { width: 26px; height: 26px; flex: none; }
.logo .s { stroke: rgb(var(--accent)); }
.actions { display: flex; gap: 8px; align-items: center; }

.add-wrap { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(360px, calc(100vw - 32px));
  padding: 16px; border-radius: 20px; display: grid; gap: 10px;
}
.popover[hidden] { display: none; }
.link-form { display: flex; gap: 8px; }
.link-form input {
  flex: 1; min-width: 0; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; outline: none;
}
.link-form input:focus { border-color: rgba(20, 20, 20, 0.3); }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint[hidden] { display: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- cover flow ---------- */
.stage {
  position: relative; z-index: 1; min-height: 0;
  overflow: clip;
  /* sleeves stack by z-index in a flat layer (see .flow), so panels and dialogs sit above them
     without any filter on this area — a filter here would repaint the whole crate every frame */
  isolation: isolate;
  cursor: grab; touch-action: pan-y; user-select: none;
}
.stage.dragging { cursor: grabbing; }
/* Each sleeve is drawn in 3D on its own and then stacked by distance from the centre (z-index),
   instead of all sharing one 3D scene: sleeves tilted toward each other can't cut through one
   another, so the browser never flips between which one is in front while they move. */
.flow { position: absolute; inset: 0; perspective: 1400px; transform-style: flat; }

.item {
  position: absolute; left: 50%; top: 50%;
  width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  transform-style: preserve-3d;
  will-change: transform;
}

/* the sleeve is a two-sided card: cover in front, track list on the back */
/* The turn is one continuous eased rotation (no stop at 90°); the lift toward you is a separate,
   gentle rise-and-settle on translate/scale, so the two blend instead of stepping. */
.card {
  position: absolute; inset: 0; transform-style: preserve-3d;
  translate: 0 0 1px;
  rotate: y 0deg;
  transition: rotate 0.7s cubic-bezier(0.55, 0.05, 0.3, 1);
}
.item.flipped .card { rotate: y 180deg; }
.item.lifting .card { animation: card-lift 0.7s cubic-bezier(0.4, 0, 0.3, 1); }
.item.instant .card { transition: none; }
@keyframes card-lift {
  0%, 100% { translate: 0 0 1px; scale: 1; }
  45% { translate: 0 0 60px; scale: 1.025; }
}
.item.flipping .card { will-change: transform; }
/* the reflection is re-rendered every frame of a flip; drop it while turning */
.item.flipping .sleeve, .item.flipped .sleeve, .item.lifting .sleeve { -webkit-box-reflect: none; }
.face { position: absolute; inset: 0; border-radius: 4px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }

.sleeve {
  overflow: hidden;
  background: #ddd center / cover;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 18px 40px -12px rgba(0, 0, 0, 0.35),
    0 40px 80px -30px rgba(0, 0, 0, 0.25);
  -webkit-box-reflect: below 6px linear-gradient(transparent 72%, rgba(255, 255, 255, 0.28));
  cursor: pointer;
}
/* clear plastic outer sleeve */
.sleeve::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.06) 28%, transparent 42%, transparent 70%, rgba(255, 255, 255, 0.12) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.sleeve .fallback {
  position: absolute; inset: 0; display: grid; place-items: end start; padding: 8%;
  font-weight: 700; font-size: calc(var(--s) * 0.075); line-height: 1.1; color: rgba(255, 255, 255, 0.95);
  overflow-wrap: anywhere;
}

/* the back of a real record jacket: matte card, printed track list */
.back {
  transform: rotateY(180deg); overflow: hidden; cursor: default;
  background: rgb(var(--paper));
  color: rgb(var(--paper-ink));
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex; flex-direction: column; text-align: left;
}
.back::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--grain);
  opacity: 0.22; /* no blend mode: blending inside a turning 3D card is slow */
}
/* card edge and the faint shading of the spine */
.back::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.07), transparent 5%, transparent 96%, rgba(0, 0, 0, 0.04));
}
.back > * { position: relative; z-index: 1; }
.back-head { padding: 16px 18px 12px; }
.back-actions { display: flex; gap: 8px; padding: 12px 18px 2px; }
.back-actions .btn { padding: 7px 14px; font-size: 13px; }
.back-actions .fi { width: 12px; height: 12px; }
.back .kicker {
  margin: 0 0 8px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgb(var(--paper-ink) / 0.55); display: flex; justify-content: space-between;
}
.back-head h2 {
  margin: 0; font-size: 18px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.back .by { margin: 4px 0 0; font-family: "Bodoni Moda", "Noto Serif TC", serif; font-style: italic; font-size: 15px; color: rgb(var(--paper-ink) / 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back .rule { height: 0; margin: 0 18px; border-top: 1.5px solid rgb(var(--paper-ink) / 0.8); }
.back .rule.thin { border-top-width: 1px; border-color: rgb(var(--paper-ink) / 0.18); }

.tracks {
  flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 6px 18px 10px; list-style: none; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgb(var(--paper-ink) / 0.25) transparent;
}
.tracks .side {
  margin: 10px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgb(var(--accent)); filter: brightness(0.75) saturate(1.2);
}
.tracks .side:first-child { margin-top: 4px; }
.tracks li[data-track] {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
  padding: 4px 0; font-size: 13px; cursor: pointer; text-align: left;
  border-bottom: 1px dotted rgb(var(--paper-ink) / 0.14);
}
.tracks li[data-track]:hover .t { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tracks .n { color: rgb(var(--paper-ink) / 0.5); font-variant-numeric: tabular-nums; font-size: 12px; }
.tracks .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .d { color: rgb(var(--paper-ink) / 0.5); font-size: 12px; font-variant-numeric: tabular-nums; }
/* the song on the platter gets a printed dot, not a highlight bar */
.tracks li.now .t { font-weight: 700; }
.tracks li.now .n { color: transparent; position: relative; }
.tracks li.now .n::before { content: ""; position: absolute; left: 2px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: rgb(var(--accent)); }
.playing .tracks li.now .n::before { animation: now-pulse 1.4s ease-in-out infinite; }
@keyframes now-pulse { 50% { opacity: 0.35; } }

.back-msg { flex: 1; display: grid; place-content: center; gap: 12px; padding: 18px; text-align: center; font-size: 13px; color: rgb(var(--paper-ink) / 0.75); line-height: 1.55; }
.back-msg .btn { justify-self: center; font-size: 13px; }
.back-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 18px 12px; }
/* a local record has three actions; the spec line gives way so "Flip back" never wraps */
.back .spec { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; letter-spacing: 0.08em; color: rgb(var(--paper-ink) / 0.5); white-space: nowrap; }
.back .acts { display: flex; flex: none; gap: 12px; }
.back .acts .text-btn { white-space: nowrap; }
.back .sp-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: rgb(var(--paper-ink) / 0.7); }
.back .sp-link:hover { color: rgb(var(--paper-ink)); }
.back .sp-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
.sp-icon { width: 15px; height: 15px; flex: none; fill: #1ed760; }
.text-btn {
  border: 0; background: none; padding: 2px 0; cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgb(var(--paper-ink) / 0.75); border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.text-btn:hover { color: rgb(var(--paper-ink)); border-color: currentColor; }

.flip-btn {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 34px; height: 34px; opacity: 0; scale: 0.8;
  transition: opacity 0.3s, scale 0.3s, transform 0.18s;
}
.item.peek .flip-btn, .item.out .flip-btn { opacity: 1; scale: 1; }
.item.flipped .flip-btn { opacity: 0; pointer-events: none; }

/* vinyl sits behind its sleeve and slides out to the right */
/* The record sits a hair behind the sleeve (translateZ) so the two are never coplanar —
   otherwise the browser can't tell which is in front while the sleeve turns and the
   record flashes through it. Off-centre sleeves tuck their record away quickly and hide it. */
.slot {
  position: absolute; top: 2%; left: 2%; width: 96%; height: 96%;
  transform: translate3d(0, 0, -2px);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.45, 0, 0.25, 1), visibility 0s 0.3s;
}
.item.peek .slot, .item.out .slot {
  visibility: visible;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}
.item.peek .slot { transform: translate3d(34%, 0, -2px); }
.item.out .slot { transform: translate3d(62%, 0, -2px); }

.glow {
  position: absolute; inset: -8%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--accent) / calc(0.22 + var(--pulse) * 0.28)), transparent 72%);
  filter: blur(18px);
  opacity: 0; transition: opacity 0.8s;
}
.item.out .glow { opacity: 1; transform: scale(calc(1 + var(--pulse) * 0.05)); }

/* translucent coloured vinyl, tinted from the album */
.vinyl {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 33.6%, rgba(255, 255, 255, 0.14) 33.8% 34.1%, transparent 34.4% 39.6%, rgba(0, 0, 0, 0.25) 39.8% 40.1%, transparent 40.4%),
    radial-gradient(circle, transparent 0 54.8%, rgba(255, 255, 255, 0.1) 55% 55.5%, transparent 55.7% 67.8%, rgba(255, 255, 255, 0.1) 68% 68.5%, transparent 68.7% 80.8%, rgba(255, 255, 255, 0.1) 81% 81.5%, transparent 81.7%),
    radial-gradient(circle, rgb(var(--vinyl) / 0.95) 0 40%, rgb(var(--vinyl) / 0.8) 62%, rgb(var(--vinyl) / 0.9) 94%, rgb(255 255 255 / 0.45) 96.5%, rgb(var(--vinyl) / 0.95) 98%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.18),
    8px 16px 32px -10px rgba(0, 0, 0, 0.42);
}
.vinyl::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(0, 0, 0, 0.26) 0 0.45px, transparent 0.65px 1.3px);
  -webkit-mask: radial-gradient(circle, transparent 0 40.5%, #000 41% 96%, transparent 96.3%);
          mask: radial-gradient(circle, transparent 0 40.5%, #000 41% 96%, transparent 96.3%);
}
.vinyl .label {
  position: absolute; inset: 33.5%; border-radius: 50%;
  background: rgb(var(--accent)) center / cover;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.vinyl .label::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8%; height: 8%;
  translate: -50% -50%; border-radius: 50%; background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
/* light reflection that stays put while the disc turns */
.sheen {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    conic-gradient(from 285deg, transparent 0deg, rgba(255, 255, 255, 0.5) 16deg, rgba(255, 255, 255, 0.12) 30deg, transparent 48deg 180deg, rgba(255, 255, 255, 0.38) 196deg, rgba(255, 255, 255, 0.08) 210deg, transparent 228deg),
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.18), transparent 45%);
  -webkit-mask: radial-gradient(circle, transparent 0 34%, #000 35% 97.5%, transparent 98%);
          mask: radial-gradient(circle, transparent 0 34%, #000 35% 97.5%, transparent 98%);
  mix-blend-mode: screen;
}

.tonearm {
  position: absolute; right: -14%; top: -6%; width: 26%; height: 74%;
  overflow: visible;
  transform-origin: 66% 10%; rotate: -12deg; opacity: 0;
  /* the slight overshoot reads as the arm settling onto the record */
  transition: rotate 1.2s cubic-bezier(0.34, 1.28, 0.64, 1) 0.3s, opacity 0.4s;
  pointer-events: none;
  filter: drop-shadow(0 8px 7px rgba(0, 0, 0, 0.28));
}
.item.out .tonearm { opacity: 1; }
.item.out.spinning .tonearm { rotate: 15deg; }

/* song-list loading: a thin bar with the count, on the sleeve's back and above the row */
.loadbar { width: min(220px, 80%); height: 3px; border-radius: 3px; background: rgb(0 0 0 / 0.08); overflow: hidden; justify-self: center; }
.loadbar i { display: block; height: 100%; width: 0; background: rgb(var(--accent)); border-radius: inherit; transition: width 0.3s ease; }
.indeterminate .loadbar i { width: 35%; animation: load-slide 1.1s ease-in-out infinite; }
@keyframes load-slide { from { translate: -100% 0; } to { translate: 290% 0; } }
.back-msg.loading { gap: 12px; }
.load-hint {
  position: absolute; top: 4px; left: 50%; translate: -50% 0; z-index: 5;
  display: grid; gap: 7px; justify-items: center; padding: 9px 16px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--frost-edge); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.25);
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.load-hint[hidden] { display: none; }
.load-hint .loadbar { width: 160px; }

/* the old row sinks and fades before a new one is dealt out */
/* a record being removed sinks a little and fades before the crate closes up around it */
.item.removing { opacity: 0 !important; translate: 0 24px; scale: 0.94; transition: opacity 0.22s ease-in, translate 0.22s ease-in, scale 0.22s ease-in; pointer-events: none; }
.flow.leaving .item { opacity: 0 !important; translate: 0 40px; transition: opacity 0.22s ease-in, translate 0.22s ease-in; }

/* reflections only near the centre: they're expensive to draw */
.item.far .sleeve { -webkit-box-reflect: none; }
/* (reflections: centre and its two neighbours only — see layoutFlow) */
.item.song .flip-btn { display: none; }

/* centred above the row so the side panels never cover it */
.view-bar {
  position: absolute; top: 4px; left: 50%; translate: -50% 0; z-index: 4;
  display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100% - 32px));
}
.view-bar[hidden] { display: none; }
.view-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.edge {
  --a: 0;
  position: absolute; top: 50%; translate: 0 -50%; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--frost-edge);
  /* solid, not blurred: a blur over a moving crate is recalculated every frame */
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.25);
  opacity: var(--a); scale: calc(0.85 + var(--a) * 0.15);
  transition: opacity 0.25s, scale 0.25s;
  pointer-events: none;
}
.edge svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.edge.left { left: clamp(12px, 3vw, 36px); }
.edge.right { right: clamp(12px, 3vw, 36px); }

/* ---------- deck ---------- */
.deck {
  position: relative; z-index: 2;
  display: grid; justify-items: center; gap: 14px;
  padding: 0 16px 24px;
}
.deck > .now { text-align: center; max-width: min(640px, 100%); min-height: 54px; }
/* Fixed line boxes: a Chinese or Japanese title falls back to a taller font, and if the title area
   grew with it the crate above would shrink and the whole row would jolt as you browse past it. */
.deck > .now h1 {
  margin: 0; font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.015em;
  height: 34px; line-height: 34px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* browsed away from what's playing: the title area takes you back */
.deck > .now.away { cursor: pointer; border-radius: 12px; padding: 4px 14px; transition: background 0.2s; }
.deck > .now.away:hover { background: rgba(255, 255, 255, 0.6); }
.deck > .now.away h1::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 10px 0.18em 0; border-radius: 50%;
  background: rgb(var(--accent)); vertical-align: middle; animation: now-pulse 1.4s ease-in-out infinite;
}
.deck > .now p { margin: 4px 0 0; height: 20px; line-height: 20px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.transport {
  display: flex; align-items: center; gap: 18px;
  width: min(860px, 100%); padding: 9px 14px 9px 10px; border-radius: 999px;
}
.group { display: flex; align-items: center; gap: 8px; }
.progress { flex: 1; min-width: 120px; display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; }
.time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.bar { height: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); cursor: pointer; position: relative; }
.bar::before { content: ""; position: absolute; inset: -10px 0; }
.fill { height: 100%; width: 0; border-radius: inherit; background: rgb(var(--accent)); position: relative; }
.fill::after {
  content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06); opacity: 0; transition: opacity 0.2s;
}
.bar:hover .fill::after { opacity: 1; }

.volume { display: flex; align-items: center; gap: 6px; }
/* glass-bead slider */
.range { -webkit-appearance: none; appearance: none; width: 84px; height: 18px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgb(var(--accent)) var(--v, 80%), rgba(0, 0, 0, 0.1) var(--v, 80%)); }
.range::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.1); }
.range::-moz-range-progress { height: 4px; border-radius: 999px; background: rgb(var(--accent)); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; border: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* ---------- Spotify corner card (must stay visible) ---------- */
.embed-wrap {
  /* top-right, under the header, so it never sits on the transport bar */
  position: fixed; right: clamp(16px, 4vw, 44px); top: 76px; z-index: 6;
  width: 300px; display: grid; gap: 6px;
}
.embed-wrap[hidden] { display: none; }
.embed-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; font-size: 12px; color: var(--muted); }
.embed-wrap #embed, .embed-wrap iframe {
  display: block; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35);
}
.embed-wrap .hint { display: none; }
/* Spotify's player has to stay visible, so in full screen it rides above the spread, bottom-right */
.im-on .embed-wrap { z-index: 45; top: auto; bottom: 24px; right: 24px; transition: right 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
/* with Up next open it stays in the corner, over the panel's foot: the list scrolls clear of it,
   and the spread and controls make room for the panel, so nothing covers the buttons */
.im-on.queue-on .q-list { padding-bottom: 140px; }
@media (min-width: 761px) {
  .immersive.queue-open .im-grid { padding-right: calc(min(380px, 88vw) + 3vw); }
  .immersive.queue-open .im-foot { padding-right: calc(min(380px, 88vw) + 24px); }
}
.im-on .embed-wrap .hint, .im-on .embed-head { display: none; }

/* ---------- immersive full screen: a magazine spread ---------- */
.immersive {
  position: fixed; inset: 0; z-index: 40; overflow: hidden;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  background: rgb(var(--paper)); color: rgb(var(--paper-ink));
  animation: im-in 0.6s ease;
  transition: background 0.8s;
}
.immersive::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--grain); opacity: 0.28; mix-blend-mode: multiply;
}
.immersive[hidden] { display: none; }
@keyframes im-in { from { opacity: 0; } }

.im-grid {
  position: relative; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); align-items: center; gap: 3vw;
  padding: 7vh 6vw 2vh;
}
/* the sleeve, with its record drawn out to the right */
/* sized so sleeve + drawn-out record + tonearm fit the left column */
.im-art { position: relative; width: min(50vh, 29vw); aspect-ratio: 1; justify-self: start; }
.im-sleeve {
  position: absolute; inset: 0; z-index: 2; border-radius: 3px;
  background: rgb(var(--accent)) center / cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}
.im-sleeve::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 35%); }
.im-disc {
  position: absolute; top: 2%; left: 2%; width: 96%; aspect-ratio: 1; z-index: 1;
  transform: translateX(28%);
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.playing .im-disc { transform: translateX(56%); }
.im-disc .vinyl { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 10px 24px 50px -14px rgba(0, 0, 0, 0.5); }
.im-disc .vinyl::before { opacity: 0.45; }
.im-disc .tonearm { opacity: 1; right: -16%; }
.playing .im-disc .tonearm { rotate: 15deg; }

.im-text { position: relative; min-width: 0; }
.im-kicker {
  margin: 0 0 18px; display: flex; gap: 14px; align-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: rgb(var(--paper-ink) / 0.6);
}
.im-kicker::before { content: ""; width: 34px; height: 2px; background: rgb(var(--accent)); filter: brightness(0.8); }
/* the song's number, set large and light like a magazine folio */
.im-num {
  margin: 0 0 -0.08em; font-family: "Bodoni Moda", "Noto Serif TC", serif; font-weight: 400;
  font-size: clamp(56px, 7vw, 120px); line-height: 0.9; letter-spacing: -0.02em;
  color: rgb(var(--accent)); filter: saturate(1.1) brightness(0.85); opacity: 0.85;
}
.im-num:empty { display: none; }
/* at most two evenly balanced lines; long titles step down a size instead of wrapping to a third */
/* the title in a fine, high-contrast serif — at most two evenly balanced lines */
.im-text h2 {
  margin: 0; font-family: "Bodoni Moda", "Noto Serif TC", serif; font-weight: 400;
  font-size: clamp(34px, 4.4vw, 76px); line-height: 1.02; letter-spacing: -0.015em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: balance; hyphens: none;
}
.im-text h2.long { font-size: clamp(28px, 3.2vw, 54px); }
/* the artist as a small caption under the title */
.im-artist {
  margin: 16px 0 0; font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgb(var(--paper-ink) / 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* small facts table framed by hairlines */
/* album and length stay tucked away until you point at the text (or tap it) */
.im-facts {
  opacity: 0; translate: 0 -8px;
  transition: opacity 0.3s ease, translate 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin: 26px 0 0; max-width: 460px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid rgb(var(--paper-ink) / 0.55); border-bottom: 1px solid rgb(var(--paper-ink) / 0.18);
}
.im-text:hover .im-facts, .im-text:focus-within .im-facts, .im-text.show .im-facts { opacity: 1; translate: 0 0; }
.im-text { cursor: default; }
.im-facts div { padding: 10px 12px 12px 0; min-width: 0; }
.im-facts div + div { padding-left: 12px; border-left: 1px solid rgb(var(--paper-ink) / 0.14); }
.im-facts dt { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--paper-ink) / 0.5); }
.im-facts dd { margin: 4px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.im-foot {
  position: relative; display: grid; justify-items: center; gap: 14px; padding: 0 24px 30px;
  transition: opacity 0.6s, translate 0.6s;
}
/* one lyric line, like a subtitle under the spread */
.im-line {
  margin: 0; min-height: 1.4em; max-width: min(900px, 90vw); text-align: center;
  font-family: "Bodoni Moda", "Noto Serif TC", serif; font-size: var(--sub-size, clamp(20px, 2.2vw, 30px)); line-height: 1.3;
  transition: opacity 0.35s, translate 0.35s;
}
.im-line.swap { opacity: 0; translate: 0 6px; }
.im-line[hidden] { display: block; visibility: hidden; }
.immersive .progress { width: min(560px, 88vw); flex: none; }
.immersive .time { color: rgb(var(--paper-ink) / 0.6); }
.immersive .bar { background: rgb(var(--paper-ink) / 0.14); }
.immersive .fill { background: rgb(var(--paper-ink)); }
.im-controls { display: flex; align-items: center; gap: 12px; }
.immersive .ctl.play { width: 58px; height: 58px; }
.im-exit { position: absolute; top: 22px; right: 22px; transition: opacity 0.6s; }

/* up next: a paper panel sliding in from the right */
.im-queue {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 4; width: min(380px, 88vw);
  display: flex; flex-direction: column;
  background: rgb(var(--paper)); border-left: 1px solid rgb(var(--paper-ink) / 0.15);
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, 0.4);
  translate: 100% 0; transition: translate 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.im-queue::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: 0.22; pointer-events: none; }
.immersive.queue-open .im-queue { translate: 0 0; }
.immersive.queue-open .im-exit { opacity: 0; pointer-events: none; }
.q-head { position: relative; padding: 26px 24px 16px; border-bottom: 1px solid rgb(var(--paper-ink) / 0.5); }
.q-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: rgb(var(--paper-ink) / 0.55); }
.q-head h3 { margin: 6px 40px 0 0; font-family: "Bodoni Moda", "Noto Serif TC", serif; font-weight: 400; font-size: 26px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-head .ctl { position: absolute; top: 22px; right: 18px; }
.q-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 8px 12px 24px; list-style: none; overscroll-behavior: contain; }
.q-list li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background 0.2s;
}
.q-list li:hover { background: rgb(var(--paper-ink) / 0.06); }
.q-list .n { font-size: 12px; color: rgb(var(--paper-ink) / 0.45); font-variant-numeric: tabular-nums; text-align: right; }
.q-list .t { min-width: 0; }
.q-list .t b { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-list .t span { display: block; font-size: 12px; color: rgb(var(--paper-ink) / 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-list .d { font-size: 12px; color: rgb(var(--paper-ink) / 0.5); font-variant-numeric: tabular-nums; }
.q-list li.now { background: rgb(var(--accent) / 0.14); }
.q-list li.now .n { color: transparent; position: relative; }
.q-list li.now .n::before { content: ""; position: absolute; right: 2px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: rgb(var(--accent)); }
.q-list li.past { opacity: 0.45; }
.q-list li.q-empty { display: block; padding: 20px 12px; font-size: 14px; color: rgb(var(--paper-ink) / 0.6); line-height: 1.6; cursor: default; background: none; }
.immersive.idle { cursor: none; }
.immersive.idle .im-controls, .immersive.idle .progress { opacity: 0; }
.immersive.idle .im-exit { opacity: 0; }
.im-controls, .immersive .progress { transition: opacity 0.6s; }

/* ---------- lyrics ---------- */
.lyrics-panel {
  position: fixed; left: clamp(16px, 4vw, 44px); top: 76px; bottom: 120px; z-index: 6;
  width: min(340px, calc(100vw - 32px)); border-radius: 22px; padding: 16px 8px 10px 16px;
  display: flex; flex-direction: column;
  animation: lyr-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lyrics-panel[hidden] { display: none; }
@keyframes lyr-in { from { opacity: 0; translate: -12px 0; } }
.lyrics-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-right: 8px; }
.lyrics-head h2 { margin: 0; font-size: 15px; }
.lyrics-head .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.lyrics-credit { font-size: 12px; padding-top: 6px; }
.lyr-offset { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0 0; }
.lyr-offset[hidden] { display: none; }
.lyr-offset .hint { flex: 1; }
.lyr-offset output { min-width: 44px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }

.lyrics {
  flex: 1; min-height: 0; overflow-y: auto; padding: 30% 8px 45% 0;
  -webkit-mask: linear-gradient(transparent, #000 14%, #000 80%, transparent);
          mask: linear-gradient(transparent, #000 14%, #000 80%, transparent);
  scrollbar-width: none;
}
.lyrics::-webkit-scrollbar { display: none; }
.lyrics p { margin: 0; }
.lyrics .line {
  padding: 7px 0; font-size: var(--lyr-size, 17px); font-weight: 600; line-height: 1.35; color: rgba(20, 20, 20, 0.28);
  transition: color 0.35s, scale 0.35s; transform-origin: left center; cursor: pointer;
}
.lyrics .line:hover { color: rgba(20, 20, 20, 0.55); }
.lyrics .line.on { color: var(--ink); scale: 1.03; }
.lyrics .line.gap { min-height: 1.35em; }
.lyrics.plain .line { color: #444; font-weight: 500; font-size: 15px; cursor: default; }
.lyrics .msg { color: var(--muted); font-size: 14px; line-height: 1.6; }
.lyrics .msg.note { font-size: 12px; margin-bottom: 14px; }

/* ---------- sheets: manage + help ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 30; transform: translateZ(0); display: grid; place-items: center; padding: 20px;
  /* fairly solid: browsers skip 3D layers when blurring what's behind */
  background: rgba(243, 242, 239, 0.86); backdrop-filter: blur(10px);
  animation: im-in 0.25s ease;
}
.sheet[hidden] { display: none; }
/* panels ease in and out instead of popping (hide() in app.js waits for the fade) */
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes panel-out { to { opacity: 0; transform: translateY(6px) scale(0.99); } }
.sheet:not([hidden]) { animation: fade-in 0.2s ease; }
.sheet:not([hidden]) > * { animation: panel-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet.closing { animation: fade-out 0.17s ease forwards; }
.sheet.closing > * { animation: panel-out 0.17s ease forwards; }
.popover:not([hidden]) { animation: panel-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: top center; }
.sheet-open .stage { filter: blur(6px); opacity: 0.6; }
.sheet-panel {
  width: min(920px, 100%); max-height: min(720px, calc(100dvh - 40px)); display: flex; flex-direction: column;
  border-radius: 24px; padding: 22px; background: rgba(255, 255, 255, 0.94);
}
.sheet-panel.narrow { width: min(460px, 100%); }
/* the shortcut list is taller than a laptop screen: scroll inside the panel, not past it */
#help .sheet-panel { overflow-y: auto; overscroll-behavior: contain; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0 0 4px; font-size: 18px; }
.sheet-foot { margin-top: 14px; display: flex; justify-content: flex-start; }

.tiles {
  list-style: none; margin: 0; padding: 10px 4px 4px; overflow-y: auto; min-height: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px;
}
.tile { position: relative; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile .cover {
  aspect-ratio: 1; border-radius: 4px; background: rgb(var(--accent)) center / cover;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transition: transform 0.2s;
}
.tile:hover .cover { transform: translateY(-2px); }
/* the slot the picked-up record will land in */
.tile.placeholder { visibility: hidden; }
.tile.leaving { opacity: 0; scale: 0.9; transition: opacity 0.2s ease-in, scale 0.2s ease-in; pointer-events: none; }
.tile-dragging, .tile-dragging * { cursor: grabbing !important; }
/* the record floating under the pointer */
.tile.ghost {
  position: fixed; z-index: 70; margin: 0; pointer-events: none; list-style: none;
  transition: scale 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), rotate 0.22s;
}
.tile.ghost .remove, .tile.ghost .name, .tile.ghost .sub { display: none; }
.tile.ghost .cover { transition: box-shadow 0.22s; }
.tile.ghost.lifted { scale: 1.08; rotate: -1.5deg; }
.tile.ghost.lifted .cover { transform: none; box-shadow: 0 28px 50px -14px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.5) inset; }
.tile.ghost.dropping { transition: translate 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), scale 0.28s, rotate 0.28s; }
/* fixed line boxes: a Chinese title falls back to a taller font and would push its row out of line */
.tile .name { margin-top: 6px; font-size: 12px; font-weight: 500; height: 17px; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 12px; color: var(--muted); height: 17px; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .remove {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px;
  opacity: 0; transition: opacity 0.2s;
}
.tile .remove .ic { width: 13px; height: 13px; }
.tile:hover .remove, .tile .remove:focus-visible { opacity: 1; }

.import { gap: 10px; }
.add-local { display: grid; gap: 8px; }

.edit { gap: 12px; }
.edit-top { display: flex; gap: 16px; align-items: flex-start; }
.edit-cover {
  width: 112px; aspect-ratio: 1; flex: none; border-radius: 4px; background: rgb(var(--accent)) center / cover;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.4);
}
.edit-cover.empty { background-image: linear-gradient(145deg, rgb(var(--accent)), rgb(var(--paper-ink))); }
.edit-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.edit-fields .text-input { margin: 0; }
.field-label { font-size: 12px; color: var(--muted); }
.edit-cover-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.edit-tracks { list-style: none; margin: 0; padding: 0; max-height: min(320px, 40vh); overflow-y: auto; display: grid; gap: 4px; }
.edit-tracks li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 30px; align-items: center; gap: 8px;
  padding: 6px 6px 6px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line);
  font-size: 14px; position: relative;
}
.edit-tracks li.lifting { z-index: 2; background: #fff; box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.35); }
.edit-tracks .grip { cursor: grab; color: var(--muted); display: grid; place-items: center; touch-action: none; }
.edit-tracks .grip .ic { stroke-width: 3; }
.edit-tracks .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-tracks .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.edit-tracks .x { width: 28px; height: 28px; }
.edit-tracks .x .ic { width: 13px; height: 13px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.5); transition: border-color 0.2s, background 0.2s;
}
.choice:has(input:checked) { border-color: rgb(var(--accent)); background: rgba(255, 255, 255, 0.9); }
.choice input[type="radio"] { margin-top: 3px; accent-color: rgb(var(--accent)); }
.choice > span { display: grid; gap: 3px; flex: 1; min-width: 0; }
.choice b { font-size: 14px; }
.choice small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.text-input {
  margin-top: 6px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; outline: none; font-size: 14px;
}
.text-input:disabled { opacity: 0.45; }
.text-input:focus { border-color: rgb(var(--accent)); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.keys dt { display: flex; gap: 4px; justify-content: flex-end; }
.keys dd { margin: 0; align-self: center; color: #444; }
kbd {
  min-width: 26px; padding: 3px 7px; border-radius: 7px; text-align: center; font: 500 12px "Space Grotesk", system-ui, sans-serif;
  border: 1px solid var(--frost-edge); background: var(--frost-hover);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
}
.help-notes { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; color: #555; line-height: 1.55; }
.help-notes p { margin: 0; }

/* ---------- settings ---------- */
.setting { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; }
.setting output { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.range.wide { width: 100%; }
.preview-line { margin: 0; font-size: var(--lyr-size, 17px); font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-line.serif { font-family: "Bodoni Moda", "Noto Serif TC", serif; font-weight: 400; font-size: var(--sub-size, 28px); }
/* ---------- picture-in-picture window (its own little page) ---------- */
.pip-body { margin: 0; height: 100vh; overflow: hidden; background: rgb(var(--paper)); color: rgb(var(--paper-ink)); display: block; }
.pip-body::before { content: ""; position: fixed; inset: 0; background: var(--grain); opacity: 0.22; pointer-events: none; }
.pip { position: relative; height: 100vh; box-sizing: border-box; padding: 16px 14px 12px; display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto auto; justify-items: center; gap: 8px; text-align: center; }
/* the sleeve, with its record drawn out to the right and turning */
.pip-art { position: relative; height: 100%; max-height: 62vw; aspect-ratio: 1; translate: -18% 0; align-self: center; }
.pip-sleeve { position: absolute; inset: 0; z-index: 2; border-radius: 2px; background: rgb(var(--accent)) center / cover; box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.45); }
.pip-sleeve::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 38%); }
.pip-disc { position: absolute; top: 2%; left: 2%; width: 96%; aspect-ratio: 1; transform: translateX(42%); }
.pip-disc .vinyl { box-shadow: 6px 12px 24px -10px rgba(0, 0, 0, 0.45); }
.pip-meta { min-width: 0; max-width: 100%; }
.pip-meta b { display: block; font-family: "Bodoni Moda", "Noto Serif TC", serif; font-weight: 400; font-size: 20px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pip-meta span { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--paper-ink) / 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pip-line { margin: 0; min-height: 2.6em; font-family: "Bodoni Moda", "Noto Serif TC", serif; font-style: italic; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pip-bar { width: 100%; height: 3px; border-radius: 3px; background: rgb(var(--paper-ink) / 0.14); overflow: hidden; }
.pip-bar i { display: block; height: 100%; width: 0; background: rgb(var(--paper-ink)); }
.pip-ctl { display: flex; gap: 10px; align-items: center; }
.pip-ctl .ctl { width: 36px; height: 36px; }
.pip-ctl .ctl.play { width: 46px; height: 46px; }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 32; background: rgba(243, 242, 239, 0.7); backdrop-filter: blur(8px); display: grid; justify-items: center; align-items: start; padding: 70px 16px 16px; }
.search[hidden] { display: none; }
.search-panel { width: min(640px, 100%); max-height: calc(100dvh - 100px); display: flex; flex-direction: column; border-radius: 22px; background: rgba(255, 255, 255, 0.95); overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 18px; }
.search-bar kbd { min-width: auto; }
.search-results { overflow-y: auto; padding: 8px 10px 14px; overscroll-behavior: contain; }
.sr-group { margin: 10px 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.sr-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; }
.sr-item:hover, .sr-item.sel { background: rgba(0, 0, 0, 0.05); }
.sr-art { width: 44px; height: 44px; border-radius: 3px; background: rgb(var(--accent)) center / cover; box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.4); }
.sr-text b { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-text span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sr-note { margin: 12px 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* account & devices */
.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.device-list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.6); font-size: 14px;
}
.device-list .dn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-list .ds { font-size: 12px; color: var(--muted); white-space: nowrap; }
.device-list .this { font-size: 12px; font-weight: 600; color: rgb(var(--accent)); filter: brightness(0.8); }
.device-list.pick li { cursor: pointer; }
.device-list.pick li:has(input:checked) { border-color: rgb(var(--accent)); background: #fff; }
.device-list.pick input { accent-color: rgb(var(--accent)); }
#signOutBtn { justify-self: start; }

.auth .sheet-panel { gap: 12px; }
.auth-step { display: grid; gap: 10px; }
.auth-step[hidden] { display: none; }
.auth-step .text-input { margin: 0; font-size: 16px; padding: 12px 14px; }
.code-input { font-size: 26px !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; }
.auth-note { margin: 0; font-size: 14px; line-height: 1.55; }
.auth-error { color: #b3261e; }
.pw-signin { margin: 14px 0 0; font-size: 14px; color: rgb(var(--paper-ink) / 0.7); }
.lp-link { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; color: inherit; font: inherit; font-size: 14px; }

.key-row { display: flex; gap: 8px; align-items: center; }
.key-row code {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.04); border: 1px solid var(--line);
  font-size: 13px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- app welcome (first launch of the apps) ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 24px;
  background: var(--bg); overflow-y: auto;
}
.welcome[hidden] { display: none; }
.welcome::before { content: ""; position: fixed; inset: 0; background: var(--grain); opacity: 0.18; pointer-events: none; }
.welcome:not([hidden]) { animation: fade-in 0.3s ease; }
.welcome:not([hidden]) .welcome-card { animation: panel-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.welcome.closing { animation: fade-out 0.17s ease forwards; pointer-events: none; }
.welcome-card { position: relative; width: min(420px, 100%); text-align: center; display: grid; justify-items: center; }
.welcome-logo { width: 72px; height: 72px; margin-bottom: 22px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.22)); }
.welcome h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.welcome-lede { margin: 12px 0 0; max-width: 36ch; font-size: 15px; line-height: 1.6; color: var(--muted); }
.welcome-actions { display: grid; gap: 10px; width: 100%; margin-top: 28px; }
.welcome-actions .btn { justify-content: center; padding: 12px 20px; font-size: 15px; }
.welcome-bought { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
/* the desktop app can sign in to Spotify; the phone app just starts */
.welcome .welcome-start, .welcome.phone .welcome-spotify, .welcome.phone .welcome-skip { display: none; }
.welcome.phone .welcome-start { display: inline-flex; }
.sp-glyph { width: 18px; height: 18px; border-radius: 50%; background: #1ed760; flex: none; }
html:not(.desktop-app) .desktop-app-only { display: none !important; }

/* ---------- landing page / paywall ---------- */
.on-landing > :not(.paywall):not(.toast):not(svg):not(#authSheet) { visibility: hidden; }
/* free: Spotify plays for everyone; paid: local music, editing, mini player */
body:not(.paid) .paid-only, body.paid .free-only { display: none !important; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
/* "Unlock" scrolls here: keep the card's top clear of the sticky nav */
#lp-price, #lp-download { scroll-margin-top: 72px; }
.pw-free { margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: rgb(var(--paper-ink) / 0.7); }
/* sign-in / buy opens on top of the landing page */
#authSheet { z-index: 90; }
.paywall {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth;
  background: rgb(var(--paper)); color: rgb(var(--paper-ink));
  --display: "Space Grotesk", "Noto Sans TC", system-ui, sans-serif;
}
.paywall[hidden] { display: none; }
/* the landing page rises in, and fades away over the player when you go to it */
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
.paywall:not([hidden]) { animation: page-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.paywall.closing { animation: fade-out 0.17s ease forwards; pointer-events: none; }
.paywall::before { content: ""; position: fixed; inset: 0; background: var(--grain); opacity: 0.22; pointer-events: none; }
.paywall > * { position: relative; }
.paywall section, .lp-nav, .lp-foot { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
/* opening the landing page laid out every section at once (~150ms); off-screen ones wait until scrolled to */
/* the FAQ waits until scrolled to; the price card is left alone: deferring a section also clips
   what spills past it, and that cut off the card's outline and shadow */
.lp-faq { content-visibility: auto; contain-intrinsic-size: auto 420px; }

.lp-nav {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; background: linear-gradient(rgb(var(--paper)), rgb(var(--paper) / 0.85) 70%, transparent);
}
.lp-nav nav { display: flex; align-items: center; gap: 12px; }
.pw-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; }
.lp-link { color: inherit; font-size: 14px; text-underline-offset: 4px; }
.lp-small-cta { text-decoration: none; padding: 9px 16px; }

/* hero: heavy, high-contrast type */
.lp-hero { padding: 6vh 0 6vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 4vw; min-height: calc(100vh - 80px); }
.lp-hero-copy { order: -1; }
/* a big sleeve with its record drawn out and turning */
.lp-hero-art { position: relative; width: min(30vw, 52vh); aspect-ratio: 1; justify-self: center; translate: -18% 0; }
.ha-sleeve { position: absolute; inset: 0; z-index: 2; border-radius: 3px; background: rgb(var(--accent)) center / cover; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 40px 70px -24px rgba(0, 0, 0, 0.5); }
.ha-sleeve::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, 0.25), transparent 38%); }
.ha-disc { position: absolute; top: 2%; left: 2%; width: 96%; aspect-ratio: 1; transform: translateX(52%); }
.ha-disc .vinyl { animation: demo-spin 1.8s linear infinite; box-shadow: 10px 24px 50px -14px rgba(0, 0, 0, 0.5); }
.lp-kicker {
  margin: 0 0 18px; display: flex; gap: 12px; align-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: rgb(var(--paper-ink) / 0.6);
}
.lp-kicker::before { content: ""; width: 34px; height: 3px; background: rgb(var(--paper-ink)); }
.lp-title {
  margin: 0; font-family: var(--display); font-weight: 900; letter-spacing: -0.055em; line-height: 0.92;
  font-size: clamp(52px, 8.4vw, 136px); max-width: 12ch;
}
.lp-title span { display: block; }
/* the middle line carries the album colour */
.lp-title .outline { color: rgb(var(--accent)); filter: brightness(0.8) saturate(1.2); }
.lp-lede { margin: 26px 0 0; max-width: 560px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; color: rgb(var(--paper-ink) / 0.72); }
.lp-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: 30px; }
.lp-cta { display: inline-flex; gap: 14px; align-items: center; padding: 15px 24px; font-size: 16px; font-weight: 600; text-decoration: none; }
.lp-cta-price { padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.3); font-weight: 400; }
.lp-hero-note { font-size: 14px; color: rgb(var(--paper-ink) / 0.6); }

/* the playable mini crate */
.lp-demo { padding: 4vh 0 10vh; }
.demo-window {
  border-radius: 22px; overflow: hidden; background: #f3f2ef; color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.demo-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.demo-bar span { width: 11px; height: 11px; border-radius: 50%; background: rgba(0, 0, 0, 0.12); }
.demo-bar em { margin-left: 10px; font-style: normal; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.demo-stage {
  --s: min(260px, 46vw, 38vh);
  position: relative; height: calc(var(--s) * 1.75); overflow: clip; isolation: isolate;
  cursor: grab; touch-action: pan-y; user-select: none;
}
.demo-stage.dragging { cursor: grabbing; }
.demo-flow { position: absolute; inset: 0; perspective: 1200px; transform-style: flat; }
.demo-caption { display: grid; justify-items: center; gap: 2px; padding: 0 16px 6px; text-align: center; }
.demo-caption b { font-size: 20px; letter-spacing: -0.01em; }
.demo-caption span { font-size: 14px; color: var(--muted); }
.demo-hint { margin: 0; padding: 4px 16px 20px; text-align: center; font-size: 13px; color: var(--muted); }
.demo-stage .back-msg p { margin: 0; }
@keyframes demo-spin { to { rotate: 360deg; } }

/* features */
.lp-features { display: grid; gap: 12vh; padding: 4vh 0 14vh; }
.lp-feature { display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.1fr); gap: 4vw; align-items: center; }
.lp-feature:nth-child(even) .lp-visual { order: -1; grid-column: 1 / 3; }
.lp-feature:nth-child(even) { grid-template-columns: minmax(0, 1.1fr) 90px minmax(0, 1fr); }
.lp-num { font-family: var(--display); font-weight: 900; font-size: 64px; letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 1.5px rgb(var(--paper-ink) / 0.6); align-self: start; }
.lp-copy h2 { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(30px, 3.6vw, 52px); line-height: 1; letter-spacing: -0.045em; }
.lp-copy p { margin: 16px 0 0; font-size: 16px; line-height: 1.65; color: rgb(var(--paper-ink) / 0.7); max-width: 440px; }
.lp-visual { aspect-ratio: 4 / 3; border-radius: 18px; background: rgb(var(--paper-ink) / 0.06); position: relative; overflow: hidden; }

.v-crate { display: flex; align-items: center; justify-content: center; perspective: 700px; }
.v-crate i { width: 30%; aspect-ratio: 1; border-radius: 3px; margin: 0 -7%; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.5); }
.v-crate i:nth-child(1) { background: #c84b31; transform: rotateY(42deg) translateZ(-90px); }
.v-crate i:nth-child(2) { background: #2d4263; transform: rotateY(42deg) translateZ(-40px); }
.v-crate i:nth-child(3) { background: #ecdbba; transform: none; z-index: 2; margin: 0 2%; }
.v-crate i:nth-child(4) { background: #191919; transform: rotateY(-42deg) translateZ(-40px); }
.v-crate i:nth-child(5) { background: #8e7f6f; transform: rotateY(-42deg) translateZ(-90px); }

.v-spread { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 8%; gap: 6%; background: #e7e1d4; }
.vs-art { position: relative; aspect-ratio: 1; }
.vs-sleeve { position: absolute; inset: 0; background: linear-gradient(135deg, #1f3b4d, #b88a44); border-radius: 2px; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5); }
.vs-disc { position: absolute; inset: 3%; border-radius: 50%; background: radial-gradient(circle, #b88a44 0 30%, #161616 31%); translate: 42% 0; }
.vs-text b { display: block; font-family: "Bodoni Moda", serif; font-weight: 400; font-size: clamp(28px, 3vw, 44px); color: #9b6b2a; }
.vs-text strong { display: block; font-family: var(--display); font-size: clamp(20px, 2.2vw, 34px); letter-spacing: -0.04em; line-height: 1; }
.vs-text em { font-family: "Bodoni Moda", serif; font-size: 16px; }

.v-lyrics { display: grid; align-content: center; gap: 10px; padding: 8%; }
.v-lyrics p { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(16px, 1.8vw, 24px); color: rgb(var(--paper-ink) / 0.25); }
.v-lyrics p.on { color: rgb(var(--paper-ink)); }

.v-local { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px; padding: 10%; }
.v-local span { padding: 12px 18px; border-radius: 12px; background: rgb(var(--paper)); font-family: var(--display); font-weight: 700; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.3); }

/* price + faq */
/* desktop app download */
/* three short points under the hero */
.lp-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4vw; padding: 2vh 0 12vh; }
.lp-points h2 { margin: 0 0 8px; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.lp-points p { margin: 0; font-size: 15px; line-height: 1.6; color: rgb(var(--paper-ink) / 0.7); }
@media (max-width: 860px) { .lp-points { grid-template-columns: 1fr; gap: 22px; } }

.lp-download {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: center;
  padding: 0 0 12vh; border-top: 1px solid rgb(var(--paper-ink) / 0.2); padding-top: 8vh;
}
.lp-download[hidden] { display: none; }
.dl-title { margin: 0; font-family: var(--display); font-weight: 900; letter-spacing: -0.04em; line-height: 1; font-size: clamp(36px, 5vw, 64px); }
.dl-lede { margin: 18px 0 0; max-width: 46ch; font-size: 16px; line-height: 1.6; color: rgb(var(--paper-ink) / 0.72); }
.dl-buttons { display: grid; gap: 10px; }
.dl-btn { justify-content: flex-start; gap: 14px; padding: 13px 20px; border-radius: 16px; text-decoration: none; }
.dl-btn:not(.dark) { background: rgb(var(--paper)); box-shadow: inset 0 0 0 1.5px rgb(var(--paper-ink) / 0.25); color: rgb(var(--paper-ink)); }
.dl-os svg { display: block; width: 24px; height: 24px; }
.dl-text { display: grid; gap: 2px; text-align: left; }
.dl-text b { font-size: 15px; font-weight: 700; }
.dl-text small { font-size: 12px; opacity: 0.7; }
.dl-btn:focus-visible { outline: 2px solid rgb(var(--paper-ink)); outline-offset: 3px; }
.dl-note { margin: 14px 0 0; font-size: 13px; color: rgb(var(--paper-ink) / 0.6); }
@media (max-width: 860px) { .lp-download { grid-template-columns: 1fr; } }

.lp-price { padding: 0 0 12vh; display: grid; justify-items: center; }
.price-card {
  width: min(520px, 100%); padding: 36px; border-radius: 26px; background: rgb(var(--paper)); 
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.35), 0 0 0 1.5px rgb(var(--paper-ink));
}
.price-card .lp-kicker { margin-bottom: 8px; }
.pw-price { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.pw-price b { font-weight: 900; font-size: 92px; line-height: 1; letter-spacing: -0.06em; }
.pw-usd { font-size: 15px; font-weight: 500; letter-spacing: 0; color: rgb(var(--paper-ink) / 0.6); }
.pw-usd:empty { display: none; }
.pw-note { margin: 4px 0 0; font-size: 14px; color: rgb(var(--paper-ink) / 0.6); }
.pw-list { margin: 24px 0; padding: 18px 0 0; list-style: none; display: grid; gap: 10px; font-size: 15px; border-top: 1px solid rgb(var(--paper-ink) / 0.2); }
.pw-list li { display: flex; gap: 10px; align-items: baseline; }
.pw-list li::before { content: "✓"; font-weight: 700; }
.pw-cta { display: flex; justify-content: center; padding: 15px 20px; font-size: 16px; font-weight: 600; text-decoration: none; }
.pw-redeem { display: flex; gap: 8px; margin-top: 12px; }
.pw-redeem .text-input { flex: 1; min-width: 0; margin: 0; }
.paywall .hint { margin-top: 12px; color: rgb(var(--paper-ink) / 0.6); }

.lp-faq { width: min(760px, calc(100% - 40px)) !important; padding: 0 0 12vh; }
.lp-faq h2 { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -0.045em; margin: 0 0 20px; }
.lp-faq details { border-top: 1px solid rgb(var(--paper-ink) / 0.2); padding: 18px 0; }
.lp-faq details:last-child { border-bottom: 1px solid rgb(var(--paper-ink) / 0.2); }
.lp-faq summary { cursor: pointer; font-size: 17px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.lp-faq summary::after { content: "+"; font-size: 22px; line-height: 1; transition: rotate 0.2s; }
.lp-faq details[open] summary::after { rotate: 45deg; }
.lp-faq p { margin: 12px 0 0; font-size: 15px; line-height: 1.65; color: rgb(var(--paper-ink) / 0.72); }
.lp-legal { display: flex; gap: 18px; }
.lp-legal a { color: inherit; text-underline-offset: 3px; }
.auth-terms { margin-top: 14px; font-size: 12px; }
.auth-spam { margin: 0; font-size: 12px; text-align: center; }
.auth-terms a { color: inherit; }
.lp-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 0 40px; border-top: 1px solid rgb(var(--paper-ink) / 0.2); font-size: 13px; color: rgb(var(--paper-ink) / 0.6); }

/* ---------- overlays ---------- */
.drop-overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(243, 242, 239, 0.75); backdrop-filter: blur(8px);
  font-size: 20px; font-weight: 500;
  outline: 2px dashed rgba(20, 20, 20, 0.25); outline-offset: -16px;
}
.drop-overlay[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; top: 80px; translate: -50% 0; z-index: 60;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }

/* narrower screens: lyrics drop down over the crate, never over the title or controls */
@media (max-width: 1100px) {
  .lyrics-panel {
    left: 50%; translate: -50% 0; top: 64px; bottom: auto; height: 42vh; width: min(560px, calc(100vw - 32px));
    background: rgba(250, 250, 248, 0.95);
  }
}

@media (max-width: 900px) {
  .transport { flex-wrap: wrap; justify-content: center; border-radius: 28px; gap: 10px 14px; }
  .progress { order: -1; flex-basis: 100%; }
}
@media (max-width: 640px) {
  :root { --s: min(240px, 58vw, 36vh); }
  /* phone: icon-only header, compact controls on two rows */
  .actions { gap: 6px; }
  .btn.icon { width: 34px; height: 34px; }
  #loginLabel { display: none; }
  #loginBtn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .brand { gap: 8px; }
  .transport { gap: 8px 6px; padding: 10px; }
  .transport .group { gap: 6px; }
  .ctl { width: 36px; height: 36px; }
  .ctl.small { width: 34px; height: 34px; }
  .ctl.play { width: 48px; height: 48px; }
  .volume { display: none; }

  .topbar { padding: 14px 16px; }
  .brand { font-size: 16px; }
  .btn { padding: 7px 11px; font-size: 13px; }
  .add-wrap .btn span { display: none; }
  /* keyboard shortcuts mean little on a phone; it frees room for Unlock */
  #helpBtn { display: none; }
  .volume .range { display: none; }
  .embed-wrap { left: 16px; right: 16px; top: auto; bottom: 12px; width: auto; }
  /* the Spotify player sits at the bottom on a phone: lift the controls above it instead of under it */
  body:has(#embedWrap:not([hidden])) .deck { padding-bottom: 124px; }
  body.im-on:has(#embedWrap:not([hidden])) .immersive { padding-bottom: 104px; }
  .embed-wrap .embed-head { display: none; }
  /* a phone-sized sleeve back: tighter type so the track list keeps room to show */
  .back-head { padding: 10px 12px 8px; }
  .back .kicker { margin-bottom: 4px; font-size: 10px; }
  .back-head h2 { font-size: 15px; -webkit-line-clamp: 1; }
  .back .by { font-size: 12px; }
  .back .rule { margin: 0 12px; }
  .back-actions { padding: 8px 12px 0; gap: 6px; }
  .back-actions .btn { padding: 5px 10px; font-size: 12px; }
  .tracks { padding: 4px 12px 6px; }
  .tracks li[data-track] { font-size: 12px; padding: 3px 0; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; }
  .back-foot { padding: 6px 12px 8px; }
  .back .sp-link span { display: none; }
  .back .acts { gap: 10px; }
  .back .text-btn { font-size: 10px; }
  .im-grid { grid-template-columns: 1fr; align-content: center; gap: 28px; padding: 64px 24px 8px; }
  .im-art { width: min(52vw, 34vh); translate: -22% 0; }
  .im-disc .tonearm { display: none; }
  .im-text { text-align: center; }
  .im-kicker { justify-content: center; }
  .im-facts { margin-inline: auto; text-align: left; }
}

/* a phone turned sideways (the phone app is landscape-only): very little height, plenty of width.
   One slim header row, one control row, and the crate takes what is left. */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --s: min(240px, 34vw, 40vh); }
  .topbar { padding: 8px max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left)); }
  .brand { font-size: 16px; gap: 8px; }
  .logo { width: 22px; height: 22px; }
  .actions { gap: 6px; }
  .btn { padding: 6px 12px; font-size: 13px; }
  .btn.icon { width: 32px; height: 32px; }
  #loginLabel { display: none; }
  #loginBtn { width: 32px; height: 32px; padding: 0; justify-content: center; }
  #helpBtn { display: none; }

  .deck { gap: 4px; padding: 0 max(16px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .deck > .now { min-height: 40px; }
  .deck > .now h1 { font-size: 17px; height: 24px; line-height: 24px; }
  .deck > .now p { margin-top: 0; font-size: 13px; height: 18px; line-height: 18px; }
  .transport { flex-wrap: nowrap; gap: 10px; padding: 5px 10px 5px 6px; border-radius: 999px; }
  .progress { order: 0; flex-basis: auto; min-width: 80px; }
  .transport .group { gap: 4px; }
  .ctl { width: 34px; height: 34px; }
  .ctl.small { width: 32px; height: 32px; }
  .ctl.play { width: 42px; height: 42px; }
  .volume { display: none; }

  /* the Spotify player tucks into the top-right corner, under the header */
  .embed-wrap { top: 48px; bottom: auto; left: auto; right: max(16px, env(safe-area-inset-right)); width: 260px; }
  .embed-wrap .embed-head { display: none; }
  body:has(#embedWrap:not([hidden])) .deck { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .im-on .embed-wrap { top: auto; bottom: 12px; right: max(16px, env(safe-area-inset-right)); width: 240px; }
  body.im-on:has(#embedWrap:not([hidden])) .immersive { padding-bottom: 0; }
  .im-foot { gap: 8px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* full screen: keep the progress bar and buttons clear of the Spotify player in the corner */
  body.im-on:has(#embedWrap:not([hidden])) .im-foot { padding-right: 264px; }

  /* a sleeve this small can't fit the whole back: keep the title and the songs, drop the rest
     (tap a song to play from it) */
  .back .kicker, .back .by, .back-actions { display: none; }
  .back-head { padding: 8px 10px 6px; }
  .back-head h2 { font-size: 13px; }
  .back .rule { margin: 0 10px; }
  .tracks { padding: 2px 10px 4px; }
  .tracks .side { margin: 4px 0 2px; font-size: 10px; }
  .tracks li[data-track] { font-size: 11px; padding: 2px 0; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px; }
  .tracks .n, .tracks .d { font-size: 10px; }
  .back-foot { padding: 4px 10px 6px; }
  .back .sp-link span, .back .spec:not(.sp-link) { display: none; }
  .back .acts { gap: 8px; }
  .back .text-btn { font-size: 9px; letter-spacing: 0.06em; }

  /* landing page: keep clear of the notch / Dynamic Island, and scale the hero to the short screen */
  .paywall section, .lp-nav, .lp-foot {
    width: auto;
    margin-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
  }
  .lp-nav { padding: 10px 0; }
  .lp-hero { min-height: calc(100dvh - 56px); padding: 2vh 0 4vh; gap: 4vw; }
  .lp-title { font-size: clamp(36px, 11vh, 56px); }
  .lp-kicker { margin-bottom: 10px; }
  .lp-lede { margin-top: 12px; font-size: 14px; }
  .lp-hero-cta { margin-top: 16px; gap: 10px 14px; }
  .lp-cta { padding: 11px 18px; font-size: 14px; }
  .lp-hero-art { width: min(30vw, 62vh); }
  .demo-stage { --s: min(200px, 26vw, 46vh); }

  /* full screen keeps the magazine spread side by side, scaled to the short screen */
  .im-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-content: center; gap: 4vw; padding: 16px max(24px, env(safe-area-inset-right)) 4px max(24px, env(safe-area-inset-left)); }
  .im-art { width: min(34vw, 62vh); translate: 0 0; }
  .im-text { text-align: left; }
  .im-kicker { justify-content: flex-start; }
}

@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 3vh; }
  .lp-hero-copy { order: 0; }
  .lp-hero-art { width: min(52vw, 260px); translate: -24% 0; }
  .lp-feature, .lp-feature:nth-child(even) { grid-template-columns: 1fr; gap: 18px; }
  .lp-feature:nth-child(even) .lp-visual { order: 0; grid-column: auto; }
  .lp-num { font-size: 44px; }
  .lp-link { display: none; }
  .price-card { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet > *, .popover, .paywall, .welcome, .welcome-card { animation: none !important; }

  .slot, .tonearm, .card { transition: none; animation: none !important; }
}

/* public site: lyrics are off (personal use only) */
.no-lyrics .needs-lyrics,
.no-lyrics [data-action="lyrics"],
.no-lyrics #lyricsPanel {
  display: none !important;
}

/* desktop app: Spotify sign-in state in settings and on the welcome screen */
html:not(.spotify-on) .spotify-in,
html.spotify-on .spotify-out { display: none; }
