/* =========================================================
   Music Change — styles
   Design: pro-audio workstation / mastering console
   ========================================================= */

:root {
  --bg: #0c0c0b;
  --bg-elevated: #141412;
  --bg-surface: #1c1b18;
  --ink: #f4f0e8;
  --ink-muted: #9a958c;
  --ink-faint: #5c5852;
  --accent: #d4a054;
  --accent-soft: rgba(212, 160, 84, 0.14);
  --accent-line: rgba(212, 160, 84, 0.35);
  --success: #7ba87b;
  --danger: #d46b5e;
  --border: #2a2824;
  --border-strong: #3a3732;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-display: "MiSans", "MiSans VF", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "MiSans", Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ---------- Layout shell ---------- */

.wrap {
  width: min(var(--max), calc(100% - clamp(32px, 6vw, 80px)));
  margin-inline: auto;
}

.section {
  padding: clamp(64px, 10vw, 112px) 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: clamp(32px, 5vw, 48px);
  max-width: 65ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(12, 12, 11, 0.78);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-inset);
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-name {
  font-size: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 180ms var(--ease-out);
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink) !important;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 180ms, transform 160ms;
}

.nav-cta:hover {
  border-color: var(--accent-line);
  text-decoration: none;
  transform: scale(0.98);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(32px, 5vw, 56px) 0 clamp(40px, 6vw, 64px);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -12% 0 auto 0;
  height: 420px;
  background:
    radial-gradient(58% 100% at 50% 0%, rgba(212, 160, 84, 0.1), transparent 72%),
    radial-gradient(40% 70% at 78% 8%, rgba(123, 168, 123, 0.04), transparent 70%);
  pointer-events: none;
}

/* Centered workbench-as-hero */
.hero-solo {
  position: relative;
  width: min(840px, calc(100% - clamp(28px, 6vw, 64px)));
  margin-inline: auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  position: relative;
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 5.6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-copy h1 .accent {
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 28px;
  color: var(--ink-muted);
  font-size: 17px;
  max-width: 38ch;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.tag.hot {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-meta dt {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hero-meta dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Workbench (converter) ---------- */

.workbench {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset);
  overflow: hidden;
}

.workbench-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.workbench-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.build-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(123, 168, 123, 0.5);
}

.led.busy {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(212, 160, 84, 0.6);
  animation: pulse 1.2s ease-in-out infinite;
}

.led.error {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(212, 107, 94, 0.55);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.workbench-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(212, 160, 84, 0.03), transparent 50%),
    var(--bg-surface);
  min-height: 176px;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  cursor: pointer;
  transition: border-color 200ms var(--ease-out), background 200ms, transform 200ms;
  overflow: hidden;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent-line);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(212, 160, 84, 0.1), transparent 60%),
    var(--bg-surface);
}

.dropzone.is-dragover .waveform {
  opacity: 1;
}

.dropzone-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 4px;
}

