/* ============================================================================
   AetherPlayer 5 — "Aurora" UI
   Colours follow the cover art (--c1..--c3, set by visuals.js), motion follows
   the music (--energy / --bass 0..1). Without JS the defaults below apply.
   ============================================================================ */

@property --energy { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --bass { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --c1 { syntax: '<color>'; inherits: true; initial-value: #8b5cf6; }
@property --c2 { syntax: '<color>'; inherits: true; initial-value: #22d3ee; }
@property --c3 { syntax: '<color>'; inherits: true; initial-value: #f472b6; }
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: dark;
  --bg: #08070d;
  --fg: #f5f3ff;
  --fg-2: rgb(245 243 255 / .68);
  --fg-3: rgb(245 243 255 / .42);
  --line: rgb(255 255 255 / .08);
  --line-2: rgb(255 255 255 / .14);
  --surface: rgb(255 255 255 / .045);
  --surface-2: rgb(255 255 255 / .08);
  --grad: linear-gradient(120deg, var(--c1), var(--c2) 55%, var(--c3));
  --radius: 24px;
  --font: 'Inter', system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --display: 'Outfit', var(--font);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --art-url: none;
  transition: --c1 1.2s ease, --c2 1.2s ease, --c3 1.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body:has(#player-workspace:not(.hidden)) { overflow: hidden; height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3, h4, p { margin: 0; }
.hidden { display: none !important; }
::selection { background: color-mix(in oklab, var(--c1) 60%, transparent); }
:focus-visible { outline: 2px solid color-mix(in oklab, var(--c2) 80%, white); outline-offset: 2px; }
svg.lucide { width: 18px; height: 18px; flex: none; }

* { scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------------------------------------------------------------- backdrop */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.aurora-art {
  position: absolute; inset: -10%;
  background: var(--art-url) center / cover no-repeat;
  filter: blur(80px) saturate(1.5);
  opacity: .28;
  transform: scale(calc(1.05 + var(--bass) * .06));
}
.blob {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(70px); opacity: calc(.32 + var(--energy) * .3); mix-blend-mode: screen;
  animation: drift 26s ease-in-out infinite alternate;
}
.b1 { background: radial-gradient(circle, var(--c1), transparent 62%); top: -22vmax; left: -14vmax; }
.b2 { background: radial-gradient(circle, var(--c2), transparent 62%); bottom: -26vmax; right: -16vmax; animation-duration: 32s; animation-delay: -8s; }
.b3 { background: radial-gradient(circle, var(--c3), transparent 62%); top: 30%; left: 40%; width: 44vmax; height: 44vmax; opacity: calc(.18 + var(--energy) * .25); animation-duration: 38s; animation-delay: -16s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vmax, 6vmax) scale(1.12); }
  100% { transform: translate(-6vmax, 10vmax) scale(.95); }
}
.grain {
  position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.aurora::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgb(4 3 8 / .75) 100%);
}

/* ---------------------------------------------------------------- primitives */
.glass {
  background: color-mix(in oklab, rgb(18 16 28) 55%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}
.glass-strong {
  background: color-mix(in oklab, rgb(16 14 24) 82%, transparent);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(32px) saturate(170%);
  -webkit-backdrop-filter: blur(32px) saturate(170%);
  box-shadow: 0 24px 60px -12px rgb(0 0 0 / .6);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  transition: transform .25s var(--spring), background .2s, box-shadow .3s, border-color .2s;
}
.btn:active { transform: scale(.95); }
.btn-primary {
  background: var(--grad); background-size: 160% 100%; color: #0b0912;
  box-shadow: 0 8px 28px -8px color-mix(in oklab, var(--c1) 70%, transparent);
  animation: grad-pan 8s ease-in-out infinite alternate;
}
.btn-primary:hover { box-shadow: 0 10px 36px -6px color-mix(in oklab, var(--c2) 70%, transparent); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); border-color: var(--line-2); }
@keyframes grad-pan { to { background-position: 100% 0; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--fg-2); transition: background .2s, color .2s, transform .25s var(--spring);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn:active { transform: scale(.9); }
.like-btn.liked, .source-like-btn.liked, .mini-btn.liked { color: #ff5d8f; }
.like-btn.liked svg, .source-like-btn.liked svg, .mini-btn.liked svg { fill: currentColor; animation: pop .45s var(--spring); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: rgb(0 0 0 / .25); border: 1px solid var(--line); color: var(--fg-2); font-size: 13px; font-weight: 500;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .2s, color .2s;
}
.pill-btn:hover { background: var(--surface-2); color: var(--fg); }
.pill-btn svg { width: 15px; height: 15px; }

.btn-ghost-sm {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
  color: var(--fg-3); font-size: 12.5px; font-weight: 500; transition: background .2s, color .2s;
}
.btn-ghost-sm:hover { background: var(--surface); color: var(--fg); }
.btn-ghost-sm svg { width: 15px; height: 15px; }

.count-badge {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--fg-2); font: 600 11px var(--mono);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2);
}
.eyebrow.small { font-size: 10.5px; letter-spacing: .16em; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c2); box-shadow: 0 0 12px var(--c2); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.grad-text {
  background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-pan 6s ease-in-out infinite alternate;
}

.loader { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(0 0 0 / .25); border-top-color: #0b0912; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  background: var(--grad); color: #0b0912; box-shadow: 0 6px 22px -6px var(--c1);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 10px; }
.brand-name { font: 700 18px var(--display); letter-spacing: -.01em; }
.clickable-logo { cursor: pointer; }

.nav-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px;
  color: var(--fg-2); font-size: 13px; font-weight: 500; transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--surface); color: var(--fg); }
.nav-link svg { width: 16px; height: 16px; }
button.nav-link { background: none; border: 0; font-family: inherit; cursor: pointer; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px;
  color: var(--fg-3); font-weight: 600; font-size: 13px; transition: background .25s, color .25s;
}
.segmented button svg { width: 15px; height: 15px; }
.segmented button.active { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.segmented.small { align-self: flex-start; }
.segmented.small button { padding: 6px 12px; font-size: 12px; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 1.6px solid var(--fg-3); border-bottom: 1.6px solid var(--fg-3); transform: translateY(-70%) rotate(45deg);
}
.styled-select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 42px; padding: 0 36px 0 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--fg);
  font-size: 13.5px; font-weight: 500; cursor: pointer; transition: border-color .2s, background .2s;
  text-overflow: ellipsis;
}
.styled-select:hover { background: var(--surface-2); border-color: var(--line-2); }
.styled-select option { background: #15121f; color: var(--fg); }

.switch { position: relative; display: inline-block; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track {
  display: block; width: 52px; height: 30px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line-2); transition: background .35s, box-shadow .35s; position: relative;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / .4); transition: transform .4s var(--spring);
}
.switch input:checked + .switch-track { background: var(--grad); border-color: transparent; box-shadow: 0 0 22px -4px var(--c1); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--c2); outline-offset: 2px; }

/* range sliders (--p is kept in sync by visuals.js) */
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0;
  --p: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, var(--c1), var(--c2) var(--p), rgb(255 255 255 / .12) var(--p));
}
input[type=range]::-moz-range-track { height: 5px; border-radius: 99px; background: rgb(255 255 255 / .12); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--c2) 35%, transparent), 0 2px 8px rgb(0 0 0 / .5);
  transform: scale(0); transition: transform .25s var(--spring);
}
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px color-mix(in oklab, var(--c2) 35%, transparent); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { transform: scale(1); }
@media (hover: none) { input[type=range]::-webkit-slider-thumb { transform: scale(1); } }

