/* ============================================================
   A-LAB AUDIO STUDIO Ã¢â‚¬â€ design system v2
   Paleta unificada: morado (brand) + ÃƒÂ¡mbar (funcional).
   Sin azul/cian. Organizado por intenciÃƒÂ³n de uso.
   ============================================================ */

/* === Design Tokens === */
:root {
    --bg: #08080c;
    --bg2: #121218;
    --surface: #101016;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f2ee;
    --text2: #9a9aa5;
    --accent: #A855F7;
    --accent-strong: #9333EA;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --warm: #f2b24a;
    --warm-glow: rgba(242, 178, 74, 0.35);
    --ok: #4ade80;
    --danger: #ff6b81;

    --font-display: 'Space Grotesk', 'Poppins', system-ui, sans-serif;
    --font-body: 'Poppins', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, system-ui, monospace;

    --navbar-height: 64px;
    --section-max: 1180px;
    --radius: 14px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background-color: var(--bg); }

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--bg);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

a { color: var(--text); text-decoration: none; }
img, canvas, svg { vertical-align: middle; }

::selection { background: rgba(168, 85, 247, 0.45); color: #ffffff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23232e; border-radius: 5px; border: 2px solid var(--bg); }

::-webkit-scrollbar-thumb:hover { background: #2f2f3d; }

:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }

/* === Navbar glass === */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: var(--navbar-height);
    background-color: rgba(10, 10, 12, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand { flex: 1; display: flex; align-items: center; min-width: 0; }

.nav-brand a {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text);
    white-space: nowrap;
}

.nav-brand a span { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 2;
    gap: 0.1rem;
}

.nav-links li { height: 100%; display: flex; align-items: center; }

.nav-links a {
    color: var(--text2);
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: 0 0.7rem;
    height: 100%;
    display: flex;
    align-items: center;
    letter-spacing: 0.02em;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--warm); font-weight: 600; }

.nav-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }

.nav-pill {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 50px;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
}

/* Hamburguesa (solo mÃƒÂ³vil) */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text);
    margin: 5px 0;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hamburger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; transform: translateX(-20px); }
.hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 19999; }

.mobile-menu-overlay.active { display: block; }

/* === Hero === */
.lab-hero {
    height: 100vh;
    height: 100svh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--bg);
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    cursor: default;
}

.lab-hero-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
    pointer-events: none;
    max-width: 880px;
    margin: 2.5rem auto 0;
}

.lab-hero-content::before {
    content: "";
    position: absolute;
    inset: -22% -25%;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(8, 8, 12, 0.88) 0%, rgba(8, 8, 12, 0.55) 48%, transparent 75%);
    pointer-events: none;
}

.lab-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.lab-hero h1 {
    font-size: clamp(3rem, 7vw, 5.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1.2rem;
    color: var(--text);
    text-shadow: 0 0 35px rgba(168, 85, 247, 0.25);
}

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

.lab-subtitle {
    color: var(--text2);
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    font-weight: 300;
    max-width: 520px;
    margin: 1.2rem auto 0;
    line-height: 1.5;
}

/* Cue de scroll */
.lab-scroll-cue {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text2);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 0.5rem 1rem;
    min-width: 44px;
    min-height: 44px;
}

.lab-scroll-cue:hover { color: var(--accent); transform: translateX(-50%) translateY(3px); }

.lab-scroll-line { width: 1px; height: 36px; background: linear-gradient(to bottom, transparent, var(--accent)); }

.lab-scroll-chevron svg { animation: labFloat 2s ease-in-out infinite; }

@keyframes labFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* === Secciones === */
.lab-section { padding: 6rem 2rem; max-width: var(--section-max); margin: 0 auto; position: relative; z-index: 2; }

.lab-section[id],
.tool-card[id] { scroll-margin-top: calc(var(--navbar-height) + 1rem); }

.section-head { text-align: center; max-width: 700px; margin: 0 auto 3.5rem; }

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.section-head h2 { font-size: 2.6rem; margin-bottom: 0.8rem; }

.section-sub { color: var(--text2); font-size: 1.05rem; font-weight: 300; }

/* === Grid de tarjetas === */
.panels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: stretch; }

.tool-card,
.panel {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: transform 0.45s var(--ease-out), border-color 0.45s ease, box-shadow 0.45s ease;
}

.tool-card:hover,
.panel:hover { transform: translateY(-4px); border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(168, 85, 247, 0.12); }

.panel-wide { grid-column: 1 / -1; }

.tool-card.is-busy,
.btn.is-busy { opacity: 0.5; pointer-events: none; }

.tool-card.is-done { border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 0 24px rgba(168, 85, 247, 0.1); }

/* === Cabecera de tarjeta === */
.panel-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

.panel-title { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.55rem; }

.panel-desc { font-size: 0.92rem; font-weight: 300; color: var(--text2); line-height: 1.65; }

.panel-body { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.2rem; flex: 1; }

/* === Tabs de vista === */
.view-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.view-tab {
    min-height: 40px;
    padding: 0.45rem 1.1rem;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text2);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.view-tab:hover { color: var(--text); }

.view-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.55), rgba(168, 85, 247, 0.25));
    box-shadow: 0 2px 12px rgba(168, 85, 247, 0.35);
}

/* === Botones === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.68rem 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(168, 85, 247, 0.06));
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.18);
}

.btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(168, 85, 247, 0.25));
    border-color: rgba(168, 85, 247, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(168, 85, 247, 0.4);
    color: #ffffff;
}

.btn:active:not(:disabled) { transform: translateY(0); }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text2);
}

.btn svg { flex: 0 0 auto; }

.btn-secondary { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text2); box-shadow: none; }

.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); border-color: rgba(168, 85, 247, 0.5); color: var(--text); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }

.btn-hero { min-height: 62px; font-size: 1.05rem; padding: 0.9rem 1.5rem; }

.btn-icon { width: 52px; padding: 0; border-radius: 10px; }

.btn-toggle.active,
.btn-toggle.is-active {
    background: linear-gradient(135deg, rgba(242, 178, 74, 0.18), rgba(242, 178, 74, 0.05));
    border-color: rgba(242, 178, 74, 0.6);
    color: var(--warm);
    box-shadow: 0 0 18px rgba(242, 178, 74, 0.15);
}

.btn.is-active {
    background: linear-gradient(135deg, rgba(242, 178, 74, 0.18), rgba(242, 178, 74, 0.05));
    border-color: rgba(242, 178, 74, 0.6);
    color: var(--warm);
}

.btn-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }

.fx-actions { grid-template-columns: 1fr 1fr 1.4fr; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--warm);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

/* === Switch (activar FX) === */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease-out);
    flex: 0 0 auto;
}