.dropzone h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dropzone p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.dropzone .hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* Waveform bars — signature moment */
.waveform {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 18px 24px 12px;
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.waveform span {
  flex: 1;
  max-width: 8px;
  min-width: 3px;
  height: 20%;
  border-radius: 999px 999px 2px 2px;
  background: linear-gradient(180deg, var(--accent), rgba(212, 160, 84, 0.25));
  transform-origin: bottom;
  animation: wave 1.1s ease-in-out infinite;
  animation-play-state: paused;
}

.dropzone.is-dragover .waveform span,
.dropzone.is-busy .waveform span {
  animation-play-state: running;
}

.dropzone.is-busy .waveform {
  opacity: 0.85;
}

.waveform span:nth-child(1) { animation-delay: 0s; height: 28%; }
.waveform span:nth-child(2) { animation-delay: 0.08s; height: 48%; }
.waveform span:nth-child(3) { animation-delay: 0.16s; height: 72%; }
.waveform span:nth-child(4) { animation-delay: 0.04s; height: 40%; }
.waveform span:nth-child(5) { animation-delay: 0.2s; height: 88%; }
.waveform span:nth-child(6) { animation-delay: 0.12s; height: 55%; }
.waveform span:nth-child(7) { animation-delay: 0.24s; height: 34%; }
.waveform span:nth-child(8) { animation-delay: 0.06s; height: 66%; }
.waveform span:nth-child(9) { animation-delay: 0.18s; height: 92%; }
.waveform span:nth-child(10) { animation-delay: 0.1s; height: 44%; }
.waveform span:nth-child(11) { animation-delay: 0.22s; height: 60%; }
.waveform span:nth-child(12) { animation-delay: 0.02s; height: 30%; }
.waveform span:nth-child(13) { animation-delay: 0.14s; height: 78%; }
.waveform span:nth-child(14) { animation-delay: 0.26s; height: 52%; }
.waveform span:nth-child(15) { animation-delay: 0.08s; height: 36%; }
.waveform span:nth-child(16) { animation-delay: 0.16s; height: 70%; }
.waveform span:nth-child(17) { animation-delay: 0.04s; height: 46%; }
.waveform span:nth-child(18) { animation-delay: 0.2s; height: 84%; }
.waveform span:nth-child(19) { animation-delay: 0.12s; height: 38%; }
.waveform span:nth-child(20) { animation-delay: 0.24s; height: 58%; }
.waveform span:nth-child(21) { animation-delay: 0.1s; height: 64%; }
.waveform span:nth-child(22) { animation-delay: 0.18s; height: 42%; }
.waveform span:nth-child(23) { animation-delay: 0.06s; height: 74%; }
.waveform span:nth-child(24) { animation-delay: 0.14s; height: 50%; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.35); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Scan line on drag */
.dropzone.is-dragover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(212, 160, 84, 0.08) 48%,
    rgba(212, 160, 84, 0.18) 50%,
    rgba(212, 160, 84, 0.08) 52%,
    transparent 100%
  );
  background-size: 100% 200%;
  animation: scan 1.4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes scan {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

/* Controls row */
.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field select,
.field input[type="range"] {
  width: 100%;
}

.field select {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A958C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.field select:focus {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

.bitrate-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bitrate-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

.bitrate-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  min-width: 56px;
  text-align: right;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background 180ms, border-color 180ms, opacity 180ms;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #1a1408;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--accent-line);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(212, 107, 94, 0.35);
}

/* Queue / file list */
.queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-empty {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
}

.queue:empty + .queue-empty,
.queue.is-empty .queue-empty {
  display: block;
}

.file-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
  animation: rise 320ms var(--ease-out);
}

.file-row:hover { border-color: var(--border-strong); }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.file-info {
  min-width: 0;
}

.file-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-sub {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: right;
  white-space: nowrap;
}

.file-status.ok {
  color: var(--success);
}

.file-status.err {
  color: var(--danger);
}

.file-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.act-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 52px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms, transform 140ms;
  white-space: nowrap;
}

.act-btn:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--accent-line);
}

.act-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.act-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.act-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1408;
}

.act-btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  color: #1a1408;
  border-color: var(--accent);
}

.act-btn-danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(212, 107, 94, 0.45);
}

