/* ==========================================================================
   OXIDE STUDIO WEB — SOTA INDUSTRIAL DARK CARBON STYLING (v1.0.0)
   Frontend-Craft Baseline: OLED Void Black (#030504), Carbon (#07080a),
   Analog Amber (#ffbe00), Laser Cyan (#00f0ff), 0-2px Micro-Bevels, Tabular Nums.
   ========================================================================== */

:root {
  /* Surface Void & Carbon Hierarchy */
  --void-bg: #030504;
  --carbon-bg: #07080a;
  --surface-base: #111318;
  --surface-card: #151821;
  --surface-elevated: #1a1e29;
  --surface-sunken: #0b0d12;
  --surface-hover: #1f2430;
  --surface-border: #242a38;
  --surface-border-subtle: #1c212c;
  --surface-border-highlight: #3a4358;

  /* Studio Signal Accents */
  --signal-amber: #ffbe00;
  --signal-amber-glow: rgba(255, 190, 0, 0.22);
  --signal-amber-dim: #997200;
  --laser-cyan: #00f0ff;
  --laser-cyan-glow: rgba(0, 240, 255, 0.24);
  --meter-green: #00e676;
  --meter-green-glow: rgba(0, 230, 118, 0.22);
  --meter-yellow: #ffd100;
  --transient-pink: #ff007f;
  --clip-red: #ff1744;
  --trk-purple: #a855f7;

  /* Inks & Contrast (WCAG AAA compliant) */
  --text-primary: #f2f5f9;
  --text-secondary: #9aa5b8;
  --text-muted: #647085;
  --text-dim: #434c5c;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, monospace;

  /* Geometry: 0px to 2px industrial micro-bevels */
  --radius-xs: 1px;
  --radius-sm: 2px;
}

/* Browser Surface Theming Standard */
::selection {
  background: var(--laser-cyan);
  color: var(--void-bg);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--surface-sunken);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--surface-border-highlight);
}

:focus-visible {
  outline: 2px solid var(--laser-cyan);
  outline-offset: 1px;
}

.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Base Body & Shell */
html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--void-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.daw-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: var(--void-bg);
}

/* ==========================================================================
   Audio Unlock Overlay
   ========================================================================== */
.audio-unlock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 4, 0.88);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.audio-unlock-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.unlock-card {
  background: var(--carbon-bg);
  border: 1px solid var(--surface-border-highlight);
  border-radius: var(--radius-sm);
  padding: 32px 40px;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
}

.unlock-icon {
  font-size: 32px;
  color: var(--signal-amber);
  margin-bottom: 12px;
}

.unlock-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.unlock-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ==========================================================================
   Header Bar & Transport Controls
   ========================================================================== */
.daw-header {
  height: 48px;
  min-height: 48px;
  background: var(--carbon-bg);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 12px;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--signal-amber);
  color: var(--carbon-bg);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 14px;
  border-radius: var(--radius-xs);
}

.brand-name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-sunken);
  color: var(--signal-amber);
  border: 1px solid var(--surface-border);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.header-back-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.header-back-link:hover {
  color: var(--laser-cyan);
  background: var(--surface-hover);
}

