.app-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0 clamp(0.75rem, 2vw, 1.25rem);
        height: clamp(40px, 5vh, 52px);
        background: rgba(14,12,10,0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
        z-index: 100;
        position: sticky;
        top: 0;
      }      /* ═══════════════════════════════════════════════════════════
   RACK ANALOG NIGHT  —  MASTER Audio Mastering Studio
   Paleta: Carbón cálido · Ámbar · Verde VU · Rojo clipping
   ═══════════════════════════════════════════════════════════ */

      :root {
        /* ── Fondos — dark glass ── */
        --bg:       #0e0c0a;
        --surface:  #161310;
        --surface2: #1e1a15;
        --surface3: #27221a;
        --glass:    rgba(255,255,255,0.03);
        --glass2:   rgba(255,255,255,0.06);
        --border:   rgba(255,255,255,0.09);
        --border2:  rgba(255,255,255,0.05);

        /* ── Colores de señal — más vibrantes ── */
        --amber:       #f0b840;
        --amber2:      #c8902a;
        --amber-glow:  rgba(240,184,64,0.15);
        --vu-green:    #4ade80;
        --vu-yellow:   #facc15;
        --clip-red:    #f43f5e;
        --cyan:        #22d3ee;
        --lilac:       #a78bfa;

        /* ── Texto ── */
        --text:   #f5f0e8;
        --muted:  #a09585;
        --faint:  #6b6055;

        /* ── Tipografía ── */
        --mono: "IBM Plex Mono", "Courier New", monospace;
        --sans: "Inter", system-ui, sans-serif;

        /* ── Radio y sombras ── */
        --radius-sm: 6px;
        --radius:    10px;
        --radius-lg: 16px;
        --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
        --shadow:    0 4px 16px rgba(0,0,0,.5);
        --shadow-lg: 0 8px 32px rgba(0,0,0,.6);

        /* ── Resize handle ── */
        --handle-w: 4px;
        --sidebar-w: 360px;

        /* ── Aliases para compatibilidad con el JS original ── */
        --accent:  var(--amber);
        --accent2: var(--lilac);
        --green:   var(--vu-green);
        --yellow:  var(--vu-yellow);
        --red:     var(--clip-red);
        --blue:    var(--cyan);
        --orange:  #f97316;
      }

      .panel-block {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 18px;
        padding: 1rem;
        margin-bottom: 1rem;
      }

      .panel-block-secondary {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.06);
      }

      .panel-block-note {
        background: rgba(255, 255, 255, 0.015);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 14px;
        padding: 0.85rem;
      }

      .full-width {
        width: 100%;
      }

      .stack-row {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
      }

      .space-top-sm {
        margin-top: 0.75rem;
      }

      .space-top-md {
        margin-top: 1rem;
      }

      .section-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.45rem;
      }

      .section-header-row .btn {
        padding: 0.38rem 0.7rem;
        font-size: 0.75rem;
      }

      .summary-accent {
        cursor: pointer;
        font-family: var(--mono);
        font-size: 0.72rem;
        letter-spacing: 0.12em;
        color: var(--amber);
        text-transform: uppercase;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.28rem 0;
        user-select: none;
      }

      .summary-accent .summary-pill {
        width: 3px;
        height: 14px;
        border-radius: 999px;
        background: var(--amber);
        opacity: 0.65;
        flex-shrink: 0;
      }

      .summary-accent .summary-divider {
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, var(--border2), transparent);
      }

      .summary-muted {
        color: var(--muted);
        font-size: 0.72rem;
        margin-bottom: 0.5rem;
        line-height: 1.5;
      }

      .muted-small {
        font-size: 0.68rem;
        color: var(--muted);
      }

      .hidden-input {
        display: none;
      }

      .inline-note {
        font-size: 0.82rem;
        opacity: 0.85;
        cursor: pointer;
      }

      .scroll-panel {
        max-height: 180px;
        overflow-y: auto;
        font-size: 0.82rem;
      }

      .status-text {
        min-height: 1em;
        margin-top: 0.22rem;
        font-family: var(--mono);
        font-size: 0.65rem;
        color: var(--muted);
      }

      .grid-2cols {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
      }

      .panel-block-secondary {
        padding: 1rem;
      }

      .section-header-row .btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
      }

      .small-text {
        font-size: 0.72rem;
        color: var(--muted);
        line-height: 1.5;
      }

      .button-row {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-top: 0.8rem;
      }

      .button-row + .button-row {
        margin-top: 0.6rem;
      }

      .btn-small {
        padding: 0.35rem 0.6rem;
        font-size: 0.72rem;
        min-width: 110px;
      }

      .loading-placeholder {
        opacity: 0.65;
        padding: 0.55rem 0.55rem;
        font-size: 0.82rem;
        color: var(--muted);
      }

      .drop-zone-ref {
        border: 1px dashed var(--lilac);
        border-radius: 8px;
        padding: 0.85rem;
        text-align: center;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
        position: relative;
        margin-bottom: 0.65rem;
        background: rgba(167, 139, 250, 0.04);
      }

      .drop-zone-ref:hover,
      .drop-zone-ref.dragover {
        background: rgba(167, 139, 250, 0.12);
        border-color: rgba(167, 139, 250, 0.75);
      }

      .drop-zone-ref .drop-zone-icon {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
      }

      .drop-zone-ref p {
        margin: 0;
        font-size: 0.76rem;
        color: var(--text);
        font-weight: 500;
      }

      .drop-zone-ref .drop-zone-note {
        margin: 0.18rem 0 0;
        font-size: 0.65rem;
        color: var(--muted);
      }

      .drop-zone-ref .file-name {
        margin-top: 0.35rem;
        font-size: 0.68rem;
        color: var(--lilac);
        font-family: var(--mono);
      }

      .overlay-input {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
      }

      .note-mini {
        font-size: 0.65rem;
        color: var(--muted);
      }

      .mb-none {
        margin-bottom: 0;
      }

      .ref-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        font-size: 0.68rem;
      }

      .hidden-panel {
        display: none;
      }

      .detail-panel {
        margin-bottom: 0.6rem;
      }

      .details-summary {
        font-size: 0.72rem;
        color: var(--muted);
        cursor: pointer;
        margin-bottom: 0.45rem;
        user-select: none;
        letter-spacing: 0.05em;
        text-transform: uppercase;
      }

      .control-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        margin-bottom: 0.65rem;
      }

      .control-row-wide {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
      }

      .field-group {
        display: flex;
        align-items: center;
        gap: 0.38rem;
        font-size: 0.7rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 5px;
        padding: 0.4rem 0.55rem;
        cursor: pointer;
        transition: border-color 0.12s ease, background 0.12s ease;
      }

      .field-group:hover {
        border-color: var(--amber);
      }

      .field-group input {
        width: auto;
        cursor: pointer;
      }

      .toggle-label {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        font-size: 0.76rem;
        margin-bottom: 0.75rem;
        cursor: pointer;
      }
      .toggle-label--compact {
        margin-bottom: 0.35rem;
      }
      .toggle-label--tight {
        margin-bottom: 0.25rem;
      }
      .toggle-label-right {
        display: flex;
        align-items: center;
        gap: 0.28rem;
        font-size: 0.65rem;
        font-weight: 400;
        margin-left: auto;
        cursor: pointer;
      }

      .section-subtitle {
        font-size: 0.68rem;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }

      .grid-2cols-tight {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
      }

      .stack-col {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
      }

      .grid-full {
        grid-column: 1 / -1;
      }

      .select-full {
        grid-column: 1 / -1;
        font-size: 0.72rem;
        padding: 0.3rem;
        margin-bottom: -0.2rem;
      }

      .mb-base {
        margin-bottom: 0.5rem;
      }

      .divider-top-lg {
        margin-top: 0.7rem;
        border-top: 1px solid var(--border);
        padding-top: 0.7rem;
      }

      .text-muted-body {
        font-size: 0.68rem;
        color: var(--muted);
        line-height: 1.4;
        margin-bottom: 0.45rem;
      }

      .mt-base {
        margin-top: 0.5rem;
      }

      .mt-lg {
        margin-top: 0.7rem;
      }

      .mt-sm {
        margin-top: 0.45rem;
      }

      .mt-xs {
        margin-top: 0.25rem;
      }

      .mb-none {
        margin-bottom: 0;
      }

      .mb-xs {
        margin-bottom: 0.25rem;
      }

      .mb-sm {
        margin-bottom: 0.35rem;
      }

      .param--md {
        margin-bottom: 0.45rem;
      }

      .note-mini {
        font-size: 0.65rem;
        color: var(--muted);
      }

      .status-text {
        min-height: 1em;
        margin-top: 0.22rem;
        font-family: var(--mono);
        font-size: 0.65rem;
        color: var(--muted);
      }

      .section-divider--highlight {
        margin-top: 0.45rem;
        border: 1px solid rgba(245, 158, 11, 0.25);
        border-radius: 8px;
        padding: 0.65rem;
        background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.02));
      }

      .btn-ref-library {
        width: 100%;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.38rem 0.6rem;
        background: var(--surface2);
        border: 1px dashed var(--lilac);
        border-radius: 6px;
        color: var(--lilac);
        font-size: 0.75rem;
        cursor: pointer;
        text-align: left;
        display: inline-flex;
        align-items: center;
        transition: background 0.15s ease;
      }
      .btn-ref-library:hover,
      .btn-ref-library:focus-visible {
        background: var(--surface3);
        border-color: rgba(167, 139, 250, 0.7);
      }

      .section-title-row--compact {
        margin-bottom: 0.3rem;
      }

      .canvas-block {
        width: 100%;
        height: 50px;
        background: var(--surface2, #0d0d1a);
        border-radius: 5px;
        display: block;
      }

      .dash-metrics-row {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        font-size: 0.68rem;
        font-family: var(--mono);
      }

      .meter-fill {
        height: 0%;
      }

      .dash-bar-fill {
        width: 0%;
      }

      .text-on-surface {
        color: var(--text);
      }

      .section-divider {
        margin-top: 0.7rem;
        border-top: 1px solid var(--border);
        padding-top: 0.5rem;
      }

      .section-divider--highlight {
        margin-top: 0.45rem;
        border: 1px solid rgba(245, 158, 11, 0.25);
        border-radius: 8px;
        padding: 0.65rem;
        background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.02));
      }

      .section-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 0.4rem;
      }

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

      .stack-xxs {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
      }

      .canvas-block {
        width: 100%;
        height: 50px;
        background: var(--surface2, #0d0d1a);
        border-radius: 5px;
        display: block;
      }

      .dash-metrics-row {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        font-size: 0.68rem;
        font-family: var(--mono);
      }

      .range-value {
        font-size: 0.7rem;
        font-family: var(--mono);
        color: var(--accent2);
        min-width: 1.5rem;
      }

      .note-small {
        font-size: 0.65rem;
        color: var(--muted);
        margin: 0.15rem 0 0;
      }

      .btn-block {
        width: 100%;
      }

      .mt-lg {
        margin-top: 0.7rem;
      }

      .mt-sm {
        margin-top: 0.45rem;
      }

      .mt-xs {
        margin-top: 0.25rem;
      }

      .mb-sm {
        margin-bottom: 0.35rem;
      }

      .param--md {
        margin-bottom: 0.45rem;
      }

      .param--lg {
        margin-bottom: 0.55rem;
      }

      .details-summary--accent {
        color: var(--amber);
      }

      .ml-auto {
        margin-left: auto;
      }

      .ref-library-list {
        max-height: 140px;
        overflow-y: auto;
        margin-bottom: 0.5rem;
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 6px;
      }

      .ref-metrics {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        font-size: 0.68rem;
        font-family: var(--mono);
      }

      .range-compact {
        width: 70px;
      }

      .accent-amber {
        accent-color: var(--amber);
      }

      .accent2 {
        accent-color: var(--accent2);
      }

      .field-input {
        width: auto;
        cursor: pointer;
      }

      .btn-block {
        width: 100%;
      }

      .mt-lg {
        margin-top: 0.7rem;
      }

      .mt-sm {
        margin-top: 0.45rem;
      }

      .mt-xs {
        margin-top: 0.25rem;
      }

      .mb-sm {
        margin-bottom: 0.35rem;
      }

      .param--md {
        margin-bottom: 0.45rem;
      }

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

      .stack-xxs {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
      }

      .canvas-block {
        width: 100%;
        height: 50px;
        background: var(--surface2, #0d0d1a);
        border-radius: 5px;
        display: block;
      }

      .dash-metrics-row {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        font-size: 0.68rem;
        font-family: var(--mono);
      }

      .drop-zone-text {
        font-size: 0.76rem;
        color: var(--text);
        font-weight: 500;
        margin: 0;
      }

      .btn-tertiary:hover {
        border-color: var(--amber);
        color: var(--amber);
      }

      .link-inline:hover {
        color: rgba(167, 139, 250, 0.95);
      }

      .select-field {
        margin-top: 0.25rem;
      }

      .select-field--spaced {
        margin-bottom: 0.45rem;
      }

      .note-small {
        font-size: 0.65rem;
        color: var(--muted);
      }

      .field-group.accent2 input {
        accent-color: var(--accent2);
      }

      .checkbox-row {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        font-size: 0.76rem;
        cursor: pointer;
      }

      .checkbox-row.small-text {
        font-size: 0.82rem;
        opacity: 0.85;
      }

      .section-note {
        margin-top: 0.5rem;
        color: var(--muted);
        font-size: 0.78rem;
        line-height: 1.55;
      }

      .preset-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
      }

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

      .section-note {
        margin-top: 0.5rem;
        color: var(--muted);
        font-size: 0.78rem;
        line-height: 1.55;
      }

      .preset-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
      }

      .btn-group .btn {
        flex: 1 1 140px;
        min-width: 130px;
      }

      .preset-btn {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: 12px;
        color: var(--text);
        padding: 0.85rem 0.95rem;
        text-align: left;
        font-size: 0.84rem;
        cursor: pointer;
        transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      .preset-btn:hover,
      .preset-btn:focus-visible {
        background: rgba(240, 184, 64, 0.08);
        border-color: rgba(240, 184, 64, 0.24);
        transform: translateY(-1px);
      }

      .preset-btn.active {
        background: rgba(240, 184, 64, 0.14);
        border-color: rgba(240, 184, 64, 0.28);
        color: #fff9e6;
      }

      .sidebar .drop-zone,
      .sidebar .drop-zone-ref {
        border-radius: 16px;
        padding: 1rem;
      }

      .sidebar .drop-zone:hover,
      .sidebar .drop-zone.dragover,
      .sidebar .drop-zone-ref:hover,
      .sidebar .drop-zone-ref.dragover {
        background: rgba(240, 184, 64, 0.08);
      }

      .sidebar .section-label {
        margin-bottom: 0.5rem;
      }

      .sidebar-note,
      .param-hint,
      .analysis-panel p,
      .workflow-hero p {
        color: var(--muted);
      }

      @media (max-width: 1120px) {
        .preset-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      @media (max-width: 860px) {
        main {
          flex-direction: column;
        }
        aside {
          width: 100%;
          max-width: none;
          border-right: none;
          padding-bottom: 0.5rem;
        }
        .content {
          padding: 0.75rem 0.9rem 1rem;
        }
        .workflow-hero,
        .studio-focus,
        .content-grid,
        .analysis-grid,
        .mb-crossover,
        .control-card .eq4-wrap {
          grid-template-columns: 1fr;
        }
      }

      @media (max-width: 640px) {
        .api-url-input {
          width: 100%;
        }
        .btn-group {
          flex-direction: column;
        }
        .preset-grid {
          grid-template-columns: 1fr;
        }
      }

      *,
      *::before,
      *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      html {
        height: 100%;
        overflow: hidden;
      }

      body {
        position: relative;
        background:
          radial-gradient(ellipse at 20% 0%, rgba(240,184,64,.10) 0%, transparent 50%),
          radial-gradient(ellipse at 80% 100%, rgba(167,139,250,.07) 0%, transparent 50%),
          var(--bg);
        color: var(--text);
        font-family: var(--sans);
        font-size: clamp(12px, 1.1vw, 14px);
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }
      body::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        background:
          radial-gradient(circle at 30% 20%, rgba(232, 160, 32, 0.08), transparent 26%),
          radial-gradient(circle at 82% 18%, rgba(231, 177, 90, 0.06), transparent 24%),
          repeating-linear-gradient(180deg, transparent 0, transparent 34px, rgba(255, 255, 255, 0.02) 34px, rgba(255, 255, 255, 0.02) 35px);
        opacity: 0.22;
        z-index: 0;
      }
      body::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        background:
          radial-gradient(circle at 40% 20%, rgba(232, 160, 32, 0.065), transparent 30%),
          radial-gradient(circle at 80% 13%, rgba(231, 177, 90, 0.05), transparent 24%),
          repeating-linear-gradient(180deg, transparent 0, transparent 34px, rgba(255, 255, 255, 0.03) 34px, rgba(255, 255, 255, 0.03) 35px);
        opacity: 0.28;
        z-index: 0;
      }

      /* ═══════════════════════════════════════════════════════════
   HEADER — placa de rack serigrafiada
   ═══════════════════════════════════════════════════════════ */
      header {
        border-bottom: 1px solid var(--border);
        padding: 0.45rem 1.1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        background: linear-gradient(90deg, var(--surface2) 0%, var(--surface) 100%);
        box-shadow:
          0 1px 0 rgba(232, 160, 32, 0.12),
          inset 0 1px 0 rgba(255, 255, 255, 0.025);
        flex-shrink: 0;
      }

      .logo {
        font-family: var(--mono);
        font-size: 1.1rem;
        font-weight: 700;
        letter-spacing: 0.3em;
        color: var(--amber);
        text-shadow: 0 0 14px rgba(232, 160, 32, 0.5);
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }
      .logo-dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--vu-yellow);
        box-shadow:
          0 0 8px rgba(231, 177, 90, 0.45),
          0 0 16px rgba(231, 177, 90, 0.28);
        animation: vu-pulse 2.4s ease-in-out infinite;
      }
      @keyframes vu-pulse {
        0%,
        100% {
          opacity: 1;
          box-shadow:
            0 0 8px rgba(231, 177, 90, 0.45),
            0 0 16px rgba(231, 177, 90, 0.28);
        }
        50% {
          opacity: 0.5;
          box-shadow: 0 0 4px rgba(231, 177, 90, 0.45);
        }
      }
      header small {
        color: var(--muted);
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        text-transform: uppercase;
      }
      .api-url-input {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 4px;
        color: var(--muted);
        font-family: var(--mono);
        font-size: 0.72rem;
        padding: 0.35rem 0.65rem;
        width: 210px;
      }
      .api-url-input:focus {
        outline: none;
        border-color: var(--amber);
        color: var(--text);
      }
      .dev-toggle {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }
      .dev-toggle-btn {
        background: none;
        border: 1px solid var(--border);
        border-radius: 4px;
        color: var(--faint);
        font-family: var(--mono);
        font-size: 0.7rem;
        padding: 0.28rem 0.55rem;
        cursor: pointer;
        letter-spacing: 0.08em;
        transition: all 0.15s;
      }
      .dev-toggle-btn:hover {
        border-color: var(--amber);
        color: var(--amber);
      }
      #apiUrlWrap {
        display: none;
      }

      /* ═══════════════════════════════════════════════════════════
   LAYOUT — sidebar + contenido
   ═══════════════════════════════════════════════════════════ */
      main {
        display: flex;
        flex: 1;
        min-height: 0;
        height: 0;
        overflow: hidden;
        position: relative;
      }

      /* ── Sidebar resizable ── */
      aside {
        width: var(--sidebar-w);
        min-width: 220px;
        max-width: 60vw;
        flex-shrink: 0;
        border-right: var(--handle-w) solid transparent;
        padding: 0.4rem 0.6rem;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        height: 100%;
        background: var(--surface);
        position: relative;
        transition: border-color 0.15s;
        scrollbar-width: thin;
        scrollbar-color: var(--border2) transparent;
      }

      /* Handle de resize drag ── */
      .resize-handle {
        width: var(--handle-w);
        background: var(--border);
        cursor: col-resize;
        flex-shrink: 0;
        position: relative;
        transition: background 0.15s;
        user-select: none;
        z-index: 10;
      }
      .resize-handle:hover,
      .resize-handle.dragging {
        background: var(--amber);
        box-shadow: 0 0 8px var(--amber-glow);
      }
      .resize-handle::after {
        content: "";
        position: absolute;
        inset: 0 -4px;  /* área clickeable más amplia */
      }
      .aside-scroll-hint {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2.5rem;
        background: linear-gradient(to bottom, transparent, var(--surface));
        pointer-events: none;
        transition: opacity 0.3s;
      }
      .aside-scroll-hint.hidden {
        opacity: 0;
      }

      /* ═══════════════════════════════════════════════════════════
   SIDEBAR TABS
   ═══════════════════════════════════════════════════════════ */
      .sidebar-tabs {
        display: flex;
        gap: 2px;
        padding: 4px;
        background: var(--surface2);
        border-radius: var(--radius);
        flex-shrink: 0;
        margin-bottom: 0.4rem;
        flex-wrap: wrap;
      }
      .sidebar-tab {
        flex: 1;
        min-width: 0;
        padding: 0.3rem 0.5rem;
        font-size: clamp(0.6rem, 1vw, 0.72rem);
        font-family: var(--sans);
        font-weight: 600;
        color: var(--muted);
        background: transparent;
        border: none;
        border-radius: calc(var(--radius) - 2px);
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: all 0.15s;
        letter-spacing: 0.02em;
      }
      
      .sidebar-tab:hover {
        color: var(--text);
        background: var(--glass2);
      }
      
      .sidebar-tab.active {
        color: var(--amber);
        background: rgba(240,184,64,0.12);
        box-shadow: inset 0 0 0 1px rgba(240,184,64,0.2);
      }
      
      .sidebar-pane-archivo,
      .sidebar-pane-cadena,
      .sidebar-pane-salida {
        display: none !important;
      }
      .sidebar-showing-archivo .sidebar-pane-archivo,
      .sidebar-showing-cadena .sidebar-pane-cadena,
      .sidebar-showing-salida .sidebar-pane-salida {
        display: block !important;
      }

      .control-grid {
        contain: layout;
      }

      /* ═══════════════════════════════════════════════════════════
   SECTION LABEL — serigrafia sobre módulo metálico
   ═══════════════════════════════════════════════════════════ */
      .section-label {
        font-family: var(--mono);
        font-size: 0.76rem;
        letter-spacing: 0.12em;
        color: var(--amber);
        text-transform: uppercase;
        margin-bottom: 0.3rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        font-weight: 600;
      }
      .section-label::before {
        content: "";
        width: 3px;
        height: 14px;
        border-radius: 1px;
        background: var(--amber);
        opacity: 0.6;
        flex-shrink: 0;
      }
      .section-label::after {
        content: "";
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, var(--border2), transparent);
      }

      /* Stage number badge inside section-label */
      .stage-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 17px;
        height: 17px;
        border-radius: 3px;
        background: var(--surface3);
        border: 1px solid var(--border2);
        color: var(--amber);
        font-family: var(--mono);
        font-size: 0.66rem;
        font-weight: 700;
        flex-shrink: 0;
      }
      .stage-num--highlight {
        color: #d4c18d;
      }

      /* ═══════════════════════════════════════════════════════════
   PROCESS CARDS — módulos de rack colapsables
   ═══════════════════════════════════════════════════════════ */
      .process-card {
        background: var(--glass);
        backdrop-filter: blur(4px);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        overflow: hidden;
        transition: border-color 0.2s, box-shadow 0.2s;
      }
      .process-card:focus-within {
        border-color: rgba(240,184,64,0.25);
        box-shadow: 0 0 0 1px rgba(240,184,64,0.1), var(--shadow);
      }
      /* Left LED stripe */
      .process-card::before {
        content: "";
        position: absolute;
        inset: 0.6rem auto 0.6rem 0;
        width: 2px;
        border-radius: 999px;
        background: linear-gradient(180deg, var(--amber), var(--amber2));
        opacity: 0.7;
      }
      .process-card-collapsible > summary {
        list-style: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        margin-bottom: 0.25rem;
        padding-left: 0.3rem;
      }
      .process-card-collapsible > summary::-webkit-details-marker {
        display: none;
      }
      .process-card-collapsible > summary::after {
        content: "▾";
        font-size: 0.74rem;
        color: var(--muted);
        transition: transform 0.2s;
      }
      .process-card-collapsible[open] > summary::after {
        transform: rotate(180deg);
      }
      .process-card-collapsible[open] > summary {
        margin-bottom: 0.55rem;
      }

      .process-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        padding-left: 0.3rem;
      }
      .process-card-step {
        font-family: var(--mono);
        font-size: 0.76rem;
        letter-spacing: 0.18em;
        color: var(--amber);
        text-transform: uppercase;
        font-weight: 600;
      }
      .process-card-copy {
        font-size: 0.72rem;
        color: var(--muted);
      }
      .process-card-body {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
      }

      /* ═══════════════════════════════════════════════════════════
   PARAM ROWS — sliders con iluminación ámbar interna
   ═══════════════════════════════════════════════════════════ */
      .param {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.05rem;
        margin-bottom: 0.28rem;
      }
      .param label {
        font-size: 0.72rem;
        color: var(--muted);
      }
      .param .val {
        font-family: var(--mono);
        font-size: 0.76rem;
        color: var(--amber);
        text-align: right;
        min-width: 50px;
        font-weight: 600;
      }
      .param input[type="range"] {
        grid-column: 1/-1;
        appearance: none;
        -webkit-appearance: none;
        height: 4px;
        border-radius: 2px;
        outline: none;
        cursor: pointer;
        background: linear-gradient(90deg, var(--amber) var(--pct, 30%), var(--surface3) var(--pct, 30%));
        opacity: 0.9;
      }
      .param input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 13px;
        height: 13px;
        border-radius: 50%;
        background: #1c1913;
        border: 2px solid var(--amber);
        box-shadow: 0 0 6px rgba(232, 160, 32, 0.5);
        transition: box-shadow 0.15s;
      }
      .param input[type="range"]:hover::-webkit-slider-thumb {
        box-shadow:
          0 0 10px rgba(232, 160, 32, 0.8),
          0 0 18px rgba(232, 160, 32, 0.3);
      }
      .param input[type="range"]::-moz-range-thumb {
        width: 13px;
        height: 13px;
        border-radius: 50%;
        background: #1c1913;
        border: 2px solid var(--amber);
        box-shadow: 0 0 6px rgba(232, 160, 32, 0.5);
      }

      /* ═══════════════════════════════════════════════════════════
   DROP ZONE
   ═══════════════════════════════════════════════════════════ */
      .drop-zone {
        border: 1px dashed var(--border2);
        border-radius: 8px;
        padding: 0.55rem 0.6rem;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
        background: linear-gradient(160deg, rgba(232, 160, 32, 0.04), transparent);
      }
      .drop-zone:hover,
      .drop-zone.dragover {
        border-color: var(--amber);
        background: rgba(232, 160, 32, 0.07);
        transform: translateY(-1px);
      }
      .drop-zone input {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
      }
      .drop-zone .icon {
        font-size: 1.1rem;
        margin-bottom: 0.12rem;
      }
      .drop-zone p {
        color: var(--muted);
        font-size: 0.8rem;
        line-height: 1.4;
      }
      .drop-zone .file-name {
        color: var(--vu-yellow);
        font-family: var(--mono);
        font-size: 0.75rem;
        margin-top: 0.4rem;
        word-break: break-all;
        font-weight: 600;
      }
      .file-size-warn {
        color: var(--vu-yellow);
        font-size: 0.72rem;
        margin-top: 0.3rem;
        font-family: var(--mono);
      }
      .uppy-picker {
        margin-top: 0.6rem;
        display: flex;
        justify-content: center;
      }
      .uppy-picker .uppy-FileInput-container {
        width: 100%;
      }
      .uppy-picker .uppy-FileInput-btn {
        width: 100%;
        padding: 0.5rem 0.65rem;
        border: 1px solid var(--border2);
        border-radius: 6px;
        background: var(--surface2);
        color: var(--text);
        font-family: var(--sans);
        font-size: 0.72rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.15s;
      }
      .uppy-picker .uppy-FileInput-btn:hover {
        border-color: var(--amber);
        background: var(--surface3);
      }

      /* ═══════════════════════════════════════════════════════════
   SELECT
   ═══════════════════════════════════════════════════════════ */
      select {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 5px;
        color: var(--text);
        font-family: var(--sans);
        font-size: 0.8rem;
        padding: 0.48rem 0.6rem;
        width: 100%;
        cursor: pointer;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237A6E56'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.6rem center;
        padding-right: 1.8rem;
      }
      select:focus {
        outline: none;
        border-color: var(--amber);
      }

      /* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
      .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.38rem clamp(0.6rem, 1.5vw, 0.9rem);
        font-size: clamp(0.68rem, 1vw, 0.78rem);
        font-family: var(--sans);
        font-weight: 600;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--glass2);
        color: var(--text);
        cursor: pointer;
        transition: all 0.15s;
        white-space: nowrap;
        letter-spacing: 0.02em;
        box-shadow: var(--shadow-sm);
        text-decoration: none;
      }
      .btn:hover {
        background: var(--glass);
        border-color: rgba(240,184,64,0.3);
        color: var(--amber);
        box-shadow: 0 0 0 1px rgba(240,184,64,0.15), var(--shadow-sm);
        transform: translateY(-1px);
      }
      .btn:active { transform: translateY(0); }
      
      .btn:active {
        transform: scale(0.98);
      }
      .btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
      }

      .btn-primary {
        background: linear-gradient(135deg, var(--amber) 0%, var(--amber2) 100%);
        color: #0a0907;
        box-shadow: 0 2px 12px rgba(232, 160, 32, 0.3);
        position: relative;
        overflow: hidden;
      }
      .btn-primary:not(:disabled):hover {
        box-shadow: 0 4px 18px rgba(232, 160, 32, 0.5);
        filter: brightness(1.08);
      }
      .btn-primary::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transform: translateX(-120%);
        transition: transform 0.45s;
      }
      .btn-primary:not(:disabled):hover::after {
        transform: translateX(120%);
      }

      .btn-secondary {
        background: var(--surface2);
        border: 1px solid var(--border);
        color: var(--text);
        margin-top: 0.4rem;
      }
      .btn-secondary:not(:disabled):hover {
        border-color: var(--amber);
        color: var(--amber);
      }

      .btn-tertiary {
        background: none;
        border: 1px solid var(--border);
        color: var(--muted);
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
        cursor: pointer;
        margin-top: 0.3rem;
      }
      .btn-tertiary:hover {
        border-color: var(--amber);
        color: var(--amber);
        background: rgba(232, 160, 32, 0.06);
      }

      .btn-download {
        background: rgba(231, 177, 90, 0.14);
        border: 1px solid var(--amber);
        color: var(--surface);
        margin-top: 0.4rem;
        display: none;
        font-weight: 700;
      }
      .btn-ab {
        background: rgba(232, 210, 32, 0.1);
        border: 1px solid var(--vu-yellow);
        color: var(--vu-yellow);
        margin-top: 0.4rem;
      }
      .btn-report {
        background: rgba(232, 160, 32, 0.1);
        border: 1px solid var(--amber);
        color: var(--amber);
        margin-top: 0.4rem;
        display: none;
      }
      .btn-automaster {
        background: linear-gradient(135deg, var(--amber2) 0%, var(--amber) 50%, rgba(231, 177, 90, 0.95) 100%);
        color: var(--surface);
        font-weight: 700;
        box-shadow: 0 2px 14px rgba(231, 177, 90, 0.22);
        position: relative;
        overflow: hidden;
      }
      .btn-automaster:not(:disabled):hover {
        box-shadow: 0 4px 20px rgba(231, 177, 90, 0.35);
      }
      .btn-ref {
        background: linear-gradient(135deg, rgba(240,184,64,0.15), rgba(240,184,64,0.05));
        border-color: rgba(240,184,64,0.35);
        color: var(--amber);
      }
      .btn-ref:hover {
        background: linear-gradient(135deg, rgba(240,184,64,0.25), rgba(240,184,64,0.12));
        border-color: var(--amber);
        box-shadow: 0 0 16px rgba(240,184,64,0.2);
        color: var(--amber);
      }

      .btn-ref-library {
        width: 100%;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.38rem 0.6rem;
        background: var(--surface2);
        border: 1px dashed var(--lilac);
        border-radius: 6px;
        color: var(--lilac);
        font-size: 0.75rem;
        transition: background 0.15s;
      }
      .btn-ref-library:hover,
      .btn-ref-library:focus-visible {
        background: var(--surface3);
        border-color: rgba(167, 139, 250, 0.7);
      }
      
      .btn-preset-load {
        background: var(--surface2);
        border: 1px solid var(--border);
        color: var(--muted);
        font-family: var(--sans);
        font-size: 0.7rem;
        font-weight: 500;
        padding: 0.44rem;
        border-radius: 5px;
        cursor: pointer;
        width: 100%;
        margin-top: 0.3rem;
        transition: all 0.12s;
      }
      .btn-preset-load:hover {
        border-color: var(--amber);
        color: var(--amber);
      }

      /* ═══════════════════════════════════════════════════════════
   CONTROL CARD — módulo rack con cabecera
   ═══════════════════════════════════════════════════════════ */
      .control-card {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0.4rem;
      }
      .control-card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        margin-bottom: 0.2rem;
      }
      .control-card-head h3 {
        font-size: 0.84rem;
        color: var(--text);
      }
      .control-card-kicker {
        font-family: var(--mono);
        font-size: 0.66rem;
        letter-spacing: 0.18em;
        color: var(--amber);
        text-transform: uppercase;
        margin-bottom: 0.12rem;
      }
      .control-card-badge {
        font-family: var(--mono);
        font-size: 0.76rem;
        letter-spacing: 0.06em;
        color: var(--faint);
        padding: 0.22rem 0.45rem;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: rgba(7, 8, 14, 0.2);
        white-space: nowrap;
      }
      .control-card-body {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        align-items: stretch;
      }
      .control-stack {
        display: flex;
        flex-direction: column;
        gap: 0.18rem;
      }
      .control-side {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
      }
      .mini-surface {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0.45rem;
      }
      .mini-label {
        font-family: var(--mono);
        font-size: 0.76rem;
        letter-spacing: 0.08em;
        color: var(--muted);
        text-transform: uppercase;
        margin-bottom: 0.35rem;
      }
      .mini-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
      }
      .mini-tag {
        padding: 0.22rem 0.4rem;
        border-radius: 999px;
        border: 1px solid var(--border);
        font-size: 0.7rem;
        color: var(--faint);
        background: rgba(255, 255, 255, 0.02);
        font-family: var(--mono);
      }
      .control-card .section-label {
        margin-bottom: 0.4rem;
      }
      .control-card .param {
        margin-bottom: 0.45rem;
      }
      .control-card .eq4-wrap {
        grid-template-columns: 1fr 1fr;
      }

      /* ═══════════════════════════════════════════════════════════
   EQ BANDS
   ═══════════════════════════════════════════════════════════ */
      .eq4-wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.22rem;
        margin-bottom: 0.18rem;
      }
      .eq4-band {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 5px;
        padding: 0.28rem 0.32rem;
        transition: border-color 0.15s;
      }
      .eq4-band:hover {
        border-color: var(--amber);
      }
      .eq4-header {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        margin-bottom: 0.35rem;
      }
      .eq4-num {
        font-family: var(--mono);
        font-size: 0.7rem;
        background: rgba(232, 160, 32, 0.15);
        border: 1px solid rgba(232, 160, 32, 0.3);
        color: var(--amber);
        border-radius: 3px;
        padding: 1px 5px;
        font-weight: 700;
      }
      .eq4-band .param {
        margin-bottom: 0.2rem;
      }
      .eq4-band .param label {
        font-size: 0.76rem;
      }

      .eq-curve-wrap {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0.35rem;
        margin-bottom: 0.25rem;
      }
      .eq-curve-wrap canvas {
        width: 100%;
        height: 130px;
        display: block;
        border-radius: 3px;
      }

      /* ═══════════════════════════════════════════════════════════
   MULTIBAND
   ═══════════════════════════════════════════════════════════ */
      .mb-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid rgba(231, 177, 90, 0.5);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.8rem;
      }
      .mb-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: #d4c18d;
        text-transform: uppercase;
        margin-bottom: 0.7rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: wrap;
      }
      .mb-tabs {
        display: flex;
        gap: 0.4rem;
        margin-bottom: 0.8rem;
      }
      .mb-tab {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 4px;
        padding: 0.35rem 0.75rem;
        font-size: 0.7rem;
        font-family: var(--mono);
        color: var(--muted);
        cursor: pointer;
        transition: all 0.12s;
      }
      .mb-tab.active {
        border-color: var(--amber);
        color: var(--amber);
        background: rgba(232, 160, 32, 0.1);
      }
      .mb-panel {
        display: none;
        background: var(--surface2);
        border-radius: 6px;
        padding: 0.6rem;
      }
      .mb-panel.active {
        display: block;
      }
      .mb-crossover {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
        margin-bottom: 0.7rem;
      }
      .mb-crossover .param {
        margin-bottom: 0.25rem;
      }

      /* ═══════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════ */
      .content {
        padding: 0.55rem 0.75rem;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        height: 100%;
      }
      .content-shell {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        max-width: 1180px;
        width: 100%;
        margin: 0 auto;
      }

      /* ── Hero panel ── */
      .workflow-hero {
        background: radial-gradient(circle at 20% 40%, rgba(232, 160, 32, 0.12), transparent 35%),
          radial-gradient(circle at 85% 20%, rgba(231, 177, 90, 0.08), transparent 26%),
          linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(17, 15, 10, 0.95));
        border: 1px solid rgba(232, 160, 32, 0.18);
        border-radius: 16px;
        padding: 1rem 1.1rem;
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 0.9rem;
        align-items: center;
        box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02), 0 28px 80px rgba(0, 0, 0, 0.16);
      }
      .workflow-hero h2 {
        font-size: 1.05rem;
        margin-bottom: 0.35rem;
        color: #f7f4e4;
        line-height: 1.3;
      }
      .workflow-hero p {
        color: rgba(176, 192, 183, 0.95);
        font-size: 0.82rem;
        line-height: 1.45;
      }
      .workflow-steps {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
      }
      .workflow-step {
        background: linear-gradient(145deg, rgba(232, 160, 32, 0.05), rgba(255, 255, 255, 0.02));
        border: 1px solid rgba(232, 160, 32, 0.16);
        border-radius: 12px;
        padding: 0.65rem 0.85rem;
        font-size: 0.74rem;
        color: var(--text);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
      }
      .workflow-step strong {
        display: block;
        font-size: 0.76rem;
        font-family: var(--mono);
        color: var(--amber);
        margin-bottom: 0.15rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }

      /* ── Studio focus block ── */
      .studio-focus {
        display: grid;
        grid-template-columns: 1.05fr 0.95fr;
        gap: 0.75rem;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 0.75rem 0.9rem;
      }
      .studio-focus-copy h3 {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
      }
      .studio-focus-copy p {
        color: var(--muted);
        font-size: 0.76rem;
        line-height: 1.45;
      }
      .studio-focus-kicker {
        font-family: var(--mono);
        font-size: 0.7rem;
        letter-spacing: 0.12em;
        color: var(--amber);
        text-transform: uppercase;
        margin-bottom: 0.35rem;
      }
      .studio-focus-pills {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
      }
      .focus-pill {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        padding: 0.55rem;
        border-radius: 7px;
        background: rgba(7, 8, 14, 0.4);
        border: 1px solid var(--border);
      }
      .focus-pill-num {
        font-family: var(--mono);
        font-size: 0.76rem;
        color: var(--amber);
        padding-top: 0.1rem;
      }
      .focus-pill strong {
        display: block;
        font-size: 0.72rem;
        margin-bottom: 0.14rem;
      }
      .focus-pill span {
        font-size: 0.74rem;
        color: var(--muted);
        line-height: 1.35;
      }

      /* ── Content grid ── */
      .content-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.33fr) minmax(280px, 0.75fr);
        gap: 0.85rem;
        align-items: start;
      }
      .content-grid > #previewWrap {
        grid-column: 1 / -1;
      }

      /* ── Status bar ── */
      .status-bar {
        background: linear-gradient(120deg, rgba(232, 160, 32, 0.08), var(--surface));
        border: 1px solid var(--amber);
        border-radius: 8px;
        padding: 0.9rem 1.1rem;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        font-size: 0.82rem;
      }
      .status-bar-top {
        display: flex;
        align-items: center;
        gap: 0.65rem;
      }
      .status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--muted);
        flex-shrink: 0;
      }
      .status-dot.queued {
        background: var(--vu-yellow);
        animation: vu-pulse 1s infinite;
      }
      .status-dot.processing {
        background: var(--amber);
        animation: vu-pulse 0.5s infinite;
      }
      .status-dot.done {
        background: var(--vu-yellow);
        box-shadow: 0 0 8px rgba(231, 177, 90, 0.4);
      }
      .status-dot.error {
        background: var(--clip-red);
        box-shadow: 0 0 8px var(--clip-red);
      }
      .status-time {
        margin-left: auto;
        color: var(--muted);
        font-family: var(--mono);
        font-size: 0.7rem;
      }
      .progress-pct {
        color: var(--amber);
        font-family: var(--mono);
        font-size: 0.7rem;
        font-weight: 600;
        flex-shrink: 0;
      }
      .progress-wrap {
        background: var(--border);
        border-radius: 3px;
        height: 3px;
        overflow: hidden;
        display: none;
        width: 100%;
      }
      .progress-bar {
        height: 100%;
        background: linear-gradient(90deg, var(--amber), var(--vu-yellow));
        width: 0%;
        transition: width 0.35s;
        border-radius: 3px;
      }
      .progress-bar.indeterminate {
        animation: indeterminate 1.5s infinite;
        width: 40%;
      }
      @keyframes indeterminate {
        0% {
          margin-left: -40%;
        }
        100% {
          margin-left: 100%;
        }
      }

      /* ── Drop zone referencia ── */
      .drop-zone-ref {
        border: 1px dashed var(--border2);
        border-radius: 8px;
        padding: 0.9rem 0.7rem;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
        margin-top: 0.5rem;
      }
      .drop-zone-ref:hover,
      .drop-zone-ref.dragover {
        border-color: var(--lilac);
        background: rgba(160, 128, 208, 0.05);
      }
      .drop-zone-ref input {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
      }
      .drop-zone-ref p {
        color: var(--muted);
        font-size: 0.76rem;
      }
      .drop-zone-ref .file-name {
        color: var(--lilac);
        font-family: var(--mono);
        font-size: 0.72rem;
        margin-top: 0.35rem;
        word-break: break-all;
      }

      /* ── Analysis panels ── */
      .analysis-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
      }
      .analysis-panel {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid rgba(231, 177, 90, 0.5);
        border-radius: 7px;
        padding: 0.55rem;
      }
      .professional-meter {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid rgba(231, 177, 90, 0.5);
        border-radius: 7px;
        padding: 0.75rem;
        margin-top: 0.7rem;
      }
      .professional-meter h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: #d4c18d;
        text-transform: uppercase;
        margin-bottom: 0.85rem;
      }
      .professional-meter-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
      }
      .professional-meter-card {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 0.7rem;
        display: grid;
        gap: 0.15rem;
      }
      .professional-meter-card strong {
        display: block;
        font-size: 0.76rem;
        font-family: var(--mono);
        color: var(--muted);
      }
      .professional-meter-card span {
        display: block;
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1.1;
      }
      .professional-meter-card em {
        display: block;
        font-size: 0.72rem;
        color: var(--muted);
      }
      .professional-meter-warning {
        margin-top: 0.85rem;
        padding: 0.65rem 0.75rem;
        background: rgba(232, 160, 32, 0.08);
        border: 1px solid rgba(232, 160, 32, 0.14);
        border-radius: 7px;
        font-size: 0.78rem;
        color: var(--text);
        line-height: 1.4;
      }
      .workflow-step.workflow-chip {
        cursor: pointer;
      }
      .workflow-step.workflow-chip:hover {
        transform: translateY(-1px);
      }
      .analysis-panel h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: #d4c18d;
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .metric-row {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 0.35rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 0.82rem;
      }
      .metric-row:last-child {
        border: none;
      }
      .metric-label {
        color: var(--muted);
      }
      .metric-value {
        font-family: var(--mono);
        font-weight: 700;
      }
      .metric-value.good {
        color: var(--vu-yellow);
      }
      .metric-value.warn {
        color: var(--vu-yellow);
      }
      .metric-value.bad {
        color: var(--clip-red);
      }
      .metric-value.neutral {
        color: var(--text);
      }

      /* ── Loudness meter ── */
      .loudness-meter {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid var(--amber);
        border-radius: 7px;
        padding: 0.55rem;
      }
      .loudness-meter h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--amber);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .lufs-display {
        display: flex;
        align-items: center;
        gap: 1.2rem;
        margin-bottom: 0.65rem;
      }
      .lufs-number {
        font-family: var(--mono);
        font-size: 2.2rem;
        font-weight: 700;
        color: var(--amber);
        line-height: 1;
        text-shadow: 0 0 14px rgba(232, 160, 32, 0.4);
      }
      .lufs-label {
        color: var(--muted);
        font-size: 0.72rem;
      }
      .lufs-bar-track {
        flex: 1;
        height: 20px;
        background: var(--surface3);
        border-radius: 3px;
        overflow: hidden;
        position: relative;
      }
      .lufs-bar-fill {
        height: 100%;
        border-radius: 3px;
        transition:
          width 0.15s,
          background 0.15s;
      }
      .lufs-zones {
        display: flex;
        justify-content: space-between;
        font-size: 0.7rem;
        font-family: var(--mono);
        color: var(--muted);
        margin-top: 0.25rem;
      }

      /* ── Waveform ── */
      .waveform-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid rgba(231, 177, 90, 0.5);
        border-radius: 7px;
        padding: 0.55rem;
      }
      .waveform-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: #d4c18d;
        text-transform: uppercase;
        margin-bottom: 0.8rem;
        display: flex;
        align-items: center;
        gap: 0.65rem;
      }
      .waveform-wrap canvas {
        width: 100%;
        height: 70px;
        display: block;
        border-radius: 5px;
        background: var(--surface2);
        cursor: crosshair;
      }
      .waveform-legend {
        display: flex;
        gap: 1rem;
        margin-top: 0.4rem;
        font-size: 0.74rem;
        font-family: var(--mono);
        color: var(--muted);
      }

      /* ── Dashboard ── */
      .dashboard-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0.8rem;
      }
      .dashboard-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--muted);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
      }
      .dash-live-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--vu-yellow);
        box-shadow: 0 0 7px rgba(231, 177, 90, 0.55);
        animation: vu-pulse 1.4s infinite;
      }
      .dash-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
      }
      .dash-card {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 0.65rem;
        transition: border-color 0.15s;
      }
      .dash-card:nth-child(4n + 1) {
        border-top: 2px solid var(--amber);
      }
      .dash-card:nth-child(4n + 2) {
        border-top: 2px solid rgba(231, 177, 90, 0.5);
      }
      .dash-card:nth-child(4n + 3) {
        border-top: 2px solid var(--orange);
      }
      .dash-card:nth-child(4n + 4) {
        border-top: 2px solid rgba(231, 177, 90, 0.55);
      }
      .dash-card .dash-label {
        font-size: 0.72rem;
        color: var(--muted);
        font-family: var(--mono);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.35rem;
      }
      .dash-card .dash-value {
        font-family: var(--mono);
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--amber);
      }
      .dash-bar-track {
        background: var(--border);
        border-radius: 2px;
        height: 4px;
        margin-top: 0.4rem;
        overflow: hidden;
      }
      .dash-bar-fill {
        width: 0%;
        height: 100%;
        border-radius: 2px;
        background: linear-gradient(90deg, var(--amber), rgba(231, 177, 90, 0.8));
        transition: width 0.3s;
      }
      .dash-queue-row {
        display: flex;
        justify-content: space-between;
        font-size: 0.76rem;
        color: var(--muted);
        font-family: var(--mono);
        margin-top: 0.25rem;
      }
      .meters-toggle {
        font-size: 0.74rem;
        color: var(--muted);
        font-family: var(--mono);
        cursor: pointer;
        margin-left: auto;
      }

      /* ── VU Meters ── */
      .meters-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid var(--vu-yellow);
        border-radius: 8px;
        padding: 0.8rem;
      }
      .meters-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--vu-yellow);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
      }
      .meters-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.6rem;
      }
      .meter-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
      }
      .meter-col .meter-name {
        font-size: 0.72rem;
        color: var(--muted);
        font-family: var(--mono);
        letter-spacing: 0.05em;
        text-transform: uppercase;
      }
      .meter-track {
        width: 26px;
        height: 130px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 4px;
        position: relative;
        overflow: hidden;
        display: flex;
        align-items: flex-end;
      }
      .meter-fill {
        width: 100%;
        background: linear-gradient(
          to top,
          rgba(211, 181, 110, 0.94) 0%,
          rgba(211, 181, 110, 0.72) 60%,
          var(--vu-yellow) 80%,
          var(--clip-red) 100%
        );
        transition: height 0.08s linear;
        border-radius: 0 0 3px 3px;
      }
      .meter-readout {
        font-family: var(--mono);
        font-size: 0.75rem;
        color: var(--text);
      }
      .stereo-meter-track {
        width: 100%;
        height: 24px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 4px;
        position: relative;
        overflow: hidden;
      }
      .stereo-meter-fill {
        position: absolute;
        top: 0;
        bottom: 0;
        background: var(--amber);
        transition:
          left 0.1s,
          width 0.1s;
      }
      .stereo-meter-center {
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 1px;
        background: var(--border2);
      }

      /* ── Live spectrum ── */
      .live-spectrum-wrap {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0.4rem;
        margin-top: 0.35rem;
      }
      .live-spectrum-wrap canvas {
        width: 100%;
        height: 120px;
        display: block;
        border-radius: 3px;
      }
      .freqbands-grid {
        margin-top: 0.6rem;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
      }
      .freqband-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-family: var(--mono);
        font-size: 0.74rem;
      }
      .freqband-label {
        width: 74px;
        flex-shrink: 0;
        color: var(--muted);
      }
      .freqband-track {
        flex: 1;
        height: 5px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 2px;
        overflow: hidden;
      }
      .freqband-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--amber), var(--vu-yellow));
        transition: width 0.1s;
      }
      .freqband-val {
        width: 46px;
        flex-shrink: 0;
        text-align: right;
        color: var(--text);
      }

      /* ── Multiband GR ── */
      .mb-gr-section {
        margin-top: 1rem;
        border-top: 1px solid var(--border);
        padding-top: 0.8rem;
      }
      .mb-gr-title {
        font-size: 0.72rem;
        color: var(--muted);
        font-family: var(--mono);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-bottom: 0.65rem;
      }
      .mb-gr-grid {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
      }
      .mb-gr-col {
        display: flex;
        align-items: center;
        gap: 0.55rem;
      }
      .mb-gr-label {
        width: 68px;
        flex-shrink: 0;
        font-size: 0.7rem;
        color: var(--muted);
        font-family: var(--mono);
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
      .mb-gr-bar-wrap {
        flex: 1;
        min-width: 0;
        height: 9px;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 4px;
        overflow: hidden;
      }
      .mb-gr-bar {
        height: 100%;
        background: linear-gradient(to right, var(--amber), var(--vu-yellow));
        border-radius: 3px;
        width: 0%;
        transition: width 0.12s;
      }
      .mb-gr-readout {
        width: 64px;
        flex-shrink: 0;
        text-align: right;
        font-family: var(--mono);
        font-size: 0.72rem;
        color: var(--text);
      }
      .mb-vu-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin-top: 0.8rem;
      }
      .mb-vu-item {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0.55rem 0.65rem;
      }
      .mb-vu-label {
        font-family: var(--mono);
        font-size: 0.76rem;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 0.4rem;
      }
      .mb-vu-row {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        font-size: 0.76rem;
        padding: 0.18rem 0;
        border-bottom: 1px solid rgba(51, 45, 34, 0.7);
      }
      .mb-vu-row:last-child {
        border-bottom: none;
      }
      .mb-vu-key {
        color: var(--muted);
      }
      .mb-vu-val {
        font-family: var(--mono);
        color: var(--text);
        font-weight: 700;
      }

      /* ── FFT ── */
      .fft-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid var(--orange);
        border-radius: 8px;
        padding: 0.8rem;
      }
      .fft-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--orange);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .fft-wrap canvas {
        width: 100%;
        height: 150px;
        display: block;
        border-radius: 5px;
        background: var(--surface2);
      }

      /* ── Spectrum bars ── */
      .spectrum-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid var(--lilac);
        border-radius: 8px;
        padding: 0.8rem;
      }
      .spectrum-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--lilac);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .spectrum-bars {
        display: flex;
        gap: 5px;
        align-items: flex-end;
        height: 75px;
      }
      .bar-wrap {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        height: 100%;
      }
      .bar-track {
        flex: 1;
        width: 100%;
        background: var(--surface3);
        border-radius: 3px;
        display: flex;
        align-items: flex-end;
        overflow: hidden;
        position: relative;
      }
      .bar-before {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 45%;
        border-radius: 2px 0 0 2px;
        background: var(--muted);
        transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
      }
      .bar-after {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 45%;
        border-radius: 0 2px 2px 0;
        background: linear-gradient(to top, var(--amber), var(--vu-yellow));
        transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
      }
      .bar-label {
        font-size: 0.76rem;
        font-family: var(--mono);
        color: var(--muted);
        text-align: center;
        white-space: nowrap;
      }
      .legend {
        display: flex;
        gap: 0.8rem;
        margin-top: 0.6rem;
        font-size: 0.76rem;
        color: var(--muted);
        font-family: var(--mono);
      }
      .legend span::before {
        content: "■";
        margin-right: 4px;
      }
      .legend .l-before::before {
        color: var(--muted);
      }
      .legend .l-after::before {
        color: var(--amber);
      }

      /* ── Stems ── */
      .stems-wrap {
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 2px solid var(--lilac);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.8rem;
      }
      .stems-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--lilac);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .stem-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
        margin-bottom: 0.8rem;
      }
      .stem-card {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0.6rem;
      }
      .stem-card.silent {
        opacity: 0.5;
      }
      .stem-card .stem-title {
        font-size: 0.78rem;
        font-weight: 600;
        margin-bottom: 0.35rem;
      }
      .stem-card .stem-metric {
        font-family: var(--mono);
        font-size: 0.64rem;
        color: var(--muted);
        display: flex;
        justify-content: space-between;
      }
      .stem-card a.stem-dl {
        display: block;
        margin-top: 0.4rem;
        font-size: 0.64rem;
        color: var(--lilac);
        text-decoration: none;
      }
      .stem-rec {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-left: 2px solid #f59e0b;
        border-radius: 6px;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.4rem;
        font-size: 0.75rem;
        line-height: 1.5;
      }
      .stem-rec .rec-score {
        font-family: var(--mono);
        font-size: 0.72rem;
        color: var(--muted);
        margin-top: 0.25rem;
      }
      .stem-rec.kick-bass {
        border-left-color: var(--lilac);
      }

      /* ── AB ── */
      .ab-wrap {
        background: var(--surface);
        border: 1px solid var(--vu-yellow);
        border-radius: 8px;
        padding: 1rem;
      }
      .ab-wrap h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--vu-yellow);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
      }
      .ab-controls {
        display: flex;
        gap: 0.65rem;
        margin-bottom: 0.8rem;
        align-items: center;
        flex-wrap: wrap;
      }
      .ab-btn {
        padding: 0.45rem 1.1rem;
        border-radius: 5px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--muted);
        font-family: var(--mono);
        font-size: 0.76rem;
        cursor: pointer;
        transition: all 0.12s;
      }
      .ab-btn.active-a {
        border-color: var(--amber);
        color: var(--amber);
        background: rgba(232, 160, 32, 0.1);
      }
      .ab-btn.active-b {
        border-color: var(--vu-yellow);
        color: var(--vu-yellow);
        background: rgba(232, 210, 32, 0.1);
      }
      .ab-label {
        font-family: var(--mono);
        font-size: 0.7rem;
        color: var(--muted);
      }

      /* ── Preview ── */
      .preview-wrap {
        display: grid;
        gap: 1rem;
        background: radial-gradient(circle at 10% 10%, rgba(232, 160, 32, 0.05), transparent 22%),
          linear-gradient(180deg, rgba(18, 16, 12, 0.92), rgba(24, 22, 18, 0.98));
        border: 1px solid rgba(232, 160, 32, 0.16);
        border-radius: 20px;
        padding: 1.1rem;
        box-shadow: 0 32px 90px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
        position: relative;
        overflow: hidden;
      }
      .preview-wrap::before {
        content: "";
        position: absolute;
        top: -26%;
        right: -14%;
        width: 260px;
        height: 260px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(232, 160, 32, 0.12), transparent 50%);
        filter: blur(8px);
        pointer-events: none;
      }
      .preview-wrap::after {
        content: "";
        position: absolute;
        bottom: -18px;
        left: 28px;
        width: 240px;
        height: 110px;
        background: linear-gradient(130deg, transparent 0%, rgba(231, 177, 90, 0.08) 50%, transparent 100%);
        filter: blur(14px);
        pointer-events: none;
      }
      .preview-wrap {
        grid-column: 1 / -1;
        padding: 1rem 1rem 1.1rem;
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(28, 24, 19, 0.82));
        border: 1px solid rgba(231, 177, 90, 0.16);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
        position: relative;
      }
      .preview-wrap::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 18px;
        pointer-events: none;
        background: radial-gradient(circle at 20% 20%, rgba(231, 177, 90, 0.08), transparent 26%);
      }
      .preview-header {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.85rem;
        align-items: center;
        position: relative;
        z-index: 1;
      }
      .preview-wrap h3 {
        font-size: 0.92rem;
        font-family: var(--mono);
        letter-spacing: 0.18em;
        color: var(--amber);
        text-transform: uppercase;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.55rem;
        text-shadow: 0 0 10px rgba(232, 160, 32, 0.18);
      }
      .preview-live-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--amber);
        box-shadow: 0 0 12px rgba(232, 160, 32, 0.55);
      }
      .preview-live-dot.updating {
        animation: vu-pulse 0.6s infinite;
      }
      .preview-status-dot.updating, #previewPanelDot.updating {
        animation: vu-pulse 0.6s infinite;
      }
      .preview-status-dot.updating, #previewPanelDot.updating {
        background: var(--vu-yellow);
        box-shadow: 0 0 18px rgba(214, 196, 111, 0.45);
      }
      .preview-audio {
        width: 100%;
        display: grid;
        gap: 0.35rem;
        position: relative;
        z-index: 1;
        padding: 0.45rem 0.55rem 0.65rem;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(231, 177, 90, 0.12);
        box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.02);
      }
      .preview-audio audio {
        width: 100%;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(232, 160, 32, 0.10);
        box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.22);
      }
      .preview-mode-badge {
        flex-shrink: 0;
        font-size: 0.72rem;
        font-family: var(--mono);
        background: rgba(231, 177, 90, 0.14);
        color: #f8e5a2;
        border: 1px solid rgba(231, 177, 90, 0.25);
        border-radius: 999px;
        padding: 6px 11px;
        white-space: nowrap;
        box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.08);
        transition: all 0.18s ease;
      }
      .preview-wrap canvas {
        width: 100%;
        max-width: 100%;
        min-height: 300px;
        display: block;
        border-radius: 16px;
        background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.06), transparent 18%),
          linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(14, 12, 9, 0.96));
        border: 1px solid rgba(232, 160, 32, 0.14);
        box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.04);
        margin: 0;
      }

      @media (max-width: 900px) {
        .preview-wrap canvas { min-height: 220px; }
      }
      .preview-canvas-wrap {
        display: grid;
        gap: 0.35rem;
      }
      .preview-canvas-label {
        font-size: 0.72rem;
        font-family: var(--mono);
        color: rgba(157, 155, 143, 0.95);
        letter-spacing: 0.12em;
        text-transform: uppercase;
        padding-left: 0.1rem;
      }
      .preview-note-row {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        margin-bottom: 0.7rem;
        color: var(--muted);
        font-size: 0.78rem;
      }
      .preview-status-dot {
        width: 8px;
        height: 8px;
        background: var(--amber);
        border-radius: 50%;
        box-shadow: 0 0 12px rgba(231, 177, 90, 0.35);
      }
      .preview-status-dot--small {
        width: 7px;
        height: 7px;
      }
      .preview-info-box {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-left: 2px solid var(--lilac);
        border-radius: 6px;
        padding: 0.6rem 0.75rem;
        font-size: 0.76rem;
        line-height: 1.5;
        color: var(--text);
      }
      .process-card-accent {
        padding: 0.55rem;
        border-radius: 8px;
        background: linear-gradient(135deg, rgba(232, 160, 32, 0.07), rgba(255, 255, 255, 0.02));
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
      }
      .preview-spectrum-canvas {
        width: 100%;
        height: 120px;
        display: block;
        border-radius: 8px;
        background: var(--surface2);
        border: 1px solid rgba(231, 177, 90, 0.16);
        box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.03);
      }
      .preview-subsection {
        display: grid;
        gap: 0.65rem;
        padding: 0.9rem;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.045);
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        position: relative;
        z-index: 1;
      }

      /* ── Advice ── */
      .advice-panel {
        background: linear-gradient(160deg, rgba(232, 160, 32, 0.07), var(--surface2));
        border: 1px solid var(--amber);
        border-radius: 10px;
        padding: 0.6rem;
        margin-top: 0.25rem;
      }
      .advice-panel h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--amber);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .advice-score-row {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        margin-bottom: 0.8rem;
      }
      .advice-score-circle {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--amber);
        font-family: var(--mono);
      }
      .advice-score-circle .score-num {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--amber);
        line-height: 1;
      }
      .advice-score-circle .score-label {
        font-size: 0.64rem;
        color: var(--muted);
        letter-spacing: 0.05em;
      }
      .advice-grade {
        font-size: 0.95rem;
        font-weight: 600;
      }
      .advice-grade.grade-ex {
        color: var(--vu-yellow);
      }
      .advice-grade.grade-good {
        color: var(--vu-yellow);
      }
      .advice-grade.grade-ok {
        color: var(--vu-yellow);
      }
      .advice-grade.grade-bad {
        color: var(--clip-red);
      }
      .advice-issues {
        list-style: none;
        margin-bottom: 0.6rem;
      }
      .advice-issues li {
        font-size: 0.76rem;
        color: var(--clip-red);
        padding: 0.28rem 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        gap: 0.45rem;
      }
      .advice-issues li::before {
        content: "⚠";
        flex-shrink: 0;
      }
      .advice-tips {
        list-style: none;
      }
      .advice-tips li {
        font-size: 0.76rem;
        color: #d4c18d;
        padding: 0.28rem 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        gap: 0.45rem;
      }
      .advice-tips li::before {
        content: "→";
        flex-shrink: 0;
        color: var(--amber);
      }

      /* ── Ref match ── */
      .ref-match-panel {
        background: var(--surface2);
        border: 1px solid var(--lilac);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.8rem;
      }
      .ref-match-panel h3 {
        font-size: 0.7rem;
        font-family: var(--mono);
        letter-spacing: 0.1em;
        color: var(--lilac);
        text-transform: uppercase;
        margin-bottom: 0.8rem;
      }
      .ref-match-score-row {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        margin-bottom: 0.8rem;
      }
      .ref-match-score-circle {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--lilac);
        font-family: var(--mono);
      }
      .ref-match-score-circle .score-num {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--lilac);
        line-height: 1;
      }
      .ref-match-score-circle .score-label {
        font-size: 0.64rem;
        color: var(--muted);
        letter-spacing: 0.05em;
      }
      .ref-match-steps {
        display: flex;
        gap: 0.4rem;
        flex-wrap: wrap;
        margin-bottom: 0.75rem;
      }
      .ref-match-step {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 4px;
        padding: 0.35rem 0.6rem;
        font-size: 0.76rem;
        font-family: var(--mono);
        color: var(--muted);
      }
      .ref-match-step b {
        color: var(--text);
      }
      .ref-match-curve-wrap canvas {
        width: 100%;
        height: 130px;
        display: block;
      }

      /* ── Barras de comparación visual (match mastering) ── */
      .match-stage-cols {
        display: flex;
        gap: 0.6rem;
        align-items: flex-end;
        flex: 1;
      }
      .match-stage-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 42px;
      }
      .match-stage-bar-track {
        width: 14px;
        height: 44px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 3px;
        display: flex;
        align-items: flex-end;
        overflow: hidden;
      }
      .match-stage-bar-fill {
        width: 100%;
        background: var(--lilac);
        border-radius: 2px 2px 0 0;
      }
      .match-stage-pct {
        font-size: 0.72rem;
        font-family: var(--mono);
        color: var(--text);
        margin-top: 0.25rem;
      }
      .match-stage-label {
        font-size: 0.76rem;
        color: var(--muted);
      }
      .match-bar-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.35rem;
        font-size: 0.76rem;
        font-family: var(--mono);
      }
      .match-bar-label {
        width: 130px;
        flex-shrink: 0;
        color: var(--muted);
      }
      .match-bar-track {
        position: relative;
        flex: 1;
        height: 8px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 4px;
        overflow: visible;
      }
      .match-bar-fill {
        height: 100%;
        background: var(--lilac);
        border-radius: 3px;
        opacity: 0.75;
      }
      .match-bar-marker {
        position: absolute;
        top: -3px;
        width: 2px;
        height: 14px;
        background: var(--accent2, #e08a4a);
        transform: translateX(-1px);
      }
      .match-bar-values {
        width: 130px;
        flex-shrink: 0;
        color: var(--text);
        text-align: right;
      }

      /* ── Delta badges ── */
      .delta {
        font-size: 0.75rem;
        margin-left: 5px;
        padding: 1px 4px;
        border-radius: 2px;
      }
      .delta.up {
        background: rgba(231, 177, 90, 0.14);
        color: var(--vu-yellow);
      }
      .delta.down {
        background: rgba(232, 48, 32, 0.15);
        color: var(--clip-red);
      }

      /* ── Empty state ── */
      .empty-state {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--muted);
        text-align: center;
        gap: 0.55rem;
        background: rgba(255, 255, 255, 0.01);
        border: 1px dashed var(--border2);
        border-radius: 10px;
        padding: 1rem;
        min-height: 180px;
      }
      .empty-state .big {
        font-size: 2.5rem;
        opacity: 0.5;
      }
      .empty-state p {
        font-size: 0.82rem;
        max-width: 260px;
        line-height: 1.5;
      }

      /* ── Params preview ── */
      .params-preview {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 0.8rem 1rem;
        margin: 0.65rem 0;
      }
      .params-preview h3 {
        margin: 0 0 0.55rem;
        font-size: 0.9rem;
        color: var(--text);
      }
      .params-preview .pp-group {
        margin-bottom: 0.6rem;
      }
      .params-preview .pp-group-title {
        font-size: 0.76rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        margin-bottom: 0.3rem;
        font-weight: 700;
      }
      .params-preview .pp-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.35rem 0.7rem;
      }
      .params-preview .pp-item {
        display: flex;
        justify-content: space-between;
        gap: 0.45rem;
        font-size: 0.74rem;
        padding: 0.28rem 0.45rem;
        background: var(--surface);
        border-radius: 4px;
        border: 1px solid var(--border);
      }
      .params-preview .pp-item span:first-child {
        color: var(--muted);
      }
      .params-preview .pp-item span:last-child {
        color: var(--text);
        font-family: var(--mono);
        font-weight: 600;
      }
      .params-preview .pp-actions {
        display: flex;
        gap: 0.45rem;
        margin-top: 0.8rem;
      }
      .params-preview .pp-actions button {
        flex: 1;
      }

      /* ── Workflow chips ── */
      .workflow-rail {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-bottom: 0.2rem;
      }
      .workflow-chip {
        padding: 0.4rem 0.6rem;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--surface2);
        color: var(--muted);
        font-family: var(--mono);
        font-size: 0.64rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        transition: all 0.2s;
      }
      .workflow-chip.active {
        color: var(--text);
        border-color: var(--amber);
        background: rgba(232, 160, 32, 0.12);
      }
      .workflow-chip.done {
        color: var(--vu-yellow);
        border-color: rgba(231, 177, 90, 0.28);
        background: rgba(231, 177, 90, 0.08);
      }

      /* ── Studio hero (sidebar) ── */
      .studio-hero {
        background: linear-gradient(135deg, rgba(232, 160, 32, 0.12), rgba(232, 160, 32, 0.04));
        border: 1px solid rgba(232, 160, 32, 0.2);
        border-radius: 10px;
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.45rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.7rem;
      }
      .studio-hero h2 {
        font-size: 0.88rem;
        margin-bottom: 0.18rem;
      }
      .studio-hero p {
        font-size: 0.76rem;
        line-height: 1.4;
        color: var(--muted);
      }
      .studio-hero-badge {
        padding: 0.28rem 0.5rem;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(7, 8, 14, 0.28);
        font-family: var(--mono);
        font-size: 0.76rem;
        letter-spacing: 0.08em;
        color: var(--amber);
        white-space: nowrap;
      }

      /* ── AI FAB ── */
      .ai-fab {
        position: fixed;
        right: 1.5rem;
        bottom: 1.5rem;
        z-index: 1000;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--amber), #c47a10);
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(232, 160, 32, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        transition:
          transform 0.15s,
          box-shadow 0.15s;
      }
      .ai-fab:hover {
        transform: scale(1.07);
        box-shadow: 0 6px 26px rgba(232, 160, 32, 0.55);
      }
      .ai-fab:active {
        transform: scale(0.96);
      }
      .ai-fab .ai-fab-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--vu-yellow);
        border: 2px solid var(--bg);
        display: none;
        box-shadow: 0 0 6px rgba(231, 177, 90, 0.45);
      }
      .ai-fab.has-context .ai-fab-dot {
        display: block;
      }

      /* ── AI Panel ── */
      .ai-panel {
        position: fixed;
        right: 1.5rem;
        bottom: 5.2rem;
        z-index: 1000;
        width: 370px;
        max-width: calc(100vw - 2rem);
        height: min(540px, calc(100vh - 8rem));
        background: var(--surface);
        border: 1px solid var(--border2);
        border-radius: 12px;
        box-shadow:
          0 16px 50px rgba(0, 0, 0, 0.6),
          0 0 0 1px rgba(232, 160, 32, 0.06);
        display: none;
        flex-direction: column;
        overflow: hidden;
      }
      .ai-panel.open {
        display: flex;
      }
      .ai-panel-head {
        padding: 0.8rem 1rem;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 0.55rem;
        background: linear-gradient(135deg, rgba(232, 160, 32, 0.1), rgba(160, 128, 208, 0.06));
      }
      .ai-panel-head .ai-avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--amber), var(--amber2));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        flex-shrink: 0;
      }
      .ai-panel-head .ai-title {
        flex: 1;
        min-width: 0;
      }
      .ai-panel-head .ai-title b {
        font-family: var(--sans);
        font-size: 0.82rem;
        display: block;
      }
      .ai-panel-head .ai-title small {
        color: var(--muted);
        font-size: 0.74rem;
        font-family: var(--mono);
      }
      .ai-panel-head .ai-close {
        background: none;
        border: none;
        color: var(--muted);
        font-size: 1rem;
        cursor: pointer;
        padding: 0.2rem 0.4rem;
        line-height: 1;
      }
      .ai-panel-head .ai-close:hover {
        color: var(--text);
      }
      .ai-messages {
        flex: 1;
        overflow-y: auto;
        padding: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
      }
      .ai-msg {
        max-width: 85%;
        padding: 0.55rem 0.75rem;
        border-radius: 9px;
        font-size: 0.79rem;
        line-height: 1.5;
        white-space: pre-wrap;
        word-break: break-word;
      }
      .ai-msg.user {
        align-self: flex-end;
        background: linear-gradient(135deg, var(--amber), var(--amber2));
        color: #0a0907;
        border-bottom-right-radius: 2px;
      }
      .ai-msg.assistant {
        align-self: flex-start;
        background: var(--surface2);
        border: 1px solid var(--border);
        color: var(--text);
        border-bottom-left-radius: 2px;
      }
      .ai-msg.system-note {
        align-self: center;
        color: var(--muted);
        font-size: 0.76rem;
        font-family: var(--mono);
        text-align: center;
        background: none;
      }
      .ai-msg.typing {
        display: flex;
        gap: 4px;
        align-items: center;
        padding: 0.65rem 0.85rem;
      }
      .ai-msg.typing span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--muted);
        animation: ai-bounce 1.2s infinite;
      }
      .ai-msg.typing span:nth-child(2) {
        animation-delay: 0.15s;
      }
      .ai-msg.typing span:nth-child(3) {
        animation-delay: 0.3s;
      }
      @keyframes ai-bounce {
        0%,
        60%,
        100% {
          opacity: 0.3;
          transform: translateY(0);
        }
        30% {
          opacity: 1;
          transform: translateY(-3px);
        }
      }
      .ai-suggestions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0 0.85rem 0.6rem;
      }
      .ai-suggestion-card {
        align-self: flex-start;
        max-width: 88%;
        background: var(--surface2);
        border: 1px solid var(--amber);
        border-radius: 9px;
        padding: 0.6rem 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
      }
      .ai-suggestion-card.applied {
        border-color: var(--border);
        opacity: 0.75;
      }
      .ai-suggestion-card-title {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--amber);
      }
      .ai-suggestion-card-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.22rem;
      }
      .ai-suggestion-card-list li {
        display: flex;
        justify-content: space-between;
        gap: 0.65rem;
        font-size: 0.71rem;
        font-family: var(--mono);
        color: var(--text);
      }
      .ai-suggestion-param {
        color: var(--muted);
      }
      .ai-suggestion-value {
        color: var(--text);
        font-weight: 600;
        text-align: right;
      }
      .ai-suggestion-card-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.4rem;
        flex-wrap: wrap;
      }
      .ai-suggestion-apply-btn,
      .ai-suggestion-cancel-btn {
        border: none;
        border-radius: 6px;
        padding: 0.35rem 0.8rem;
        font-size: 0.72rem;
        font-weight: 600;
        cursor: pointer;
      }
      .ai-suggestion-apply-btn {
        background: linear-gradient(135deg, var(--amber), var(--amber2));
        color: #0a0907;
      }
      .ai-suggestion-cancel-btn {
        background: var(--surface3);
        color: var(--text);
        border: 1px solid var(--border);
      }
      .ai-suggestion-apply-btn:hover {
        filter: brightness(1.08);
      }
      .ai-suggestion-cancel-btn:hover {
        background: var(--surface2);
      }
      .ai-suggestion-explanation {
        color: var(--text);
        font-size: 0.72rem;
        line-height: 1.4;
        background: rgba(232, 160, 32, 0.06);
        border: 1px solid rgba(232, 160, 32, 0.14);
        border-radius: 6px;
        padding: 0.45rem 0.6rem;
        font-family: var(--sans);
      }
      .ai-suggestion-apply-btn:disabled,
      .ai-suggestion-cancel-btn:disabled {
        cursor: default;
        filter: none;
        opacity: 0.7;
      }
      .ai-suggestion-btn {
        background: var(--surface2);
        border: 1px solid var(--border);
        color: var(--muted);
        border-radius: 999px;
        padding: 0.32rem 0.65rem;
        font-size: 0.74rem;
        font-family: var(--sans);
        cursor: pointer;
        transition: all 0.12s;
      }
      .ai-suggestion-btn:hover {
        border-color: var(--amber);
        color: var(--amber);
      }
      .ai-inputrow {
        border-top: 1px solid var(--border);
        padding: 0.6rem;
        display: flex;
        gap: 0.45rem;
        align-items: flex-end;
      }
      .ai-inputrow textarea {
        flex: 1;
        resize: none;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text);
        font-family: var(--sans);
        font-size: 0.79rem;
        padding: 0.5rem 0.65rem;
        max-height: 90px;
        min-height: 36px;
      }
      .ai-inputrow textarea:focus {
        outline: none;
        border-color: var(--amber);
      }
      .ai-send-btn {
        background: linear-gradient(135deg, var(--amber), var(--amber2));
        border: none;
        color: #0a0907;
        width: 36px;
        height: 36px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.95rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.12s;
      }
      .ai-send-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
      }
      .ai-panel-foot {
        padding: 0.35rem 0.85rem 0.6rem;
        color: var(--muted);
        font-size: 0.7rem;
        font-family: var(--mono);
        text-align: center;
      }

      /* ═══════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════ */
      ::-webkit-scrollbar {
        width: 7px;
        height: 7px;
      }
      ::-webkit-scrollbar-track {
        background: var(--bg);
      }
      ::-webkit-scrollbar-thumb {
        background: var(--border2);
        border-radius: 4px;
      }
      ::-webkit-scrollbar-thumb:hover {
        background: var(--amber2);
      }

      h1,
      h2,
      h3,
      h4 {
        color: var(--text);
      }
      ::selection {
        background: rgba(232, 160, 32, 0.35);
        color: #fff;
      }

      label:has(> input[type="checkbox"]:checked) {
        border-color: var(--amber) !important;
        background: rgba(232, 160, 32, 0.1) !important;
        color: var(--text);
      }

      /* ─ Workflow rail ─ */
      .process-stack {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
      }

      /* ─ content-grid ─ */
      .content-grid > .dashboard-wrap,
      .content-grid > .meters-wrap,
      .content-grid > .empty-state,
      .content-grid > .preview-wrap {
        min-width: 0;
      }

      /* ─ Studio process card override in the main content ─ */
      .content .process-card {
        background: transparent;
        border: none;
        padding: 0;
      }
      .content .process-card::before {
        display: none;
      }

      /* ─ NR params inline ─ */
      .param-label {
        font-size: 0.72rem;
        color: var(--muted);
        display: block;
        margin-bottom: 0.18rem;
      }
      .val-badge {
        font-family: var(--mono);
        font-size: 0.76rem;
        color: var(--amber);
        display: inline-block;
        min-width: 40px;
      }
      .param-hint {
        font-size: 0.72rem;
        color: var(--faint);
        display: block;
        margin-top: 0.1rem;
        line-height: 1.3;
      }

      @media (max-width: 900px) {
        .content-grid {
          grid-template-columns: 1fr;
        }
        .dash-grid {
          grid-template-columns: repeat(2, 1fr);
        }
      }
      @media (max-width: 768px) {
        main {
          flex-direction: column;
        }
        aside {
          width: 100% !important;
          max-width: 100% !important;
          min-width: 0 !important;
          border-right: none;
          border-bottom: 1px solid var(--border);
          max-height: 45dvh;
        }
        .resize-handle { display: none; }
        .analysis-grid { grid-template-columns: 1fr; }
        .workflow-hero { grid-template-columns: 1fr; }
        .workflow-steps { grid-template-columns: 1fr; }
        .studio-focus { grid-template-columns: 1fr; }
        .studio-focus-pills { grid-template-columns: 1fr; }
      }
      @media (max-width: 480px) {
        body { font-size: 12px; }
        .app-header { padding: 0 0.5rem; gap: 0.4rem; }
        .sidebar-tab { font-size: 0.7rem; padding: 0.25rem 0.35rem; }
      }
      @media (max-width: 480px) {
        .ai-panel {
          right: 0.6rem;
          left: 0.6rem;
          width: auto;
          bottom: 4.8rem;
        }
        .ai-fab {
          right: 1rem;
          bottom: 1rem;
        }
      }
    

      /* ── Sliders modernos ── */
      input[type="range"] {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        height: 4px;
        border-radius: 2px;
        background: var(--surface3);
        cursor: pointer;
        outline: none;
      }
      input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--amber);
        box-shadow: 0 0 0 2px rgba(240,184,64,0.3);
        transition: box-shadow 0.15s, transform 0.15s;
      }
      input[type="range"]:hover::-webkit-slider-thumb {
        box-shadow: 0 0 0 4px rgba(240,184,64,0.25);
        transform: scale(1.15);
      }
      input[type="range"]::-moz-range-thumb {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--amber);
        border: none;
        box-shadow: 0 0 0 2px rgba(240,184,64,0.3);
      }

      /* ── Checkboxes modernos ── */
      input[type="checkbox"] {
        -webkit-appearance: none;
        appearance: none;
        width: 15px;
        height: 15px;
        border-radius: 4px;
        border: 1px solid var(--border);
        background: var(--surface2);
        cursor: pointer;
        position: relative;
        flex-shrink: 0;
        transition: all 0.15s;
      }
      input[type="checkbox"]:checked {
        background: var(--amber);
        border-color: var(--amber);
      }
      input[type="checkbox"]:checked::after {
        content: "✓";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        color: #000;
        font-weight: 700;
      }

      /* ── Select modernos ── */
      select {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text);
        font-family: var(--sans);
        font-size: .72rem;
        padding: .25rem .5rem;
        cursor: pointer;
        outline: none;
        transition: border-color 0.15s;
      }
      select:hover, select:focus {
        border-color: rgba(240,184,64,0.4);
      }

      /* ── Scrollbar global ── */
      ::-webkit-scrollbar { width: 5px; height: 5px; }
      ::-webkit-scrollbar-track { background: transparent; }
      ::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
      ::-webkit-scrollbar-thumb:hover { background: var(--border); }

      /* ── Preset grid ── */
      .preset-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        margin: 0.4rem 0;
      }
      .preset-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.2rem;
        padding: 0.22rem 0.55rem;
        font-size: clamp(0.62rem, 0.9vw, 0.72rem);
        font-family: var(--sans);
        font-weight: 500;
        border-radius: 20px;
        border: 1px solid var(--border);
        background: var(--surface2);
        color: var(--muted);
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.15s;
        line-height: 1.3;
      }
      .preset-btn:hover {
        border-color: var(--amber);
        color: var(--amber);
        background: rgba(240,184,64,0.08);
      }
      .preset-btn.active,
      .preset-btn[aria-pressed="true"] {
        border-color: var(--amber);
        color: var(--amber);
        background: rgba(240,184,64,0.15);
        box-shadow: 0 0 0 1px rgba(240,184,64,0.2);
      }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE & RESIZE IMPROVEMENTS — patch v2
   ═══════════════════════════════════════════════════════════ */