.act-btn.is-playing {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.act-btn-loading {
  opacity: 0.85;
  cursor: default;
  color: var(--ink-muted);
}

.act-btn-loading .spin {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: btn-spin 0.7s linear infinite;
  vertical-align: -1px;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.file-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.done-panel {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
}

.done-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.done-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.done-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.done-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: border-color 180ms var(--ease-out);
  animation: rise 280ms var(--ease-out);
}

.done-row:hover { border-color: var(--border-strong); }

.done-row .file-sub {
  margin-top: 2px;
}

/* VU-style progress */
.progress-wrap {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.progress-wrap.is-on {
  display: flex;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.progress-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a67c3a, var(--accent), #f0c57a);
  transition: width 220ms var(--ease-out);
  box-shadow: 0 0 12px rgba(212, 160, 84, 0.35);
}

/* Flight chips — signature moment 2 */
.flight {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.flight.is-on {
  display: flex;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chip.active {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

.flight-rail {
  width: 56px;
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.flight-rail::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: rail 1s linear infinite;
}

@keyframes rail {
  to {
    left: 100%;
  }
}

/* ---------- Format matrix ---------- */

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.matrix th,
.matrix td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.matrix thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  background: var(--bg-elevated);
}

.matrix tbody tr {
  transition: background 160ms;
}

.matrix tbody tr:hover {
  background: rgba(212, 160, 84, 0.04);
}

.matrix td:first-child {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.matrix .note {
  color: var(--ink-muted);
  font-size: 13px;
}

.yes {
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 12px;
}

.no {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 14px;
}

.step h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.step p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  max-width: 36ch;
}

/* ---------- Features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}

.feature {
  padding: 28px 24px 28px 0;
  border-bottom: 1px solid var(--border);
}

.feature:nth-child(3n + 2) {
  padding-left: 24px;
  padding-right: 24px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.feature:nth-child(3n) {
  padding-left: 24px;
  padding-right: 0;
}

.feature h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.feature .icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

/* ---------- FAQ ---------- */

.faq {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  transition: transform 200ms var(--ease-out);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item .faq-body {
  padding: 0 0 20px;
  color: var(--ink-muted);
  font-size: 15px;
  max-width: 70ch;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 56px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
  max-width: 52ch;
}

.footer-brand {
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 8px;
  font-size: 14px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok {
  border-color: rgba(123, 168, 123, 0.4);
}

.toast.err {
  border-color: rgba(212, 107, 94, 0.45);
}

/* ========== Fixed preview deck ========== */

.player-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(12px);
  width: min(720px, calc(100vw - 24px));
  z-index: 80;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(18, 18, 16, 0.94);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 160, 84, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease-out), transform 280ms var(--ease-out);
}

.player-dock:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  animation: dock-in 360ms var(--ease-out);
}

@keyframes dock-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.player-inner {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(180px, 1.4fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

/* now playing */
.np {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.np-art {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.vinyl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, #222 0 16%, #111 17% 38%, #0a0a09 39% 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.vinyl::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, transparent 0 2px, rgba(255, 255, 255, 0.05) 2px 3px);
}

.vinyl-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, transparent 0 28%, rgba(255, 255, 255, 0.08) 38%, transparent 48% 100%);
  opacity: 0.7;
}

.vinyl.is-spinning {
  animation: spin 3s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.vinyl-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  height: 36%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8bc78, var(--accent) 55%, #8a622c);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  z-index: 1;
}

.vinyl-label.has-cover {
  background-size: cover;
  background-position: center;
  background-color: var(--accent);
}

.vinyl-hole {
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: #0c0c0b;
}

.np-text {
  min-width: 0;
}

.np-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-sub {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* center */
.np-center {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.np-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pbtn {
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: color 150ms, background 150ms, transform 140ms, border-color 150ms;
}

.pbtn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.pbtn:active {
  transform: scale(0.94);
}

.pbtn-main {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(180deg, #e4b46a, var(--accent));
  color: #1a1408;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 20px rgba(212, 160, 84, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.pbtn-main:hover {
  color: #1a1408;
  background: linear-gradient(180deg, #eec27c, var(--accent));
  filter: none;
}

.pbtn-main:active {
  transform: scale(0.92);
}

.pbtn-ghost {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--ink-faint);
}

.pbtn-ghost:hover {
  color: var(--danger);
  background: rgba(212, 107, 94, 0.1);
}

/* play / pause exclusive icons — one visible at a time */
.pbtn-main .i-play,
.pbtn-main .i-pause {
  display: none;
  line-height: 0;
}

.player-dock:not(.is-playing) .pbtn-main .i-play {
  display: inline-flex;
}

.player-dock.is-playing .pbtn-main .i-pause {
  display: inline-flex;
}

.np-seek {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
  align-items: center;
}

.np-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seek-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  touch-action: none;
}

.seek-track::before {
  content: "";
  position: absolute;
  inset: -6px 0;
}

.seek-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(212, 160, 84, 0.45), var(--accent));
  box-shadow: 0 0 10px rgba(212, 160, 84, 0.35);
  pointer-events: none;
  transition: width 80ms linear;
}

.seek-knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  transition: opacity 150ms, transform 150ms;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.seek-track:hover .seek-knob,
.seek-track.is-drag .seek-knob {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* side */
.np-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vu {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
  width: 58px;
  justify-content: center;
}

.vu i {
  display: block;
  flex: 1;
  max-width: 3px;
  height: 22%;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(180deg, var(--accent), rgba(212, 160, 84, 0.3));
  opacity: 0.35;
  transform-origin: bottom;
  transition: height 90ms linear, opacity 90ms linear;
}

/* CSS fallback animation only when the live analyser isn't driving the bars */
.player-dock.is-playing .vu:not(.is-live) i {
  opacity: 1;
  animation: vu 0.65s ease-in-out infinite alternate;
}

.player-dock.is-playing .vu.is-live i { opacity: 1; }

.player-dock.is-playing .vu:not(.is-live) i:nth-child(3n + 1) { animation-delay: 0s; }
.player-dock.is-playing .vu:not(.is-live) i:nth-child(3n + 2) { animation-delay: 0.12s; }
.player-dock.is-playing .vu:not(.is-live) i:nth-child(3n) { animation-delay: 0.2s; }

@keyframes vu {
  0% { height: 22%; opacity: 0.55; }
  100% { height: 100%; opacity: 1; }
}

.np-vol {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
}

.np-vol input[type="range"] {
  width: 64px;
  accent-color: var(--accent);
  height: 3px;
  cursor: pointer;
}

body.has-player {
  padding-bottom: 104px;
}

@media (max-width: 700px) {
  .player-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "np side"
      "center center";
    gap: 10px;
    padding: 12px;
  }

  .np { grid-area: np; }
  .np-center { grid-area: center; }
  .np-side { grid-area: side; }

  .np-art { width: 44px; height: 44px; }
  .vinyl { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .player-dock,
  .player-dock:not([hidden]) {
    animation: none;
    transition: none;
  }

  .vinyl.is-spinning,
  .player-dock.is-playing .vu i {
    animation: none;
  }

  .player-dock.is-playing .vu i {
    height: 55%;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 40rem;
  }

  .steps,
  .features {
    grid-template-columns: 1fr;
  }

  .feature,
  .feature:nth-child(3n + 2),
  .feature:nth-child(3n) {
    padding: 24px 0;
    border-left: none;
    border-right: none;
  }

  .nav-links li:not(:last-child) {
    display: none;
  }
}

@media (max-width: 640px) {
  .controls,
  .controls-2 {
    grid-template-columns: 1fr;
  }
}

/* Stack row actions below cover + info on narrow screens */
@media (max-width: 560px) {
  .file-row,
  .done-row {
    grid-template-columns: 48px 1fr;
    row-gap: 10px;
  }

  .file-cover,
  .file-icon {
    width: 48px;
    height: 48px;
  }

  .file-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .file-status { margin-right: auto; text-align: left; }

  .btn-row { flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .waveform {
    display: none;
  }
}

/* ---------- Metadata editor modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 5, 0.66);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 34%),
    rgba(24, 23, 20, 0.86);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 160, 84, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform-origin: center;
  animation: modal-in 320ms var(--ease-out);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal[hidden] { display: none; }
.modal:not([hidden]) .modal-backdrop { animation: fade-in 240ms var(--ease-out); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.meta-cover-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.meta-cover-box {
  position: relative;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg, rgba(212, 160, 84, 0.1), transparent 60%),
    var(--bg-surface);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.meta-cover-box:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.meta-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-cover:not([src]),
.meta-cover[src=""] { display: none; }

.meta-cover-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.meta-cover-box:has(.meta-cover[src]:not([src=""])) .meta-cover-empty { display: none; }

.meta-cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(12, 12, 11, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
}

.meta-cover-box:hover .meta-cover-overlay,
.meta-cover-box:focus-visible .meta-cover-overlay { opacity: 1; }

.meta-cover-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.meta-cover-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.link-btn {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  transition: opacity 160ms;
}

.link-btn:hover { opacity: 0.75; text-decoration: underline; }

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-field span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.meta-field input {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink);
}

.meta-field input:focus {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

/* full-page drag overlay */
body.is-dragging-file::after {
  content: "松手加入队列";
  position: fixed;
  inset: 12px;
  z-index: 200;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 20px;
  background: rgba(212, 160, 84, 0.08);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* output spec badge on done rows */
.spec-badge {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.spec-badge b {
  font-weight: 500;
  color: var(--ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none; }
}

/* =========================================================
   UI upgrade: liquid glass, 3D tilt, reactive glow, motion
   ========================================================= */

/* Vinyl reacts to live audio amplitude (--amp set each frame) */
.vinyl { --amp: 0; }
.vinyl::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 calc(8px + var(--amp) * 26px) calc(var(--amp) * 5px) rgba(212, 160, 84, calc(0.15 + var(--amp) * 0.55));
  opacity: calc(0.3 + var(--amp) * 0.7);
  transition: opacity 90ms linear;
}

/* Liquid-glass workbench (static — no tilt) */
.workbench {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 30%),
    var(--bg-elevated);
}

/* Liquid-glass polish for the format matrix rows on hover */
.matrix tbody tr { transition: background 200ms var(--ease-out), transform 200ms var(--ease-out); }
.matrix tbody tr:hover { transform: translateX(2px); }

/* Smooth collapse/expand for optional control fields (no display:none jump) */
.field { min-width: 0; }

#bitrateField, #depthField {
  overflow: hidden;
  max-height: 96px;
  opacity: 1;
  transition: max-height 320ms var(--ease-out), opacity 220ms var(--ease-out), margin 320ms var(--ease-out), transform 320ms var(--ease-out);
}

#bitrateField.field--off, #depthField.field--off {
  max-height: 0;
  opacity: 0;
  margin: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* Native select: keep long labels from overflowing the control */
.field select {
  min-width: 0;
  width: 100%;
  text-overflow: ellipsis;
  font-size: 14px;
}

/* Compact, content-sized action buttons */
.controls-2 { grid-template-columns: 1fr 1fr; }

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-template-columns: none;
}

.action-row .btn-primary { padding: 0 26px; }
.action-row .btn-ghost { padding: 0 16px; }

/* the .btn display rule would otherwise defeat the [hidden] attribute */
.btn[hidden] { display: none; }

.action-row .btn {
  transition: transform 160ms var(--ease-out), background 180ms, border-color 180ms, opacity 180ms, box-shadow 200ms;
}
.action-row .btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(212, 160, 84, 0.3);
  transform: translateY(-1px);
}

/* Bitrate / depth field row is a single column so swaps feel like one surface */
#bitrateField, #depthField { grid-column: 1 / -1; }

/* Softer, springy reveal for queue rows + done panel */
.done-panel {
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.done-panel[hidden] { display: none; }

/* Player dock: richer liquid glass */
.player-dock {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 40%),
    radial-gradient(140% 120% at 0% 0%, rgba(212, 160, 84, 0.08), transparent 55%),
    rgba(18, 18, 16, 0.82);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
}

@media (prefers-reduced-motion: reduce) {
  .matrix tbody tr:hover { transform: none !important; }
  #bitrateField, #depthField { transition: none; }
  .vinyl::after { transition: none; }
}

/* Focused result line — one aligned row; only changed dimensions are highlighted */
.result-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.rl-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* output format badge */
.rl-fmt {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

/* unchanged dimension — quiet */
.rl-same {
  color: var(--ink-faint);
  background: transparent;
  padding: 0 2px;
}

/* changed dimension — highlighted old → new */
.rl-chg {
  background: rgba(212, 160, 84, 0.1);
  border: 1px solid var(--accent-line);
  color: var(--ink);
}

.rl-chg .rl-old { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--ink-faint); }
.rl-chg i { color: var(--accent); font-style: normal; margin: 0 5px; }
.rl-chg .rl-new { color: var(--ink); font-weight: 500; }

.rl-size { color: var(--ink-muted); padding: 0 2px; gap: 6px; }

.sc-delta {
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
}

.sc-delta.down { color: var(--success); background: rgba(123, 168, 123, 0.16); }
.sc-delta.up { color: var(--danger); background: rgba(212, 107, 94, 0.16); }
.sc-delta.flat { color: var(--ink-muted); }

/* tappable chips */
.rl-info { cursor: pointer; transition: background 140ms, border-color 140ms, color 140ms; }
.rl-same.rl-info {
  height: 20px;
  padding: 0 8px;
  border: 1px solid transparent;
}
.rl-info:hover { color: var(--ink); }
.rl-same.rl-info:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); }
.rl-fmt.rl-info:hover { filter: brightness(1.08); }
.rl-chg.rl-info:hover { background: rgba(212, 160, 84, 0.18); }
.rl-size.rl-info:hover { color: var(--ink); }
.rl-info:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.rl-info.rl-active { border-color: var(--accent) !important; color: var(--ink); }

/* explanation popover */
.pop {
  position: fixed;
  z-index: 130;
  width: min(300px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%),
    rgba(24, 23, 20, 0.94);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modal-in 200ms var(--ease-out);
}

.pop[hidden] { display: none; }

.pop-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.pop-what {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.pop-change {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }

/* Ensure control columns stack on small screens (placed last to win the cascade) */
@media (max-width: 640px) {
  .controls,
  .controls-2 { grid-template-columns: 1fr; }
}

/* Editor hint + inline control notes */
.modal-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.control-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--danger);
}