/* ================================================================ LANDING */
.landing { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 20px; }
.landing-nav { width: min(1120px, 100%); display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.nav-links { display: flex; gap: 4px; }

.hero { width: min(760px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 5vh 0 40px; }

.hero-orb { position: relative; width: 132px; height: 132px; margin-bottom: 18px; }
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from var(--spin), var(--c1), var(--c2), var(--c3), var(--c1));
  animation: orb-spin 6s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 57%, #000 60%); mask: radial-gradient(circle, transparent 57%, #000 60%);
}
.hero-orb::before {
  content: ''; position: absolute; inset: -18%; border-radius: 50%;
  background: conic-gradient(from 90deg, var(--c1), var(--c2), var(--c3), var(--c1));
  filter: blur(34px); opacity: .45; animation: spin 14s linear infinite;
}
@keyframes orb-spin { to { --spin: 360deg; } }
.orb-core {
  position: absolute; inset: 14px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, rgb(255 255 255 / .18), rgb(20 16 32 / .92) 70%);
  border: 1px solid var(--line-2); box-shadow: inset 0 0 30px rgb(0 0 0 / .6);
}
.orb-core svg { width: 40px; height: 40px; color: #fff; opacity: .92; }
.orb-bars { position: absolute; left: 50%; bottom: -30px; translate: -50% 0; display: flex; gap: 4px; align-items: end; height: 18px; }
.orb-bars i { width: 4px; height: 4px; border-radius: 3px; background: var(--grad); animation: eq 1.1s ease-in-out infinite; }
.orb-bars i:nth-child(2) { animation-delay: -.2s; } .orb-bars i:nth-child(3) { animation-delay: -.5s; }
.orb-bars i:nth-child(4) { animation-delay: -.8s; } .orb-bars i:nth-child(5) { animation-delay: -.35s; }
.orb-bars i:nth-child(6) { animation-delay: -.65s; } .orb-bars i:nth-child(7) { animation-delay: -.95s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 18px; } }