/* Dual View Switcher */
.view-switch-group {
  display: flex;
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-view {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-view:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-view.active {
  background: var(--surface-card);
  color: var(--signal-amber);
  border: 1px solid var(--surface-border-highlight);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.key-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  background: var(--surface-border);
  color: var(--text-muted);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  margin-left: 2px;
}

/* Header Transport Center */
.header-transport {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transport-buttons {
  display: flex;
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-transport {
  background: transparent;
  border: none;
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-transport:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-play.active {
  background: var(--meter-green);
  color: var(--void-bg);
  box-shadow: 0 0 8px var(--meter-green-glow);
}

.btn-rec.active {
  background: var(--clip-red);
  color: #fff;
}

.btn-loop.active {
  color: var(--signal-amber);
  background: var(--surface-card);
}

/* Tempo, Signature & Metro */
.tempo-control-box, .sig-box, .swing-box, .scale-box {
  display: flex;
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  gap: 6px;
  height: 28px;
}

.ctrl-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.tempo-input {
  background: transparent;
  border: none;
  color: var(--signal-amber);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  width: 58px;
  text-align: center;
}
.tempo-input:focus {
  outline: none;
  color: var(--laser-cyan);
}

.step-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  width: 14px;
}
.step-btn:hover {
  color: var(--text-primary);
}

.sig-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-metro {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
}
.btn-metro.active {
  background: var(--surface-card);
  color: var(--signal-amber);
  border-color: var(--signal-amber);
}

.swing-box input[type="range"] {
  width: 60px;
}

#swing-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal-amber);
  width: 32px;
}

.ctrl-select {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

/* Header Right Telemetry & Exports */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dsp-telemetry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.telemetry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.telemetry-dot.live {
  background: var(--meter-green);
  box-shadow: 0 0 6px var(--meter-green-glow);
}

.export-actions {
  display: flex;
  gap: 6px;
}

.btn-export {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-export:hover {
  background: var(--surface-hover);
  border-color: var(--surface-border-highlight);
}

.btn-amber-glow {
  color: var(--signal-amber);
  border-color: rgba(255, 190, 0, 0.4);
}
.btn-amber-glow:hover {
  background: var(--signal-amber);
  color: var(--carbon-bg);
  box-shadow: 0 0 8px var(--signal-amber-glow);
}

/* Common Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-amber {
  background: var(--signal-amber);
  color: var(--carbon-bg);
  font-weight: 700;
}
.btn-amber:hover {
  background: #ffcc22;
  box-shadow: 0 0 10px var(--signal-amber-glow);
}

/* Range Sliders */
.range-slider {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-sunken);
  height: 4px;
  border-radius: 1px;
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 12px;
  background: var(--signal-amber);
  border-radius: 1px;
  cursor: pointer;
}
.range-slider::-moz-range-thumb {
  width: 10px;
  height: 12px;
  background: var(--signal-amber);
  border-radius: 1px;
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   Upper Main Workspace (Session & Arrangement Views)
   ========================================================================== */
.daw-workspace {
  flex: 1 1 50%;
  min-height: 220px;
  overflow: hidden;
  position: relative;
  background: var(--carbon-bg);
}

/* View 1: Session View */
.session-view-container {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.session-view-container.active {
  display: flex;
}

.session-header-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) repeat(2, minmax(100px, 0.8fr)) minmax(130px, 1fr);
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface-base);
  min-width: 860px;
}

.session-col-head {
  padding: 6px 10px;
  border-right: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.trk-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 10px;
  border-radius: 1px;
}

.head-trk1 { border-top: 2px solid var(--signal-amber); }
.head-trk2 { border-top: 2px solid var(--meter-green); }
.head-trk3 { border-top: 2px solid var(--laser-cyan); }
.head-trk4 { border-top: 2px solid var(--trk-purple); }
.head-rtnA { border-top: 2px solid #0099cc; color: #88ccff; }
.head-rtnB { border-top: 2px solid #cc8800; color: #ffcc66; }
.head-master { border-top: 2px solid #f59e0b; color: #f59e0b; }

.session-matrix-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 860px;
  background: var(--void-bg);
}

.matrix-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) repeat(2, minmax(100px, 0.8fr)) minmax(130px, 1fr);
  border-bottom: 1px solid var(--surface-border-subtle);
}

.clip-slot {
  height: 38px;
  border-right: 1px solid var(--surface-border-subtle);
  background: var(--surface-sunken);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease;
}
.clip-slot:hover {
  background: var(--surface-hover);
}

.clip-state-icon {
  font-size: 9px;
  color: var(--text-dim);
}
.clip-slot:hover .clip-state-icon {
  color: var(--signal-amber);
}

.clip-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-len {
  font-size: 9px;
  color: var(--text-muted);
}

.clip-slot.active-clip {
  background: rgba(255, 190, 0, 0.15);
  border-left: 2px solid var(--signal-amber);
}
.clip-slot.active-clip .clip-state-icon {
  color: var(--meter-green);
}

.return-slot {
  height: 38px;
  border-right: 1px solid var(--surface-border-subtle);
  background: rgba(11, 13, 18, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 10px;
}

.scene-trigger-slot {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: var(--surface-card);
}

.btn-scene-launch {
  width: 100%;
  height: 26px;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.btn-scene-launch:hover {
  background: var(--surface-hover);
  border-color: var(--signal-amber);
  color: var(--signal-amber);
}
.btn-scene-launch.playing {
  background: var(--meter-green);
  color: var(--carbon-bg);
  border-color: var(--meter-green);
}

.scene-play-icon {
  font-size: 8px;
}

.matrix-stop-row {
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border);
}
.stop-clip-slot {
  height: 28px;
  border-right: 1px solid var(--surface-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-stop-clip {
  width: 22px;
  height: 18px;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 8px;
  cursor: pointer;
  border-radius: 1px;
}
.btn-stop-clip:hover {
  background: var(--surface-hover);
  color: var(--clip-red);
}

.btn-stop-all {
  width: 100%;
  height: 22px;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  border-radius: 1px;
}
.btn-stop-all:hover {
  color: var(--clip-red);
  border-color: var(--clip-red);
}

.session-footer-bar {
  height: 28px;
  min-height: 28px;
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  font-size: 11px;
}
.footer-hint {
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.footer-status-pill {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* View 2: Arrangement Timeline View */
.arrangement-view-container {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--void-bg);
}
.arrangement-view-container.active {
  display: flex;
}

.timeline-ruler {
  height: 32px;
  min-height: 32px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  min-width: 900px;
}
.ruler-sidebar {
  width: 140px;
  min-width: 140px;
  border-right: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  padding: 0 8px;
}
.btn-back-arr {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 6px;
  border-radius: 1px;
  cursor: pointer;
}
.btn-back-arr:hover {
  color: var(--signal-amber);
}

.ruler-lane {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.ruler-bar-num {
  position: absolute;
  top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  transform: translateX(-50%);
}
.ruler-locator {
  position: absolute;
  top: 17px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--signal-amber);
}

.loop-brace {
  position: absolute;
  top: 0;
  height: 6px;
  background: rgba(255, 190, 0, 0.35);
  border-top: 2px solid var(--signal-amber);
}
.loop-title {
  display: none;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: -400px;
  width: 2px;
  background: var(--laser-cyan);
  box-shadow: 0 0 6px var(--laser-cyan-glow);
  z-index: 50;
  pointer-events: none;
}

.arrangement-tracks-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 900px;
  overflow-y: auto;
}

.arr-track-lane {
  display: flex;
  height: 48px;
  border-bottom: 1px solid var(--surface-border-subtle);
  position: relative;
}

.arr-track-header {
  width: 140px;
  min-width: 140px;
  background: var(--surface-base);
  border-right: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.trk-amber { border-left: 3px solid var(--signal-amber); }
.trk-green { border-left: 3px solid var(--meter-green); }
.trk-cyan { border-left: 3px solid var(--laser-cyan); }
.trk-purple { border-left: 3px solid var(--trk-purple); }

.arr-track-body {
  flex: 1;
  position: relative;
  background: var(--surface-sunken);
}

.arr-clip-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 1px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.block-amber { background: rgba(255, 190, 0, 0.25); border-color: rgba(255, 190, 0, 0.5); color: #ffe680; }
.block-green { background: rgba(0, 230, 118, 0.25); border-color: rgba(0, 230, 118, 0.5); color: #99ffcc; }
.block-cyan { background: rgba(0, 240, 255, 0.25); border-color: rgba(0, 240, 255, 0.5); color: #b3f7ff; }
.block-purple { background: rgba(168, 85, 247, 0.25); border-color: rgba(168, 85, 247, 0.5); color: #e9d5ff; }

.automation-curve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ==========================================================================
   Center Resizable Splitter
   ========================================================================== */
.daw-splitter {
  height: 4px;
  min-height: 4px;
  background: var(--surface-border);
  cursor: row-resize;
  transition: background 0.15s ease;
}
.daw-splitter:hover {
  background: var(--signal-amber);
}

/* ==========================================================================
   Persistent Lower Detail Deck
   ========================================================================== */
.daw-detail-deck {
  flex: 1 1 50%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border);
  overflow: hidden;
}

.detail-tabs {
  height: 32px;
  min-height: 32px;
  background: var(--carbon-bg);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  padding: 0 8px;
  gap: 4px;
}

.deck-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.deck-tab:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.deck-tab.active {
  color: var(--signal-amber);
  border-bottom: 2px solid var(--signal-amber);
  background: var(--surface-base);
}

.deck-content-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--surface-base);
}

.deck-panel {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
.deck-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   PANEL 1: TR-909 Sequencer Grid
   -------------------------------------------------------------------------- */
.sequencer-ctrl-strip {
  height: 38px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--surface-card);
}

.bank-toggle-group {
  display: flex;
  gap: 4px;
}
.btn-bank {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 1px;
  cursor: pointer;
}
.btn-bank.active {
  background: var(--signal-amber);
  color: var(--carbon-bg);
  border-color: var(--signal-amber);
}

.preset-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-preset {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 1px;
  cursor: pointer;
}
.btn-preset:hover {
  color: var(--text-primary);
  border-color: var(--surface-border-highlight);
}
.btn-clear:hover {
  color: var(--clip-red);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}

.drum-grid {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 4px;
}

.drum-voice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
}

.voice-meta {
  width: 140px;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-audition-btn {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  font-size: 8px;
  font-family: var(--font-mono);
  width: 22px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 1px;
}
.voice-audition-btn:active {
  background: var(--signal-amber);
  color: var(--carbon-bg);
}

.voice-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
}

.btn-row-m, .btn-row-s {
  width: 18px;
  height: 18px;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 8px;
  font-family: var(--font-mono);
  cursor: pointer;
}
.btn-row-m.active { background: #b45309; color: #fff; }
.btn-row-s.active { background: #047857; color: #fff; }

.step-buttons-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  height: 100%;
}

.seq-step {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  border-radius: 1px;
  cursor: pointer;
  position: relative;
  transition: all 0.1s ease;
}

/* 4-beat color grouping (1-4 dark, 5-8 tinted, 9-12 dark, 13-16 tinted) */
.seq-step:nth-child(n+5):nth-child(-n+8),
.seq-step:nth-child(n+13):nth-child(-n+16) {
  background: #151821;
}

.seq-step:hover {
  border-color: var(--surface-border-highlight);
}

.seq-step.active {
  background: var(--signal-amber) !important;
  border-color: var(--signal-amber);
  box-shadow: 0 0 6px var(--signal-amber-glow);
}

.seq-step.accent {
  background: #ffffff !important;
  border-color: var(--signal-amber);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.seq-step.playhead-cursor {
  outline: 2px solid var(--laser-cyan);
  outline-offset: -1px;
}

/* --------------------------------------------------------------------------
   PANEL 2: Polyphonic Suite Synthesizer & FX Rack
   -------------------------------------------------------------------------- */
.synth-fx-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.synth-section, .fx-rack-section {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  overflow-y: auto;
}
.synth-section {
  border-right: 1px solid var(--surface-border);
}

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sec-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--signal-amber);
  color: var(--carbon-bg);
  padding: 2px 5px;
  border-radius: 1px;
}
.sec-badge.cyan {
  background: var(--laser-cyan);
  color: var(--carbon-bg);
}

.section-title-bar h3 {
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  margin-right: auto;
}

.synth-mode-switch {
  display: flex;
  gap: 2px;
}
.btn-smode {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 1px;
}
.btn-smode.active {
  background: var(--surface-card);
  color: var(--signal-amber);
  border-color: var(--signal-amber);
}

.synth-params-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.param-knob-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.param-knob-box label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}
.param-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--signal-amber);
}

/* Piano Keyboard */
.piano-keyboard-wrapper {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.keyboard-top-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
}
.octave-controls {
  display: flex;
  gap: 4px;
}
.btn-mini {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
}

.piano-keys {
  display: flex;
  position: relative;
  height: 72px;
  background: #000;
}
.p-key-white {
  flex: 1;
  background: #d8dce2;
  border: 1px solid #1a1e29;
  border-radius: 0 0 2px 2px;
  cursor: pointer;
  position: relative;
}
.p-key-white:active, .p-key-white.pressed {
  background: var(--signal-amber);
}
.p-key-black {
  position: absolute;
  width: 5.5%;
  height: 44px;
  background: #111318;
  border: 1px solid #242a38;
  border-radius: 0 0 2px 2px;
  z-index: 5;
  cursor: pointer;
}
.p-key-black:active, .p-key-black.pressed {
  background: var(--laser-cyan);
}

/* Audio FX Devices in Rack */
.fx-devices-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fx-device-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.dev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.dev-tag {
  color: var(--laser-cyan);
}
.dev-tag.red {
  color: var(--clip-red);
}
.dev-enable {
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
}
.ceiling-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  background: rgba(255, 23, 68, 0.2);
  color: var(--clip-red);
  padding: 2px 6px;
  border-radius: 1px;
}
.dev-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}
.fx-knob {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}
.val-static {
  color: var(--text-primary);
  font-size: 11px;
}
.clip-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #331111;
  border: 1px solid #552222;
  margin-top: 2px;
}
.clip-led.active {
  background: var(--clip-red);
  box-shadow: 0 0 8px rgba(255, 23, 68, 0.8);
}

/* --------------------------------------------------------------------------
   PANEL 3: Studio Mixer & Segmented VU Meters
   -------------------------------------------------------------------------- */
.mixer-strips-container {
  display: flex;
  height: 100%;
  padding: 10px 14px;
  gap: 6px;
  overflow-x: auto;
}

.mixer-channel-strip {
  width: 90px;
  min-width: 90px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 6px;
}
.strip-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 3px 0;
  border-radius: 1px;
  background: var(--surface-sunken);
}
.trk-return { color: #88ccff; }
.trk-gold { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }

.strip-meters-box {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 90px;
  background: #000;
  border: 1px solid var(--surface-border-subtle);
  border-radius: 1px;
  padding: 2px;
  position: relative;
}

.vu-meter-column {
  width: 6px;
  height: 100%;
  background: #0b0d12;
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
  overflow: hidden;
}

.meter-seg {
  width: 100%;
  height: 3px;
  background: #1a1e29;
}
.meter-seg.lit-green { background: var(--meter-green); box-shadow: 0 0 2px var(--meter-green-glow); }
.meter-seg.lit-yellow { background: var(--meter-yellow); }
.meter-seg.lit-red { background: var(--clip-red); box-shadow: 0 0 4px rgba(255, 23, 68, 0.6); }

.meter-db-readout {
  position: absolute;
  top: 2px;
  right: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
}
.master-db {
  color: var(--signal-amber);
}

.strip-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pan-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
}
.pan-slider {
  width: 100%;
}
.pan-val {
  color: var(--laser-cyan);
}