.control-note[hidden] { display: none; }

/* =========================================================
   Split panels: input workbench vs. output deck
   ========================================================= */

/* Queue section label inside the input panel */
.queue-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 2px 2px 2px;
}
.queue-head[hidden] { display: none; }

/* Standalone output panel below the workbench */
.output-deck {
  margin-top: 18px;
  background:
    linear-gradient(180deg, rgba(123, 168, 123, 0.05), rgba(255, 255, 255, 0) 30%),
    var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset);
  overflow: hidden;
  animation: rise 320ms var(--ease-out);
}
.output-deck[hidden] { display: none; }

.deck-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.deck-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.led-ok {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(123, 168, 123, 0.5);
}

.output-deck .done-list {
  padding: 14px;
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

/* =========================================================
   Playlist popover (dock)
   ========================================================= */
.pbtn-ghost.is-on { color: var(--accent); background: rgba(212, 160, 84, 0.12); }

.playlist-pop {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 10px;
  width: min(360px, calc(100vw - 32px));
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%),
    rgba(20, 20, 18, 0.96);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 90;
  animation: modal-in 200ms var(--ease-out);
}
.playlist-pop[hidden] { display: none; }

.playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}
.playlist-item + .playlist-item { margin-top: 2px; }
.playlist-item:hover { background: rgba(255, 255, 255, 0.05); }
.playlist-item.is-current { background: var(--accent-soft); border-color: var(--accent-line); }

.pl-idx {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.playlist-item.is-current .pl-idx { color: var(--accent); }

.pl-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pl-title {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-faint);
}

.pl-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.pl-eq i { width: 2px; height: 40%; background: var(--accent); border-radius: 1px; animation: vu 0.6s ease-in-out infinite alternate; }
.pl-eq i:nth-child(2) { animation-delay: 0.15s; }
.pl-eq i:nth-child(3) { animation-delay: 0.3s; }

.playlist-empty { padding: 16px; text-align: center; color: var(--ink-faint); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .playlist-pop { animation: none; }
  .pl-eq i { animation: none; height: 60%; }
}

/* ===== Auto cover-art picker (metadata editor) ===== */
.btn-fetch-art {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.btn-fetch-art:hover { background: rgba(212, 160, 84, 0.22); border-color: var(--accent); }
.btn-fetch-art:active { transform: scale(0.98); }
.btn-fetch-art svg { flex: none; }

.art-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.art-status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.art-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 140ms var(--ease-out), transform 120ms var(--ease-out);
}
.art-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.art-cell:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.art-cell.is-sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.art-cell.is-sel::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.art-cell.is-broken { display: none; }
