/* Layout: queue + moods | turntable deck | sound + take-home. Five switchable vintage themes, each a full token set. */
:root {
  --page: repeating-linear-gradient(0deg, #f6d6dd66 0 16px, transparent 16px 32px), repeating-linear-gradient(90deg, #f6d6dd66 0 16px, transparent 16px 32px), #fbeef0;
  --bg: #fbeef0; --paper: #fffafa; --ink: #57222e; --soft: #86505c;
  --accent: #b93a58; --accent-text: #b93a58; --on-accent: #fff7f8; --accent2: #e99aae;
  --line: #efcbd3; --wave-rest: #e6b3bf; --shadow: rgba(185, 58, 88, 0.18);
  --display: "Cherry Bomb One", "Quicksand", "Segoe UI", sans-serif;
  --head: "Cherry Bomb One", "Quicksand", "Segoe UI", sans-serif;
  --body: "Quicksand", "Segoe UI", system-ui, sans-serif;
  --script: "Parisienne", "Segoe Script", cursive;
  --size: 15px; --r: 22px; --rs: 14px;
  --vinyl: #2a1a1e; --groove: #3d2a30; --arm: #d9b3bc; --label: #f6c4cf; --label-ink: #57222e;
  color-scheme: light;
}
html[data-theme="sepia"] {
  --page: repeating-linear-gradient(0deg, transparent 0 33px, #d6c19a66 33px 34px), #efe2c8;
  --bg: #efe2c8; --paper: #f8efdc; --ink: #40291a; --soft: #6b5140;
  --accent: #80492a; --accent-text: #80492a; --on-accent: #fbf3e3; --accent2: #9aa582;
  --line: #dcc8a2; --wave-rest: #cdb58a; --shadow: rgba(64, 41, 26, 0.18);
  --display: "IM Fell English", Georgia, serif; --head: "IM Fell English", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif; --script: "Pinyon Script", "Segoe Script", cursive;
  --size: 17px; --r: 6px; --rs: 4px;
  --vinyl: #231a14; --groove: #382b21; --arm: #b9a27e; --label: #c9a676; --label-ink: #40291a;
}
html[data-theme="jukebox"] {
  --page: repeating-linear-gradient(90deg, #ffe9b3 0 48px, #fff3d3 48px 96px);
  --bg: #fff3d3; --paper: #fffaee; --ink: #3a2849; --soft: #65557a;
  --accent: #ff8f6b; --accent-text: #c4502c; --on-accent: #3a2849; --accent2: #8ed4bf;
  --line: #f0dcaa; --wave-rest: #e9cf8f; --shadow: rgba(255, 143, 107, 0.25);
  --display: "Shrikhand", Georgia, serif; --head: "Shrikhand", Georgia, serif;
  --body: "Karla", "Segoe UI", system-ui, sans-serif; --script: "Yellowtail", "Segoe Script", cursive;
  --size: 15px; --r: 30px; --rs: 18px;
  --vinyl: #2f2440; --groove: #43365a; --arm: #c9c4d6; --label: #8ed4bf; --label-ink: #3a2849;
}
html[data-theme="cherry"] {
  --page: radial-gradient(#9e1b2c14 1.5px, transparent 2px) 0 0/20px 20px, #f5ede3;
  --bg: #f5ede3; --paper: #fbf7f1; --ink: #350d14; --soft: #6d4a48;
  --accent: #9e1b2c; --accent-text: #9e1b2c; --on-accent: #fbf1e6; --accent2: #c9a45c;
  --line: #e3d2bf; --wave-rest: #dcc3ae; --shadow: rgba(53, 13, 20, 0.2);
  --display: "Bodoni Moda", Didot, "Times New Roman", serif; --head: "Bodoni Moda", Didot, "Times New Roman", serif;
  --body: "Libre Baskerville", Georgia, serif; --script: "Great Vibes", "Segoe Script", cursive;
  --size: 14px; --r: 3px; --rs: 2px;
  --vinyl: #1a0a0d; --groove: #2e1418; --arm: #c9a45c; --label: #9e1b2c; --label-ink: #f5e6d0;
}
html[data-theme="gothic"] {
  --page: radial-gradient(ellipse at 50% -10%, #3a2340 0%, #141117 55%);
  --bg: #141117; --paper: #1e1a22; --ink: #eee4ec; --soft: #b5a5b6;
  --accent: #a3355a; --accent-text: #e08aa9; --on-accent: #fbeef3; --accent2: #b9a3c9;
  --line: #3a3040; --wave-rest: #4a3e52; --shadow: rgba(0, 0, 0, 0.5);
  --display: "UnifrakturMaguntia", "Old English Text MT", serif; --head: "Cormorant Garamond", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif; --script: "Monsieur La Doulaise", "Segoe Script", cursive;
  --size: 17px; --r: 8px; --rs: 6px;
  --vinyl: #0a080c; --groove: #221c28; --arm: #9a93a3; --label: #4a1a2c; --label-ink: #eee4ec;
  color-scheme: dark;
}
html[data-theme="mahogany"] {
  --page: repeating-linear-gradient(97deg, rgba(0,0,0,0) 0 7px, rgba(0,0,0,.12) 7px 9px, rgba(255,200,150,.03) 9px 16px), radial-gradient(ellipse at 50% -10%, #4a2819 0%, #22110a 65%);
  --bg: #22110a; --paper: #33200f; --ink: #f3e3cf; --soft: #cdb49a;
  --accent: #c8963e; --accent-text: #e2b565; --on-accent: #22110a; --accent2: #a4552f;
  --line: #553621; --wave-rest: #6a4331; --shadow: rgba(0, 0, 0, 0.5);
  --display: "Abril Fatface", Georgia, serif; --head: "Abril Fatface", Georgia, serif;
  --body: "Lora", Georgia, serif; --script: "Allura", "Segoe Script", cursive;
  --size: 15px; --r: 10px; --rs: 6px;
  --vinyl: #0d0806; --groove: #231712; --arm: #c8963e; --label: #c8963e; --label-ink: #22110a;
  color-scheme: dark;
}
html[data-theme="velvet"] {
  --page: radial-gradient(ellipse at 50% -20%, #5a0d18 0%, #1c0507 60%);
  --bg: #1c0507; --paper: #2a090d; --ink: #f7e1e0; --soft: #d6a9a8;
  --accent: #c2334a; --accent-text: #f08c9c; --on-accent: #fff1f1; --accent2: #d9a07a;
  --line: #4a1519; --wave-rest: #5c2127; --shadow: rgba(0, 0, 0, 0.55);
  --display: "Limelight", Georgia, serif; --head: "Limelight", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif; --script: "Great Vibes", "Segoe Script", cursive;
  --size: 17px; --r: 14px; --rs: 8px;
  --vinyl: #0b0304; --groove: #22090c; --arm: #d9a07a; --label: #d9a07a; --label-ink: #2a090d;
  color-scheme: dark;
}
html[data-theme="coffee"] {
  --page: radial-gradient(circle at 15% 0%, #4a2e1f 0%, #1d130e 60%);
  --bg: #1d130e; --paper: #2a1c15; --ink: #f1e4cf; --soft: #c7ae93;
  --accent: #d9713b; --accent-text: #f0955f; --on-accent: #1d130e; --accent2: #b38b5d;
  --line: #45301f; --wave-rest: #5a4130; --shadow: rgba(0, 0, 0, 0.5);
  --display: "DM Serif Display", Georgia, serif; --head: "DM Serif Display", Georgia, serif;
  --body: "Karla", "Segoe UI", system-ui, sans-serif; --script: "Mrs Saint Delafield", "Segoe Script", cursive;
  --size: 15px; --r: 18px; --rs: 12px;
  --vinyl: #0c0806; --groove: #211813; --arm: #b38b5d; --label: #fff3d3; --label-ink: #2a1c15;
  color-scheme: dark;
}
html[data-theme="wine"] {
  --page: radial-gradient(ellipse at 80% -10%, #4b1430 0%, #150810 60%);
  --bg: #150810; --paper: #220d19; --ink: #f5e4ec; --soft: #cfa6b8;
  --accent: #9b2c55; --accent-text: #eb9bbd; --on-accent: #fff0f5; --accent2: #d9a5b3;
  --line: #3e1a2c; --wave-rest: #53263b; --shadow: rgba(0, 0, 0, 0.55);
  --display: "Cormorant Garamond", Georgia, serif; --head: "Cormorant Garamond", Georgia, serif;
  --body: "EB Garamond", Georgia, serif; --script: "Petit Formal Script", "Segoe Script", cursive;
  --size: 17px; --r: 8px; --rs: 5px;
  --vinyl: #0a0408; --groove: #1f0d17; --arm: #b98aa0; --label: #d9a5b3; --label-ink: #220d19;
  color-scheme: dark;
}
html[data-theme="wine"] .logo, html[data-theme="wine"] #title, html[data-theme="wine"] .empty h1 { font-style: italic; font-weight: 700; }
html[data-theme="cinema"] {
  --page: repeating-linear-gradient(90deg, #36090c 0 22px, #2a0709 22px 44px);
  --bg: #1a0708; --paper: #241011; --ink: #f5e6c8; --soft: #d2b98f;
  --accent: #d4a73c; --accent-text: #e9c164; --on-accent: #1a0708; --accent2: #b3272f;
  --line: #4a1f1c; --wave-rest: #5c2a24; --shadow: rgba(0, 0, 0, 0.6);
  --display: "Cinzel", "Trajan Pro", Georgia, serif; --head: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Libre Baskerville", Georgia, serif; --script: "Italianno", "Segoe Script", cursive;
  --size: 14px; --r: 4px; --rs: 2px;
  --vinyl: #0a0404; --groove: #1f0f0d; --arm: #d4a73c; --label: #d4a73c; --label-ink: #1a0708;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--page); background-attachment: fixed; color: var(--ink); font: 400 var(--size)/1.5 var(--body); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes sv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .record { animation: none !important; } * { transition: none !important; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 700; cursor: pointer; }
.btn:hover { border-color: var(--soft); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.link { white-space: nowrap; background: none; border: 0; color: var(--soft); font-size: 13px; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.script { font-family: var(--script); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px clamp(16px, 3vw, 40px); background: var(--paper); border-bottom: 1.5px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-size: 36px; line-height: 1; }
.tagline { font-family: var(--script); font-size: 26px; color: var(--accent-text); line-height: 1; }
.top-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.theme-picker { position: relative; }
.theme-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 600; max-width: 280px; }
.theme-btn:hover { border-color: var(--soft); }
.theme-btn .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-btn .caret { transition: transform .2s; flex: none; }
.theme-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.swatch { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(340px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 40px var(--shadow); padding: 10px; }
.theme-menu h3 { margin: 8px 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.theme-opt { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 8px; border: 0; border-radius: var(--rs); background: transparent; color: var(--ink); text-align: left; }
.theme-opt:hover, .theme-opt:focus-visible { background: var(--bg); }
.theme-opt[aria-checked="true"] { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.theme-opt .opt-name { font-weight: 600; line-height: 1.2; }
.theme-opt .opt-desc { font-size: 12px; color: var(--soft); line-height: 1.3; }
.theme-opt .swatch { width: 34px; height: 34px; }

.love { text-align: center; padding: 4px 16px 24px; font-family: var(--script); font-size: 21px; line-height: 1.3; color: var(--accent-text); }
.love span { white-space: nowrap; }

/* layout */
.grid { display: grid; grid-template-columns: 290px minmax(0, 1fr) 340px; grid-template-areas: "left center right"; gap: 28px; padding: 26px clamp(16px, 3vw, 40px) 40px; align-items: start; }
.left { grid-area: left; } .center { grid-area: center; } .right { grid-area: right; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1200px) { .grid { grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "center right" "left right"; } }
@media (max-width: 820px) { .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "right" "left"; } }

.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h2 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 22px; line-height: 1.2; }

/* queue */
#queue-list { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#queue-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--rs); cursor: pointer; min-width: 0; }
#queue-list li:hover { background: color-mix(in srgb, var(--bg) 70%, transparent); }
#queue-list li.active { background: var(--bg); }
.q-disc { width: 40px; height: 40px; flex: none; border-radius: 50%; background: repeating-radial-gradient(circle, var(--vinyl) 0 2px, var(--groove) 2px 3px); display: grid; place-items: center; }
.q-disc i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
li.active .q-disc i { background: var(--accent); }
.q-text { flex: 1; min-width: 0; }
.q-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-artist { font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-del { background: none; border: 0; color: var(--soft); font-size: 18px; line-height: 1; padding: 6px; opacity: 0; }
#queue-list li:hover .q-del, .q-del:focus-visible { opacity: 1; }
.heart-switch { flex: none; position: relative; width: 52px; height: 30px; padding: 0; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; transition: background .25s ease, border-color .25s ease; }
.heart-switch .knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 6px var(--shadow); display: grid; place-items: center; transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.heart-switch svg { fill: none; stroke: var(--soft); stroke-width: 2.2; transition: fill .25s, stroke .25s, transform .3s; }
.heart-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.heart-switch[aria-checked="true"] .knob { transform: translateX(22px); }
.heart-switch[aria-checked="true"] svg { fill: var(--accent); stroke: var(--accent); animation: heart-pop .4s ease; }
.heart-switch:hover .knob { box-shadow: 0 3px 10px var(--shadow); }
@keyframes heart-pop { 40% { transform: scale(1.35); } }
.xf-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--rs); background: var(--bg); }
.xf-row .ctl-head label { color: var(--soft); }
.q-grip { flex: none; width: 28px; height: 36px; margin-left: -6px; display: grid; place-items: center; border: 0; border-radius: var(--rs); background: transparent; color: var(--soft); cursor: grab; touch-action: none; }
.q-grip { transition: color .15s, background .15s, transform .15s; }
.q-grip:hover { color: var(--ink); background: color-mix(in srgb, var(--line) 50%, transparent); transform: scale(1.12); }
#queue-list li { position: relative; transition: background .15s ease, box-shadow .2s ease; }
#queue-list li:hover .q-grip { color: var(--ink); }
#queue-list li.dragging { background: var(--paper); box-shadow: 0 14px 30px var(--shadow), 0 0 0 1.5px var(--accent); z-index: 2; will-change: transform; }
#queue-list li.dragging .q-grip { cursor: grabbing; }
body.reordering { user-select: none; cursor: grabbing; }
.drop-slot { display: block; border: 1.5px dashed var(--line); border-radius: var(--rs); padding: 14px; text-align: center; font-size: 13px; color: var(--soft); cursor: pointer; }
.drop-slot:hover { border-color: var(--soft); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--soft); }
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip .x { opacity: .7; font-size: 16px; line-height: 1; }
.save-row { display: flex; gap: 8px; }
.save-row input { flex: 1; min-width: 0; min-height: 36px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 14px; }

/* center deck */
.center { align-items: center; }
.empty { width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0; }
.empty h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; text-wrap: balance; }
.empty p { margin: 0; color: var(--soft); max-width: 44ch; }
.still-record { width: 240px; height: 240px; border-radius: 50%; background: repeating-radial-gradient(circle, var(--vinyl) 0 2px, var(--groove) 2px 3.5px); display: grid; place-items: center; box-shadow: 0 18px 40px var(--shadow); }
.still-record span { width: 90px; height: 90px; border-radius: 50%; background: var(--label); display: grid; place-items: center; font-family: var(--script); font-size: 20px; color: var(--label-ink); }

#player { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.view-toggle { display: flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line); }
.view-toggle button { min-height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; }
.view-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.stage { width: 100%; min-height: 390px; display: grid; place-items: center; }

.turntable { position: relative; width: 420px; height: 380px; --rec-vinyl: var(--vinyl); --rec-groove: var(--groove); --rec-label: var(--label); --rec-ink: var(--label-ink); --rpm: 1.8s; }
.platter { position: absolute; left: 0; top: 0; width: 370px; height: 370px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--line); box-shadow: 0 18px 40px var(--shadow); }
.record { position: absolute; left: 10px; top: 10px; width: 350px; height: 350px; border-radius: 50%; background: repeating-radial-gradient(circle, var(--rec-vinyl) 0 2px, var(--rec-groove) 2px 3.5px); display: grid; place-items: center; animation: sv-spin var(--rpm) linear infinite; animation-play-state: paused; }
.turntable.playing .record { animation-play-state: running; }
.rec-label { width: 128px; height: 128px; border-radius: 50%; background: var(--rec-label) center / cover no-repeat; color: var(--rec-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; position: relative; }
.rec-label.photo .lbl-text { visibility: hidden; }
.lbl-side { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.lbl-title { font-family: var(--display); font-size: 14px; line-height: 1.1; max-width: 100px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lbl-script { font-family: var(--script); font-size: 17px; line-height: 1; }
.spindle { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); margin: 3px 0; }
.rec-label.photo .spindle { position: absolute; left: 59px; top: 59px; margin: 0; }
.sheen { position: absolute; left: 10px; top: 10px; width: 350px; height: 350px; border-radius: 50%; pointer-events: none; background: conic-gradient(from 25deg, transparent 0deg, rgba(255,255,255,.14) 35deg, transparent 75deg, transparent 200deg, rgba(255,255,255,.1) 235deg, transparent 270deg); }
.arm-base { position: absolute; left: 352px; top: 14px; width: 48px; height: 48px; border-radius: 50%; background: var(--paper); border: 3px solid var(--arm); }
.arm { position: absolute; left: 372px; top: 38px; width: 8px; height: 220px; border-radius: 4px; background: var(--arm); transform-origin: 4px 0; transform: rotate(8deg); transition: transform .7s ease; }
.arm::after { content: ""; position: absolute; left: -7px; bottom: -14px; width: 22px; height: 30px; border-radius: 4px; background: var(--arm); }
.turntable.playing .arm { transform: rotate(27deg); }
@media (max-width: 480px) { .stage { min-height: 300px; } .turntable { transform: scale(.76); margin: -45px -50px; } }

.wave-view { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.wave-box { position: relative; height: 220px; cursor: pointer; }
.wave-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave-hint { text-align: center; font-family: var(--script); font-size: 24px; color: var(--accent-text); }
.loading-note { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--soft); text-align: center; }
#bars { width: 100%; height: 40px; display: block; }

.song { text-align: center; }
#title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
#summary { color: var(--soft); margin-top: 4px; }
.progress-row { width: 100%; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.progress-row span { flex: none; min-width: 3.2em; }
.progress-row span:last-child { text-align: right; }

.transport { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); display: grid; place-items: center; position: relative; }
.icon-btn:hover { border-color: var(--soft); }
.icon-btn[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent); }
.play-btn { width: 66px; height: 66px; border: 0; background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px var(--shadow); }
.loop-one { position: absolute; right: 6px; bottom: 4px; font-size: 10px; font-weight: 700; }
.ab-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vol { display: flex; align-items: center; gap: 8px; width: 140px; color: var(--soft); }

/* trim, drawn right on the big waveform */
.trim-toggle { align-self: center; }
.trim-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.trim-layer { position: absolute; inset: 0; pointer-events: none; }
.trim-shade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.trim-shade.l { left: 0; border-right: 2px dashed var(--accent); }
.trim-shade.r { right: 0; border-left: 2px dashed var(--accent); }
input[type=range].trim-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; pointer-events: none; }
input[type=range].trim-range::-webkit-slider-runnable-track { height: 220px; background: transparent; }
input[type=range].trim-range::-webkit-slider-thumb { pointer-events: auto; width: 16px; height: 220px; margin-top: 0; border-radius: 8px; background: var(--accent); border: 4px solid var(--paper); box-shadow: 0 4px 12px var(--shadow); cursor: ew-resize; }
input[type=range].trim-range::-moz-range-track { height: 220px; background: transparent; }
input[type=range].trim-range::-moz-range-progress { background: transparent; }
input[type=range].trim-range::-moz-range-thumb { pointer-events: auto; width: 10px; height: 212px; border-radius: 8px; background: var(--accent); border: 4px solid var(--paper); cursor: ew-resize; }
.trim-panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--paper); text-align: center; }
.trim-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 560px; }
@media (max-width: 560px) { .trim-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trim-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--soft); text-align: left; min-width: 0; }
.trim-fields input { min-height: 40px; min-width: 0; border-radius: var(--rs); border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 10px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trim-fields input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.trim-fields input[aria-invalid="true"] { border-color: #c0392b; }
.trim-error { color: var(--accent-text); font-weight: 600; margin: 0; }
.trim-info { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.trim-info b { color: var(--ink); font-weight: 700; }
.trim-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; align-items: center; }

/* sliders */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; --p: 50%; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: var(--paper); border: 3px solid var(--accent); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 3px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 3px solid var(--accent); }
input[type=range]:disabled { opacity: .45; }

.grp { border-top: 1.5px solid var(--line); padding-top: 10px; }
.grp:first-of-type { border-top: 0; padding-top: 0; }
.grp summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.grp summary::-webkit-details-marker { display: none; }
.grp summary::after { content: "+"; color: var(--soft); font-size: 18px; }
.grp[open] summary::after { content: "−"; }
.grp-body { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 4px; }
.ctl { display: flex; flex-direction: column; gap: 2px; }
.ctl-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ctl-head label { color: var(--soft); }
.ctl-head output { font-weight: 600; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--soft); margin: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--soft); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.reset-row { display: flex; justify-content: flex-end; }

/* take home */
.take-row { display: flex; gap: 14px; align-items: stretch; }
.mini-cover { width: 118px; height: 118px; flex: none; padding: 0; border: 0; border-radius: var(--rs); overflow: hidden; box-shadow: 0 6px 16px var(--shadow); background: var(--bg); }
.mini-cover canvas { width: 100%; height: 100%; display: block; }
.take-actions { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.formats { display: flex; gap: 6px; }
.formats button { flex: 1; min-height: 36px; border-radius: var(--rs); border: 1.5px solid var(--line); background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; }
.formats button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#fmt-note, #export-status { font-size: 12px; color: var(--soft); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.script-link { align-self: flex-start; background: none; border: 0; padding: 0; font-family: var(--script); font-size: 26px; color: var(--accent-text); }
.script-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.keys { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--soft); padding: 0 16px 28px; }
kbd { font: 12px ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--paper); color: var(--ink); }

body.dragging .drop-veil { opacity: 1; }
.drop-veil { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .15s; background: color-mix(in srgb, var(--bg) 88%, transparent); display: grid; place-items: center; font-family: var(--display); font-size: clamp(28px, 5vw, 56px); color: var(--accent-text); border: 3px dashed var(--accent); }

/* cover maker */
dialog { border: 1.5px solid var(--line); border-radius: var(--r); padding: 0; background: var(--paper); color: var(--ink); width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(20, 10, 15, .55); }
.cover-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 24px; }
@media (max-width: 820px) { .cover-layout { grid-template-columns: minmax(0, 1fr); } }
.cover-preview { display: flex; flex-direction: column; gap: 10px; }
.cover-preview canvas { width: 100%; aspect-ratio: 1; max-width: 100%; border-radius: var(--rs); box-shadow: 0 10px 30px var(--shadow); display: block; }
.cover-opts { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 26px; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--paper); padding: 0; box-shadow: 0 0 0 1.5px var(--line); }
.sw.square { border-radius: var(--rs); width: 56px; height: 44px; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.font-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.font-opts button { min-height: 44px; border-radius: var(--rs); border: 1.5px solid var(--line); background: transparent; color: var(--ink); font-size: 20px; white-space: nowrap; overflow: hidden; }
.font-opts button[aria-pressed="true"] { border-color: var(--ink); background: var(--bg); }
.words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.words label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--soft); min-width: 0; }
.words input { min-height: 40px; border-radius: var(--rs); border: 1.5px solid var(--line); background: var(--bg); padding: 0 10px; font-size: 14px; color: var(--ink); min-width: 0; }
.photo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dlg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }
.x-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; font-size: 20px; line-height: 1; }
