/* Listen v4 — premium redesign (Victor's order, 2026-10-13).
   Built on the 29Court design system v2: tokens.css +
   listen-theme.css load before this file; every value below
   resolves to a --29d-* token through the bridge block (the only
   place Listen's own names are defined). Light is the premium
   beach register (warm bone, white surfaces, hairlines, coral).
   Dark is Melee Night (see listen-theme.css). Hairlines, not
   shadows; shadows only on floating UI. GPU-only motion. */
:root {
  --bg: var(--29d-bg);
  --surface: var(--29d-surface);
  --surface-2: var(--29d-sunken);
  --surface-3: var(--29d-raised);
  --ink: var(--29d-text-1);
  --ink-dim: var(--29d-text-2);
  --ink-faint: var(--29d-text-3);
  --accent: var(--29d-coral-600);
  --accent-hover: var(--29d-coral-700);
  --accent-ink: var(--29d-on-coral);
  --accent-soft: color-mix(in srgb, var(--29d-coral-500) 14%, transparent);
  --good: var(--29d-green-600);
  --warn: var(--29d-amber-600);
  --bad: var(--29d-red-600);
  --line: var(--29d-border);
  --line-strong: var(--29d-border-strong);
  --radius: var(--29d-r-3);
  --radius-sm: var(--29d-r-2);
  --tabbar-h: 62px;
  --player-h: 64px;
  --rail-w: 236px;
  --spring: var(--29d-ease);
  --wash: 38, 36, 40;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--29d-font-ui);
  font-feature-settings: var(--29d-font-features);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