.hero-title { font: 800 clamp(34px, 6.4vw, 68px)/1.1 var(--display); letter-spacing: -.03em; margin-top: 4px; }
.hero-sub { max-width: 560px; color: var(--fg-2); font-size: clamp(14px, 1.6vw, 16px); }

.import-bar {
  width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 6px 6px 18px;
  border-radius: 999px; background: color-mix(in oklab, rgb(20 17 30) 70%, transparent);
  border: 1px solid var(--line-2); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px -20px color-mix(in oklab, var(--c1) 55%, transparent);
  transition: border-color .3s, box-shadow .3s;
}
.import-bar:focus-within { border-color: color-mix(in oklab, var(--c2) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c2) 18%, transparent), 0 20px 60px -20px var(--c2); }
.import-icon { color: var(--fg-3); }
#landing-input { flex: 1; min-width: 0; height: 44px; background: none; border: 0; outline: none; font-size: 15px; }
#landing-input::placeholder { color: var(--fg-3); }
#landing-btn { height: 46px; padding: 0 22px; }
#landing-btn-text { display: inline-flex; align-items: center; gap: 6px; }
#landing-btn-text svg { width: 16px; height: 16px; fill: currentColor; }

.quick-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.quick-label { color: var(--fg-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin-right: 2px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); font-size: 13px; font-weight: 500;
  transition: background .2s, color .2s, transform .25s var(--spring), border-color .2s;
}
.chip-btn:hover { background: var(--surface-2); color: var(--fg); border-color: color-mix(in oklab, var(--c1) 50%, transparent); transform: translateY(-2px); }
.chip-btn svg { width: 15px; height: 15px; }
.landing-helper-text { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-3); font-size: 12px; }
.landing-helper-text svg { width: 14px; height: 14px; }
.landing-helper-text b { color: var(--fg-2); font-weight: 600; }

.landing-library { width: min(1120px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 40px; }
.library-grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.library-col { border-radius: var(--radius); padding: 16px; min-height: 180px; max-height: 360px; display: flex; flex-direction: column; gap: 10px; }
.library-col h4, .dropdown-grid h4 {
  display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--fg-3);
}
.library-col h4 svg, .dropdown-grid h4 svg { width: 14px; height: 14px; }
.history-list, .favorites-list, .dropdown-history-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; }