.switch-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text2);
    transition: all 0.3s var(--ease-out);
}

.switch input:checked + .switch-slider {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(168, 85, 247, 0.2));
    border-color: rgba(168, 85, 247, 0.7);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.3);
}

.switch input:checked + .switch-slider::after {
    left: 22px;
    background: #fff;
}

.switch input:focus-visible + .switch-slider { outline: 2px solid var(--warm); outline-offset: 2px; }

.check-line {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text2);
    cursor: pointer;
    min-height: 44px;
}

.check-line input { accent-color: var(--accent); width: 18px; height: 18px; }

/* === Pills / tags === */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--accent);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* === Formularios === */
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1 1 auto; min-width: 0; }

.field-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text2); }

.field-input {
    min-height: 44px;
    width: 100%;
    padding: 0.6rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.field-input::placeholder { color: rgba(154, 154, 165, 0.6); }
.field-input:hover { border-color: rgba(255, 255, 255, 0.18); }

.field-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18); background: rgba(168, 85, 247, 0.05); }

select.field-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%239a9aa5' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.6rem;
    cursor: pointer;
}

select.field-input:focus {
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23A855F7' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
 }

/* Todos los selects en tema oscuro: fondo oscuro, texto claro y flecha
   (triangulito) propia visible — sin la flecha nativa que "se rompe" sobre
   fondo oscuro. El !important vence al shorthand `background` de las reglas
   individuales (.eq-band-type, .win-presets, .export-row select). */
select,
select.field-input,
.win-presets,
.eq-band-type,
.export-row select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%239a9aa5' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.7rem center !important;
    padding-right: 2rem !important;
    cursor: pointer;
}

/* El popup nativo del select también es oscuro (Chromium/Firefox). */
:root { color-scheme: dark; }
option {
    background-color: #121218;
    color: #f2f2ee;
}

textarea.field-input { resize: vertical; min-height: 120px; line-height: 1.55; }

input[type="number"].field-input { -moz-appearance: textfield; appearance: textfield; font-family: var(--font-mono); font-size: 0.9rem; }

input[type="number"].field-input::-webkit-outer-spin-button,
input[type="number"].field-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* === Sliders (webkit + moz) === */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 120px;
    height: 28px;
    background: transparent;
    cursor: pointer;
    flex: 1 1 auto;
}

/* NOTA: las reglas webkit y moz de sliders van SEPARADAS: si se juntan en un
   mismo selector, Chrome descarta toda la regla por el pseudo desconocido. */
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(242, 178, 74, 0.35), rgba(168, 85, 247, 0.55)); border: 1px solid var(--border); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(242, 178, 74, 0.35), rgba(168, 85, 247, 0.55)); border: 1px solid var(--border); }

input[type="range"]::-webkit-slider-thumb {
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
input[type="range"]::-moz-range-thumb {
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; }

input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; }

input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 18px var(--accent-glow); }
input[type="range"]:hover::-moz-range-thumb { transform: scale(1.15); box-shadow: 0 0 18px var(--accent-glow); }

input[type="range"]:focus-visible { outline: 2px solid var(--warm); outline-offset: 4px; }

.range-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--warm);
    min-width: 3.4em;
    text-align: right;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* === Dropzone === */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 190px;
    padding: 2rem 1.5rem;
    border: 1.5px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover { border-color: var(--accent); background: rgba(168, 85, 247, 0.06); box-shadow: 0 0 30px rgba(168, 85, 247, 0.1); }

.dropzone svg { color: var(--accent); transition: transform 0.3s ease; }

.dropzone:hover svg { transform: translateY(-3px); }

.dropzone-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text); }

.dropzone-sub { font-size: 0.85rem; font-weight: 300; color: var(--text2); }

/* === MicrÃƒÂ³fono === */
.mic-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }

.rec-timer { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text2); letter-spacing: 0.08em; min-width: 3.4em; }

#mic-btn.recording { color: var(--danger); border-color: rgba(255, 107, 129, 0.6); animation: recPulse 1.2s ease-in-out infinite; }

@keyframes recPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 107, 129, 0.18); }
    50% { box-shadow: 0 0 22px rgba(255, 107, 129, 0.45); }
}

.mic-level {
    display: block;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: #0a0a10;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* === Info de pista === */
.track-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.track-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.track-duration { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text2); white-space: nowrap; }

/* === Waveform === */
.waveform-frame { background: #0a0a10; border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem; transition: border-color 0.3s ease, box-shadow 0.3s ease; }

.tool-card.is-done .waveform-frame,
.waveform-frame:hover { border-color: rgba(168, 85, 247, 0.35); }

.waveform-canvas {
    display: block;
    width: 100%;
    height: 220px;
    border-radius: 8px;
    cursor: crosshair;
    background: transparent;
}

/* === Espectrograma === */
.spectrogram-frame {
    position: relative;
    background: #0a0a10;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
}

.spectrogram-canvas {
    display: block;
    width: 100%;
    height: 260px;
    border-radius: 8px;
    background: transparent;
}

.spectrogram-overlay {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: calc(100% - 1rem);
    height: calc(100% - 1rem);
    border-radius: 8px;
    pointer-events: auto;
    cursor: crosshair;
}

/* === Transporte === */
.transport {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.transport-buttons { display: flex; align-items: center; gap: 0.6rem; flex: 0 0 auto; }

.time-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text2);
    letter-spacing: 0.05em;
    margin-left: 0.4rem;
    white-space: nowrap;
}

.time-sep { opacity: 0.5; margin: 0 0.25rem; }

.master-row { display: flex; align-items: center; gap: 0.8rem; flex: 1 1 260px; min-width: 0; }

.ctl-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text2);
    flex: 0 0 auto;
    white-space: nowrap;
}

/* === Medidor de nivel === */
.meter-wrap { padding: 0.4rem 0.6rem 0; }

.level-meter {
    display: block;
    width: 100%;
    height: 150px;
    border-radius: 10px;
    background: #0a0a10;
    border: 1px solid var(--border);
}

/* === Herramientas (tool blocks) === */
.tool {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.3s ease;
}

.tool:hover { border-color: rgba(255, 255, 255, 0.14); }

.tool-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text2); }

.tool-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }

.tool-row .field { flex: 0 1 130px; }