.ic { width: 24px; height: 24px; flex: none; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: none; box-shadow: var(--29d-focus-ring), var(--29d-focus-halo); border-radius: var(--29d-r-1); }
@media (hover: hover) {
  .icon-btn:hover, .skip-btn:hover { background: var(--29d-wash); }
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-word { font-family: var(--29d-font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; animation: pulse 1.6s ease-in-out infinite; }
.loader-sub { font-size: 13px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--ink-dim); }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ---------- lock screen ---------- */
.lock {
  position: fixed; inset: 0; z-index: 50; overflow: auto;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
.lock-wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 15% 0%, color-mix(in srgb, var(--29d-coral-500) 17%, transparent), transparent 60%),
    radial-gradient(100% 60% at 90% 100%, color-mix(in srgb, var(--29d-gold-500) 10%, transparent), transparent 60%);
}
.lock-inner { position: relative; width: 100%; max-width: 380px; animation: rise 0.6s var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.lock-mark { font-weight: 800; letter-spacing: -0.02em; font-size: 15px; color: var(--ink-dim); text-transform: lowercase; }
.lock-title { font-family: var(--29d-font-display); font-size: 56px; font-weight: 800; letter-spacing: -0.035em; margin: 6px 0 8px; }
.lock-sub { color: var(--ink-dim); font-size: 16px; line-height: 1.45; margin: 0 0 28px; }
.lock-form { display: grid; gap: 14px; }
.lock-field { display: grid; gap: 7px; }
.lock-label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.lock-field input {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 14px 15px; color: var(--ink); font-size: 16px; outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lock-field input:focus { border-color: var(--accent); box-shadow: var(--29d-focus-halo); }
.lock-submit {
  margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px;
  border-radius: var(--radius-sm); padding: 15px 20px; min-height: 52px;
  transition: transform 0.15s var(--spring), background 0.15s;
}
.lock-submit .ic { width: 19px; height: 19px; }
.lock-submit:active { transform: scale(0.97); }
@media (hover: hover) { .lock-submit:hover { background: var(--accent-hover); } }
.lock-error { color: var(--bad); font-size: 14px; margin: 14px 0 0; text-align: center; }

/* ---------- app frame ---------- */
.app { min-height: 100dvh; }
.rail { display: none; }
.content {
  padding: 18px 16px calc(var(--tabbar-h) + var(--player-h) + 34px);
  max-width: 1060px; margin: 0 auto;
}
.app.no-player .content { padding-bottom: calc(var(--tabbar-h) + 34px); }
.view { animation: view-in 0.38s var(--spring) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-head { margin: 8px 0 16px; }
.view-title { font-family: var(--29d-font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.view-sub { color: var(--ink-dim); font-size: 14px; margin: 5px 0 0; font-variant-numeric: tabular-nums; }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--29d-bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-faint); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  transition: color 0.2s, transform 0.12s var(--spring); min-height: 48px;
}
.nav-btn .ic { width: 23px; height: 23px; }
.nav-btn:active { transform: scale(0.93); }
.nav-btn.active { color: var(--ink); }
.nav-btn.active::before {
  content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent);
}
.nav-badge {
  position: absolute; top: 6px; right: calc(50% - 22px); background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: var(--29d-pill);
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- home ---------- */
.home-head { padding: 14px 0 4px; }
.home-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-lock { color: var(--ink-dim); background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 960px) { .icon-btn.mobile-lock { display: none; } }
.greeting { font-family: var(--29d-font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.home-sub { color: var(--ink-dim); font-size: 14.5px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.shelves { display: grid; gap: 30px; margin-top: 22px; grid-template-columns: minmax(0, 1fr); }
.shelf-block { min-width: 0; animation: shelf-in 0.55s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes shelf-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.shelf-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.shelf-name { font-family: var(--29d-font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.shelf-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 14px;
  overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row.wide { grid-auto-columns: min(78vw, 320px); }

/* cards */
.card {
  position: relative; text-align: left; padding: 0; border-radius: var(--radius);
  scroll-snap-align: start; transition: transform 0.15s var(--spring);
  display: flex; flex-direction: column; gap: 0; width: 100%;
}
.card:active { transform: scale(0.965); }
.card-art { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--line); }
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art .noart { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; color: var(--ink-faint); background: var(--surface-2); }
.card-title {
  font-size: 14.5px; font-weight: 700; line-height: 1.3; margin: 10px 0 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 13px; color: var(--ink-dim); margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-progress { height: 4px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 8px; overflow: hidden; }
.card-progress > div { height: 100%; background: var(--accent); border-radius: 4px; }
.card-play {
  position: absolute; right: 8px; bottom: 8px; width: 42px; height: 42px; border-radius: var(--29d-pill);
  background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--29d-shadow-pop); opacity: 0; transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s var(--spring);
}
.card-play .ic { width: 20px; height: 20px; }
.card:hover .card-play, .card.playing .card-play { opacity: 1; transform: none; }
.card-heart {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: var(--29d-pill);
  background: rgba(8, 8, 10, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: transform 0.13s var(--spring), color 0.2s;
}
.card-heart .ic { width: 18px; height: 18px; }
.card-heart:active { transform: scale(0.85); }
.card-heart.on { color: var(--29d-coral-400); }
.eq {
  position: absolute; left: 10px; bottom: 10px; display: flex; align-items: flex-end; gap: 2.5px; height: 14px;
  background: rgba(8, 8, 10, 0.55); padding: 4px 5px; border-radius: 6px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.eq span { width: 3px; background: var(--29d-coral-400); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq span:nth-child(1) { height: 60%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 100%; animation-delay: 0.22s; }
.eq span:nth-child(3) { height: 45%; animation-delay: 0.44s; }
.eq span:nth-child(4) { height: 80%; animation-delay: 0.11s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.eq span { transform-origin: bottom; }

/* wide cards (highlights on home, radio teaser) */
.wide-card {
  position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; display: grid; gap: 5px; width: 100%;
  transition: transform 0.15s var(--spring), background 0.2s;
}
.wide-card:active { transform: scale(0.98); }
@media (hover: hover) { .wide-card:hover { background: var(--surface-2); } }
.wide-card .wc-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.wide-card .wc-range { color: var(--accent); font-weight: 700; }
.wide-card .wc-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.wide-card .wc-excerpt { color: var(--ink-dim); font-size: 13.5px; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.radio-card .wc-title { font-size: 17px; display: flex; align-items: center; gap: 9px; }
.radio-card .ic { color: var(--accent); }

/* skeleton */
.skel { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--29d-wash-2) 50%, transparent 70%);
  animation: shimmer 1.4s infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { aspect-ratio: 0.82; }
.skel-row { height: 72px; margin-bottom: 10px; }

/* ---------- library ---------- */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--ink-faint); pointer-events: none; }
.search-input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 14px 12px 42px; color: var(--ink); font-size: 16px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus { border-color: var(--accent); box-shadow: var(--29d-focus-halo); }
.search-input::placeholder { color: var(--ink-faint); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 15px; border-radius: var(--29d-pill); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-size: 13.5px; font-weight: 600; min-height: 36px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.12s var(--spring);
}
.chip:active { transform: scale(0.94); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.sort-row { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.sort-label { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin-right: 2px; }
.sort-btn {
  padding: 7px 14px; border-radius: var(--29d-pill); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-size: 13px; font-weight: 600; min-height: 34px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.12s var(--spring);
}
.sort-btn:active { transform: scale(0.94); }
.sort-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.list { display: grid; gap: 2px; grid-template-columns: minmax(0, 1fr); }
.list-group-head { font-family: var(--29d-font-display); font-size: 15.5px; font-weight: 750; color: var(--ink); padding: 18px 8px 5px; }
.list-group-head:first-child { padding-top: 4px; }
.row {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; text-align: left;
  padding: 9px 8px; border-radius: var(--radius-sm); transition: background 0.15s; min-height: 68px;
}
@media (hover: hover) { .row:hover { background: var(--29d-wash); } }
.row:active { background: var(--29d-wash-2); }
.row-cover { width: 52px; height: 52px; border-radius: var(--29d-r-2); object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); }
.row-info { flex: 1; min-width: 0; }
.row-title { font-size: 15.5px; font-weight: 650; line-height: 1.3; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.playing .row-title { color: var(--accent); }
.row-meta { font-size: 13px; color: var(--ink-dim); margin: 3px 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-progress { position: absolute; left: 73px; right: 12px; bottom: 4px; height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.row-progress > div { height: 100%; background: var(--accent); }
.row-done { color: var(--good); flex: none; display: flex; }
.row-done .ic { width: 18px; height: 18px; }
.fav-btn { color: var(--ink-faint); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--29d-pill); transition: transform 0.13s var(--spring), color 0.2s; flex: none; }
.fav-btn .ic { width: 21px; height: 21px; }
.fav-btn:active { transform: scale(0.82); }
.fav-btn.on { color: var(--accent); }
.empty-note { font-family: var(--29d-font-display); font-size: 19px; font-weight: 750; margin: 26px 0 6px; }
.empty-sub { color: var(--ink-dim); margin: 0; font-size: 14.5px; line-height: 1.5; }

/* ---------- highlights view ---------- */
.shelf-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; border-radius: var(--radius-sm); padding: 12px 20px; min-height: 48px;
  transition: transform 0.14s var(--spring), background 0.15s, opacity 0.2s;
}
.btn-primary .ic { width: 18px; height: 18px; }
.btn-primary:active { transform: scale(0.96); }
@media (hover: hover) { .btn-primary:hover { background: var(--accent-hover); } }
.btn-primary:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  font-weight: 700; font-size: 15px; border-radius: var(--radius-sm); padding: 12px 20px; min-height: 48px;
  transition: transform 0.14s var(--spring), background 0.2s;
}
.btn-ghost:active { transform: scale(0.96); }
@media (hover: hover) { .btn-ghost:hover { background: var(--surface-2); } }
.shelf-list { display: grid; gap: 12px; }
.hl-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; display: grid; gap: 9px; }
.hl-item-head { display: flex; align-items: flex-start; gap: 10px; }
.hl-item-title { font-weight: 700; font-size: 15.5px; line-height: 1.3; flex: 1; }
.hl-range { color: var(--accent); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; padding: 4px 9px; border-radius: var(--29d-pill); white-space: nowrap; }
.badge.sent { background: var(--29d-green-100); color: var(--29d-green-700); }
.badge.unsent { background: var(--29d-amber-100); color: var(--29d-amber-700); }
.hl-excerpt { margin: 0; color: var(--ink); font-size: 14.5px; line-height: 1.55; }
.hl-excerpt-note { margin: 0; color: var(--ink-faint); font-size: 12px; }
.hl-note-input {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--ink); font-size: 16px; width: 100%; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hl-note-input:focus { border-color: var(--accent); box-shadow: var(--29d-focus-halo); }
.hl-item-actions { display: flex; gap: 8px; }
.btn-sm { padding: 9px 15px; min-height: 40px; font-size: 13.5px; }
.hl-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 10px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; transition: background 0.15s;
}
@media (hover: hover) { .hl-row:hover { background: var(--surface-2); } }
.hl-row-range { color: var(--accent); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hl-row-note { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-empty { color: var(--ink-dim); font-size: 14.5px; margin: 4px 0 10px; line-height: 1.5; }

.site-foot { margin-top: 44px; color: var(--ink-faint); font-size: 12.5px; line-height: 1.55; }

/* ---------- mini-player ---------- */
.player {
  position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6px); z-index: 40;
  height: var(--player-h); display: flex; align-items: center; gap: 11px; padding: 0 10px 0 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--29d-r-4); cursor: pointer;
  box-shadow: var(--29d-shadow-pop);
  transition: transform 0.3s var(--spring);
  overflow: hidden;
}
.player:active { transform: scale(0.99); }
.p-progress { position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: var(--surface-2); }
.p-progress > div { height: 100%; background: var(--accent); width: 0%; }
.p-cover { width: 46px; height: 46px; border-radius: var(--29d-r-2); object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); }
.p-meta { flex: 1; min-width: 0; }
.p-title { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-status { font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-status.error { color: var(--bad); }
.mini-hl {
  flex: none; font-size: 12.5px; font-weight: 800; color: var(--accent-ink); background: var(--accent);
  padding: 8px 12px; border-radius: var(--29d-pill); min-height: 36px; transition: transform 0.13s var(--spring), background 0.2s;
}
.mini-hl:active { transform: scale(0.93); }
.mini-hl.is-marking { animation: pulse 1.2s ease-in-out infinite; }
.icon-btn {
  display: flex; align-items: center; justify-content: center; border-radius: var(--29d-pill); color: var(--ink);
  transition: transform 0.13s var(--spring), background 0.2s; min-width: 44px; min-height: 44px;
}
.icon-btn:active { transform: scale(0.88); }
.toggle-wrap { position: relative; display: inline-flex; flex: none; }
.toggle-btn { width: 46px; height: 46px; color: var(--ink); }
.toggle-btn .ic { width: 27px; height: 27px; }
.spin {
  position: absolute; inset: 3px; border-radius: var(--29d-pill); pointer-events: none;
  border: 2.5px solid color-mix(in srgb, var(--29d-text-1) 20%, transparent); border-top-color: var(--29d-text-1); animation: rot 0.8s linear infinite;
}
.spin-lg { inset: 3px; }
.np .spin { border-color: color-mix(in srgb, var(--29d-on-coral) 35%, transparent); border-top-color: var(--29d-on-coral); }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- now playing ---------- */
.np {
  position: fixed; inset: 0; z-index: 45; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, color-mix(in srgb, rgb(var(--wash)) 42%, var(--29d-bg)) 0%, var(--29d-bg) 76%);
  transform: translateY(103%); transition: transform 0.48s var(--spring), visibility 0.48s;
  visibility: hidden;
}
.np.open { transform: none; visibility: visible; }
.np-wash { position: absolute; inset: 0; background: radial-gradient(110% 55% at 50% 0%, color-mix(in srgb, rgb(var(--wash)) 50%, transparent), transparent 70%); pointer-events: none; transition: opacity 0.6s; }
.np-inner {
  position: relative; max-width: 520px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; min-height: 100%;
}
.np-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.np-top .icon-btn { background: var(--surface); border: 1px solid var(--line); }
.np-top-mid { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.np-overline { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
.np-album { font-size: 13px; font-weight: 650; }
.np-cover-wrap { position: relative; margin: 4px auto 22px; width: min(78vw, 340px); }
.np-cover {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--29d-r-4); display: block;
  box-shadow: var(--29d-shadow-modal); background: var(--surface-2); border: 1px solid var(--line);
  transition: transform 0.5s var(--spring);
}
.np.paused .np-cover { transform: scale(0.94); }
.np-cover-wrap .eq { left: auto; right: 10px; }
.np-title { font-family: var(--29d-font-display); font-size: 21px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 4px; }
.np-status { font-size: 13.5px; color: var(--ink-dim); margin: 0 0 6px; }
.np-status.error { color: var(--bad); }
.seek { position: relative; padding: 14px 0 4px; cursor: pointer; touch-action: none; margin-top: 8px; }
.seek-track { position: relative; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--29d-text-1) 14%, transparent); transition: height 0.15s; }
.seek.dragging .seek-track { height: 8px; }
.seek-buffered { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--29d-text-1) 24%, transparent); border-radius: 5px; }
.seek-played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--29d-text-1); border-radius: 5px; }
.seek-markers { position: absolute; inset: 0; }
.seek-marker { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; opacity: 0.9; }
.seek-thumb {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: var(--29d-pill); background: var(--29d-text-1);
  transform: translate(-50%, -50%) scale(0.6); transition: transform 0.15s; box-shadow: var(--29d-shadow-pop);
}
.seek:hover .seek-thumb, .seek.dragging .seek-thumb { transform: translate(-50%, -50%) scale(1); }
.seek-bubble {
  position: absolute; top: -24px; transform: translateX(-50%); background: var(--29d-text-1); color: var(--29d-bg);
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--29d-r-2); font-variant-numeric: tabular-nums; pointer-events: none;
}
.np-times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-dim); font-variant-numeric: tabular-nums; margin-top: 5px; }
.np-transport { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 6px; }
.skip-btn { width: 54px; height: 54px; color: var(--ink); }
.skip-btn .ic { width: 34px; height: 34px; }
.np-play { width: 72px; height: 72px; background: var(--accent); color: var(--accent-ink); margin: 0 8px; box-shadow: var(--29d-shadow-modal); }
.np-play .ic { width: 32px; height: 32px; }
@media (hover: hover) { .np-play:hover { background: var(--accent-hover); } }
.np-play:active { transform: scale(0.93); }
.np-rate-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.np-rate-label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.rate-btn { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 16px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; min-height: 38px; transition: transform 0.13s var(--spring); }
.rate-btn:active { transform: scale(0.93); }
.np-hl-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.hl-btn.is-marking { animation: pulse 1.2s ease-in-out infinite; }
.np-hl-status { text-align: center; color: var(--accent); font-size: 13.5px; font-weight: 650; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.np-upnext {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; margin-top: 24px;
}
.np-upnext-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.np-upnext-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-upnext .icon-btn { background: var(--surface-2); }
.np-ep-highlights { margin-top: 26px; }
.np-ep-highlights .np-overline { display: block; margin-bottom: 10px; }
.np-shortcuts { margin-top: 28px; color: var(--ink-faint); font-size: 12.5px; text-align: center; line-height: 2; }
.np-shortcuts kbd {
  background: var(--surface-2); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: var(--29d-r-1); padding: 1px 6px; font-family: var(--29d-font-mono); font-size: 11.5px;
}

/* ---------- toast ---------- */
.toast-zone { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--player-h) + 22px); z-index: 55; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.app.no-player ~ .toast-zone, body:has(.app.no-player) .toast-zone { bottom: calc(var(--tabbar-h) + 22px); }
.toast {
  background: var(--29d-overlay); color: var(--ink); border: 1px solid var(--line); font-size: 14px; font-weight: 650; padding: 11px 18px; border-radius: var(--29d-pill);
  box-shadow: var(--29d-shadow-pop); animation: toast-in 0.3s var(--spring) both; max-width: 92vw; text-align: center;
}
.toast.error { background: var(--29d-red-100); color: var(--29d-red-700); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }

/* ---------- wide screens: left rail, bottom player bar ---------- */
@media (min-width: 960px) {
  .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--rail-w); padding: 26px 16px; background: var(--surface-2); z-index: 30;
    border-right: 1px solid var(--line);
  }
  .rail-mark { font-family: var(--29d-font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; padding: 0 10px 20px; }
  .rail-mark span { color: var(--accent); }
  .rail-nav { display: grid; gap: 4px; }
  .rail .nav-btn {
    flex-direction: row; justify-content: flex-start; gap: 13px; padding: 0 12px; min-height: 48px;
    border-radius: var(--radius-sm); font-size: 14.5px;
  }
  .rail .nav-btn:hover { color: var(--ink); background: var(--29d-wash); }
  .rail .nav-btn.active { background: var(--surface); color: var(--ink); }
  .rail .nav-btn.active::before { display: none; }
  .rail .nav-badge { position: static; margin-left: auto; }
  .rail-lock {
    margin-top: auto; display: flex; align-items: center; gap: 11px; color: var(--ink-dim);
    font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); min-height: 48px;
  }
  .rail-lock:hover { color: var(--ink); background: var(--29d-wash); }
  .rail-lock .ic { width: 20px; height: 20px; }
  .content { margin-left: var(--rail-w); padding: 30px 38px 130px; max-width: 1240px; }
  .app.no-player .content { padding-bottom: 48px; }
  .player {
    left: var(--rail-w); right: 0; bottom: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; height: 76px; padding: 0 18px;
  }
  .shelf-row { margin: 0; padding-left: 2px; padding-right: 2px; grid-auto-columns: 168px; }
  .shelf-row.wide { grid-auto-columns: 340px; }
  .toast-zone { bottom: 100px; }
  .greeting { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