.sends-control {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.send-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
}
.send-dial input {
  width: 36px;
}

.mute-solo-btns {
  display: flex;
  gap: 4px;
}
.btn-mute, .btn-solo {
  flex: 1;
  height: 20px;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  cursor: pointer;
  border-radius: 1px;
}
.btn-mute.active { background: #b45309; color: #fff; }
.btn-solo.active { background: #047857; color: #fff; }

.fader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 60px;
}
.vertical-fader {
  width: 100%;
  margin-top: 10px;
}
.fader-unity {
  position: absolute;
  top: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
}

.master-modes {
  display: flex;
  gap: 4px;
}
.btn-mini-toggle {
  flex: 1;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 9px;
  font-family: var(--font-mono);
  padding: 3px 0;
  cursor: pointer;
}
.btn-mini-toggle.active {
  background: var(--signal-amber);
  color: var(--carbon-bg);
}

/* --------------------------------------------------------------------------
   PANEL 4: Bilingual OKF Copilot
   -------------------------------------------------------------------------- */
.copilot-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
}

.copilot-sidebar {
  background: var(--surface-card);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  overflow-y: auto;
}

.lang-switch-group {
  display: flex;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  padding: 2px;
  border-radius: 1px;
  gap: 2px;
}
.btn-lang {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px;
  cursor: pointer;
  border-radius: 1px;
}
.btn-lang.active {
  background: var(--signal-amber);
  color: var(--carbon-bg);
  font-weight: 700;
}