/* === Bloques FX === */
.fx-block {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.fx-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.fx-head .tool-label { font-size: 0.8rem; letter-spacing: 0.22em; color: var(--text); }

.fx-status {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text2);
    margin-left: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.fx-status.is-on { color: var(--warm); border-color: rgba(242, 178, 74, 0.4); background: rgba(242, 178, 74, 0.08); }

.fx-bands {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: center;
}

.eq-band {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: stretch;
}

.eq-band .range-label { text-align: center; }

.fx-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem 1.2rem;
    align-items: end;
}

.fx-ctl {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.fx-ctl select.field-input { min-height: 40px; padding: 0.45rem 2.4rem 0.45rem 0.7rem; }

/* === A/B compare === */
.ab-compare {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 12px;
    background: rgba(168, 85, 247, 0.05);
}

.ab-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.ab-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.ab-btn { font-family: var(--font-mono); font-size: 0.82rem; }

.ab-btn.ab-active {
    background: linear-gradient(135deg, rgba(242, 178, 74, 0.2), rgba(242, 178, 74, 0.07));
    border-color: rgba(242, 178, 74, 0.65);
    color: var(--warm);
    box-shadow: 0 0 18px rgba(242, 178, 74, 0.18);
}

.ab-state { font-size: 0.82rem; color: var(--text2); }

/* === Stems === */
.stems { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; width: 100%; }

.stems:empty::after {
    content: "La voz y la mÃƒÂºsica separadas van a aparecer acÃƒÂ¡, listas para escuchar y elegir.";
    display: block;
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text2);
    opacity: 0.7;
    padding: 0.4rem 0;
}

.stem-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 1rem;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.stem-btn:hover:not(:disabled) { border-color: rgba(168, 85, 247, 0.55); color: var(--accent); background: rgba(168, 85, 247, 0.06); transform: translateY(-2px); }

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

/* === Nota explicativa === */
.clean-note {
    font-size: 0.83rem;
    font-weight: 300;
    color: var(--text2);
    line-height: 1.6;
    padding: 0.75rem 1rem;
    border-left: 2px solid rgba(242, 178, 74, 0.4);
    background: rgba(242, 178, 74, 0.03);
    border-radius: 0 10px 10px 0;
}

/* === Registro de estado === */
.status-log {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
}

.status-log:empty::before { content: "Los mensajes del estudio van a aparecer acÃƒÂ¡."; color: var(--text2); opacity: 0.6; }

.status-line { display: block; padding: 0.15rem 0; color: var(--text2); word-break: break-word; }

.status-line::before { content: "> "; color: var(--accent); }

.status-ok::before { content: "Ã¢Å“â€œ "; color: var(--ok); }
.status-error::before { content: "Ã¢Å“â€¢ "; color: var(--danger); }
.status-ai::before { content: "Ã¢â€”â€  "; color: var(--warm); }

/* === Overlay de progreso === */
.progress-wrap {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 2rem));
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    background: rgba(16, 16, 22, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(168, 85, 247, 0.15);
}

.progress-wrap[hidden] { display: none; }

.progress-label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text); }

.progress-track { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; overflow: hidden; }

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--warm) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    animation: progressSweep 1.6s linear infinite;
    transition: width 0.25s ease;
}

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

/* === Footer === */
footer {
    background: transparent;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3.5rem 2rem 2.5rem;
    position: relative;
    z-index: 2;
}

.footer-inner { max-width: var(--section-max); margin: 0 auto; text-align: center; }

.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; color: var(--text); }

.footer-line { color: var(--text2); font-weight: 300; font-size: 0.95rem; margin-top: 0.3rem; }

.footer-copy { font-size: 0.8rem; color: var(--text2); margin-top: 1.6rem; opacity: 0.7; }

/* === Reveal on scroll === */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }

.reveal.revealed { opacity: 1; transform: translateY(0); }

