:root {
    --bg: #050505;
    --steel: #2f302c;
    --panel: #171713;
    --panel-hi: #3b3932;
    --gold: #d7aa51;
    --gold-hot: #ffe18a;
    --text: #f7f0df;
    --muted: #b8ad98;
    --line: rgba(255, 225, 138, .22);
    --green: #53dd8f;
    --amber: #ffbf4d;
    --blue: #61a8ff;
    --red: #ff6066;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 50% -10%, rgba(255,225,138,.15), transparent 34%), linear-gradient(135deg, #080807, #15140f 48%, #030303);
    overflow: hidden;
}
button, input { font: inherit; }
a { color: inherit; }
.wave-console-shell { width: min(1640px, calc(100vw - 20px)); height: 100vh; margin: 0 auto; padding: 10px 0; display: flex; flex-direction: column; gap: 9px; }
.console-header, .transport-mixer, .console-panel { border: 1px solid rgba(255,255,255,.11); background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02) 38%, rgba(0,0,0,.24)), linear-gradient(135deg, var(--panel-hi), var(--panel) 54%, #070707); box-shadow: inset 0 1px rgba(255,255,255,.16), inset 0 -1px rgba(0,0,0,.8), 0 16px 40px rgba(0,0,0,.48); }
.console-header { flex: 0 0 auto; min-height: 66px; border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-disc { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #171006; font-weight: 950; background: radial-gradient(circle at 33% 28%, #fff4be, var(--gold-hot) 35%, var(--gold) 62%, #3b260a); box-shadow: 0 0 24px rgba(215,170,81,.34), inset 0 2px 8px rgba(255,255,255,.4); }
.eyebrow { display: block; color: var(--gold-hot); font-size: 10px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
.header-readout { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.header-readout span, .status-pill, .session-readout { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--gold-hot); background: rgba(0,0,0,.22); font: 900 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.message-stack { flex: 0 0 auto; display: grid; gap: 6px; }
.msg { border: 1px solid rgba(255,191,77,.35); border-radius: 12px; padding: 10px 12px; background: rgba(255,191,77,.12); color: #ffe6ad; }
.console-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 265px minmax(520px, 1fr) 330px; gap: 9px; }
.console-panel { min-height: 0; position: relative; border-radius: 15px; padding: 14px; overflow: hidden; }
.console-panel::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(215,170,81,.13); border-radius: 10px; pointer-events: none; }
.panel-heading { margin-bottom: 14px; }
h1, h2 { margin: 0; letter-spacing: -.03em; text-transform: uppercase; }
h1 { font-size: clamp(34px, 4vw, 62px); line-height: .9; }
h2 { font-size: 19px; }
.real-project-list, .module-rack { position: relative; z-index: 1; display: grid; gap: 8px; max-height: calc(100% - 70px); overflow: auto; padding-right: 3px; }
.project-row { display: grid; gap: 7px; padding: 10px; text-decoration: none; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: linear-gradient(180deg, #24231f, #090908); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.project-row:hover, .module:hover { border-color: rgba(255,225,138,.55); }
.project-main strong { display: block; font-size: 13px; }
.project-main small, .empty-state, .upload-console p, .module small { color: var(--muted); line-height: 1.35; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; width: max-content; padding: 6px 8px; font-size: 9px; text-transform: uppercase; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.processing i { background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.finished i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.error i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.empty-state { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.workspace-panel { display: flex; flex-direction: column; gap: 10px; }
.workspace-topline { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.wave-display { flex: 1 1 auto; min-height: 0; position: relative; z-index: 1; display: grid; grid-template-rows: 28px 1fr 38px; overflow: hidden; border: 1px solid rgba(215,170,81,.25); border-radius: 12px; background: #060606; box-shadow: inset 0 0 65px rgba(0,0,0,.8); }
.time-ruler, .track-labels { display: grid; align-items: center; color: #827662; background: linear-gradient(180deg, #1b1a16, #0b0b09); font: 900 10px/1 ui-monospace, monospace; }
.time-ruler { grid-template-columns: repeat(5, 1fr); }
.track-labels { grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(215,170,81,.16); }
.time-ruler span, .track-labels span { padding-left: 10px; border-left: 1px solid rgba(255,255,255,.06); }
.upload-console { position: relative; z-index: 1; flex: 0 0 auto; border: 1px solid rgba(215,170,81,.22); border-radius: 12px; padding: 12px; background: rgba(0,0,0,.24); }
.upload-console label { display: block; margin-bottom: 8px; font-weight: 900; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.upload-row input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); background: #0a0a08; }
.primary-action { border: 0; border-radius: 10px; padding: 10px 15px; cursor: pointer; color: #1b1204; font-weight: 950; background: linear-gradient(180deg, var(--gold-hot), var(--gold)); box-shadow: inset 0 1px rgba(255,255,255,.42), 0 5px 0 #3b2709; }
.upload-console p { margin: 8px 0 0; font-size: 12px; }
.module { width: 100%; display: grid; grid-template-columns: 14px 1fr auto; gap: 9px; align-items: center; text-align: left; text-decoration: none; cursor: pointer; color: inherit; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 10px; background: linear-gradient(180deg, #3a3832, #141412 50%, #070707); box-shadow: inset 0 1px rgba(255,255,255,.18), inset 0 -4px 8px rgba(0,0,0,.42); }
.module strong, .module small { grid-column: 2; }
.module small { font-size: 11px; }
.module em { grid-column: 3; grid-row: 1 / span 2; align-self: center; color: var(--gold-hot); border: 1px solid var(--line); border-radius: 999px; padding: 4px 7px; font-style: normal; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.led { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px var(--green); grid-row: 1 / span 2; }
.led.amber { background: var(--amber); box-shadow: 0 0 16px var(--amber); }
.transport-mixer { flex: 0 0 126px; min-height: 0; border-radius: 15px; padding: 12px; display: grid; grid-template-columns: 210px minmax(380px, 1fr) 330px; gap: 12px; align-items: center; }
.transport-buttons { display: flex; gap: 7px; margin-top: 8px; }
.transport-buttons button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold-hot); background: #090908; cursor: pointer; box-shadow: inset 0 1px rgba(255,255,255,.13); }
.mixer-bank { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.channel { display: grid; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.channel i { height: 15px; border-radius: 999px; overflow: hidden; border: 1px solid rgba(215,170,81,.24); background: linear-gradient(90deg, var(--green) 0 var(--level), #11100d var(--level)); box-shadow: inset 0 0 0 2px rgba(0,0,0,.2); }
.session-readout { justify-self: end; white-space: normal; line-height: 1.3; }
@media (max-width: 1180px) {
    body { overflow: auto; }
    .wave-console-shell { height: auto; min-height: 100vh; }
    .console-grid, .transport-mixer { grid-template-columns: 1fr; }
    .console-panel { min-height: 320px; }
    .transport-mixer { min-height: 220px; }
    .session-readout { justify-self: stretch; }
}
@media (max-width: 680px) {
    .console-header, .workspace-topline { flex-direction: column; align-items: flex-start; }
    .upload-row, .mixer-bank { grid-template-columns: 1fr; }
    .wave-console-shell { width: min(100vw - 12px, 1640px); padding: 6px 0; }
}

/* Real waveform monitor: the audio shape is painted by Web Audio API on canvas, never by decorative bars. */
.waveform-canvas-wrap {
    position: relative;
    min-height: 220px;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(215,170,81,.08) 1px, transparent 1px) 0 0/34px 100%,
        linear-gradient(0deg, rgba(215,170,81,.08) 1px, transparent 1px) 0 0/100% 44px,
        radial-gradient(circle at 50% 50%, rgba(255,225,138,.08), transparent 48%),
        #050505;
    border-top: 1px solid rgba(215,170,81,.12);
    border-bottom: 1px solid rgba(215,170,81,.12);
    overflow: hidden;
}
.waveform-canvas { display: block; width: 100%; height: 100%; min-height: 220px; opacity: .98; }
.waveform-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #8f846f;
    text-align: center;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(5,5,5,.72);
}
.waveform-empty[hidden] { display: none; }
.real-wave-editor { grid-template-rows: 28px 34px minmax(220px, 1fr) 32px; }
.wave-source-tabs { display: flex; gap: 8px; align-items: center; padding: 5px 8px; background: linear-gradient(180deg, #24221d, #0b0b09); border-bottom: 1px solid rgba(215,170,81,.16); }
.wave-source-tabs button { border: 1px solid rgba(215,170,81,.24); border-radius: 999px; padding: 5px 12px; color: var(--muted); background: #090908; cursor: pointer; font-size: 10px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.wave-source-tabs button.active { color: #1b1204; background: linear-gradient(180deg, var(--gold-hot), var(--gold)); box-shadow: 0 0 18px rgba(215,170,81,.22); }
.wave-source-tabs button:disabled { opacity: .42; cursor: not-allowed; }
.console-grid { grid-template-columns: 300px minmax(560px, 1fr) 320px; }
.workspace-panel h1, .studio-workspace h1 { margin: 0; font-size: clamp(24px, 3vw, 42px); letter-spacing: .04em; }
.console-panel, .daw-panel { border-radius: 10px; background-image: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.025) 34%, rgba(0,0,0,.38)), linear-gradient(135deg, #4a473f, #1a1a16 48%, #070707); }
.module, .module-strip, .upload-console, .wave-display, .wave-editor { box-shadow: inset 0 1px rgba(255,255,255,.16), inset 0 -10px 22px rgba(0,0,0,.38), 0 12px 28px rgba(0,0,0,.28); }
.module.locked { opacity: .62; cursor: not-allowed; }
.led.off { background: #39362f; box-shadow: inset 0 0 6px rgba(0,0,0,.8); }
.project-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--gold-hot); background: rgba(0,0,0,.28); text-decoration: none; cursor: pointer; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.mini-btn.danger { color: #ffd0d2; border-color: rgba(255,96,102,.38); }
.waveform-scroll { min-height: 220px; height: 100%; overflow-x: auto; overflow-y: hidden; background: #050505; }
.zoomable-wave { width: 100%; min-width: 100%; }
.wave-zoom { width: 100%; accent-color: var(--gold); background: #090908; }
.transport-block { display: grid; gap: 6px; }
.transport-progress { width: 100%; accent-color: var(--gold); }
.time-readout { color: var(--gold-hot); font: 900 11px/1 ui-monospace, monospace; letter-spacing: .08em; }
.result-card { display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(215,170,81,.22); border-radius: 10px; background: rgba(0,0,0,.28); }
.result-card audio { width: 100%; height: 34px; }
.compact-results { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 10px; width: 100%; }
.download.zip { grid-column: 1 / -1; justify-self: start; }
.download { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: #1b1204; background: linear-gradient(180deg, var(--gold-hot), var(--gold)); font-weight: 950; text-decoration: none; }
@media (max-width: 900px) { .compact-results { grid-template-columns: 1fr; } }

/* Elegant visual reference overlay: the shipped console image is now part of the UI, not a hidden comment. */
.console-reference-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(5,5,5,.42), rgba(5,5,5,.9)),
        url('/static/img/wave-audio-console-reference.png') center / cover no-repeat;
    opacity: .24;
    filter: saturate(.85) contrast(1.08);
}
.wave-console-shell { position: relative; z-index: 1; }
.results-console {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    border: 1px solid rgba(255,225,138,.35);
    border-radius: 14px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(255,225,138,.08), rgba(0,0,0,.24)),
        rgba(5,5,5,.62);
    box-shadow: inset 0 1px rgba(255,255,255,.16), 0 16px 34px rgba(0,0,0,.34);
}
.results-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.results-head h2 { font-size: clamp(24px, 3vw, 38px); color: var(--gold-hot); text-shadow: 0 0 22px rgba(255,225,138,.22); }
.result-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.big-result-card {
    display: grid;
    gap: 10px;
    min-height: 148px;
    padding: 14px;
    border: 1px solid rgba(255,225,138,.32);
    border-radius: 13px;
    background: linear-gradient(180deg, #302d25, #0a0a08 70%);
    box-shadow: inset 0 1px rgba(255,255,255,.14), 0 10px 24px rgba(0,0,0,.28);
}
.big-result-card span { display: block; color: var(--gold-hot); font-size: 12px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.big-result-card strong { display: block; margin-top: 3px; font-size: 16px; }
.big-result-card audio { width: 100%; height: 38px; }
.result-button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-btn, .zip-result-btn, .rack-result-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid rgba(255,225,138,.42);
    border-radius: 10px;
    padding: 10px 12px;
    text-decoration: none;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.result-btn.listen { color: var(--gold-hot); background: rgba(0,0,0,.38); }
.result-btn.download, .zip-result-btn { color: #1b1204; background: linear-gradient(180deg, var(--gold-hot), var(--gold)); box-shadow: 0 5px 0 #3b2709; }
.zip-result-btn { grid-column: 1 / -1; min-height: 52px; font-size: 15px; }
.rack-results {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255,225,138,.28);
    border-radius: 11px;
    background: rgba(0,0,0,.34);
}
.rack-results strong { color: var(--gold-hot); letter-spacing: .14em; }
.rack-results p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.rack-result-btn { min-height: 38px; color: var(--gold-hot); background: rgba(0,0,0,.3); font-size: 11px; }
.rack-result-btn.zip { color: #1b1204; background: linear-gradient(180deg, var(--gold-hot), var(--gold)); }
@media (max-width: 1180px) { .result-actions-grid { grid-template-columns: 1fr; } }

/* UI cleanup: keep waveform primary, make results compact, and prevent rack/result overflow. */
.workspace-panel { overflow: hidden; }
.workspace-panel .wave-display { flex: 1 1 52%; min-height: 280px; }
.workspace-panel .results-console { flex: 0 0 auto; max-height: 190px; overflow: auto; }
.results-console { padding: 10px 12px; }
.results-head { align-items: center; margin-bottom: 8px; }
.results-head h2 { font-size: clamp(16px, 1.7vw, 24px); }
.result-actions-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 8px; }
.big-result-card,
.compact-result-card { min-height: auto; padding: 10px; gap: 8px; }
.big-result-card audio,
.result-card audio { display: none; }
.big-result-card strong { font-size: 13px; }
.big-result-card span { font-size: 10px; }
.result-button-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.result-btn,
.zip-result-btn,
.rack-result-btn { min-height: 34px; padding: 8px 10px; font-size: 10px; line-height: 1.1; cursor: pointer; }
button.result-btn { font: inherit; }
.zip-result-btn { min-height: 38px; font-size: 11px; }
.rack-panel { display: flex; flex-direction: column; }
.module-rack { flex: 1 1 auto; max-height: none; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 6px; scrollbar-color: var(--gold) rgba(0,0,0,.28); }
.module { min-height: 72px; }
.rack-results { flex: 0 0 auto; }
.rack-results .rack-result-btn { min-height: 32px; }
.module.locked strong,
.module-strip.locked strong { color: rgba(247,240,223,.78); }
.module.locked em { color: #c9b076; }
#sampleRateReadout { min-width: 64px; text-align: center; }

/* Project detail page compatibility: add compact DAW layout/scrolling when legacy classes are used. */
.daw-shell { width: min(1640px, calc(100vw - 20px)); min-height: 100vh; margin: 0 auto; padding: 10px 0; display: flex; flex-direction: column; gap: 9px; }
.daw-topbar,
.bottom-mixer,
.status-bar,
.panel { border: 1px solid rgba(255,255,255,.11); background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02) 38%, rgba(0,0,0,.24)), linear-gradient(135deg, var(--panel-hi), var(--panel) 54%, #070707); box-shadow: inset 0 1px rgba(255,255,255,.16), inset 0 -1px rgba(0,0,0,.8), 0 16px 40px rgba(0,0,0,.48); border-radius: 14px; }
.daw-topbar { min-height: 64px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; }
.daw-board { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 285px minmax(560px, 1fr) 320px; gap: 9px; }
.panel { min-height: 0; padding: 14px; overflow: hidden; }
.center-bay { display: flex; flex-direction: column; gap: 10px; }
.center-bay .wave-editor { flex: 1 1 auto; min-height: 300px; display: grid; overflow: hidden; border: 1px solid rgba(215,170,81,.25); border-radius: 12px; background: #060606; }
.rack-bay { display: flex; flex-direction: column; }
.rack-stack { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: grid; gap: 8px; padding-right: 6px; scrollbar-color: var(--gold) rgba(0,0,0,.28); }
.module-strip { width: 100%; min-height: 66px; display: grid; grid-template-columns: 14px 1fr 34px; gap: 9px; align-items: center; text-align: left; color: inherit; text-decoration: none; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 10px; background: linear-gradient(180deg, #3a3832, #141412 50%, #070707); }
.module-strip.locked { opacity: .62; cursor: not-allowed; }
.bottom-mixer { flex: 0 0 auto; max-height: 250px; padding: 12px; display: grid; grid-template-columns: 150px minmax(0,1fr) minmax(220px, .7fr) minmax(220px, .7fr); gap: 10px; overflow: auto; }
.bottom-mixer .compact-results { grid-template-columns: repeat(3, minmax(150px, 1fr)); align-content: start; }
@media (max-width: 1180px) { .daw-board, .bottom-mixer { grid-template-columns: 1fr; } .bottom-mixer { max-height: none; } }

/* Reference-console integration pass: keep the supplied image visible as the console skin. */
.wave-console-shell {
    position: relative;
    z-index: 1;
    isolation: isolate;
    padding: 10px;
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255,225,138,.12), transparent 28%),
        linear-gradient(135deg, rgba(25,24,20,.72), rgba(3,3,3,.82));
}
.wave-console-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/static/img/wave-audio-console-reference.png') center/cover no-repeat;
    opacity: 0.18;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 0;
}
.console-header,
.console-grid,
.transport-mixer,
.message-stack {
    position: relative;
    z-index: 2;
}
.console-header,
.transport-mixer,
.console-panel,
.workspace-panel,
.rack-panel,
.real-project-list {
    background:
        linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.18)),
        rgba(5,5,5,.62);
    backdrop-filter: blur(4px);
}
.console-panel,
.workspace-panel,
.rack-panel {
    border-color: rgba(255,225,138,.23);
}
.rack-panel { padding: 12px; }
.module-rack {
    gap: 10px;
    padding: 8px 8px 8px 0;
    background: linear-gradient(90deg, rgba(255,225,138,.06), rgba(0,0,0,.1));
    border-radius: 12px;
}
.module,
.rack-results {
    border-radius: 6px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.08), transparent 18%, rgba(0,0,0,.2)),
        linear-gradient(180deg, #353229, #11110f 55%, #050505);
    box-shadow:
        inset 0 1px rgba(255,255,255,.2),
        inset 0 -8px 18px rgba(0,0,0,.55),
        0 8px 18px rgba(0,0,0,.32);
}
.module::after {
    content: "";
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 20px;
    height: 20px;
    justify-self: end;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: radial-gradient(circle at 35% 30%, #777, #151515 60%, #000);
    box-shadow: inset 0 1px rgba(255,255,255,.28), 0 0 0 3px rgba(0,0,0,.18);
}
.module em { margin-right: 28px; }
.rack-result-btn.listen { color: var(--gold-hot); background: rgba(0,0,0,.38); }
.transport-mixer { grid-template-columns: 245px minmax(360px, 1fr) minmax(260px, .9fr); }
.transport-source-selector { display: grid; gap: 9px; }
.source-choice-buttons { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.source-choice-buttons button {
    min-height: 38px;
    border: 1px solid rgba(255,225,138,.34);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(0,0,0,.44);
    cursor: pointer;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}
.source-choice-buttons button.active {
    color: #1b1204;
    background: linear-gradient(180deg, var(--gold-hot), var(--gold));
    box-shadow: 0 0 18px rgba(255,225,138,.2);
}
.source-choice-buttons button:disabled { opacity: .45; cursor: not-allowed; }
.results-console,
.big-result-card,
.compact-result-card,
.project-row,
.upload-console,
.wave-display { background-color: rgba(5,5,5,.58); backdrop-filter: blur(3px); }
.result-actions-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.compact-result-card { border-radius: 8px; }
.zip-result-btn { min-height: 34px; }
@media (max-width: 1180px) { .source-choice-buttons, .result-actions-grid { grid-template-columns: 1fr; } }

/* Final UI cleanup: results live only in the right rack; center stays focused on waveform and status. */
.console-reference-overlay { opacity: .32; }
.wave-console-shell::before { opacity: .32; }
.console-header,
.transport-mixer,
.console-panel,
.workspace-panel,
.rack-panel,
.real-project-list {
    background:
        linear-gradient(180deg, rgba(255,255,255,.055), rgba(0,0,0,.12)),
        rgba(5,5,5,.50);
}
.results-console { display: none; }
.workspace-panel .wave-display {
    flex: 1 1 68%;
    min-height: 430px;
    grid-template-rows: 28px minmax(300px, 1fr) 28px auto;
}
.center-monitor-bar {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(210px, .45fr);
    gap: 10px;
    align-items: stretch;
    padding: 9px;
    border-top: 1px solid rgba(215,170,81,.18);
    background: linear-gradient(180deg, rgba(22,21,17,.94), rgba(5,5,5,.78));
}
.inline-source,
.project-status-card {
    min-width: 0;
    border: 1px solid rgba(255,225,138,.18);
    border-radius: 10px;
    padding: 8px;
    background: rgba(0,0,0,.26);
}
.inline-source { display: grid; gap: 7px; }
.project-status-card { display: grid; align-content: center; gap: 5px; }
.project-status-card strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.transport-mixer {
    flex-basis: 82px;
    grid-template-columns: minmax(0, 1fr) auto;
}
.transport-controls-row {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.transport-buttons { margin-top: 0; }
.transport-buttons button { width: 36px; height: 36px; }
.session-readout { font-size: 10px; }
.rack-panel { overflow: hidden; }
.module-rack {
    align-content: start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 8px 0;
}
.rack-results {
    gap: 7px;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
}
.rack-results strong { font-size: 11px; }
.rack-result-btn {
    justify-content: flex-start;
    min-height: 31px;
    padding: 8px 10px;
    text-align: left;
}
.rack-result-btn.zip { justify-content: center; }
.module { min-height: 62px; padding: 9px; }
.module.locked { opacity: .52; }
@media (max-width: 1180px) {
    .workspace-panel .wave-display { min-height: 360px; }
    .center-monitor-bar,
    .transport-controls-row,
    .transport-mixer { grid-template-columns: 1fr; }
}

/* Session privacy + activated tool controls */
.privacy-notice {
    border: 1px solid rgba(255,225,138,.26);
    border-radius: 10px;
    padding: 8px 10px;
    color: #f6e7b2;
    background: linear-gradient(180deg, rgba(255,225,138,.08), rgba(0,0,0,.24));
    font-size: 12px;
    line-height: 1.35;
    backdrop-filter: blur(3px);
}
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-status,
.tool-controls {
    border: 1px solid rgba(255,225,138,.18);
    border-radius: 10px;
    padding: 8px;
    background: rgba(0,0,0,.26);
    color: var(--muted);
    font-size: 12px;
}
.tool-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool-controls select,
.tool-controls input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    color: var(--text);
    background: #090908;
}
.module-strip:not(.locked), .module:not(.locked) { cursor: pointer; }
.module-strip:not(.locked):hover, .module:not(.locked):hover { border-color: rgba(255,225,138,.48); }
.module-console {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 8px;
    width: 100%;
}
.module-console div {
    border: 1px solid rgba(255,225,138,.24);
    border-radius: 10px;
    padding: 9px 10px;
    background: rgba(0,0,0,.26);
}
.module-console strong,
.module-console span { display: block; }
.module-console strong { color: var(--gold-hot); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.module-console span { margin-top: 4px; color: var(--text); font-weight: 900; }
.tool-controls label { color: var(--gold-hot); font-size: 10px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 900px) { .module-console { grid-template-columns: 1fr; } }

/* WAVE_PROCESSING_PROGRESS_V1 */

.wave-processing-panel {
  flex-shrink: 0;
  margin: 10px 0;
  padding: 14px 16px;
  border: 1px solid rgba(224,181,75,.42);
  border-radius: 12px;
  background: rgba(5,5,5,.80);
  box-shadow:
    inset 0 1px rgba(255,255,255,.06),
    0 10px 24px rgba(0,0,0,.30);
}

.wave-processing-panel[hidden] {
  display: none !important;
}

.wave-processing-header,
.wave-processing-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wave-processing-header strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.wave-processing-kicker {
  color: #e8bd58;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

#waveProcessingElapsed,
#waveProcessingPercent {
  color: #f0cc6c;
  font: 900 11px/1 monospace;
}

.wave-processing-track {
  height: 12px;
  margin: 12px 0 8px;
  overflow: hidden;
  border: 1px solid rgba(224,181,75,.32);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.wave-processing-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      #b88020,
      #f2d579,
      #d99e2d
    );
  box-shadow: 0 0 14px rgba(235,187,70,.42);
  transition: width .45s ease;
  position: relative;
  overflow: hidden;
}

.wave-processing-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      110deg,
      transparent 20%,
      rgba(255,255,255,.42) 45%,
      transparent 70%
    );
  animation: waveProgressShine 1.3s linear infinite;
}

@keyframes waveProgressShine {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.wave-processing-info {
  color: #d5cbb5;
  font-size: 11px;
  font-weight: 800;
}

.wave-processing-panel p {
  margin: 9px 0 0;
  color: #a99f8b;
  font-size: 11px;
}

.wave-processing-panel.is-complete {
  border-color: rgba(77,221,139,.48);
}

.wave-processing-panel.is-complete .wave-processing-bar {
  background: linear-gradient(90deg, #168a50, #5ce59d);
}

.wave-processing-panel.is-error {
  border-color: rgba(255,90,90,.55);
}

.wave-processing-panel.is-error .wave-processing-bar {
  background: linear-gradient(90deg, #8f2222, #ff6c6c);
}

.source-not-ready {
  opacity: .42 !important;
  cursor: not-allowed !important;
}

/* WAVE_MASTERING_MODULE_V1
   Módulo aislado. No modifica Vocal Remover.
*/

.mastering-module-button {
  cursor: pointer !important;
}

.mastering-module-button:hover {
  filter: brightness(1.12);
}

.wave-mastering-panel {
  position: absolute;
  inset: 0;
  z-index: 100;
  padding: 14px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 75% 15%, rgba(216,174,74,.12), transparent 34%),
    rgba(5,5,5,.96);
  backdrop-filter: blur(8px);
}

.workspace-panel {
  position: relative !important;
}

.mastering-window {
  width: min(900px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(221,180,78,.42);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.06), rgba(0,0,0,.25)),
    rgba(10,10,9,.94);
  box-shadow:
    inset 0 1px rgba(255,255,255,.08),
    0 25px 70px rgba(0,0,0,.55);
}

.mastering-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(221,180,78,.22);
}

.mastering-header h2 {
  margin: 5px 0 2px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .95;
  letter-spacing: -.04em;
}

.mastering-header p {
  margin: 0;
  color: #bdb19a;
}

.mastering-kicker {
  color: #e8bd59;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .20em;
}

.mastering-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(221,180,78,.36);
  border-radius: 50%;
  background: #080808;
  color: #f1cb69;
  font-size: 25px;
  cursor: pointer;
}

.mastering-project,
.mastering-description,
.mastering-progress-area,
.mastering-result-area {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(221,180,78,.25);
  border-radius: 12px;
  background: rgba(0,0,0,.38);
}

.mastering-project span {
  display: block;
  margin-bottom: 5px;
  color: #dcae42;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .17em;
}

.mastering-project strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.mastering-description h3,
.mastering-result-area h3 {
  margin: 0 0 7px;
}

.mastering-description p,
.mastering-progress-area p {
  margin: 0;
  color: #bdb19a;
}

.mastering-chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.mastering-chain > div {
  padding: 14px;
  border: 1px solid rgba(221,180,78,.22);
  border-radius: 11px;
  background: rgba(0,0,0,.35);
}

.mastering-chain span {
  color: #e8bd59;
  font: 900 11px/1 monospace;
}

.mastering-chain strong,
.mastering-chain small {
  display: block;
}

.mastering-chain strong {
  margin-top: 9px;
}

.mastering-chain small {
  margin-top: 4px;
  color: #9f9580;
}

.mastering-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#masteringElapsed {
  color: #efcc70;
  font: 900 12px/1 monospace;
}

.mastering-progress-track {
  height: 12px;
  margin: 13px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.mastering-progress-bar {
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, #ecc55f, transparent);
  animation: masteringMovement 1.3s linear infinite;
}

@keyframes masteringMovement {
  from { transform: translateX(-110%); }
  to { transform: translateX(330%); }
}

.mastering-result-ok {
  color: #59dc99;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
}

#masteringAudioPlayer {
  width: 100%;
  margin: 12px 0;
}

.mastering-download,
.mastering-run,
.mastering-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.mastering-download,
.mastering-run {
  border: 0;
  background: linear-gradient(180deg, #f5d579, #d8a83d);
  color: #111;
}

.mastering-return {
  border: 1px solid rgba(221,180,78,.40);
  background: #090909;
  color: #e7c15e;
}

.mastering-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mastering-run:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 800px) {
  .mastering-chain {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .wave-mastering-panel {
    padding: 8px;
  }

  .mastering-window {
    padding: 16px;
  }
}

/* MASTERING_HIDE_COMPLETED_PROGRESS_V1 */
.mastering-progress-area[hidden] {
  display: none !important;
}

/* WAVE_DELETE_PROGRESS_CLEANUP_V2 */
#waveProcessingPanel[hidden] {
  display: none !important;
}

/* WAVE_BPM_MODULE_V1
   Módulo aislado tipo plugin profesional.
*/

.bpm-module-button {
  cursor: pointer !important;
}

.bpm-module-button:hover {
  filter: brightness(1.12);
}

.wave-bpm-panel {
  position: absolute;
  inset: 0;
  z-index: 100;
  padding: 14px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(227,181,66,.13), transparent 34%),
    rgba(4,4,4,.97);
  backdrop-filter: blur(8px);
}

.bpm-window {
  width: min(940px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(222,177,62,.42);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.05), rgba(0,0,0,.32)),
    #0a0a09;
  box-shadow:
    inset 0 1px rgba(255,255,255,.07),
    0 28px 80px rgba(0,0,0,.58);
}

.bpm-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(222,177,62,.22);
}

.bpm-header h2 {
  margin: 5px 0 2px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: .95;
  letter-spacing: -.04em;
}

.bpm-header p {
  margin: 0;
  color: #bdb29c;
}

.bpm-kicker {
  color: #e8bb4e;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .20em;
}

.bpm-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(222,177,62,.36);
  border-radius: 50%;
  background: #080808;
  color: #f0c85f;
  font-size: 25px;
  cursor: pointer;
}

.bpm-project,
.bpm-progress-area,
.bpm-result-area {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(222,177,62,.25);
  border-radius: 12px;
  background: rgba(0,0,0,.38);
}

.bpm-project span {
  display: block;
  margin-bottom: 5px;
  color: #dda93d;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .17em;
}

.bpm-project strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.bpm-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, .8fr);
  gap: 14px;
  margin-top: 18px;
}

.bpm-display,
.bpm-data-panel {
  border: 1px solid rgba(222,177,62,.25);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.35)),
    #080808;
}

.bpm-display {
  padding: 24px;
}

.bpm-display-label {
  color: #dfb145;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .17em;
}

.bpm-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 22px 0 28px;
}

.bpm-value-wrap strong {
  font: 950 clamp(72px, 12vw, 140px)/.82 monospace;
  letter-spacing: -.08em;
  text-shadow: 0 0 28px rgba(235,188,75,.22);
}

.bpm-value-wrap span {
  color: #e0b24c;
  font-size: 20px;
  font-weight: 950;
}

.bpm-meter-scale {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #817864;
  font: 800 9px/1 monospace;
}

.bpm-meter-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: visible;
}

.bpm-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #7d5a12, #e5b546, #f1d77b);
  transition: width .7s ease;
}

.bpm-meter-needle {
  position: absolute;
  top: -6px;
  left: 0;
  width: 2px;
  height: 26px;
  background: #fff0a6;
  box-shadow: 0 0 12px rgba(255,234,154,.8);
  transition: left .7s ease;
}

.bpm-data-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.bpm-data-item {
  padding: 15px;
  border-bottom: 1px solid rgba(222,177,62,.16);
}

.bpm-data-item:last-child {
  border-bottom: 0;
}

.bpm-data-item span {
  display: block;
  margin-bottom: 5px;
  color: #9e9177;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

.bpm-data-item strong {
  font-size: 15px;
}

.bpm-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bpm-progress-head span {
  color: #edc65f;
  font: 900 10px/1 monospace;
}

.bpm-progress-track {
  height: 12px;
  margin: 13px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.bpm-progress-bar {
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, #edc45d, transparent);
  animation: bpmMovement 1.2s linear infinite;
}

@keyframes bpmMovement {
  from { transform: translateX(-120%); }
  to { transform: translateX(360%); }
}

.bpm-progress-area[hidden],
.bpm-result-area[hidden] {
  display: none !important;
}

.bpm-progress-area p {
  margin: 0;
  color: #a99f8c;
}

.bpm-result-ok {
  color: #5ae09a;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
}

.bpm-result-area h3 {
  margin: 5px 0;
}

.bpm-result-area p {
  margin: 0;
  color: #bdb29d;
}

.bpm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.bpm-run,
.bpm-return {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 950;
  cursor: pointer;
}

.bpm-run {
  border: 0;
  background: linear-gradient(180deg, #f4d477, #d5a43a);
  color: #111;
}

.bpm-return {
  border: 1px solid rgba(222,177,62,.4);
  background: #080808;
  color: #e7be58;
}

.bpm-run:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 820px) {
  .bpm-console-grid {
    grid-template-columns: 1fr;
  }

  .wave-bpm-panel {
    padding: 8px;
  }

  .bpm-window {
    padding: 16px;
  }
}
