:root {
  --bg: #111214;
  --surface: #18191c;
  --surface-2: #202125;
  --surface-3: #282a2f;
  --line: #303238;
  --line-soft: #27292e;
  --text: #f4f5f7;
  --muted: #9b9da5;
  --faint: #6f727b;
  --accent: #f04b6a;
  --accent-hover: #ff5b78;
  --accent-soft: rgba(240,75,106,.13);
  --cyan: #52d6c9;
  --warning: #f3b95f;
  --danger: #ff7f8f;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }
.app-bar {
  height: 58px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17,18,20,.94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); font-weight: 900; }
.brand strong { font-size: 1rem; letter-spacing: -.02em; }
.brand em { color: var(--muted); font-style: normal; font-size: .82rem; border-left: 1px solid var(--line); padding-left: 10px; }
.app-bar-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(82,214,201,.08); }
.app-bar-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; }
.version-chip { padding: 5px 8px; color: #fff; background: var(--accent); border-radius: 5px; font-weight: 800; letter-spacing: .08em; }
.shell { width: min(1520px, calc(100% - 28px)); margin: 0 auto; padding: 0 0 42px; }
.hero {
  min-height: 166px;
  padding: 30px 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  border-bottom: 1px solid var(--line-soft);
}
.hero-copy { max-width: 760px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.2rem, 3.8vw, 3.9rem); line-height: .96; letter-spacing: -.055em; font-weight: 750; }
h1 span { color: var(--muted); }
h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 1rem; letter-spacing: -.015em; }
.lead { margin: 13px 0 0; max-width: 650px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-bottom: 5px; }
.hero-meta span, .badge, .live-badge { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); font-size: .72rem; font-weight: 700; }
.studio-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 10px; padding-top: 10px; align-items: start; }
.panel, .glass { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.control-deck, .listen-deck { padding: 14px; }
.control-deck { position: sticky; top: 70px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; }
.section-head p { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.5; }
.section-head.compact { align-items: center; margin-bottom: 14px; }
.upload-grid, .form-stack { display: grid; gap: 9px; }
.drop-zone { min-height: 76px; padding: 12px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed #42454c; border-radius: 9px; color: var(--text); background: var(--surface-2); transition: .15s ease; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input { display: none; }
.drop-zone span { font-weight: 750; }
.drop-zone small { margin-top: 5px; color: var(--muted); }
.file-details { padding: 8px 10px; color: var(--muted); background: #141517; border-radius: 7px; font-size: .72rem; }
.reference-zone { min-height: 56px; background: transparent; }
.form-stack, .preview-settings { margin-top: 12px; }
.field { display: grid; gap: 6px; }
.field > span, .eq-slider span { display: flex; justify-content: space-between; gap: 8px; color: #c6c8ce; font-size: .76rem; font-weight: 700; }
select { width: 100%; min-height: 40px; padding: 0 38px 0 11px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; outline: none; }
select:focus, input[type="range"]:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.range-field { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
input[type="range"] { width: 100%; height: 4px; accent-color: var(--accent); cursor: pointer; }
.preview-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; color: #d6d7db; }
.toggle-row input { margin-top: 3px; accent-color: var(--accent); }
.toggle-row span { display: grid; gap: 3px; }
.toggle-row small { color: var(--muted); }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.sticky-actions { position: sticky; bottom: 8px; padding-top: 8px; background: linear-gradient(180deg, transparent, var(--surface) 25%); }
button, .download-row a { min-height: 42px; padding: 0 15px; border-radius: 7px; color: #fff; background: var(--accent); font-weight: 750; text-decoration: none; text-align: center; transition: background .14s ease, opacity .14s ease; }
button:hover, .download-row a:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
.ghost-btn, .mini-btn, .download-row a.secondary { color: var(--text); background: var(--surface-3); border: 1px solid var(--line); }
.ghost-btn:hover, .mini-btn:hover { background: #34363c; }
.mini-btn { min-height: 32px; padding: 0 10px; font-size: .72rem; }
.listen-deck { min-height: 560px; }
.live-badge { color: var(--cyan); }
.player-panel { display: grid; gap: 10px; }
.now-playing { min-height: 82px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 9px; background: #141517; }
.now-playing span, .mini-stats span { color: var(--faint); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.now-playing strong { display: block; margin-top: 5px; font-size: 1rem; }
.now-playing small { display: block; margin-top: 3px; color: var(--muted); }
.mini-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-stats span { padding: 6px 8px; border-radius: 5px; background: var(--surface-2); color: #c2c4ca; }
audio { width: 100%; height: 44px; }
.meter { height: 5px; overflow: hidden; border-radius: 5px; background: #090a0b; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--warning), var(--accent)); }
.preview-warning, .live-eq-notice { padding: 10px 12px; border-radius: 7px; font-size: .78rem; line-height: 1.4; }
.preview-warning { color: #ffd1d7; background: rgba(255,127,143,.08); border: 1px solid rgba(255,127,143,.22); }
.live-eq-notice { color: #bff7ef; background: rgba(82,214,201,.07); border: 1px solid rgba(82,214,201,.2); }
.preview-help { margin: 0; color: var(--muted); font-size: .8rem; }
.preview-buttons { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; }
.preview-chip { flex: 0 0 132px; min-height: 55px; padding: 9px 10px; display: grid; justify-items: start; align-content: center; gap: 3px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.preview-chip small { color: var(--muted); font-weight: 500; }
.preview-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.original-chip { border-left: 3px solid var(--cyan); }
.empty-player { min-height: 190px; padding: 28px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed var(--line); border-radius: 9px; background: #141517; }
.empty-player strong { margin-top: 10px; font-size: 1rem; }
.empty-player p { max-width: 380px; margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.vinyl-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--surface-2); border: 1px solid var(--line); }
.live-eq-panel { margin-top: 8px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: #151618; }
.live-chain-panel { background: #151618; }
.eq-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eq-note { margin: 7px 0 13px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.eq-sliders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chain-sliders { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.eq-slider { min-width: 0; padding: 11px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.eq-slider b { color: var(--accent); font-variant-numeric: tabular-nums; }
.eq-slider small { color: var(--faint); font-size: .68rem; }
.eq-readout { margin-top: 8px; padding: 8px 10px; color: var(--muted); background: #101113; border-radius: 6px; font-size: .72rem; }
.status-panel, .result-panel, .mode-help, .tools { margin-top: 12px; padding: 20px; }
.status-panel { text-align: center; }
.status-panel p { color: var(--muted); }
.loader { width: 34px; height: 34px; margin: 16px auto 0; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stats-grid div { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.stats-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.stats-grid strong { font-size: 1.1rem; }
.download-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.download-row a { display: grid; place-items: center; min-height: 40px; }
details { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #141517; }
summary { cursor: pointer; font-weight: 700; }
pre { max-height: 400px; overflow: auto; color: #b8bac0; font-size: .75rem; }
.batch-summary { display: grid; gap: 7px; }
.batch-row { padding: 10px; display: grid; grid-template-columns: 1.1fr 1.2fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.batch-row span { color: var(--muted); }
.batch-row em { color: var(--cyan); font-style: normal; font-weight: 700; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.preset-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; transition: border-color .14s ease, background .14s ease; }
.preset-card:hover { border-color: #484b53; }
.preset-card.active { border-color: var(--accent); background: var(--accent-soft); }
.preset-card h3 { margin-bottom: 6px; }
.preset-card p { min-height: 45px; margin: 0 0 8px; color: var(--muted); line-height: 1.4; font-size: .78rem; }
.preset-card small { display: block; margin-bottom: 7px; color: var(--faint); }
.preset-card span { color: var(--cyan); font-size: .75rem; font-weight: 700; }
.batch-card { border-left: 3px solid var(--accent); }
.tools-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-chip { padding: 7px 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-size: .72rem; }
.studio-footer { padding: 22px 4px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .76rem; }
.studio-footer nav { display: flex; gap: 16px; }
.studio-footer a { color: var(--muted); text-decoration: none; }
.studio-footer a:hover { color: var(--text); }
@media (max-width: 1100px) {
  .studio-layout { grid-template-columns: 330px minmax(0,1fr); }
  .chain-sliders { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 820px) {
  .app-bar { grid-template-columns: 1fr auto; }
  .app-bar-status { display: none; }
  .shell { width: min(100% - 20px, 1440px); }
  .hero { min-height: 210px; padding: 36px 2px 28px; align-items: flex-start; flex-direction: column; }
  .hero-meta { justify-content: flex-start; }
  .studio-layout { grid-template-columns: 1fr; }
  .control-deck { position: static; }
}
@media (max-width: 560px) {
  .app-bar { padding: 0 12px; }
  .brand em, .app-bar-actions > span:first-child { display: none; }
  .hero { min-height: 180px; }
  .preview-settings, .action-row, .eq-sliders, .chain-sliders, .stats-grid { grid-template-columns: 1fr; }
  .now-playing, .result-header, .section-head { align-items: flex-start; flex-direction: column; }
  .batch-row { grid-template-columns: 1fr; }
  .studio-footer { flex-direction: column; }
  .control-deck, .listen-deck, .status-panel, .result-panel, .mode-help, .tools { padding: 14px; }
}