/* Sidebar toggle button — always visible, floats on the edge */
.sidebar-toggle-btn {
  position: relative;
  flex-shrink: 0;
  width: 16px;
  align-self: stretch;
  background: var(--surface2);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  color: var(--muted);
  z-index: 20;
  transition: background .15s, color .15s, width .15s;
  padding: 0;
  writing-mode: horizontal-tb;
}
.sidebar-toggle-btn:hover {
  background: var(--amber);
  color: #000;
  width: 20px;
}

/* When sidebar is collapsed, the toggle sits at the very left edge */
aside.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-right-width: 0 !important;
}
aside.collapsed ~ .resize-handle { display: none; }
aside.collapsed ~ .sidebar-toggle-btn {
  border-right: none;
  border-left: 1px solid var(--border);
  background: var(--surface2);
}
aside.collapsed ~ .sidebar-toggle-btn:hover {
  background: var(--amber);
  color: #000;
}

/* Mejorar resize handle — más visible */
.resize-handle {
  width: 5px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  transition: background .15s, width .15s;
  user-select: none;
  z-index: 10;
}
.resize-handle::before {
  content: '';
  position: absolute;
  inset: 30% -3px;
  background: var(--border2);
  border-radius: 2px;
  width: 3px;
  left: 50%;
  transform: translateX(-50%);
}
.resize-handle:hover,
.resize-handle.dragging {
  background: var(--amber);
  width: 5px;
  box-shadow: 0 0 8px var(--amber-glow);
}
.resize-handle:hover::before,
.resize-handle.dragging::before {
  background: rgba(240,184,64,.6);
}

/* content auto-fill */
.content {
  flex: 1 1 0;
  min-width: 0;
}

/* content-grid más fluido */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.33fr) minmax(240px, 0.75fr);
  gap: 0.85rem;
  align-items: start;
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .workflow-hero {
    grid-template-columns: 1fr;
  }
  .studio-focus {
    grid-template-columns: 1fr;
  }
}

/* Mejorar el header sidebar-tabs para que no salte con 4 tabs */
.sidebar-tabs {
  flex-wrap: wrap;
  gap: 2px;
}
.sidebar-tab {
  flex: 1;
  min-width: 0;
  font-size: clamp(.6rem, 1.2vw, .72rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar min-width adaptable */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  aside { min-width: 180px; }
}