.history-item, .favorite-item {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.history-item:hover, .favorite-item:hover { background: var(--surface-2); border-color: var(--line); transform: translateX(3px); }
.history-item-title, .favorite-item-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-sub, .favorite-item-sub { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-history, .empty-list { padding: 20px 8px; text-align: center; color: var(--fg-3); font-size: 12.5px; }

.landing-footer { margin-top: auto; padding: 20px 0 28px; color: var(--fg-3); font-size: 11.5px; text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .hero > *, .landing-library { animation: rise .9s var(--ease) both; }
  .hero > :nth-child(2) { animation-delay: .06s; } .hero > :nth-child(3) { animation-delay: .12s; }
  .hero > :nth-child(4) { animation-delay: .18s; } .hero > :nth-child(5) { animation-delay: .24s; }
  .hero > :nth-child(6) { animation-delay: .3s; } .hero > :nth-child(7) { animation-delay: .36s; }
  .landing-library { animation-delay: .42s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

/* ================================================================ WORKSPACE */
.workspace { height: 100dvh; display: flex; flex-direction: column; gap: 12px; padding: 12px; }
@media (prefers-reduced-motion: no-preference) { .workspace { animation: rise .7s var(--ease) both; } }

.topbar { position: relative; z-index: 30; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 12px 0 14px; border-radius: 20px; flex: none; }
.topbar-links { gap: 2px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-icon-text { height: 38px; padding: 0 14px; font-size: 13px; }
.btn-icon-text svg { width: 16px; height: 16px; }
.desktop-only-flex { display: flex; }
.mobile-only-inline { display: none; }

.history-dropdown-wrapper { position: relative; }
.header-history-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(760px, 92vw); padding: 16px; border-radius: 22px;
  display: flex; flex-direction: column; gap: 14px; transform-origin: top right;
  transition: opacity .25s, transform .3s var(--ease), display .3s allow-discrete;
}
@starting-style { .header-history-dropdown { opacity: 0; transform: scale(.96) translateY(-6px); } }
.dropdown-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dropdown-grid > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dropdown-history-list { max-height: 300px; }

.app-workspace {
  flex: 1; min-height: 0; display: grid; gap: 12px;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr) minmax(300px, 350px);
}
.panel { border-radius: var(--radius); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------------------------------------------------------------- library */
.sidebar-header { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.sidebar-nav-buttons { display: flex; justify-content: space-between; }
.source-info { display: flex; align-items: center; gap: 14px; }
.source-cover { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; box-shadow: 0 10px 30px -10px var(--c1); flex: none; }
.source-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.source-badge {
  align-self: flex-start; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: color-mix(in oklab, var(--c1) 22%, transparent); color: color-mix(in oklab, var(--c1) 40%, white);
}
.source-title-row { display: flex; align-items: center; gap: 4px; }
#source-name { font: 700 18px/1.2 var(--display); flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.source-like-btn { width: 34px; height: 34px; flex: none; }

.sidebar-content { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 8px 16px; display: flex; flex-direction: column; gap: 14px; }
.section-title { display: flex; align-items: center; gap: 7px; padding: 4px 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.section-title svg { width: 14px; height: 14px; }
.tracks-section-header { display: flex; align-items: center; justify-content: space-between; padding-right: 8px; }
.playlists-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.playlist-chip-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; transition: background .2s, border-color .2s;
}
.playlist-chip-btn span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-chip-btn svg { width: 15px; height: 15px; color: var(--fg-3); }
.playlist-chip-btn:hover { background: var(--surface-2); border-color: color-mix(in oklab, var(--c2) 40%, transparent); }

.tracks-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.track-item {
  position: relative; display: grid; grid-template-columns: 26px 44px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 7px 10px 7px 6px; border-radius: 14px; cursor: pointer;
  transition: background .2s, transform .25s var(--ease);
}
.track-item:hover { background: var(--surface-2); }
.track-item:active { transform: scale(.985); }
.track-item-idx { position: relative; text-align: center; font: 500 12px var(--mono); color: var(--fg-3); }
.track-item-cover { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.track-item-info { display: flex; flex-direction: column; min-width: 0; }
.track-item-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-item-artist { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-item.active {
  background: linear-gradient(90deg, color-mix(in oklab, var(--c1) 26%, transparent), color-mix(in oklab, var(--c2) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c1) 35%, transparent);
}
.track-item.active .track-item-title { color: #fff; }
.track-item.active .track-item-idx { color: transparent; height: 16px; }
.track-item.active .track-item-idx::before { /* a tiny equalizer instead of the number */
  content: ''; position: absolute; left: 50%; bottom: 0; width: 3px; height: 100%; translate: -50% 0; border-radius: 2px;
  background: var(--c2); box-shadow: -6px 0 0 0 var(--c1), 6px 0 0 0 var(--c3);
  animation: eq-mini .9s ease-in-out infinite;
}
body:not(.playing) .track-item.active .track-item-idx::before { animation-play-state: paused; }
@keyframes eq-mini { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sidebar-content .track-item, .sidebar-content .playlist-chip-btn {
      animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 90%;
    }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---------------------------------------------------------------- stage */
.stage {
  position: relative; border-radius: calc(var(--radius) + 4px); overflow: hidden; min-height: 0; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--c1) 14%, transparent), transparent 60%),
              color-mix(in oklab, rgb(14 12 22) 40%, transparent);
  border: 1px solid var(--line);
}
.player-modal-header { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; pointer-events: none; }
.player-modal-header > * { pointer-events: auto; }
.header-right-actions { margin-left: auto; display: flex; gap: 8px; }
.close-player-btn { display: none; }
#open-playlist-btn { display: none; }

.stage-body {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; align-items: center;
  gap: clamp(10px, 2vh, 20px); padding: 60px clamp(16px, 4vw, 48px) 24px;
}
.stage-body > * { width: min(560px, 100%); flex: none; }
.stage-body > :first-child { margin-top: auto; }
.stage-body > :last-child { margin-bottom: auto; }

.art-stage { position: relative; width: clamp(200px, min(36vh, 32vw), 380px) !important; aspect-ratio: 1; margin-bottom: 4px; }
.viz-halo { position: absolute; inset: -24%; width: 148%; height: 148%; pointer-events: none; }
.art-glow {
  position: absolute; inset: 4%; border-radius: 28px; background: var(--art-url) center / cover;
  filter: blur(42px) saturate(1.8); opacity: calc(.5 + var(--bass) * .45);
  transform: scale(calc(1.02 + var(--bass) * .14));
}
.artwork-wrapper {
  position: relative; width: 100%; height: 100%; border-radius: 26px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .1);
  transform: scale(calc(.95 + var(--bass) * .06)); transition: transform .8s var(--spring), filter .8s;
}
body.playing .artwork-wrapper { transition: transform .06s linear, filter .8s; }
body:not(.playing) .artwork-wrapper { transform: scale(.88); filter: saturate(.8) brightness(.9); }
.artwork-img { width: 100%; height: 100%; object-fit: cover; }
.artwork-img.swap { animation: art-in .7s var(--ease); }
@keyframes art-in { from { opacity: 0; transform: scale(1.12); filter: blur(12px); } }
.art-sheen {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / .4) 45%, transparent 60%);
  background-size: 250% 100%; animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

.track-details { display: flex; flex-direction: column; gap: 8px; }
.track-title-row { display: flex; align-items: flex-start; gap: 10px; }
.track-text { flex: 1; min-width: 0; }
#track-title { font: 700 clamp(20px, 2.4vw, 28px)/1.2 var(--display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#track-artist { color: var(--fg-2); font-size: 14.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-actions { display: flex; gap: 2px; margin-top: 2px; }
.ai-analyzing-indicator {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: color-mix(in oklab, var(--c2) 14%, transparent); border: 1px solid color-mix(in oklab, var(--c2) 35%, transparent);
  color: color-mix(in oklab, var(--c2) 45%, white);
}
.spinner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c2); animation: ping 1s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--c2); } 100% { box-shadow: 0 0 0 10px transparent; } }

