:root {
  --bg: #07060b;
  --bg2: #0e0c15;
  --panel: rgba(255, 255, 255, 0.035);
  --panel2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #f4f2f9;
  --muted: #a19cb3;
  --dim: #6f6a82;
  --a1: #8b5cf6;
  --a2: #ec4899;
  --a3: #f59e0b;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a3));
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', var(--font);
  --player-h: 84px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: calc(var(--player-h) + 24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #c4b5fd; }
svg { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.bg-glow {
  position: fixed; inset: -20% -10% auto -10%; height: 70vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(35% 45% at 75% 20%, rgba(236, 72, 153, 0.16), transparent 70%),
    radial-gradient(30% 40% at 55% 60%, rgba(245, 158, 11, 0.08), transparent 70%);
  filter: blur(20px);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px max(20px, env(safe-area-inset-left));
  background: rgba(7, 6, 11, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 32px; height: 32px; }
.brand-name { font: 700 20px/1 var(--display); letter-spacing: 0.08em; }
.brand-sub { color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--line2); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-btn {
  background: none; border: 0; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500;
}
.nav-btn:hover { color: var(--text); background: var(--panel); }
.nav-btn.active { color: var(--text); background: var(--panel2); }
.count { font-size: 12px; color: var(--dim); margin-left: 2px; }
.ai-pill {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--panel); font-size: 13px; color: var(--muted);
}
.ai-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.ai-pill.off .dot { background: #64748b; box-shadow: none; }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- hero / composer ---------- */
.hero { padding: 48px 0 20px; text-align: center; }
.eyebrow { color: var(--muted); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font: 700 clamp(34px, 6vw, 60px)/1.05 var(--display); margin: 0 0 14px; letter-spacing: -0.02em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); max-width: 640px; margin: 0 auto 28px; font-size: 17px; }

.composer {
  text-align: left; max-width: 860px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  border: 1px solid var(--line2); border-radius: 24px; padding: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
}
.composer textarea {
  width: 100%; resize: vertical; min-height: 84px; border: 0; outline: 0; background: transparent;
  font-size: 18px; line-height: 1.45; padding: 6px 6px 12px;
}
.composer textarea::placeholder { color: var(--dim); }
.composer-row { border-top: 1px solid var(--line); padding: 12px 4px 4px; }
.composer-row.options { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line2); background: var(--panel); padding: 6px 12px; border-radius: 999px;
  font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: .15s;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.chip.on { color: #fff; background: rgba(139, 92, 246, 0.22); border-color: rgba(167, 139, 250, 0.6); }
.chips.small .chip { font-size: 13px; padding: 5px 11px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: 13px; }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.composer-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 4px 2px; border-top: 1px solid var(--line); margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line2); background: var(--panel); padding: 9px 16px; border-radius: 12px;
  font-weight: 600; font-size: 14px; color: var(--text); transition: .15s; text-decoration: none;
}
.btn:hover { background: var(--panel2); border-color: rgba(255,255,255,0.24); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { padding: 9px 11px; }
.btn.ghost { background: transparent; }
.btn.danger { color: #fca5a5; border-color: rgba(248,113,113,.35); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 30px rgba(236, 72, 153, 0.25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 12px 24px; font-size: 16px; border-radius: 14px; }
.btn[aria-pressed="true"] svg path { fill: var(--a2); stroke: var(--a2); }

.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 860px; margin: 18px auto 0; }
.example { border: 1px dashed var(--line2); background: none; color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.example:hover { color: var(--text); border-style: solid; }

/* ---------- progress ---------- */
.progress { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 30px 0 10px; }
.progress-orb { position: relative; width: 64px; height: 64px; }
.progress-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--a1); animation: spin 1.1s linear infinite; }
.progress-orb span:nth-child(2) { inset: 8px; border-top-color: var(--a2); animation-duration: 1.5s; animation-direction: reverse; }
.progress-orb span:nth-child(3) { inset: 16px; border-top-color: var(--a3); animation-duration: .9s; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.progress-steps li { color: var(--dim); display: flex; gap: 10px; align-items: center; font-size: 15px; }
.progress-steps li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.progress-steps li.active { color: var(--text); }
.progress-steps li.active::before { background: var(--a2); box-shadow: 0 0 12px var(--a2); }
.progress-steps li.done { color: var(--muted); }
.progress-steps li.done::before { background: #22c55e; }

.notice {
  max-width: 860px; margin: 14px auto 0; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d;
}

/* ---------- studio ---------- */
.studio { margin-top: 30px; }
.versions { display: flex; gap: 10px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.version {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--muted); text-align: left; min-width: 0; flex: none;
}
.version img { width: 40px; height: 40px; border-radius: 9px; }
.version b { display: block; color: var(--text); font-size: 14px; }
.version small { font-size: 12px; }
.version.on { border-color: rgba(167,139,250,.7); background: rgba(139,92,246,.14); }

.studio-head { display: flex; gap: 22px; align-items: flex-end; }
.studio-cover { width: 168px; height: 168px; border-radius: 18px; box-shadow: var(--shadow); flex: none; background: var(--bg2); }
.studio-info { min-width: 0; flex: 1; }
.studio-title-row h2 { font: 700 clamp(26px, 4vw, 40px)/1.1 var(--display); margin: 0 0 8px; outline: 0; border-radius: 8px; overflow-wrap: anywhere; }
.studio-title-row h2:focus { box-shadow: 0 0 0 2px rgba(167,139,250,.5); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.tag.genre { color: #fff; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 260px;
  background: #15121e; border: 1px solid var(--line2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow);
}
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 12px; }
.menu button:hover { background: var(--panel2); }
.menu b { display: block; font-size: 14px; }
.menu small { color: var(--muted); font-size: 12.5px; }

.stage {
  position: relative; margin-top: 22px; height: 220px; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(120% 140% at 50% 120%, rgba(139,92,246,.18), rgba(7,6,11,.6) 60%), var(--bg2);
  border: 1px solid var(--line);
}
#viz { width: 100%; height: 100%; display: block; }
.lyric-now {
  position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; padding: 0 20px;
  font: 600 clamp(17px, 2.4vw, 24px)/1.3 var(--display); text-shadow: 0 2px 20px rgba(0,0,0,.8);
  transition: opacity .25s; pointer-events: none;
}
.timeline {
  position: relative; display: flex; height: 38px; margin-top: 10px; border-radius: 10px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer; user-select: none;
}
.timeline .seg-block {
  position: relative; height: 100%; border-right: 1px solid rgba(0,0,0,.35); display: flex; align-items: center;
  padding: 0 8px; font-size: 12px; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; min-width: 0;
}
.timeline .playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 10px #fff; left: 0; pointer-events: none; }
.timeline .played { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(255,255,255,.12); pointer-events: none; }

.tabs { display: flex; gap: 4px; margin: 22px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--a2); }
.panel { padding: 18px 0 8px; }
.panel-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }

.lyrics { columns: 2 320px; column-gap: 40px; }
.lyrics section { break-inside: avoid; margin-bottom: 20px; }
.lyrics h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.lyrics p { margin: 0; padding: 3px 8px; border-radius: 8px; color: var(--muted); font-size: 16px; transition: .2s; cursor: pointer; }
.lyrics p:hover { background: var(--panel); }
.lyrics p.now { color: #fff; background: rgba(139,92,246,.18); }
.lyrics .src { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.empty { color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 38px; height: 22px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); position: relative; transition: .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; transition: .2s; }
.switch input:checked + span { background: var(--a1); border-color: var(--a1); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(167,139,250,.5); }

.refine { display: flex; gap: 8px; margin-bottom: 10px; }
.refine input, .lib-tools input, .lib-tools select, .key-box input, .set-row select, .controls select {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; outline: 0;
}
.refine input:focus, .lib-tools input:focus, .key-box input:focus { border-color: rgba(167,139,250,.6); }
select option { background: #15121e; }
.controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 20px; margin-top: 18px; }
.ctrl { display: flex; flex-direction: column; gap: 6px; }
.ctrl label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 600; display: flex; justify-content: space-between; }
.ctrl label output { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.ctrl select { padding: 8px 12px; }
.ctrl .row { display: flex; gap: 8px; }
.ctrl.toggles { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 10px 20px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; height: 22px; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line2); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px; box-shadow: 0 0 0 4px rgba(139,92,246,.35); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(139,92,246,.35); }

.mixer { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.strip { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.strip b { font-size: 14px; }
.strip small { color: var(--dim); font-size: 12px; min-height: 16px; }
.strip .ms { display: flex; gap: 6px; }
.strip .ms button { flex: 1; border: 1px solid var(--line2); background: none; border-radius: 8px; padding: 3px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.strip .ms button.on.m { background: rgba(248,113,113,.2); color: #fca5a5; border-color: rgba(248,113,113,.5); }
.strip .ms button.on.s { background: rgba(250,204,21,.18); color: #fde047; border-color: rgba(250,204,21,.5); }
.strip.empty-track { opacity: .45; }

.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.chord-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chord { font: 600 13px var(--display); background: var(--panel2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 8px; }

/* ---------- library ---------- */
.view-head { padding: 40px 0 10px; }
.view-head h1 { font-size: clamp(30px, 5vw, 44px); }
.view-head .lead { margin: 0 0 20px; }
.lib-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.lib-tools input { flex: 2 1 220px; }
.lib-tools select { flex: 1 1 160px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.song-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: .15s; }
.song-card:hover { border-color: var(--line2); transform: translateY(-2px); }
.song-card .art { position: relative; aspect-ratio: 1; cursor: pointer; }
.song-card .art img { width: 100%; height: 100%; display: block; }
.song-card .art .play-over {
  position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: #fff; color: #111; display: grid; place-items: center; opacity: 0; transform: translateY(6px); transition: .15s;
}
.song-card:hover .play-over, .song-card .play-over:focus { opacity: 1; transform: none; }
.song-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.song-card b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card .row { display: flex; gap: 6px; margin-top: 8px; }
.song-card .row button { flex: 1; border: 1px solid var(--line); background: none; border-radius: 9px; padding: 5px 0; font-size: 12.5px; color: var(--muted); }
.song-card .row button:hover { color: var(--text); background: var(--panel2); }
.song-card .row button.fav-on { color: var(--a2); }

/* ---------- settings ---------- */
.sub { font: 600 18px var(--display); margin: 28px 0 12px; }
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.provider { text-align: left; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.provider b { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.provider small { color: var(--muted); font-size: 13px; }
.provider .badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(34,197,94,.18); color: #86efac; }
.provider.on { border-color: rgba(167,139,250,.8); background: rgba(139,92,246,.14); }
.free-da { margin-top: 14px; }
.key-box { margin-top: 14px; display: grid; gap: 8px; max-width: 620px; }
.key-box label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 600; }
.key-row { display: flex; gap: 8px; }
.hint { color: var(--dim); font-size: 13.5px; }
.set-row { display: flex; align-items: center; gap: 14px; max-width: 620px; margin-bottom: 10px; }
.set-row label { width: 90px; color: var(--muted); }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { cursor: pointer; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.about-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.about-grid h3 { margin: 0 0 6px; font-family: var(--display); }
.about-grid p { margin: 0; color: var(--muted); }
.honest { margin-top: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.honest h3 { margin: 0 0 8px; font-family: var(--display); }
.honest li { color: var(--muted); margin-bottom: 6px; }

/* ---------- player ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: calc(var(--player-h) + env(safe-area-inset-bottom));
  padding: 0 20px env(safe-area-inset-bottom); display: grid; grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.6fr) minmax(140px, 1fr);
  align-items: center; gap: 18px; background: rgba(12, 10, 18, 0.88); border-top: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.pl-cover { position: absolute; width: 52px; height: 52px; border-radius: 10px; left: 20px; top: 16px; }
.pl-info { padding-left: 66px; min-width: 0; }
.pl-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-main { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pl-buttons { display: flex; align-items: center; gap: 14px; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); }
.play-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: #0b0912; display: grid; place-items: center; }
.play-btn svg { width: 20px; height: 20px; }
.play-btn .i-pause { display: none; }
.player.playing .play-btn .i-play { display: none; }
.player.playing .play-btn .i-pause { display: block; }
.pl-seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-seek input { flex: 1; }
.pl-vol { display: flex; align-items: center; gap: 8px; justify-content: flex-end; color: var(--muted); }
.pl-vol input { max-width: 120px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--player-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 40;
  background: #1c1828; border: 1px solid var(--line2); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow);
  transition: .25s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.export-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5,4,8,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.export-box { background: #15121e; border: 1px solid var(--line2); border-radius: 18px; padding: 22px 24px; width: min(420px, 100%); box-shadow: var(--shadow); }
.export-box h3 { margin: 0 0 12px; font-family: var(--display); }
.export-box p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.bar { height: 8px; border-radius: 8px; background: var(--panel2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .brand-sub { display: none; }
  .ai-pill { display: none; }
  .nav { margin-left: auto; }
  .player { grid-template-columns: 1fr auto; gap: 10px; padding: 0 16px env(safe-area-inset-bottom); }
  .pl-cover { left: 16px; top: 12px; width: 44px; height: 44px; }
  .pl-info { padding-left: 54px; }
  .pl-main { position: absolute; left: 0; right: 0; top: 0; }
  .pl-seek { position: absolute; top: -9px; left: 0; right: 0; gap: 0; }
  .pl-seek span { display: none; }
  .pl-buttons { position: absolute; right: 14px; top: 12px; gap: 6px; }
  .pl-vol { display: none; }
  :root { --player-h: 70px; }
}
@media (max-width: 640px) {
  main { padding: 0 16px; }
  .topbar { padding: 10px 16px; gap: 8px; }
  .brand-name { font-size: 18px; }
  .nav-btn { padding: 7px 9px; font-size: 14px; }
  .nav-btn[data-view="about"] { display: none; }
  .hero { padding-top: 30px; }
  .lead { font-size: 15.5px; }
  .composer { padding: 14px; border-radius: 20px; }
  .composer textarea { font-size: 16px; }
  .composer-actions { flex-direction: column-reverse; }
  .composer-actions .btn { width: 100%; }
  .studio-head { flex-direction: column; align-items: flex-start; }
  .studio-cover { width: 120px; height: 120px; }
  .stage { height: 170px; }
  .lyrics { columns: 1; }
  .refine { flex-direction: column; }
  .pl-buttons #plBack, .pl-buttons #plFwd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- reference song (inspiration / sample / remix) ---------- */
.ref-row { display: block; }
.ref-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ref-empty .hint { margin: 0; font-size: 12.5px; }
.ref-card { display: grid; gap: 12px; padding: 4px 0; }
.ref-head { display: flex; align-items: center; gap: 12px; }
.ref-head b { font-size: 15px; display: block; overflow-wrap: anywhere; }
.ref-head small { color: var(--muted); }
.ref-head .grow { flex: 1; min-width: 0; }
.ref-wave { position: relative; height: 64px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: pointer; touch-action: none; }
.ref-wave canvas { width: 100%; height: 100%; display: block; }
.ref-wave .loop { position: absolute; top: 0; bottom: 0; background: rgba(236, 72, 153, 0.22); border-left: 2px solid #ec4899; border-right: 2px solid #ec4899; pointer-events: none; }
.ref-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.ref-mode { text-align: left; border: 1px solid var(--line2); background: var(--panel); border-radius: 12px; padding: 9px 12px; color: var(--muted); }
.ref-mode b { display: block; color: var(--text); font-size: 14px; }
.ref-mode small { font-size: 12.5px; }
.ref-mode.on { border-color: rgba(167,139,250,.8); background: rgba(139,92,246,.16); }
.ref-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.ref-progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.ref-progress .bar { flex: 1; max-width: 260px; }
.ref-legal { font-size: 12.5px; color: var(--dim); margin: 0; }
.more-chip { border-style: dashed !important; }
.credits-box p { color: var(--muted); margin: 0; }
.tag.refbadge { color: #fbcfe8; border-color: rgba(236,72,153,.5); }

.lyrics p.empty { column-span: all; }