.okf-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.okf-list-title {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.btn-okf-ch {
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 1px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-okf-ch:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.btn-okf-ch.active {
  background: var(--surface-elevated);
  color: var(--laser-cyan);
  border-left: 2px solid var(--laser-cyan);
}

.studio-telemetry-card {
  margin-top: auto;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border-subtle);
  border-radius: 1px;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-eyebrow {
  color: var(--signal-amber);
  font-weight: 700;
  margin-bottom: 2px;
}
.telemetry-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}
.telemetry-item strong {
  color: var(--text-primary);
}

.copilot-chat-console {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--void-bg);
}

.chat-header {
  height: 32px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.copilot-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--meter-green);
  box-shadow: 0 0 6px var(--meter-green-glow);
}
.copilot-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}
.copilot-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--signal-amber);
  background: var(--surface-sunken);
  padding: 2px 6px;
  border: 1px solid var(--surface-border);
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 85%;
}
.chat-msg.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 24px;
  height: 24px;
  background: var(--signal-amber);
  color: var(--carbon-bg);
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}
.chat-msg.user .msg-avatar {
  background: var(--laser-cyan);
}

.msg-bubble {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-primary);
}
.chat-msg.user .msg-bubble {
  background: var(--surface-elevated);
  border-color: var(--surface-border-highlight);
}