/* === Responsive === */
@media (max-width: 900px) {
    .panels-grid { grid-template-columns: 1fr; }
    .nav-links a { padding: 0 0.55rem; }
    .section-head h2 { font-size: 2.2rem; }
    .fx-bands { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar { z-index: 20000; padding: 0 1rem; }
    .nav-brand { flex: auto; }
    .nav-right { flex: auto; gap: 0.5rem; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 72%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(10, 10, 12, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: calc(var(--navbar-height) + 1.5rem);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 20000;
        transform: translateX(100%);
    }

    .nav-links.active { right: 0; transform: translateX(0); }

    .nav-links li { height: auto; width: 100%; text-align: center; }

    .nav-links a { font-size: 1.1rem; padding: 0.9rem 0; height: auto; width: 100%; justify-content: center; }

    .hamburger-menu { display: block; z-index: 20002; }

    .section-head h2 { font-size: 2rem; }
    .section-sub { font-size: 0.98rem; }
    .tool-card { padding: 1.5rem; }
    .fx-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .lab-hero { padding: 6.5rem 1.25rem 3rem; }
    .lab-hero-content { padding: 1rem; margin-top: 1rem; }
    .lab-hero h1 { letter-spacing: -0.02em; }
    .lab-scroll-cue { bottom: 1.5rem; }
    .lab-section { padding: 4rem 1.1rem; }
    .section-head { margin-bottom: 2.5rem; }
    .section-head h2 { font-size: 1.75rem; }
    .tool-card { padding: 1.25rem; border-radius: 12px; }
    .panel-title { font-size: 1.35rem; }
    .panel-body { gap: 0.95rem; }
    .btn-duo { grid-template-columns: 1fr; }
    .fx-actions { grid-template-columns: 1fr; }
    .btn-hero { min-height: 56px; font-size: 1rem; }
    .dropzone { min-height: 160px; padding: 1.5rem 1rem; }
    .waveform-canvas { height: 150px; }
    .spectrogram-canvas { height: 200px; }
    .transport { gap: 0.8rem; padding: 0.8rem; }
    .master-row { flex-basis: 100%; }
    .tool-row .field { flex: 1 1 100%; }
    .fx-bands { grid-template-columns: 1fr 1fr; }
    .stems { grid-template-columns: 1fr; }
    .ab-btns { grid-template-columns: 1fr; }
    .footer-brand { font-size: 1.15rem; }
}

/* === Prefers reduced motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }

    .reveal { opacity: 1; transform: none; }

    .lab-scroll-chevron svg { animation: none; }
    .progress-bar { animation: none; }
    #mic-btn.recording { animation: none; }
}

/* ============================================================
   DAW v3 Ã¯Â¿Â½ workspace multitrack
   ============================================================ */
.daw-workspace {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
    height: 76vh;
    min-height: 560px;
}

.daw-toolbar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.daw-tool {
    min-height: 38px;
    padding: 0.35rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.daw-tool:hover { color: var(--text); border-color: rgba(168, 85, 247, 0.5); }

.daw-tool.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(168, 85, 247, 0.2));
    border-color: rgba(168, 85, 247, 0.7);
}

.daw-spacer { flex: 1 1 auto; }

.daw-main {
    display: grid;
    grid-template-columns: clamp(190px, 22vw, 245px) 1fr;
    grid-template-rows: 1fr auto;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-height: 0;
}

.daw-headers {
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    scrollbar-width: none;
    padding-top: 28px;
}
.daw-headers::-webkit-scrollbar { display: none; }

.daw-scroll { overflow: auto; min-width: 0; position: relative; }

.daw-timeline { position: relative; min-width: 100%; height: 100%; }

.daw-ruler {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
    width: 100%;
    display: block;
    background: #0d0d13;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.daw-clips {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.daw-clips::-webkit-scrollbar { display: none; }

/* Barra de desplazamiento horizontal de la playlist: va al fondo del ÃƒÂ¡rea de
   pistas (bajo el viewport, no debajo de la ÃƒÂºltima pista), con estÃƒÂ©tica propia. */
.daw-hscroll {
    grid-column: 2;
    grid-row: 2;
    height: 12px;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    touch-action: none;
}
.daw-hscroll.is-hidden { display: none; }
.daw-hscroll-thumb {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    min-width: 36px;
    background: rgba(168, 85, 247, 0.45);
    border-radius: 4px;
    cursor: grab;
    transition: background 0.2s ease;
}
.daw-hscroll-thumb:hover { background: rgba(242, 178, 74, 0.65); }
.daw-hscroll-thumb:active { cursor: grabbing; background: rgba(242, 178, 74, 0.8); }

.daw-spacer-el { display: block; }

.daw-trackrow {
    position: absolute;
    left: 0;
    background: rgba(255, 255, 255, 0.018);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.daw-trackrow.is-alt { background: rgba(255, 255, 255, 0.032); }

.daw-trackrow.is-muted { opacity: 0.4; }

.daw-trackrow.has-automation { outline: 1px dashed rgba(242, 178, 74, 0.25); outline-offset: -1px; }

.daw-clip {
    position: absolute;
    height: 100%;
    top: 0;
    background: #17171f;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

.daw-clip:active { cursor: grabbing; }

.daw-clip.is-selected { outline: 2px solid #f2b24a; }

.daw-clip:hover { border-color: rgba(168, 85, 247, 0.6); }

.daw-clip.is-midi { cursor: crosshair; height: 100%; top: 0; }

.daw-clip-wave { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

.daw-clip-name {
    position: absolute;
    top: 2px;
    left: 6px;
    font-size: 9px;
    font-family: var(--font-mono);
    color: rgba(242, 178, 74, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daw-clip-rate {
    position: absolute;
    top: 2px;
    right: 6px;
    font-size: 9px;
    font-family: var(--font-mono);
    color: #f2b24a;
    pointer-events: none;
}

.daw-playhead {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: #f2b24a;
    box-shadow: 0 0 8px rgba(242, 178, 74, 0.6);
    pointer-events: none;
    z-index: 5;
}

.daw-marquee {
    position: absolute;
    border: 1px solid rgba(168, 85, 247, 0.8);
    background: rgba(168, 85, 247, 0.12);
    pointer-events: none;
    z-index: 6;
}

.daw-loop-region {
    position: absolute;
    top: 0;
    height: 28px;
    background: rgba(168, 85, 247, 0.14);
    border-top: 1px solid rgba(242, 178, 74, 0.7);
    border-bottom: 1px solid rgba(242, 178, 74, 0.7);
    cursor: move;
    z-index: 6;
    touch-action: none;
}

.daw-loop-a,
.daw-loop-b {
    position: absolute;
    top: 0;
    width: 6px;
    height: 28px;
    background: #f2b24a;
    cursor: ew-resize;
}

.daw-loop-a { left: -3px; }

.daw-loop-b { right: -3px; }

/* --- Headers de pista --- */
.daw-trackhead {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.3rem 1rem 0.3rem 0.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 78px;
    min-height: 0;
    margin-bottom: 0;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.daw-head-resize {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 3;
    border-radius: 0 0 7px 7px;
    background: transparent;
}
.daw-head-resize:hover { background: rgba(168, 85, 247, 0.22); }

.daw-trackhead.is-selected { border-color: rgba(242, 178, 74, 0.6); }

.daw-trackhead-top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

/* Pista baja: una sola fila con el nombre a la izquierda y los controles a la
   derecha. Los botones no prioritarios se ocultan y van al menú de "⋯". */
.daw-trackhead.is-short {
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 1rem 0.2rem 0.4rem;
}
.daw-trackhead.is-short .daw-trackhead-top { flex: 1 1 auto; min-width: 0; }
.daw-trackhead.is-short .daw-trackhead-btns { flex: 0 0 auto; }
.daw-trackhead.is-short .daw-trackhead-name { font-size: 0.62rem; max-width: 120px; }
.daw-trackhead.is-short .daw-ms-fx,
.daw-trackhead.is-short .daw-ms-bounce,
.daw-trackhead.is-short .daw-trackhead-del,
.daw-trackhead.is-short .daw-ms:not(.daw-ms-auto):not(.daw-ms-more) { display: none; }
.daw-trackhead.is-short .daw-ms.daw-ms-more { display: inline-flex; }

.daw-ms.daw-ms-more {
    display: none;
    flex: 0 0 auto;
    width: 26px;
    min-height: 24px;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.daw-ms-more:hover { color: var(--text); border-color: rgba(168, 85, 247, 0.5); }

.daw-trackhead-name {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
    min-width: 0;
}

.daw-trackhead-btns {
    flex: 1 1 auto;
    display: flex;
    gap: 0.2rem;
    min-width: 0;
    align-items: center;
}

.daw-trackhead-knobs {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-right: auto;
    min-width: 0;
}

.daw-ms {
    flex: 0 0 auto;
    width: 24px;
    min-height: 24px;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.daw-ms.is-muted { color: var(--text2); text-decoration: line-through; background: rgba(138, 138, 153, 0.15); }

.daw-ms.is-solo { color: #08080c; background: var(--warm); border-color: var(--warm); }

.daw-ms-fx {
    flex: 0 0 auto;
    width: 40px;
    min-height: 24px;
    padding: 0 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}
.daw-ms-fx svg { flex: 0 0 auto; }

.daw-ms-fx:hover { color: var(--text); border-color: rgba(168, 85, 247, 0.5); }

.daw-ms-fx.is-on { color: var(--accent); border-color: rgba(168, 85, 247, 0.6); background: rgba(168, 85, 247, 0.14); }

/* Cadena de FX arrastrable dentro del menú FX (tipo Reaper). */
.fx-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem 0.2rem;
    padding: 0.3rem 0.4rem 0.35rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: 0.52rem;
    line-height: 1.3;
}
.fx-chain-label {
    flex: 0 0 100%;
    font-size: 0.5rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text2);
}
.fx-chain-chip {
    display: inline-block;
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.fx-chain-chip:hover { color: var(--text); border-color: rgba(168, 85, 247, 0.5); }
.fx-chain-chip.is-off { opacity: 0.4; text-decoration: line-through; }
.fx-chain-chip.is-dragging { opacity: 0.35; }
.fx-chain-chip.is-over { color: var(--warm); border-color: rgba(242, 178, 74, 0.8); background: rgba(242, 178, 74, 0.14); }
.fx-chain-sep { color: rgba(255, 255, 255, 0.25); font-style: normal; }

.daw-ms-auto.is-active { color: var(--accent); border-color: rgba(168, 85, 247, 0.6); background: rgba(168, 85, 247, 0.15); }

.daw-ms-bounce {
    flex: none;
    width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.daw-trackhead-knobs {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-right: auto;
    min-width: 0;
}

.knob-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.knob-wrap canvas.knob { display: block; cursor: ns-resize; touch-action: none; }
.knob-label {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text2);
    line-height: 1;
}
.knob-read {
    font-family: var(--font-mono);
    font-size: 0.52rem;
    color: var(--warm);
    line-height: 1;
}

/* --- Inspector + FX rail --- */
.daw-side {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    overflow-y: auto;
}

.daw-inspector, .daw-fxrail {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem;
}

.fx-empty { font-size: 0.82rem; color: var(--text2); font-weight: 300; }

.insp-section { display: flex; flex-direction: column; gap: 0.55rem; }

.insp-title {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.insp-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.insp-row .field { flex: 1 1 90px; }

.insp-row select.field-input { flex: 1 1 120px; }

.fade-presets { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.fade-preset {
    min-height: 26px;
    padding: 0.2rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.fade-preset.is-on { color: var(--warm); border-color: rgba(242, 178, 74, 0.5); }

/* --- Transport --- */
.daw-transport {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.daw-transport .time-display { font-size: 1rem; min-width: 4.5em; }

/* Controles de loop del transporte: toggle + campos de inicio/fin + desplazar. */
.loop-ctl {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    opacity: 0.55;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.loop-ctl.is-active { opacity: 1; border-color: rgba(242, 178, 74, 0.5); }
.loop-ctl .btn-icon-sm {
    width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    font-size: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
}
.loop-ctl .btn-icon-sm:hover { color: var(--warm); border-color: rgba(242, 178, 74, 0.5); }
.loop-input {
    width: 52px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.2rem 0.3rem;
    text-align: center;
}
.loop-input:focus { outline: none; border-color: var(--accent); }
.loop-sep { color: var(--text2); font-size: 0.7rem; }
.loop-dur {
    font-size: 0.62rem;
    color: var(--warm);
    min-width: 3em;
    text-align: center;
    white-space: nowrap;
}

.daw-transport .ctl-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text2);
    flex: 0 0 auto;
}
.daw-transport .master-vol {
    flex: 0 0 auto;
    width: 120px;
    min-width: 120px;
    height: 24px;
}
.daw-transport .master-vol::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(242, 178, 74, 0.55), rgba(168, 85, 247, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}
.daw-transport .master-vol::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(242, 178, 74, 0.55), rgba(168, 85, 247, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}
.daw-transport .master-vol::-webkit-slider-thumb { margin-top: -7px; }

/* --- Inspector inferior (onda/espectro) --- */
.daw-inspect { display: flex; flex-direction: column; gap: 0.4rem; flex: 0 0 auto; min-height: 0; height: 210px; }
.daw-inspect.is-collapsed { height: auto; }

.daw-inspect-grip {
    position: relative;
    height: 12px;
    flex: 0 0 auto;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 26px;
    touch-action: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    border-radius: 6px 6px 0 0;
}
.daw-inspect-grip::before {
    content: "";
    width: 64px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.2s ease;
}
.daw-inspect-grip:hover::before { background: rgba(168, 85, 247, 0.55); }
.daw-inspect-grip.is-dragging::before { background: rgba(242, 178, 74, 0.8); }

.inspect-collapse {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
}
.inspect-collapse:hover { color: var(--warm); border-color: rgba(242, 178, 74, 0.5); }

.daw-inspect.is-collapsed .daw-inspect-grip { height: 22px; }
.daw-inspect.is-collapsed .daw-inspect-grip::before { background: rgba(168, 85, 247, 0.4); }
.daw-inspect.is-collapsed .view-tabs { display: none; }
.daw-inspect.is-collapsed .daw-inspect-canvas { display: none; }

/* --- Panel de exportaciÃ³n unificado --- */
.export-menu {
    position: fixed;
    z-index: 950;
    width: 280px;
    background: var(--bg2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 10px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.7);
    padding: 0.7rem;
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.export-title {
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--warm);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
}
.export-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text2);
}
.export-row select {
    background: var(--bg2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.25rem 0.4rem;
    max-width: 170px;
}
.export-norm { justify-content: flex-start; font-size: 0.68rem; cursor: pointer; }
.export-norm input { accent-color: var(--accent); }
.export-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.export-actions .btn { min-height: 30px; padding: 0.3rem 0.9rem; font-size: 0.72rem; }

.daw-inspect-canvas {
    display: grid;
    grid-template-columns: 1fr 150px;
    grid-template-rows: 1fr;
    gap: 0.6rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}

/* La columna principal (forma de onda / espectro) manda; a la derecha van el
   medidor de volumen y las mediciones de loudness (LUFS) como secundarios. */
.daw-inspect-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.daw-inspect-side {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    min-height: 0;
}

.daw-inspect-canvas .waveform-frame,
.daw-inspect-canvas .spectrogram-frame { margin: 0; }

.daw-inspect-canvas .waveform-frame {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.4rem;
}
.daw-inspect-canvas .waveform-canvas {
    flex: 1 1 auto;
    min-height: 40px;
    height: 100%;
    width: 100%;
}
.daw-inspect-canvas .analyzer-frame {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.daw-inspect-canvas .analyzer-canvas {
    flex: 1 1 auto;
    min-height: 40px;
    height: 100%;
    width: 100%;
}
.daw-inspect-canvas .level-meter { flex: 1 1 auto; min-height: 40px; width: 100%; }

/* Caja de loudness (LUFS) al costado del medidor de volumen. */
.lufs-box {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: #0a0a10;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.45rem;
    font-family: var(--font-mono);
}
.lufs-title {
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
}
.lufs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    font-size: 0.62rem;
    color: var(--text2);
}
.lufs-row b {
    color: var(--warm);
    font-weight: 500;
    white-space: nowrap;
}
.lufs-reset {
    margin-top: 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
}
.lufs-reset:hover { color: var(--warm); border-color: rgba(242, 178, 74, 0.45); }

/* --- MenÃ¯Â¿Â½ contextual de fades (click derecho) --- */
.fade-menu {
    position: fixed;
    z-index: 950;
    min-width: 220px;
    background: var(--bg2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 10px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.7);
    padding: 0.35rem;
    font-family: var(--font-mono);
}
.fade-menu-section-title {
    display: block;
    padding: 0.3rem 0.5rem 0.15rem;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.fade-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 34px;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text2);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}
.fade-menu-item:hover { color: var(--text); background: rgba(168, 85, 247, 0.14); }
.fade-menu-item.is-current { color: var(--warm); }
.fade-menu-item canvas { flex: 0 0 auto; border-radius: 3px; background: #0a0a10; border: 1px solid var(--border); }
.fade-menu-item .check { margin-left: auto; opacity: 0; color: var(--warm); }
.fade-menu-item.is-current .check { opacity: 1; }
.fade-menu-sep { height: 1px; background: var(--border); margin: 0.25rem 0.3rem; }

/* --- Piano roll (ventana flotante) --- */
.piano-roll { display: flex; flex-direction: column; gap: 0.4rem; height: 100%; min-height: 0; }
.piano-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text2);
    flex: 0 0 auto;
}
.piano-info b { color: var(--warm); font-weight: 500; }
.piano-canvas-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 8px; border: 1px solid var(--border); }
.piano-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.piano-hint { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text2); opacity: 0.8; flex: 0 0 auto; }

.spectrogram-frame { position: relative; background: #0a0a10; border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem; }

.spectrogram-canvas { display: block; width: 100%; height: 220px; border-radius: 8px; background: transparent; }

.spectrogram-overlay { position: absolute; top: 0.5rem; left: 0.5rem; width: calc(100% - 1rem); height: calc(100% - 1rem); border-radius: 8px; pointer-events: auto; cursor: crosshair; }

/* ============================================================
   DAW v3 Ã¯Â¿Â½ UIs de plugins FX
   ============================================================ */
.fx-panel { display: flex; flex-direction: column; gap: 0.6rem; }

.fx-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.fx-block-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.fx-block-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
}

.fx-block-body { padding: 0.7rem; display: flex; flex-direction: column; gap: 0.6rem; }

.eq-wrap { display: flex; flex-direction: column; gap: 0.5rem; }

.eq-canvas { width: 100%; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none; }

.eq-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }

.eq-band {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.eq-band.is-on { border-color: rgba(168, 85, 247, 0.55); }

.eq-band-type {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.15rem 0.2rem;
    cursor: pointer;
}
.eq-band-type:hover { border-color: rgba(242, 178, 74, 0.5); }

.eq-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-height: 32px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text2);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.1rem;
}
.eq-chip:hover { background: rgba(255, 255, 255, 0.04); }

.eq-chip-f { font-size: 0.6rem; letter-spacing: 0.05em; }

.eq-chip-db { color: var(--warm); font-size: 0.68rem; }

.comp-wrap { display: flex; gap: 0.6rem; }

.comp-sliders { display: flex; gap: 0.5rem; flex: 1; }

.vslider { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; flex: 1; min-width: 0; }

.vslider-read {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--warm);
    min-height: 1em;
    white-space: nowrap;
}

.vslider-track {
    position: relative;
    width: 24px;
    flex: 1;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: ns-resize;
    touch-action: none;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.vslider-fill {
    position: absolute;
    bottom: 0;
    left: 2px;
    right: 2px;
    height: 0%;
    background: linear-gradient(to top, rgba(168, 85, 247, 0.35), rgba(242, 178, 74, 0.75));
    border-radius: 10px;
}

.vslider-thumb {
    position: absolute;
    left: 50%;
    bottom: 0%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, 50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff, #c9c9cf 60%, #8f8f9a);
    border: 1px solid rgba(242, 178, 74, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.vslider-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); }

.comp-side { display: flex; flex-direction: column; gap: 0.4rem; width: clamp(180px, 45%, 260px); flex: 0 0 auto; min-width: 0; }

.comp-transfer { width: 100%; height: 110px; border-radius: 8px; }

.comp-gr { width: 100%; height: 60px; border-radius: 8px; }

.rev-canvas, .del-canvas { width: 100%; border-radius: 8px; }

.eq-wrap { position: relative; }

.fx-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.del-divisions { display: flex; gap: 0.25rem; }

.div-btn {
    min-height: 30px;
    padding: 0.2rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.div-btn.is-on { color: var(--warm); border-color: rgba(242, 178, 74, 0.55); background: rgba(242, 178, 74, 0.08); }

.hslider { display: flex; align-items: center; gap: 0.5rem; }

.hslider .field-label { flex: 0 0 70px; }

.hslider input { flex: 1; }

.hslider .range-label { flex: 0 0 4em; }

/* --- Responsive DAW --- */
@media (max-width: 1100px) {
    .daw-main { grid-template-columns: 140px 1fr; }
    .daw-inspect-canvas { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}

@media (max-width: 900px) {
    .daw-main { grid-template-columns: 120px 1fr; }
    .daw-side { grid-column: 1 / -1; flex-direction: row; }
    .daw-side > * { flex: 1; min-width: 0; }
    .daw-workspace { height: auto; min-height: 0; }
}

@media (max-width: 600px) {
    .daw-main { grid-template-columns: 90px 1fr; }
    .daw-side { flex-direction: column; }
    .daw-inspect-canvas { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .daw-transport { justify-content: center; }
    .comp-wrap { flex-direction: column; }
    .comp-side { width: 100%; }
}

/* ============================================================
   DAW v3.1 Ã¯Â¿Â½ full-bleed, scrub, ventanas FX flotantes, analizador
   ============================================================ */
.daw-section { max-width: none; padding: 0; scroll-margin-top: 0; }

.daw-workspace {
    height: calc(100vh - var(--navbar-height));
    height: calc(100svh - var(--navbar-height));
    min-height: 0;
    border-radius: 0;
    border-inline: none;
    border-bottom: none;
    padding: 0.6rem 1rem 0.8rem;
}

.daw-tool { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 40px; min-height: 40px; padding: 0.3rem 0.7rem; }
.daw-tool svg { flex: 0 0 auto; }
.daw-tool-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; }
.daw-tool-sep { width: 1px; height: 22px; background: var(--border); margin: 0 0.3rem; }
.daw-hint {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text2);
    opacity: 0.75;
    white-space: nowrap;
    max-width: min(58vw, 620px);
    overflow: hidden;
    text-overflow: ellipsis;
}
.daw-hint.hint-ok { color: var(--warm); opacity: 1; }
.daw-hint.hint-error { color: #ef4444; opacity: 1; }
.daw-hint.hint-help { color: var(--accent); opacity: 0.95; }

.daw-toolbar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.daw-toolbar::-webkit-scrollbar { height: 4px; }

.daw-trackrow.is-drop-target { outline: 2px solid #A855F7; outline-offset: -2px; background: rgba(168, 85, 247, 0.08); }

.daw-row-resize {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 26;
    background: transparent;
}
.daw-row-resize:hover { background: rgba(168, 85, 247, 0.2); }

/* Medidor vertical por pista (estilo Reaper): angosto, dentro del header de
   la pista, a la derecha de todo. */
.daw-track-meter {
    position: absolute;
    top: 6px;
    bottom: 6px;
    right: 5px;
    width: 8px;
    z-index: 2;
    pointer-events: none;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 8, 12, 0.5);
}
.daw-track-meter-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.daw-auto-lane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    pointer-events: auto;
    touch-action: none;
    cursor: crosshair;
}

.daw-auto-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.daw-scrub-halo {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
    pointer-events: none;
    z-index: 6;
}

.daw-trackhead-del {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.daw-trackhead-del:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.6); }
.daw-trackhead-top { display: flex; align-items: center; gap: 0.35rem; }
.daw-trackhead-top .daw-trackhead-name { flex: 1; min-width: 0; }

/* --- Ventanas flotantes FX --- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 900; }

.fx-window {
    position: absolute;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 10px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.fx-window.is-active { box-shadow: 0 0 0 1px var(--accent), 0 14px 44px rgba(0, 0, 0, 0.65); }

.win-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.win-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.win-power, .win-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.win-power.is-on { color: var(--warm); border-color: rgba(242, 178, 74, 0.55); }
.win-close:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }

.win-presets {
    max-width: 110px;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.3rem;
    cursor: pointer;
}

.win-preset-save, .win-preset-del {
    width: 28px;
    height: 28px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.win-preset-save:hover { color: var(--accent); border-color: rgba(168, 85, 247, 0.5); }
.win-preset-del:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }

/* --- Orden de la cadena de FX (reordenable) --- */
.win-chain-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex: 0 0 auto;
    font-family: var(--font-mono);
}
.win-chain-nav {
    width: 22px;
    height: 22px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
}
.win-chain-nav:hover { color: var(--warm); border-color: rgba(242, 178, 74, 0.5); }
.win-chain {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.56rem;
    white-space: nowrap;
}
.win-chain-item { color: var(--text2); }
.win-chain-item.is-current { color: var(--warm); font-weight: 600; }
.win-chain-item.is-off { opacity: 0.4; text-decoration: line-through; }
.win-chain-sep { color: rgba(255, 255, 255, 0.25); font-style: normal; }

.win-body { flex: 1; overflow-y: auto; padding: 0.7rem; }

@media (max-width: 768px) {
    .fx-window {
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        bottom: 8px;
        width: auto !important;
        height: auto !important;
        max-height: 72vh;
    }
    .win-bar::before {
        content: "";
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #333;
        margin: 0 auto 4px;
        display: block;
    }
}

/* --- MenÃ¯Â¿Â½ de plugins (botÃ¯Â¿Â½n FX del header) --- */
.fx-menu-wrap { position: relative; flex: 0 0 auto; }
.fx-menu {
    position: fixed;
    min-width: 170px;
    background: var(--bg2);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
    padding: 0.3rem;
    z-index: 950;
}
.fx-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 36px;
    padding: 0.35rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text2);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}
.fx-menu-item:hover { color: var(--text); background: rgba(168, 85, 247, 0.12); }
.fx-menu-item .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); flex: 0 0 auto; }
.fx-menu-item .dot.on { background: var(--warm); box-shadow: 0 0 8px rgba(242, 178, 74, 0.7); }
.fx-menu-item .chev { margin-left: auto; opacity: 0.6; }

/* --- Analizador de espectro --- */
.analyzer-frame {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: #0a0a10;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
}
.analyzer-frame[hidden] { display: none !important; }
.analyzer-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.analyzer-tools .field-input { min-height: 34px; width: auto; padding: 0.3rem 2rem 0.3rem 0.6rem; font-size: 0.78rem; }
.analyzer-canvas { display: block; width: 100%; height: 170px; border-radius: 8px; background: transparent; cursor: crosshair; }

/* --- Plugins: piezas --- */
.eq-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.eq-canvas { width: 100%; height: 180px; border-radius: 8px; cursor: crosshair; touch-action: none; }
.eq-tip {
    position: absolute;
    background: rgba(16, 16, 22, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--warm);
    pointer-events: none;
    z-index: 60;
}
.comp-wrap { display: flex; gap: 0.6rem; }
.comp-sliders { display: flex; gap: 0.5rem; flex: 1; min-width: 0; }
.comp-side { display: flex; flex-direction: column; gap: 0.4rem; width: clamp(180px, 45%, 260px); flex: 0 0 auto; min-width: 0; }
.comp-transfer { width: 100%; height: 100px; border-radius: 8px; }
.comp-meters { display: flex; gap: 0.4rem; }
.comp-meters .meter-col { flex: 1; }
.meter-col { display: flex; flex-direction: column; gap: 0.2rem; align-items: center; }
.plug-meter { border-radius: 6px; }
.rev-bars { display: flex; gap: 0.4rem; }
.rev-bars .meter-col { flex: 1; }
.rev-canvas, .del-canvas, .del-scope { width: 100%; border-radius: 8px; }
.del-scope { height: 60px; }

/* --- Distorsión (waveshaper) --- */
.dist-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.dist-title {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text2);
}
.dist-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
.dist-type {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.35rem 0.2rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.dist-type:hover { border-color: rgba(242, 178, 74, 0.45); color: var(--text); }
.dist-type.is-on {
    color: var(--text);
    border-color: rgba(242, 178, 74, 0.8);
    background: linear-gradient(180deg, rgba(242, 178, 74, 0.16), rgba(168, 85, 247, 0.16));
    box-shadow: 0 0 10px rgba(242, 178, 74, 0.25);
}
.dist-transfer { width: 100%; height: 150px; border-radius: 8px; }
.dist-scope { width: 100%; height: 44px; border-radius: 8px; }
.dist-meters { display: flex; gap: 0.4rem; }
.dist-meters .meter-col { flex: 1; }

/* --- Sintetizador (instrumento MIDI) --- */
.syn-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.syn-waves { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
.syn-wave {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.35rem 0.2rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.syn-wave:hover { border-color: rgba(242, 178, 74, 0.45); color: var(--text); }
.syn-wave.is-on {
    color: var(--text);
    border-color: rgba(242, 178, 74, 0.8);
    background: linear-gradient(180deg, rgba(242, 178, 74, 0.16), rgba(168, 85, 247, 0.16));
    box-shadow: 0 0 10px rgba(242, 178, 74, 0.25);
}
.syn-preview { width: 100%; height: 64px; border-radius: 8px; }
.syn-keys {
    position: relative;
    height: 74px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0d0d13;
}
.syn-key {
    position: absolute;
    top: 0;
    height: 100%;
    box-sizing: border-box;
    border: none;
    border-right: 2px solid #0d0d13;
    background: linear-gradient(180deg, #f4f4ee, #d8d8d2);
    cursor: pointer;
    border-radius: 0 0 4px 4px;
    transition: background 0.08s ease, box-shadow 0.08s ease;
}
.syn-key.is-black {
    height: 46px;
    top: 0;
    background: linear-gradient(180deg, #2a2a33, #14141a);
    z-index: 2;
    border-radius: 0 0 4px 4px;
    border-right: none;
}
.syn-key.is-down {
    background: linear-gradient(180deg, #f2b24a, #e08c2a);
    box-shadow: 0 0 12px rgba(242, 178, 74, 0.6);
}
.syn-key.is-black.is-down { background: linear-gradient(180deg, #f2b24a, #b06a15); }
.syn-note {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text2);
    text-align: center;
}
.syn-scope { width: 100%; height: 44px; border-radius: 8px; }

/* --- Inspector + inspect en pantallas chicas --- */
@media (max-width: 1200px) {
    .daw-main { grid-template-columns: clamp(150px, 17vw, 190px) 1fr; }
    .daw-trackhead-knobs { display: none; }
}
@media (max-width: 900px) {
    .daw-main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .daw-hscroll { grid-column: 1 / -1; }
    .daw-side { grid-column: 1 / -1; flex-direction: row; max-height: 200px; }
    .daw-inspector { flex: 1; overflow-y: auto; }
    .daw-inspect-canvas { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}
@media (max-width: 600px) {
    .daw-workspace { padding: 0.4rem; height: calc(100svh - var(--navbar-height)); }
    .daw-main { grid-template-columns: 44px 1fr; grid-template-rows: 1fr; }
    .daw-headers { width: 44px; }
    .daw-trackhead-name, .daw-trackhead-vol { display: none; }
    .daw-trackhead-del, .daw-ms-fx, .daw-ms-bounce, .daw-ms:not(.daw-ms-auto) { display: none; }
    .daw-hint { display: none; }
    .daw-transport { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
    .comp-wrap { flex-direction: column; }
    .comp-side { width: 100%; }
}

/* ============================================================
   DAW v3.3 Ã¯Â¿Â½ pÃ¯Â¿Â½gina standalone, knobs, razor, resize, drop
   ============================================================ */
.daw-page { display: flex; flex-direction: column; height: 100vh; height: 100svh; overflow: hidden; }

.daw-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 56px;
    padding: 0 1.2rem;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.daw-topbar-brand a {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text);
    white-space: nowrap;
}
.daw-topbar-brand a span { color: var(--accent); }

.daw-topbar-nav { display: flex; align-items: center; gap: 1rem; }

.daw-topbar-nav a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text2);
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    transition: all 0.25s ease;
}
.daw-topbar-nav a:hover { color: var(--text); border-color: var(--accent); }

.daw-page-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.daw-page .daw-workspace {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    border-radius: 0;
    border: none;
}

.nav-daw-link {
    color: var(--warm) !important;
    font-weight: 600;
    border: 1px solid rgba(242, 178, 74, 0.4);
    border-radius: 8px;
    padding: 0.2rem 0.7rem !important;
}
.nav-daw-link:hover { background: rgba(242, 178, 74, 0.1); }

/* LÃ¯Â¿Â½nea de preview de la cuchilla */
.daw-razor-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(242, 178, 74, 0.9);
    border-left: 1px dashed rgba(242, 178, 74, 0.8);
    pointer-events: none;
    z-index: 6;
}

/* Resize de ventanas FX */
.win-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 5;
}
.win-resize::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(242, 178, 74, 0.6);
    border-bottom: 2px solid rgba(242, 178, 74, 0.6);
    border-radius: 0 0 3px 0;
}
.fx-window { position: absolute; }

/* Knobs */
.daw-trackhead-knobs { display: flex; align-items: center; gap: 0.4rem; margin-right: auto; min-width: 0; }
.knob-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.05rem; }
.knob { width: 36px; height: 36px; cursor: ns-resize; touch-action: none; }
.knob-label { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text2); }
.knob-read { font-family: var(--font-mono); font-size: 0.6rem; color: var(--warm); min-height: 1em; }

/* Drop de archivos en la pÃ¯Â¿Â½gina DAW */
body.is-dropping::after {
    content: "SoltÃ¯Â¿Â½ para importar a una pista";
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.06em;
    color: var(--warm);
    background: rgba(8, 8, 12, 0.85);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* Status compacto del DAW (oculto: los mensajes van al hint adaptativo) */
.daw-status { display: none; }