.viz-wave { height: 54px; display: block; margin: -4px 0 -10px; }

.player-progress { display: flex; flex-direction: column; gap: 2px; }
.time-row { display: flex; justify-content: space-between; }
.time-label { font: 500 11.5px var(--mono); color: var(--fg-3); }

.player-controls { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2.4vw, 22px); }
.ctrl-btn { position: relative; display: grid; place-items: center; border-radius: 50%; color: var(--fg-2); transition: transform .3s var(--spring), color .2s, background .2s; }
.ctrl-btn:hover { color: var(--fg); background: var(--surface); }
.ctrl-btn:active { transform: scale(.88); }
.sub-ctrl { width: 42px; height: 42px; }
.sub-ctrl svg { width: 19px; height: 19px; }
.sub-ctrl.active { color: var(--c2); }
.sub-ctrl.active::after { content: ''; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.step-ctrl { width: 50px; height: 50px; color: var(--fg); }
.step-ctrl svg { width: 24px; height: 24px; fill: currentColor; }
.play-btn {
  width: 74px; height: 74px; color: #0b0912;
  background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 14px 40px -10px var(--c1), 0 0 calc(8px + var(--energy) * 48px) calc(var(--energy) * 6px) color-mix(in oklab, var(--c2) 50%, transparent);
  animation: grad-pan 6s ease-in-out infinite alternate;
}
.play-btn:hover { color: #0b0912; transform: scale(1.05); }
.play-btn svg { width: 30px; height: 30px; fill: currentColor; }
.play-btn::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 1.5px solid color-mix(in oklab, var(--c2) 55%, transparent);
  transform: scale(calc(1 + var(--energy) * .14)); opacity: calc(.15 + var(--energy) * .85);
}

.player-footer { display: flex; align-items: center; gap: 14px; }
.volume-control { display: flex; align-items: center; gap: 8px; width: 140px; flex: none; color: var(--fg-3); }
.volume-control svg { width: 17px; height: 17px; }
.master-dock { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 18px; }
.dock-selects { flex: 1; min-width: 0; display: flex; gap: 4px; }
.dock-selects .select-wrap { flex: 1; min-width: 0; }
.dock-selects .styled-select { height: 36px; border-radius: 12px; font-size: 12.5px; padding-left: 10px; padding-right: 26px; background: transparent; border-color: transparent; }
.dock-selects .styled-select:hover { background: var(--surface); }
.dock-selects .select-wrap::after { right: 11px; width: 6px; height: 6px; }

.master-switch { position: relative; cursor: pointer; flex: none; }
.master-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.master-switch-ui {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 12px;
  background: var(--surface-2); color: var(--fg-2); font-size: 12.5px; font-weight: 700; transition: background .35s, color .25s, box-shadow .35s;
}
.master-switch-ui svg { width: 16px; height: 16px; }
.ms-state::before { content: 'OFF'; font: 600 10px var(--mono); padding: 1px 5px; border-radius: 5px; background: rgb(255 255 255 / .1); }
.master-switch input:checked + .master-switch-ui { background: var(--grad); color: #0b0912; box-shadow: 0 6px 24px -6px var(--c1); }
.master-switch input:checked + .master-switch-ui .ms-state::before { content: 'ON'; background: rgb(0 0 0 / .18); }
.master-switch input:checked + .master-switch-ui svg { animation: twinkle 2.4s ease-in-out infinite; }
.master-switch input:focus-visible + .master-switch-ui { outline: 2px solid var(--c2); outline-offset: 2px; }
@keyframes twinkle { 50% { transform: rotate(18deg) scale(1.15); } }

/* sheets (lyrics / tracklist) */
.sheet {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column;
  background: color-mix(in oklab, rgb(12 10 20) 86%, transparent); backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%);
  transform: translateY(102%); visibility: hidden;
  transition: transform .5s var(--ease), visibility 0s .5s;
}
.player-lyrics-overlay.active-lyrics, .player-playlist-overlay.active-playlist { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px 22px; border-bottom: 1px solid var(--line); }
.sheet-header h3 { display: flex; align-items: center; gap: 8px; font: 700 17px var(--display); }
.sheet-header h3 svg { color: var(--c2); }
.lyrics-text {
  flex: 1; overflow-y: auto; padding: 28px clamp(20px, 6vw, 60px) 60px; white-space: pre-wrap;
  font: 500 clamp(16px, 1.8vw, 20px)/1.9 var(--font); color: var(--fg-2); text-align: center;
  -webkit-mask: linear-gradient(transparent, #000 40px, #000 calc(100% - 60px), transparent); mask: linear-gradient(transparent, #000 40px, #000 calc(100% - 60px), transparent);
}
.sheet .tracks-list { flex: 1; overflow-y: auto; padding: 8px 10px 20px; margin: 0; }

/* ---------------------------------------------------------------- enhancer */
.utility-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.utility-header h3 { font: 700 20px var(--display); margin-top: 3px; letter-spacing: -.01em; }
.utility-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.utility-body > *, .sidebar-content > * { flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }

.spectrum-card { border-radius: 18px; padding: 12px 12px 8px; background: rgb(0 0 0 / .25); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.spectrum-head { display: flex; align-items: center; justify-content: space-between; }
.viz-spectrum { width: 100%; height: 110px; display: block; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 700 10px var(--mono); letter-spacing: .06em; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.idle { background: var(--surface-2); color: var(--fg-3); }
.status-badge.loading { background: color-mix(in oklab, var(--c2) 16%, transparent); color: color-mix(in oklab, var(--c2) 55%, white); }
.status-badge.loading::before { animation: blink .8s infinite; }
.status-badge.active { background: color-mix(in oklab, #34d399 18%, transparent); color: #6ee7b7; }
.status-badge.active::before { box-shadow: 0 0 8px currentColor; animation: blink 2s infinite; }

.insight-list { display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.insight { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; }
.insight + .insight { border-top: 1px solid var(--line); }
.insight .lbl { color: var(--fg-3); font-size: 12px; flex: none; }
.insight .val { font-weight: 600; font-size: 12.5px; text-align: right; }

.param-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.param { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.param .lbl { font-size: 10.5px; color: var(--fg-3); font-weight: 600; letter-spacing: .04em; }
.param .val { font: 600 13px var(--mono); }
.param.wide { grid-column: 1 / -1; }
.param.accent { background: linear-gradient(120deg, color-mix(in oklab, var(--c1) 18%, transparent), color-mix(in oklab, var(--c2) 10%, transparent)); border-color: color-mix(in oklab, var(--c1) 35%, transparent); }
.param.accent .val { font-size: 14px; }
.param-grid, .insight-list { transition: opacity .4s, filter .4s; }
body:not(.mastering-on) .param-grid, body:not(.mastering-on) .insight-list { opacity: .45; filter: saturate(.3); }
.val.flash { animation: flash 1.1s var(--ease); }
@keyframes flash { 0% { color: var(--c2); text-shadow: 0 0 14px var(--c2); } }

/* ---------------------------------------------------------------- mini player / mobile nav */
.mini-player {
  position: fixed; left: 10px; right: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 40;
  border-radius: 18px; overflow: hidden; cursor: pointer;
}
.mini-player-progress-line { height: 2px; background: rgb(255 255 255 / .08); }
.mini-progress-fill { height: 100%; width: 0; background: var(--grad); }
.mini-player-content { display: flex; align-items: center; gap: 10px; padding: 8px; }
.mini-artwork { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; }
.mini-track-info { flex: 1; min-width: 0; }
.mini-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player-actions { display: flex; align-items: center; gap: 2px; }
.mini-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--fg-2); }
.mini-play-btn { background: var(--grad); color: #0b0912; }
.mini-play-btn svg, #mini-next-btn svg { fill: currentColor; }

.mobile-nav-bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 41;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; border-radius: 22px;
}
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border-radius: 16px; color: var(--fg-3); font-size: 10.5px; font-weight: 600; transition: color .25s, background .25s; }
.nav-btn svg { width: 21px; height: 21px; transition: transform .35s var(--spring); }
.nav-btn.active { color: var(--fg); background: var(--surface-2); }
.nav-btn.active svg { transform: translateY(-1px) scale(1.08); color: var(--c2); }

/* ---------------------------------------------------------------- toast / modal */
.toast-notification {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; translate: -50% 0; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
  transition: opacity .3s, transform .4s var(--spring), display .4s allow-discrete;
}
.toast-notification svg { color: #6ee7b7; }
@starting-style { .toast-notification { opacity: 0; transform: translateY(16px) scale(.95); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: rgb(4 3 8 / .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .3s, display .3s allow-discrete;
}
@starting-style { .modal-backdrop { opacity: 0; } .modal-backdrop .modal-dialog { transform: translateY(20px) scale(.96); } }
.modal-dialog { width: min(480px, 100%); max-height: 86dvh; overflow-y: auto; border-radius: 26px; padding: 18px; transition: transform .45s var(--spring); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title-group { display: flex; align-items: center; gap: 12px; }
.modal-icon-badge { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--grad); color: #0b0912; }
.modal-title { font: 700 18px var(--display); }
.modal-sub { font-size: 12.5px; color: var(--fg-3); }
.share-options-list { display: flex; flex-direction: column; gap: 8px; }
.share-option-card {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; text-align: left;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: background .2s, border-color .2s, transform .25s var(--spring);
}
.share-option-card:hover { background: var(--surface-2); border-color: color-mix(in oklab, var(--c1) 45%, transparent); transform: translateY(-2px); }
.share-option-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-option-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; background: color-mix(in oklab, var(--c1) 20%, transparent); color: color-mix(in oklab, var(--c1) 45%, white); overflow: hidden; }
.share-option-icon img { width: 100%; height: 100%; object-fit: cover; }
.share-option-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-option-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; min-width: 0; }
.share-option-tag { padding: 1px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); color: var(--fg-2); flex: none; }
.share-option-desc { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-option-action { color: var(--fg-3); flex: none; }

/* ================================================================ RESPONSIVE */

/* tablet / small laptop: library | stage, enhancer below the stage */
@media (min-width: 769px) and (max-width: 1279px) {
  .app-workspace {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    overflow-y: auto; align-items: start;
  }
  .workspace-sidebar { grid-row: 1 / span 2; position: sticky; top: 0; height: calc(100dvh - 96px); }
  .workspace-player { height: calc(100dvh - 96px); }
  .workspace-utility { overflow: visible; }
  .utility-body { overflow: visible; display: grid; grid-template-columns: 1fr 1fr; }
  .spectrum-card, .param-grid, .insight-list { grid-column: 1 / -1; }
  .param-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .volume-control { width: 110px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .topbar-links { display: none; }
  .player-footer { flex-wrap: wrap; }
  .volume-control { width: 100%; order: 2; }
}

/* phone */
@media (max-width: 768px) {
  .landing { padding: 0 16px; }
  .landing-nav { padding: 14px 0; }
  .nav-link span { display: none; }
  .hero { padding-top: 3vh; gap: 14px; }
  .hero-orb { width: 104px; height: 104px; }
  .import-bar { padding-left: 14px; }
  #landing-btn { padding: 0 16px; }
  .library-grid { grid-template-columns: 1fr; }
  .library-col { max-height: 260px; min-height: 0; }

  .workspace { padding: 8px 8px 0; gap: 8px; }
  .topbar { height: 52px; border-radius: 16px; padding: 0 8px 0 10px; }
  .desktop-only-flex { display: none; }
  .mobile-only-inline { display: inline-flex; }
  .btn-text { display: none; }
  .btn-icon-text { width: 38px; padding: 0; }
  .brand-name { font-size: 16px; }
  .dropdown-grid { grid-template-columns: 1fr; }
  .header-history-dropdown { position: fixed; left: 8px; right: 8px; top: 66px; width: auto; max-height: 70dvh; overflow-y: auto; }

  .app-workspace { display: block; position: relative; }
  .app-workspace > section { display: none; height: 100%; }
  .app-workspace > section.active-tab { display: flex; }
  .workspace-sidebar .sidebar-content, .utility-body { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .sheet .tracks-list, .sheet .lyrics-text { padding-bottom: calc(160px + env(safe-area-inset-bottom)); } /* clear the bottom nav + mini player */
  .stage { border-radius: 24px 24px 0 0; border-bottom: 0; }
  .panel { border-radius: 24px 24px 0 0; border-bottom: 0; }
  .stage-body { padding: 58px 18px calc(96px + env(safe-area-inset-bottom)); gap: 12px; }
  .art-stage { width: min(74vw, 38dvh) !important; }
  #open-playlist-btn { display: inline-flex; }
  .pill-btn span { display: none; }
  .pill-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .player-footer { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .volume-control { display: none; } /* phones: hardware volume */
  .master-dock { flex-wrap: wrap; }
  .master-switch { flex: 1 1 100%; }
  .master-switch-ui { width: 100%; justify-content: center; }
  .viz-wave { height: 44px; }
  .play-btn { width: 70px; height: 70px; }
  .toast-notification { bottom: calc(96px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
}
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  .app-workspace > section.active-tab { animation: tab-in .45s var(--ease); }
}
@keyframes tab-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@media (max-width: 768px) and (max-height: 700px) {
  .art-stage { width: min(62vw, 30dvh) !important; }
  .viz-wave { display: none; }
}
/* wide: the enhancer panel carries the selects, the dock keeps just the switch */
@media (min-width: 1280px) {
  .dock-selects { display: none; }
  .player-footer { justify-content: space-between; }
  .master-dock { flex: none; }
}
@media (min-width: 769px) {
  .mini-player, .mobile-nav-bar { display: none !important; }
}

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

/* ---------------------------------------------------------------- power */
.saver-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-note { font-size: 11.5px; line-height: 1.5; color: var(--fg-3); }

/* paused: decorative loops rest (loaders / status indicators keep running) */
body:not(.playing) :is(.blob, .btn-primary, .play-btn, .grad-text, .art-sheen, .eyebrow .dot, .master-switch svg) {
  animation-play-state: paused;
}

/* lite (phones / touch): cheaper blurs, static backdrop */
body.lite :is(.glass, .glass-strong) { backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
body.lite .aurora-art { filter: blur(40px) saturate(1.4); transform: scale(1.05); }
body.lite .blob { animation: none; filter: blur(50px); }
body.lite :is(.btn-primary, .play-btn, .grad-text, .art-sheen) { animation: none; }
body.lite .hero-orb::before { animation: none; }

/* saver: static and opaque, no canvases */
body.saver :is(.blob, #viz-halo, #viz-wave, #viz-spectrum, .art-sheen) { display: none; }
body.saver .aurora-art { filter: blur(40px) saturate(1.3); transform: none; }
body.saver .art-glow { transform: none; opacity: .5; }
body.saver :is(.glass, .glass-strong, .sheet) {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in oklab, rgb(16 14 24) 94%, transparent);
}
body.saver :is(.btn-primary, .play-btn, .grad-text, .eyebrow .dot, .master-switch svg, .orb-ring, .orb-bars i) { animation: none; }
body.saver .hero-orb::before, body.saver .track-item.active .track-item-idx::before { animation: none; }
body.saver .play-btn { box-shadow: 0 14px 40px -10px var(--c1); }

/* ---- tone preference (低音 / 高音) */
.tone-ctl { display: flex; gap: 14px; flex-wrap: wrap; }
.tone-item { display: inline-flex; align-items: center; gap: 6px; }
.tone-label { font-size: 12px; color: var(--fg-2); margin-right: 2px; }
.tone-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border, rgba(255,255,255,.14)); background: rgba(255,255,255,.06); color: var(--fg-1, inherit); font-size: 15px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; padding: 0; }
.tone-btn:hover { background: rgba(255,255,255,.12); }
.tone-btn:disabled { opacity: .35; cursor: default; }
.tone-val { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; }
.master-dock:has(.tone-ctl[data-compact]) { flex-wrap: wrap; }
.tone-ctl[data-compact] { flex: 1 1 100%; gap: 14px; padding: 2px 0 4px; justify-content: center; }
@media (min-width: 1280px) { .tone-ctl[data-compact] { display: none; } } /* the enhancer panel has it */
.tone-ctl[data-compact] .tone-btn { width: 26px; height: 26px; }