.mcp-tool-badge {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-sunken);
  color: var(--laser-cyan);
  padding: 2px 6px;
  border-radius: 1px;
  display: inline-block;
}

.quick-chips {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border-subtle);
  overflow-x: auto;
}

.chip-btn {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 1px;
  white-space: nowrap;
  cursor: pointer;
}
.chip-btn:hover {
  border-color: var(--signal-amber);
  color: var(--signal-amber);
}

.chat-input-bar {
  display: flex;
  padding: 8px 12px;
  background: var(--surface-base);
  border-top: 1px solid var(--surface-border);
  gap: 8px;
}
.chat-input-bar input {
  flex: 1;
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border);
  border-radius: 1px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12px;
}
.chat-input-bar input:focus {
  outline: none;
  border-color: var(--laser-cyan);
}

/* ==========================================================================
   Persistent 60 FPS Visualizer Dock (Bottom)
   ========================================================================== */
.daw-visualizer-dock {
  height: 94px;
  min-height: 94px;
  background: var(--carbon-bg);
  border-top: 1px solid var(--surface-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px 8px;
  z-index: 10;
}

.vis-module {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.vis-header {
  height: 18px;
  background: rgba(17, 19, 24, 0.8);
  border-bottom: 1px solid var(--surface-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}
.vis-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--signal-amber);
  letter-spacing: 0.04em;
}
.vis-mode {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
}

.vis-canvas {
  width: 100%;
  height: 72px;
  display: block;
}
