    /* BUTTON SYSTEM */
    button {
      font-family: var(--font-mono);
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      padding: 5px 9px;
      border: 1px solid var(--line-subtle);
      background: var(--bg-surface-2);
      color: var(--text-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: all 0.08s ease;
      touch-action: manipulation;
    }
    button:hover {
      background: var(--bg-surface-3);
      border-color: var(--line-bright);
      color: #fff;
    }
    button:active {
      transform: scale(0.97);
    }
    button.acid {
      background: var(--acid);
      color: #000;
      border-color: var(--acid);
    }
    button.acid:hover {
      background: #e5ff66;
    }
    button.active {
      background: var(--acid);
      color: #000;
      border-color: var(--acid);
    }
    button.orange.active {
      background: var(--orange);
      color: #000;
      border-color: var(--orange);
    }
    button.cyan.active {
      background: var(--cyan);
      color: #000;
      border-color: var(--cyan);
    }
    button.red {
      background: #2a0c0c;
      color: var(--red);
      border-color: #5c1818;
    }
    button.red:hover {
      background: var(--red);
      color: #fff;
    }
    button.red.active {
      background: var(--red);
      color: #fff;
      border-color: #ff6b64;
      animation: pulse-rec 1s infinite alternate;
    }
    @keyframes pulse-rec {
      from { box-shadow: 0 0 4px var(--red); }
      to { box-shadow: 0 0 14px var(--red); }
    }

    /* iPad-first workspace: rail / main / hardware mirror (hidden <1180px per spec §10) */
    .workspace-grid {
      min-height: 0;
      height: 100%;
      display: grid;
      grid-template-columns: 72px minmax(0, 1fr) clamp(288px, 23vw, 356px);
      background: var(--bg-deep);
      overflow: hidden;
    }

    /* LEFT MODULE RAIL — 7 equal performance cells, ≥56px touch targets */
    aside.module-rail {
      background: var(--bg-surface-1);
      border-right: 1px solid var(--line-subtle);
      display: grid;
      grid-template-rows: repeat(6, minmax(56px, 1fr));
      padding: 4px;
      gap: 4px;
      overflow: hidden;
    }
    .rail-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      background: var(--bg-deep);
      border: 1px solid var(--line-subtle);
      border-left: 3px solid transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.1s ease;
      padding: 4px 2px;
      min-height: 56px;
      min-width: 44px;
    }
    .rail-btn .num {
      font: 900 8px var(--font-mono);
      color: var(--text-dim);
    }
    .rail-btn .name {
      font: 900 9px var(--font-mono);
      letter-spacing: 0.5px;
      text-align: center;
    }
    .rail-btn:hover {
      background: var(--bg-surface-2);
      color: var(--text-main);
      border-color: var(--line-bright);
    }
    .rail-btn.active {
      background: var(--acid);
      border-color: var(--acid);
      border-left-color: var(--acid);
      color: #000;
    }
    .rail-btn.active .num,
    .rail-btn.active .name { color: #000; }

    /* CENTER ACTIVE MODULE WORKSPACE — strict grid, no internal scroll */
    main.module-workspace {
      background: var(--bg-deep);
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr);
      padding: 8px 12px;
      gap: 8px;
      min-height: 0;
      height: 100%;
      overflow: hidden;
    }

    .module-pane {
      display: none;
      height: 100%;
      min-height: 0;
      flex-direction: column;
      gap: 8px;
      overflow: hidden;
    }
    .module-pane.active {
      display: flex;
    }

    .module-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg-surface-1);
      border: 1px solid var(--line-subtle);
      padding: 6px 10px;
      min-height: 38px;
      flex-shrink: 0;
    }
    .module-title {
      font: 900 13px var(--font-mono);
      letter-spacing: 1px;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .module-badge {
      font: 800 8px var(--font-mono);
      color: var(--acid);
      background: rgba(216, 255, 69, 0.1);
      border: 1px solid rgba(216, 255, 69, 0.3);
      padding: 2px 5px;
    }

    /* WAVEFORM CANVASES */
    .canvas-container {
      width: 100%;
      background: #040503;
      border: 1px solid var(--line-subtle);
      position: relative;
      overflow: hidden;
      flex-shrink: 0;
    }
    canvas.audio-viz {
      width: 100%;
      height: 100%;
      display: block;
    }

    /* KNOB MATRICES — performance-first: dial ≥52px, whole card is touch surface */
    .param-knob-matrix {
      display: grid;
      grid-template-columns: repeat(8, minmax(0, 1fr));
      gap: 6px;
      flex: 1 1 auto;
      min-height: 0;
    }
    .knob-card {
      background: var(--bg-surface-1);
      border: 1px solid var(--line-subtle);
      padding: 6px 4px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-evenly;
      gap: 4px;
      position: relative;
      touch-action: none;
      min-width: 0;
      min-height: 92px;
      cursor: ns-resize;
    }
    .knob-card .knob-name {
      font: 900 8px var(--font-mono);
      color: var(--text-muted);
      letter-spacing: 0.5px;
      text-transform: uppercase;
      text-align: center;
      width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .knob-rotary-dial {
      width: 52px;
      height: 52px;
      flex: 0 0 auto;
      border-radius: 50%;
      background: #141711;
      border: 2px solid var(--line-bright);
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: ns-resize;
      touch-action: none;
    }
    .knob-rotary-dial .indicator-needle {
      position: absolute;
      width: 3px;
      height: 16px;
      background: var(--acid);
      top: 4px;
      transform-origin: bottom center;
      border-radius: 1px;
    }
    .knob-val-badge {
      font: 900 11px var(--font-mono);
      color: #fff;
      font-variant-numeric: tabular-nums;
    }
    .knob-midi-tag {
      position: absolute;
      top: 2px;
      right: 3px;
      font: 800 6px var(--font-mono);
      color: var(--text-dim);
    }

