/* AetherSynth Premium Glassmorphic Theme CSS - Full Viewport Layout Model */

:root {
  --bg-color: #05070c;
  --bg-gradient: radial-gradient(circle at 50% 30%, #0f172a 0%, #020617 100%);
  --panel-bg: rgba(15, 23, 42, 0.45);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-blur: blur(20px);
  
  /* Glowing Accent Colors */
  --cyan-glow: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.25);
  
  --purple-glow: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.25);

  --pink-glow: #ec4899;
  --pink-dim: rgba(236, 72, 153, 0.25);

  --amber-glow: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.25);

  --emerald-glow: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.25);

  --lime-glow: #a3e635;
  --lime-dim: rgba(163, 230, 53, 0.25);

  --reverb-glow: #2dd4bf;
  --reverb-dim: rgba(45, 212, 191, 0.25);
  --pitch-glow: #fb7185;
  --pitch-dim: rgba(251, 113, 133, 0.25);

  --comb-glow: #f97316;
  --comb-dim: rgba(249, 115, 22, 0.25);

  --vibrato-glow: #3b82f6;
  --vibrato-dim: rgba(59, 130, 246, 0.25);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --transition-speed: 0.25s;
}

/* Reset Defaults */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

/* Elegant Focus States for Premium Aesthetics & Accessibility */
button:focus,
select:focus,
input[type="range"]:focus,
input[type="checkbox"]:focus {
  outline: none;
}

button:focus-visible,
select:focus-visible,
input[type="range"]:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* Specific glows for major controls on keyboard focus */
#tab-synth:focus-visible {
  outline-color: var(--cyan-glow);
  box-shadow: 0 0 12px var(--cyan-dim);
}

#tab-effects:focus-visible {
  outline-color: var(--emerald-glow);
  box-shadow: 0 0 12px var(--emerald-dim);
}

#tab-sequencer:focus-visible,
#tab-midi:focus-visible,
.debug-btn:focus-visible {
  outline-color: var(--purple-glow);
  box-shadow: 0 0 12px var(--purple-dim);
}

#enable-midi-btn:focus-visible {
  outline-color: var(--amber-glow);
  box-shadow: 0 0 12px var(--amber-dim);
}

.bypass-btn:focus-visible,
.power-btn:focus-visible {
  outline-color: var(--pink-glow);
  box-shadow: 0 0 12px var(--pink-dim);
}

html {
  font-size: 80%;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

/* Welcome Overlay */
.welcome-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(2, 6, 23, 0.96);
  backdrop-filter: blur(35px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px;
  transition: opacity 0.5s ease, visibility 0.5s;
}

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

.welcome-logo {
  font-size: 3.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--cyan-glow), var(--purple-glow) 50%, var(--pink-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  text-shadow: 0 0 45px rgba(139, 92, 246, 0.25);
}

.welcome-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.welcome-desc {
  max-width: 520px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 36px;
  font-size: 0.95rem;
}

.welcome-btn {
  background: transparent;
  color: #fff;
  border: 1px solid var(--cyan-glow);
  padding: 11px 35px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
}

.welcome-btn:hover {
  background: var(--cyan-glow);
  color: #000;
  box-shadow: 0 0 35px var(--cyan-glow);
  transform: translateY(-2px);
}

/* Inline error shown under the Enter Studio button when audio init fails */
.welcome-error {
  margin-top: 22px;
  max-width: 520px;
  padding: 12px 18px;
  border: 1px solid #ef4444;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.welcome-error[hidden] { display: none; }

/* Top-center non-blocking notice banner (warnings / errors) */
.app-notice {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(620px, 92vw);
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--cyan-glow);
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.app-notice[hidden] { display: none; }

.app-notice.warn {
  border-color: #f59e0b;
  color: #fcd34d;
}

.app-notice.error {
  border-color: #ef4444;
  color: #fca5a5;
}

/* FULL VIEWPORT CSS GRID LAYOUT */
.app-layout {
  display: grid;
  grid-template-areas: 
    "header header"
    "content rightbar"
    "footer footer";
  grid-template-rows: 64px 1fr 190px; /* Header, Scrollable Content, Static Keyboard Footer */
  grid-template-columns: 1fr 280px;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.app-layout.disabled {
  filter: blur(10px);
  pointer-events: none;
}

/* Scanline/CRT retro visualizer screen layer */
.app-layout::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
  background-size: 100% 4px;
  z-index: 99;
  pointer-events: none;
  opacity: 0.3;
}

/* STATIC HEADER */
.app-header {
  grid-area: header;
  background: rgba(10, 15, 30, 0.7);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 19px;
  z-index: 5;
}

/* PRESET MANAGER styling */
.preset-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.02);
}

.preset-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--cyan-glow);
  letter-spacing: 0.1em;
  text-shadow: 0 0 5px rgba(0, 242, 254, 0.2);
}

.preset-controls-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.preset-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  min-width: 140px;
  transition: all 0.2s ease;
}

.preset-select:hover {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 6px rgba(0, 242, 254, 0.15);
}

.preset-btn {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
}

.preset-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.35);
  border-color: var(--purple-glow);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.preset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
  background: transparent;
}

.logo-section h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(to right, var(--cyan-glow), var(--purple-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-section span {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 15px;
}


.perf-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 12px;
  border-radius: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.perf-item {
  color: var(--text-secondary);
  user-select: text;
}

.perf-item span {
  color: var(--cyan-glow);
  font-weight: bold;
  text-shadow: 0 0 6px var(--cyan-dim);
}


/* SCROLLABLE MAIN CONTENT (Central Rack) */
.app-content {
  grid-area: content;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  padding: 19px;
}

.synth-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

/* STATIC RIGHT BAR */
.app-rightbar {
  grid-area: rightbar;
  background: rgba(8, 12, 24, 0.85);
  border-left: 1px solid var(--panel-border);
  backdrop-filter: blur(15px);
  padding: 19px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 4;
  overflow-y: auto;
}

.rightbar-widget {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 13px;
}

.widget-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 5px;
}

/* Stereo Level Meter Styling */
.meter-container {
  display: flex;
  gap: 16px;
  height: 180px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  justify-content: center;
  flex: 1; /* Stretch to fill rest of width */
}

/* Master Volume Styles */
.meter-widget-layout {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.master-volume-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 180px; /* matches .meter-container */
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: 60px; /* nice compact width */
}

.master-vol-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.master-vol-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  color: var(--cyan-glow);
  font-weight: bold;
  user-select: text;
}

.vertical-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 6px;
  height: 95px; /* adjusted to make room for Limiter button */
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  outline: none;
  writing-mode: vertical-lr;
  direction: rtl;
  cursor: pointer;
}

.vertical-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan-glow);
  box-shadow: 0 0 10px var(--cyan-glow);
  transition: transform 0.15s ease;
}

.vertical-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.meter-scale {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 24px;
  height: 100%;
  user-select: none;
}

.meter-scale-markers {
  position: relative;
  width: 100%;
  flex: 1;
  margin-top: 1px;
  margin-bottom: 1px;
}

.meter-scale-markers .marker {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  transform: translateY(50%);
  line-height: 1;
}

.meter-tick {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 5;
  pointer-events: none;
}

.meter-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  height: 100%;
}

.meter-track {
  position: relative;
  width: 100%;
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.meter-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, #10b981 0%, #10b981 60%, #f59e0b 80%, #ef4444 100%);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.85) 3px,
    rgba(0, 0, 0, 0.85) 5px
  ),
  linear-gradient(to top, #10b981 0%, #10b981 60%, #f59e0b 80%, #ef4444 100%);
  opacity: 0.95;
  clip-path: inset(100% 0 0 0); /* initially fully hidden */
  transition: clip-path 0.04s ease;
}

.meter-peak {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #f43f5e;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
  bottom: 0%; /* dynamically updated in app.js */
  transition: bottom 0.1s linear;
  z-index: 10;
}

.meter-channel span {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Settings List Panel */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.settings-item span, .settings-item label {
  color: var(--text-muted);
}

.settings-item strong {
  color: var(--text-secondary);
  font-family: 'Share Tech Mono', monospace;
  user-select: text;
}

.settings-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}

.settings-select option {
  background: #0d121f;
  color: var(--text-primary);
}

/* Rotary Knob Component Styling */
.knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 50px;
  justify-content: center;
}

.knob {
  width: 26px;
  height: 26px;
  position: relative;
  cursor: ns-resize; /* North-South resize cursor fits dragging up/down */
  user-select: none;
}

.knob-dial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #161e2e 0%, #0a0d18 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.5);
  position: relative;
  transform-origin: center center;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.knob:hover .knob-dial {
  border-color: rgba(255, 255, 255, 0.25);
}

.knob.active .knob-dial {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.knob-pointer {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 2px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  transform: translateX(-50%);
  border-radius: 1px;
  transition: background var(--transition-speed) ease;
}

.knob.active .knob-pointer, .knob:hover .knob-pointer {
  background: var(--cyan-glow);
  box-shadow: 0 0 3px var(--cyan-glow);
}

.knob-value {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
  display: inline-block;
  margin-top: 1px;
}

/* RACK MODULES & PANELS */
.rack-module {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: var(--panel-blur);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-speed) ease;
}

/* Powered OFF Module Card state - dimmer glassmorphism, no borders */
.rack-module.powered-off {
  opacity: 0.35;
  border-left-color: rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  filter: saturate(0.4);
}
.rack-module.powered-off .module-title {
  color: var(--text-muted) !important;
}

.patch-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.patch-selector label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.io-select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  width: 160px;
  transition: border-color var(--transition-speed) ease;
}

.io-select:hover, .io-select:focus {
  border-color: var(--cyan-glow);
}

.io-select option {
  background: #0d121f;
  color: var(--text-primary);
}

.patch-selectors-container {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.patch-selectors-container .patch-selector {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.patch-selectors-container .patch-selector label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.patch-selectors-container .io-select {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 4px 6px;
  font-size: 0.76rem;
}

.mixer-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.mixer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mixer-row label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 35px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.mixer-row.mixer-out-row {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mixer-inputs-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.mixer-inputs-group .io-select {
  width: 80px;
  font-size: 0.74rem;
  padding: 3px 6px;
  flex-shrink: 0;
}

.mixer-inputs-group .param-slider {
  flex: 1;
  height: 4px;
}

.mixer-inputs-group .param-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}



/* Color schemes for specific modules borders and text */
.mod-1 { grid-column: span 4; border-left: 2px solid var(--cyan-glow); }
.mod-1 .module-title { color: var(--cyan-glow); }
.mod-2 { grid-column: span 4; border-left: 2px solid var(--purple-glow); }
.mod-2 .module-title { color: var(--purple-glow); }
.mod-3 { grid-column: span 4; border-left: 2px solid var(--purple-glow); }
.mod-3 .module-title { color: var(--purple-glow); }

.mod-4 { grid-column: span 4; border-left: 2px solid var(--pink-glow); }
.mod-4 .module-title { color: var(--pink-glow); }
.mod-5 { grid-column: span 4; border-left: 2px solid var(--pink-glow); }
.mod-5 .module-title { color: var(--pink-glow); }
.mod-6 { grid-column: span 4; border-left: 2px solid var(--amber-glow); }
.mod-6 .module-title { color: var(--amber-glow); }

.mod-7 { grid-column: span 4; border-left: 2px solid var(--cyan-glow); }
.mod-7 .module-title { color: var(--cyan-glow); }
.mod-8 { grid-column: span 4; border-left: 2px solid var(--purple-glow); }
.mod-8 .module-title { color: var(--purple-glow); }
.mod-9 { grid-column: span 4; border-left: 2px solid var(--pink-glow); }
.mod-9 .module-title { color: var(--pink-glow); }

.rack-module::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.module-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-title i {
  font-style: normal;
  color: inherit;
}

.module-header-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Bypass Button Style */
.bypass-btn {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 6px;
  min-width: 20px;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-speed) ease;
}

.bypass-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-secondary);
}

/* Bypassed active state - warm amber glow */
.bypass-btn.active {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-glow);
  border-color: var(--amber-glow);
  box-shadow: 0 0 10px var(--amber-dim);
}

.bypass-btn.active:hover {
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 15px var(--amber-glow);
}

/* Power Button Style */
.power-btn {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 6px;
  min-width: 32px;
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-speed) ease;
}

.power-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-secondary);
}

/* Power ON state - vibrant emerald green glow */
.power-btn.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-glow);
  border-color: var(--emerald-glow);
  box-shadow: 0 0 10px var(--emerald-dim);
}

.power-btn.active:hover {
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 15px var(--emerald-glow);
}

/* Module Type Selector Dropdown */
.mod-type-select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-speed) ease;
}

.mod-type-select:hover, .mod-type-select:focus {
  border-color: var(--cyan-glow);
}

.mod-type-select option {
  background: #0d121f;
  color: var(--text-primary);
}

/* Module body demo texts */
.module-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.module-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.module-body p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.module-body ul {
  padding-left: 16px;
}

.module-body li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.module-body li strong {
  color: var(--text-primary);
}



/* STATIC KEYBOARD & CONTROL FOOTER */
.app-footer {
  grid-area: footer;
  background: rgba(6, 8, 16, 0.96);
  border-top: 1px solid var(--panel-border);
  backdrop-filter: blur(25px);
  display: flex;
  gap: 24px;
  padding: 13px 19px;
  z-index: 5;
  align-items: center;
  height: 100%;
}

/* Pitch & Mod Wheels controls styling */
.keyboard-controls {
  display: flex;
  gap: 16px;
  height: 100%;
  align-items: center;
}

.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  width: 40px;
}

.wheel-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.wheel-track {
  width: 28px;
  flex: 1;
  background: #03050a;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
}

.wheel-center-line {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.wheel-handle {
  width: 20px;
  height: 54px;
  background: linear-gradient(to bottom, #1e293b 0%, #3b4f6e 50%, #1e293b 100%);
  border: 1px solid rgba(0,0,0,0.6);
  border-radius: 4px;
  cursor: ns-resize;
  position: absolute;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.wheel-ridges {
  height: 100%;
  width: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.45) 3px,
    rgba(0, 0, 0, 0.45) 5px
  );
  border-radius: 4px;
}

/* Glowing center marker on handles */
.wheel-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 2px;
  background: var(--cyan-glow);
  box-shadow: 0 0 6px var(--cyan-glow);
  transform: translateY(-50%);
  pointer-events: none;
}

.mod-wheel.wheel-handle::after {
  background: var(--pink-glow);
  box-shadow: 0 0 6px var(--pink-glow);
}

/* Position wheels defaults */
.pitch-bend-wheel {
  top: calc(50% - 27px); /* Centered by default */
}
.mod-wheel {
  bottom: 0; /* Rests at bottom */
}

/* Piano Keybed container */
.piano-keyboard {
  flex: 1;
  display: flex;
  position: relative;
  height: 100%;
  background: #04060b;
  border-radius: 12px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* White Key Design */
.piano-key.white-key {
  flex: 1;
  background: linear-gradient(to bottom, #f8fafc 0%, #cbd5e1 100%);
  border-right: 1px solid #64748b;
  border-bottom: 5px solid #94a3b8;
  border-radius: 0 0 6px 6px;
  position: relative;
  z-index: 1;
}

.piano-key.white-key:last-child {
  border-right: none;
}

/* Black Key Design */
.piano-key.black-key {
  position: absolute;
  width: 2.2%;
  height: 60%;
  background: linear-gradient(to bottom, #1e293b 0%, #020617 100%);
  border-bottom: 5px solid #000;
  border-radius: 0 0 4px 4px;
  z-index: 2;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.45);
  margin-left: -1.1%;
}

/* Mapping offset locations for black keys (4 Octaves: 29 white keys spacing) */
/* Octave 1 */
.piano-key[data-note="37"] { left: 3.45%; }
.piano-key[data-note="39"] { left: 6.90%; }
.piano-key[data-note="42"] { left: 13.79%; }
.piano-key[data-note="44"] { left: 17.24%; }
.piano-key[data-note="46"] { left: 20.69%; }

/* Octave 2 */
.piano-key[data-note="49"] { left: 27.59%; }
.piano-key[data-note="51"] { left: 31.03%; }
.piano-key[data-note="54"] { left: 37.93%; }
.piano-key[data-note="56"] { left: 41.38%; }
.piano-key[data-note="58"] { left: 44.83%; }

/* Octave 3 */
.piano-key[data-note="61"] { left: 51.72%; }
.piano-key[data-note="63"] { left: 55.17%; }
.piano-key[data-note="66"] { left: 62.07%; }
.piano-key[data-note="68"] { left: 65.52%; }
.piano-key[data-note="70"] { left: 68.97%; }

/* Octave 4 */
.piano-key[data-note="73"] { left: 75.86%; }
.piano-key[data-note="75"] { left: 79.31%; }
.piano-key[data-note="78"] { left: 86.21%; }
.piano-key[data-note="80"] { left: 89.66%; }
.piano-key[data-note="82"] { left: 93.10%; }

/* Key label overlays */
.key-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
  font-weight: 600;
  text-transform: uppercase;
}

.piano-key.black-key .key-label {
  bottom: 6px;
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* RESPONSIVE LAYOUT OVERRIDES */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-areas: 
      "header"
      "content"
      "rightbar"
      "footer";
    grid-template-rows: 64px 1fr auto 190px;
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .app-rightbar {
    border-left: none;
    border-top: 1px solid var(--panel-border);
    flex-direction: row;
    justify-content: space-between;
    height: auto;
    overflow-y: visible;
  }
  .rightbar-widget {
    flex: 1;
  }
  .meter-container {
    height: 100px;
  }
}

@media (max-width: 768px) {
  .mod-1, .mod-2, .mod-3, .mod-4, .mod-5, .mod-6, .mod-7, .mod-8, .mod-9 {
    grid-column: span 12;
  }
  .app-rightbar {
    flex-direction: column;
  }
  .keyboard-controls {
    display: none; /* Hide wheels on very narrow screens for piano space */
  }
}

.hidden {
  display: none !important;
}

.param-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.param-control label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 70px; /* Increased fixed width to align sliders without wrapping */
  flex-shrink: 0;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1; /* Take up remaining horizontal space */
}

/* Custom range input styling */
.param-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 0, 0, 0.4);
  height: 6px;
  border-radius: 3px;
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.param-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Slider Thumb Color Coding per Module Accent */
.mod-1 .param-slider::-webkit-slider-thumb { background: var(--cyan-glow); box-shadow: 0 0 8px var(--cyan-glow); }
.mod-2 .param-slider::-webkit-slider-thumb { background: var(--purple-glow); box-shadow: 0 0 8px var(--purple-glow); }
.mod-3 .param-slider::-webkit-slider-thumb { background: var(--purple-glow); box-shadow: 0 0 8px var(--purple-glow); }
.mod-4 .param-slider::-webkit-slider-thumb { background: var(--pink-glow); box-shadow: 0 0 8px var(--pink-glow); }
.mod-5 .param-slider::-webkit-slider-thumb { background: var(--pink-glow); box-shadow: 0 0 8px var(--pink-glow); }
.mod-6 .param-slider::-webkit-slider-thumb { background: var(--amber-glow); box-shadow: 0 0 8px var(--amber-glow); }
.mod-7 .param-slider::-webkit-slider-thumb { background: var(--cyan-glow); box-shadow: 0 0 8px var(--cyan-glow); }
.mod-8 .param-slider::-webkit-slider-thumb { background: var(--purple-glow); box-shadow: 0 0 8px var(--purple-glow); }
.mod-9 .param-slider::-webkit-slider-thumb { background: var(--pink-glow); box-shadow: 0 0 8px var(--pink-glow); }

.param-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  width: 55px;
  text-align: right;
  user-select: text;
}

/* Waveform buttons selector */
.wave-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
}

.wave-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.wave-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.wave-btn svg {
  stroke: var(--text-muted);
  transition: stroke var(--transition-speed) ease;
}

.wave-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.wave-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Accent glowing wave SVGs based on module color */
.mod-1 .wave-btn.active svg { stroke: var(--cyan-glow); filter: drop-shadow(0 0 4px var(--cyan-glow)); }
.mod-2 .wave-btn.active svg { stroke: var(--purple-glow); filter: drop-shadow(0 0 4px var(--purple-glow)); }
.mod-3 .wave-btn.active svg { stroke: var(--purple-glow); filter: drop-shadow(0 0 4px var(--purple-glow)); }
.mod-4 .wave-btn.active svg { stroke: var(--pink-glow); filter: drop-shadow(0 0 4px var(--pink-glow)); }
.mod-5 .wave-btn.active svg { stroke: var(--pink-glow); filter: drop-shadow(0 0 4px var(--pink-glow)); }
.mod-6 .wave-btn.active svg { stroke: var(--amber-glow); filter: drop-shadow(0 0 4px var(--amber-glow)); }
.mod-7 .wave-btn.active svg { stroke: var(--cyan-glow); filter: drop-shadow(0 0 4px var(--cyan-glow)); }
.mod-8 .wave-btn.active svg { stroke: var(--purple-glow); filter: drop-shadow(0 0 4px var(--purple-glow)); }
.mod-9 .wave-btn.active svg { stroke: var(--pink-glow); filter: drop-shadow(0 0 4px var(--pink-glow)); }

/* Master Limiter Button Styling */
.lim-btn {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-speed) ease;
  margin: 4px 0;
  width: 44px;
  text-align: center;
}

.lim-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-secondary);
}

.lim-btn.active {
  background: rgba(239, 68, 68, 0.15); /* Red/coral tint */
  color: #f87171; /* red-400 */
  border-color: #ef4444; /* red-500 */
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.lim-btn.active:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.6);
}

/* Envelope controls toggle button (ADSR curve icon) */
.env-toggle-btn {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  vertical-align: middle;
  margin-left: 6px;
  border-radius: 4px;
}
.env-toggle-btn:hover {
  opacity: 1.0;
  transform: scale(1.15);
}
.env-toggle-btn.active {
  opacity: 1.0;
  color: inherit;
  filter: drop-shadow(0 0 5px currentColor);
}
.env-icon {
  width: 13px;
  height: 13px;
}

/* Tabs switcher for envelopes */
.env-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}
.env-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 2px 4px;
  position: relative;
  transition: all var(--transition-speed) ease;
}
.env-tab-btn:hover {
  color: var(--text-secondary);
}
.env-tab-btn.active {
  color: var(--text-primary);
}
.env-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor; /* Matches the parent module title color */
}

/* Noise Generator Controls Styling */
.noise-buttons, .noise-filter-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
}

.noise-btn, .noise-filter-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.noise-btn:not(:last-child), .noise-filter-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.noise-btn:hover, .noise-filter-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.noise-btn.active, .noise-filter-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: bold;
}

/* Accent glow for Noise & Filter buttons based on active color */
.mod-1 .noise-btn.active, .mod-1 .noise-filter-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-2 .noise-btn.active, .mod-2 .noise-filter-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-3 .noise-btn.active, .mod-3 .noise-filter-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-4 .noise-btn.active, .mod-4 .noise-filter-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-5 .noise-btn.active, .mod-5 .noise-filter-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-6 .noise-btn.active, .mod-6 .noise-filter-btn.active { color: var(--amber-glow); text-shadow: 0 0 6px var(--amber-dim); }
.mod-7 .noise-btn.active, .mod-7 .noise-filter-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-8 .noise-btn.active, .mod-8 .noise-filter-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-9 .noise-btn.active, .mod-9 .noise-filter-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }

/* Shaper Module Controls Styling */
.shaper-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
}

.shaper-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.shaper-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.shaper-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.shaper-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: bold;
}

/* Accent glow for Shaper buttons based on active color */
.mod-1 .shaper-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-2 .shaper-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-3 .shaper-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-4 .shaper-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-5 .shaper-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-6 .shaper-btn.active { color: var(--amber-glow); text-shadow: 0 0 6px var(--amber-dim); }
.mod-7 .shaper-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-8 .shaper-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-9 .shaper-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }

/* Filter Module Controls Styling */
.filter-type-slope-control {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 4px;
}

.filter-buttons, .filter-slope-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.filter-buttons {
  flex: 7;
}

.filter-slope-buttons {
  flex: 4;
}

.filter-btn, .filter-slope-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.filter-btn:not(:last-child), .filter-slope-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.filter-btn:hover, .filter-slope-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.filter-btn.active, .filter-slope-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: bold;
}

/* Accent glow for Filter buttons based on active color */
.mod-1 .filter-btn.active, .mod-1 .filter-slope-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-2 .filter-btn.active, .mod-2 .filter-slope-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-3 .filter-btn.active, .mod-3 .filter-slope-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-4 .filter-btn.active, .mod-4 .filter-slope-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-5 .filter-btn.active, .mod-5 .filter-slope-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-6 .filter-btn.active, .mod-6 .filter-slope-btn.active { color: var(--amber-glow); text-shadow: 0 0 6px var(--amber-dim); }
.mod-7 .filter-btn.active, .mod-7 .filter-slope-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-8 .filter-btn.active, .mod-8 .filter-slope-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-9 .filter-btn.active, .mod-9 .filter-slope-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }

/* ==========================================================================
   LFO MODULE CONTROLS
   ========================================================================== */
.lfo-toggle-btn {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  vertical-align: middle;
  margin-left: 6px;
  border-radius: 4px;
}
.lfo-toggle-btn:hover {
  opacity: 1.0;
  transform: scale(1.15);
}
.lfo-toggle-btn.active {
  opacity: 1.0;
  color: inherit;
  filter: drop-shadow(0 0 5px currentColor);
}
.lfo-icon {
  width: 13px;
  height: 13px;
}

.lfo-shape-sync-control {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 4px;
}

.lfo-shape-buttons, .lfo-range-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.lfo-shape-buttons {
  flex: 7;
}

.lfo-range-buttons {
  width: 100%;
}

.lfo-shape-btn, .lfo-range-btn, .lfo-sync-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.lfo-sync-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  margin-left: 6px;
  padding: 2px 4px;
  font-size: 0.7rem;
  min-width: 44px;
}

.lfo-shape-btn:not(:last-child), .lfo-range-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.lfo-shape-btn:hover, .lfo-range-btn:hover, .lfo-sync-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.lfo-shape-btn.active, .lfo-range-btn.active, .lfo-sync-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: bold;
}

/* Accent colors for module button active states */
.mod-1 .lfo-shape-btn.active, .mod-1 .lfo-range-btn.active, .mod-1 .lfo-sync-btn.active, .mod-1 .lfo-toggle-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-2 .lfo-shape-btn.active, .mod-2 .lfo-range-btn.active, .mod-2 .lfo-sync-btn.active, .mod-2 .lfo-toggle-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-3 .lfo-shape-btn.active, .mod-3 .lfo-range-btn.active, .mod-3 .lfo-sync-btn.active, .mod-3 .lfo-toggle-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-4 .lfo-shape-btn.active, .mod-4 .lfo-range-btn.active, .mod-4 .lfo-sync-btn.active, .mod-4 .lfo-toggle-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-5 .lfo-shape-btn.active, .mod-5 .lfo-range-btn.active, .mod-5 .lfo-sync-btn.active, .mod-5 .lfo-toggle-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-6 .lfo-shape-btn.active, .mod-6 .lfo-range-btn.active, .mod-6 .lfo-sync-btn.active, .mod-6 .lfo-toggle-btn.active { color: var(--amber-glow); text-shadow: 0 0 6px var(--amber-dim); }
.mod-7 .lfo-shape-btn.active, .mod-7 .lfo-range-btn.active, .mod-7 .lfo-sync-btn.active, .mod-7 .lfo-toggle-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-8 .lfo-shape-btn.active, .mod-8 .lfo-range-btn.active, .mod-8 .lfo-sync-btn.active, .mod-8 .lfo-toggle-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-9 .lfo-shape-btn.active, .mod-9 .lfo-range-btn.active, .mod-9 .lfo-sync-btn.active, .mod-9 .lfo-toggle-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }

/* LFO Mod assign view styles */
.lfo-mod-assign select {
  font-family: 'Share Tech Mono', monospace;
  outline: none;
}
.lfo-mod-assign select:focus {
  border-color: #fff !important;
}

/* ==========================================================================
   MODULATOR MODULE CONTROLS
   ========================================================================== */
.modulator-in-selectors {
  display: flex;
  gap: 8px;
  width: 100%;
}

.modulator-in-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.modulator-in-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'Share Tech Mono', monospace;
}

.modulator-in-group select {
  flex: 1;
  min-width: 0;
  font-family: 'Share Tech Mono', monospace;
}

.modulator-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bitcrusher-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modulator-mode-buttons,
.modulator-source-buttons,
.modulator-wave-buttons {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
}

.modulator-mode-btn,
.modulator-source-btn,
.modulator-wave-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.modulator-mode-btn:not(:last-child),
.modulator-source-btn:not(:last-child),
.modulator-wave-btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.modulator-mode-btn:hover,
.modulator-source-btn:hover,
.modulator-wave-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.modulator-mode-btn.active,
.modulator-source-btn.active,
.modulator-wave-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: bold;
}

/* Modulator module active states with corresponding glowing neon colors per slot */
.mod-1 .modulator-mode-btn.active, .mod-1 .modulator-source-btn.active, .mod-1 .modulator-wave-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-2 .modulator-mode-btn.active, .mod-2 .modulator-source-btn.active, .mod-2 .modulator-wave-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-3 .modulator-mode-btn.active, .mod-3 .modulator-source-btn.active, .mod-3 .modulator-wave-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-4 .modulator-mode-btn.active, .mod-4 .modulator-source-btn.active, .mod-4 .modulator-wave-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-5 .modulator-mode-btn.active, .mod-5 .modulator-source-btn.active, .mod-5 .modulator-wave-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }
.mod-6 .modulator-mode-btn.active, .mod-6 .modulator-source-btn.active, .mod-6 .modulator-wave-btn.active { color: var(--amber-glow); text-shadow: 0 0 6px var(--amber-dim); }
.mod-7 .modulator-mode-btn.active, .mod-7 .modulator-source-btn.active, .mod-7 .modulator-wave-btn.active { color: var(--cyan-glow); text-shadow: 0 0 6px var(--cyan-dim); }
.mod-8 .modulator-mode-btn.active, .mod-8 .modulator-source-btn.active, .mod-8 .modulator-wave-btn.active { color: var(--purple-glow); text-shadow: 0 0 6px var(--purple-dim); }
.mod-9 .modulator-mode-btn.active, .mod-9 .modulator-source-btn.active, .mod-9 .modulator-wave-btn.active { color: var(--pink-glow); text-shadow: 0 0 6px var(--pink-dim); }


/* ==========================================================================
   Step Sequencer Styles
   ========================================================================== */

/* Header Button for Sequencer Toggle */
.header-btn {
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all var(--transition-speed) ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.header-btn.active {
  background: var(--purple-dim);
  color: var(--purple-glow);
  border-color: var(--purple-glow);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

#tab-synth.active {
  background: var(--cyan-dim);
  color: var(--cyan-glow);
  border-color: var(--cyan-glow);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

#tab-effects.active {
  background: var(--emerald-dim);
  color: var(--emerald-glow);
  border-color: var(--emerald-glow);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* MIDI Button */
.midi-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.midi-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.midi-btn.active .midi-status-dot {
  background: var(--amber-glow);
  box-shadow: 0 0 6px var(--amber-glow), 0 0 12px rgba(245, 158, 11, 0.3);
  animation: midi-pulse 2s ease-in-out infinite;
}

.midi-btn.active {
  background: var(--amber-dim);
  color: var(--amber-glow);
  border-color: var(--amber-glow);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.midi-btn.midi-error {
  border-color: #ef4444;
  color: #ef4444;
}

.midi-btn.midi-error .midi-status-dot {
  background: #ef4444;
}

@keyframes midi-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Debug Button + Panel */
.debug-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.debug-btn.active {
  background: rgba(139, 92, 246, 0.18);
  color: var(--purple-glow);
  border-color: var(--purple-glow);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.debug-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
}

.debug-badge.hidden {
  display: none;
}

/* ==========================================================================
   MIDI GRID & LED INDICATOR STYLES
   ========================================================================== */

.midi-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
  background: var(--panel-bg);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: var(--panel-blur);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.midi-grid.hidden {
  display: none !important;
}

.midi-col-monitor {
  grid-column: span 2;
}

.midi-panel {
  background: rgba(10, 12, 22, 0.65);
  border: 1px solid rgba(236, 72, 153, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(236, 72, 153, 0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.midi-panel:hover {
  border-color: rgba(236, 72, 153, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(236, 72, 153, 0.12);
}

.midi-panel-title {
  margin: 0;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.08) 0%, rgba(0,0,0,0) 100%);
  border-bottom: 1px solid rgba(236, 72, 153, 0.15);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: var(--pink-glow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--pink-dim);
}

.midi-panel-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* LED Indicators in Header */
.midi-activity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 15px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.midi-led {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  user-select: none;
}

.midi-led-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27272a;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.5);
  transition: background 0.1s ease, box-shadow 0.1s ease;
}

#midi-led-in .midi-led-dot.active {
  background: var(--cyan-glow);
  box-shadow: 0 0 8px var(--cyan-glow), 0 0 16px var(--cyan-glow);
}

#midi-led-out .midi-led-dot.active {
  background: var(--pink-glow);
  box-shadow: 0 0 8px var(--pink-glow), 0 0 16px var(--pink-glow);
}

/* MIDI Setup Styles */
.midi-status-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.midi-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.midi-status-label {
  color: var(--text-muted);
}

.midi-status-value {
  color: var(--text-primary);
}

.midi-status-value.ok {
  color: var(--emerald-glow);
  text-shadow: 0 0 6px var(--emerald-dim);
}

.midi-status-value.error {
  color: #ef4444;
}

.midi-status-value.warn {
  color: var(--amber-glow);
}

.midi-action-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.midi-action-btn:hover {
  background: rgba(236, 72, 153, 0.15);
  color: var(--text-primary);
  border-color: var(--pink-glow);
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.2);
}

.midi-action-btn.primary-action {
  background: rgba(236, 72, 153, 0.1);
  border-color: rgba(236, 72, 153, 0.3);
  color: var(--pink-glow);
  font-weight: 700;
}

.midi-action-btn.primary-action:hover {
  background: var(--pink-glow);
  color: #000;
  border-color: var(--pink-glow);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.6);
}

.midi-action-btn.primary-action.active {
  background: var(--emerald-glow);
  color: #000;
  border-color: var(--emerald-glow);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.midi-control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.midi-control-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.midi-control-label {
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.midi-select {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.midi-select:focus {
  border-color: var(--pink-glow);
  box-shadow: 0 0 6px var(--pink-dim);
}

/* Modulation Matrix Styles */
.midi-matrix-header {
  display: grid;
  grid-template-columns: 90px 1.2fr 1fr;
  gap: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.midi-matrix-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.midi-matrix-row {
  display: grid;
  grid-template-columns: 90px 1.2fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.midi-matrix-row:last-child {
  border-bottom: none;
}

.mod-source-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.mod-amount-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mod-amount-ctrl input[type="range"] {
  flex: 1;
  accent-color: var(--pink-glow);
  background: rgba(0, 0, 0, 0.3);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

.mod-matrix-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--pink-glow);
  min-width: 38px;
  text-align: right;
}

/* MIDI Monitor Styles */
.midi-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.midi-log {
  flex: 1;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.74rem;
  line-height: 1.4;
  cursor: text;
}

.midi-log:focus {
  outline: 1px solid var(--pink-glow);
  box-shadow: 0 0 6px var(--pink-dim);
}

.midi-monitor-options {
  display: flex;
  gap: 16px;
  padding: 4px 0;
}

.midi-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.midi-checkbox-label input[type="checkbox"] {
  accent-color: var(--pink-glow);
}

.midi-monitor-actions {
  display: flex;
  gap: 10px;
}

.midi-monitor-actions button {
  flex: 1;
}

.midi-line {
  display: grid;
  grid-template-columns: 86px 56px 1fr 22px;
  column-gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  word-break: break-word;
  position: relative;
}

.midi-line:hover {
  background: rgba(236, 72, 153, 0.06);
}

.midi-line:last-child {
  border-bottom: none;
}

.midi-line-ts {
  color: var(--text-muted);
}

.midi-line-lvl {
  font-weight: 700;
  letter-spacing: 0.06em;
}

.midi-line-msg {
  color: var(--text-primary);
}

.midi-line-data {
  grid-column: 3 / 4;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding-left: 0;
  padding-top: 2px;
}

.midi-line-copy {
  grid-column: 4 / 5;
  grid-row: 1;
  align-self: start;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 1px 3px;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.midi-line:hover .midi-line-copy {
  opacity: 0.7;
}

.midi-line-copy:hover {
  opacity: 1;
  color: var(--emerald-glow);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
}

.midi-line-copy.copied {
  opacity: 1;
  color: #062f24;
  background: var(--emerald-glow);
  border-color: var(--emerald-glow);
}

.midi-line-copy svg {
  display: block;
}

.midi-line.lvl-info .midi-line-lvl { color: #60a5fa; }
.midi-line.lvl-ok   .midi-line-lvl { color: var(--emerald-glow); }
.midi-line.lvl-warn .midi-line-lvl { color: var(--amber-glow); }
.midi-line.lvl-error .midi-line-lvl { color: #ef4444; }
.midi-line.lvl-data .midi-line-lvl { color: var(--purple-glow); }

.midi-line.lvl-error .midi-line-msg { color: #fca5a5; }
.midi-line.lvl-warn  .midi-line-msg { color: #fcd34d; }

.midi-log,
.midi-log * {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* Sequencer Expandable Panel Container */
.sequencer-container {
  width: 100%;
  background: var(--panel-bg);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: var(--panel-blur);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  z-index: 10;
}

.sequencer-container.hidden {
  display: none !important;
}

/* Sequencer Toolbar Controls */
.seq-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.seq-controls-left, .seq-controls-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.seq-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.seq-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.seq-btn.play-btn {
  background: var(--emerald-dim);
  color: var(--emerald-glow);
  border-color: var(--emerald-glow);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 6px 16px;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.seq-btn.play-btn.active {
  background: var(--pink-dim);
  color: var(--pink-glow);
  border-color: var(--pink-glow);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

.seq-btn.clear-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.seq-btn.clear-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.seq-param-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.seq-param-group label {
  letter-spacing: 0.05em;
}

.seq-slider {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.seq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan-glow);
  box-shadow: 0 0 6px var(--cyan-glow);
  transition: transform 0.1s;
}

.seq-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.seq-val-display {
  display: inline-block;
  min-width: 30px;
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
}

.seq-select {
  background: #0f172a;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.seq-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

/* Sequencer Steps Grid */
.seq-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 6px;
  width: 100%;
}

.seq-step-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px 4px;
  border-radius: 6px;
  transition: all var(--transition-speed) ease;
}

.seq-step-col:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Active current step column accent */
.seq-step-col.active-step {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.seq-step-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.8);
  transition: background-color 0.05s ease, box-shadow 0.05s ease;
}

/* Glowing LED when the playhead passes it */
.seq-step-led.active {
  background: var(--pink-glow);
  box-shadow: 0 0 8px var(--pink-glow), 0 0 16px var(--pink-glow);
}

.seq-gate-btn {
  width: 100%;
  max-width: 44px;
  height: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.seq-gate-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.seq-gate-btn.active {
  background: var(--cyan-dim);
  color: var(--cyan-glow);
  border-color: var(--cyan-glow);
  box-shadow: 0 0 8px var(--cyan-dim);
  text-shadow: 0 0 4px var(--cyan-glow);
  font-weight: bold;
}

.seq-note-select {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  padding: 3px 2px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  text-align: center;
}

.seq-note-select:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.seq-note-select option {
  background: #0f172a;
  color: var(--text-primary);
}

/* Velocity controls */
.seq-vel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
}

.seq-vel-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.seq-vel-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1px;
  outline: none;
  cursor: pointer;
}

.seq-vel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: background-color 0.1s;
}

.seq-vel-slider:hover::-webkit-slider-thumb {
  background: var(--purple-glow);
  box-shadow: 0 0 4px var(--purple-glow);
}

.seq-gate-btn.active + .seq-note-select {
  color: var(--text-primary);
}

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

/* Effects tab layout grid */
.effects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

/* ============================================================
   FX CHAIN — schematic signal-flow overview above the effects.
   Drag nodes to reorder the master chain; click a node to
   toggle that effect's power. Per-effect colours are injected
   inline via --node-color / --node-dim on each .fx-node.
   ============================================================ */
.fx-chain-panel {
  grid-column: 1 / -1;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 15px 18px 8px;
  backdrop-filter: var(--panel-blur);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}

.fx-chain-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.fx-chain-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--cyan-glow), var(--purple-glow) 60%, var(--pink-glow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fx-chain-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fx-chain-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 8px 2px 12px;
}
.fx-chain-flow::-webkit-scrollbar { height: 6px; }
.fx-chain-flow::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
.fx-chain-flow::-webkit-scrollbar-track { background: transparent; }

/* Items (nodes + endpoints) carry the connecting arrow to the next item. */
.fx-chain-item {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.fx-chain-item:not(:last-child) { margin-right: 30px; }
.fx-chain-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -25px;
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--text-muted));
  transform: translateY(-50%);
  pointer-events: none;
}
.fx-chain-item:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px;
  width: 5px;
  height: 5px;
  border-top: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
  z-index: 1;
}

/* Draggable effect node */
.fx-node {
  --node-color: var(--cyan-glow);
  --node-dim: var(--cyan-dim);
  width: 84px;
  padding: 13px 8px 11px;
  border-radius: 13px;
  border: 1px solid var(--node-dim);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--node-dim), transparent 70%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.55), rgba(2, 6, 23, 0.45));
  color: var(--node-color);
  cursor: grab;
  transition: transform .18s ease, box-shadow .25s ease, opacity .25s ease,
              filter .25s ease, border-color .25s ease, background .25s ease;
}
.fx-node:hover {
  transform: translateY(-3px);
  border-color: var(--node-color);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 16px var(--node-dim);
}
.fx-node:active { cursor: grabbing; }

.fx-node-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--node-color);
  filter: drop-shadow(0 0 5px var(--node-dim));
}
.fx-node-icon svg { width: 100%; height: 100%; display: block; }

.fx-node-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--node-color);
  white-space: nowrap;
}

.fx-node-led {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--node-color);
  box-shadow: 0 0 6px var(--node-color), 0 0 2px var(--node-color);
}

/* Powered-off node — dim/desaturated but still visible & draggable */
.fx-node.off {
  opacity: 0.4;
  filter: saturate(0.25);
  border-color: rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.35));
}
.fx-node.off .fx-node-icon { filter: none; color: var(--text-muted); }
.fx-node.off .fx-node-label { color: var(--text-muted); }
.fx-node.off .fx-node-led {
  background: var(--text-muted);
  box-shadow: none;
  opacity: 0.5;
}
.fx-node.off:hover {
  opacity: 0.75;
  border-color: var(--node-dim);
}

/* Node being dragged */
.fx-node.dragging {
  opacity: 0.35;
  cursor: grabbing;
  transform: scale(0.95);
}

/* IN / OUT endpoints — neutral, not draggable */
.fx-endpoint {
  width: 62px;
  padding: 13px 6px 11px;
  color: var(--text-secondary);
}
.fx-endpoint .fx-node-icon {
  color: var(--text-secondary);
  filter: none;
}
.fx-endpoint .fx-node-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Sequencer tab layout grid */
.sequencer-grid {
  display: block;
}

.sequencer-grid.hidden {
  display: none !important;
}

/* Override container - now always visible inside its tab grid */
.sequencer-grid .sequencer-container {
  padding: 16px 0;
  border-top: none;
  border-bottom: none;
  box-shadow: none;
}

/* Master Chorus specific color border */
.mod-chorus {
  grid-column: span 4;
  border-left: 2px solid var(--emerald-glow);
}
.mod-chorus .module-title {
  color: var(--emerald-glow);
}
.mod-chorus .param-slider::-webkit-slider-thumb {
  background: var(--emerald-glow);
  box-shadow: 0 0 8px var(--emerald-glow);
}

/* Master Delay specific color border */
.mod-delay {
  grid-column: span 4;
  border-left: 2px solid var(--amber-glow);
}
.mod-delay .module-title {
  color: var(--amber-glow);
}
.mod-delay .param-slider::-webkit-slider-thumb {
  background: var(--amber-glow);
  box-shadow: 0 0 8px var(--amber-glow);
}

/* Master Flanger specific color border */
.mod-flanger {
  grid-column: span 4;
  border-left: 2px solid var(--pink-glow);
}
.mod-flanger .module-title {
  color: var(--pink-glow);
}
.mod-flanger .param-slider::-webkit-slider-thumb {
  background: var(--pink-glow);
  box-shadow: 0 0 8px var(--pink-glow);
}

/* Master Phaser specific color border */
.mod-phaser {
  grid-column: span 4;
  border-left: 2px solid var(--cyan-glow);
}
.mod-phaser .module-title {
  color: var(--cyan-glow);
}
.mod-phaser .param-slider::-webkit-slider-thumb {
  background: var(--cyan-glow);
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* Master Reverb specific color border */
.mod-reverb {
  grid-column: span 4;
  border-left: 2px solid var(--reverb-glow);
}
.mod-reverb .module-title {
  color: var(--reverb-glow);
}
.mod-reverb .param-slider::-webkit-slider-thumb {
  background: var(--reverb-glow);
  box-shadow: 0 0 8px var(--reverb-glow);
}

/* Master Pitch Shifter specific color border */
.mod-pitch {
  grid-column: span 4;
  border-left: 2px solid var(--pitch-glow);
}
.mod-pitch .module-title {
  color: var(--pitch-glow);
}
.mod-pitch .param-slider::-webkit-slider-thumb {
  background: var(--pitch-glow);
  box-shadow: 0 0 8px var(--pitch-glow);
}

.mod-vibrato {
  grid-column: span 4;
  border-left: 2px solid var(--vibrato-glow);
}
.mod-vibrato .module-title {
  color: var(--vibrato-glow);
}
.mod-vibrato .param-slider::-webkit-slider-thumb {
  background: var(--vibrato-glow);
  box-shadow: 0 0 8px var(--vibrato-glow);
}

/* Master Bitcrusher specific color border */
.mod-bitcrusher {
  grid-column: span 4;
  border-left: 2px solid var(--purple-glow);
}
.mod-bitcrusher .module-title {
  color: var(--purple-glow);
}
.mod-bitcrusher .param-slider::-webkit-slider-thumb {
  background: var(--purple-glow);
  box-shadow: 0 0 8px var(--purple-glow);
}

/* Master Wah-Wah specific color border */
.mod-wah {
  grid-column: span 4;
  border-left: 2px solid var(--lime-glow);
}
.mod-wah .module-title {
  color: var(--lime-glow);
}
.mod-wah .param-slider::-webkit-slider-thumb {
  background: var(--lime-glow);
  box-shadow: 0 0 8px var(--lime-glow);
}

/* Master Comb Filter specific color border */
.mod-comb {
  grid-column: span 4;
  border-left: 2px solid var(--comb-glow);
}
.mod-comb .module-title {
  color: var(--comb-glow);
}
.mod-comb .param-slider::-webkit-slider-thumb {
  background: var(--comb-glow);
  box-shadow: 0 0 8px var(--comb-glow);
}

/* Empty effects rack slot design */
.mod-placeholder {
  grid-column: span 4;
  opacity: 0.25;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 250px;
  filter: saturate(0.2);
}

.placeholder-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-muted);
}

.placeholder-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
}

.placeholder-graphic {
  width: 80px;
  height: 40px;
  color: var(--text-muted);
}

.placeholder-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Export WAV Modal Styles
   ========================================================================== */
.export-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.25s ease;
}

.export-modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.export-modal-content {
  background: rgba(10, 12, 22, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 16px;
  padding: 24px;
  width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.15);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  backdrop-filter: blur(25px);
}

.export-modal-title {
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.15rem;
  color: var(--purple-glow);
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.export-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-form-group label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.export-select {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-select:focus {
  border-color: var(--purple-glow);
  box-shadow: 0 0 8px var(--purple-dim);
}

.export-form-group.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  text-transform: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.export-form-group.checkbox-group input[type="checkbox"] {
  accent-color: var(--purple-glow);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.export-status-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.export-progress-bar {
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.export-progress-fill {
  background: linear-gradient(90deg, var(--purple-glow) 0%, var(--pink-glow) 100%);
  height: 100%;
  box-shadow: 0 0 8px var(--purple-glow);
  transition: width 0.1s linear;
}

#export-status-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  display: block;
}

.export-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.export-btn-action {
  flex: 1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.export-btn-action.cancel-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.08);
}

.export-btn-action.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.export-btn-action.start-btn {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-glow);
  border-color: rgba(139, 92, 246, 0.4);
}

.export-btn-action.start-btn:hover:not(:disabled) {
  background: var(--purple-glow);
  color: #000;
  border-color: var(--purple-glow);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.export-btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* EXPORT BUTTON IN SEQUENCER TOOLBAR */
.seq-btn.export-btn {
  background: rgba(236, 72, 153, 0.1);
  color: var(--pink-glow);
  border-color: rgba(236, 72, 153, 0.3);
  margin-left: 6px;
}

.seq-btn.export-btn:hover {
  background: var(--pink-glow);
  color: #000;
  border-color: var(--pink-glow);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

/* ==========================================================================
   STEP AUTOMATION SECTION
   ========================================================================== */
.seq-automation-section {
  margin-top: 24px;
  padding: 16px;
  background: rgba(20, 10, 35, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.seq-automation-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.seq-automation-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--pink-glow);
  text-transform: uppercase;
  margin: 0;
}

.seq-btn.add-track-btn {
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple-glow);
  border-color: rgba(139, 92, 246, 0.3);
  padding: 6px 12px;
  font-size: 11px;
  transition: all var(--transition-speed) ease;
}

.seq-btn.add-track-btn:hover {
  background: var(--purple-glow);
  color: #000;
  border-color: var(--purple-glow);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.seq-automation-tracks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual track row */
.seq-automation-track {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 10px;
  gap: 10px;
  transition: background-color var(--transition-speed) ease;
}

.seq-automation-track:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Top controls row of the track */
.seq-track-controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.seq-track-param-select {
  width: 100%;
  max-width: 350px;
  background: rgba(10, 5, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-speed) ease;
}

.seq-track-param-select:focus {
  border-color: var(--pink-glow);
}

.seq-track-delete-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  color: #ef4444;
  font-size: 14px;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  padding: 0;
}

.seq-track-delete-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Bottom steps bars grid, full width for 1-to-1 alignment with main sequencer grid */
.seq-track-steps-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 6px;
  user-select: none;
}

.seq-automation-step {
  height: 70px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  position: relative;
  cursor: ns-resize;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.seq-automation-step:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.seq-automation-step.active-step {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.seq-automation-bar-fill {
  width: 100%;
  background: linear-gradient(to top, rgba(139, 92, 246, 0.6), rgba(236, 72, 153, 0.8));
  border-top: 1px solid var(--pink-glow);
  box-shadow: 0 0 6px rgba(236, 72, 153, 0.3);
  transition: height 0.05s linear;
  pointer-events: none; /* Klikanie spracuje rodič step */
}

/* Active current step bar glowing accent when playhead passes it */
.active-step .seq-automation-bar-fill {
  background: linear-gradient(to top, rgba(139, 92, 246, 0.8), var(--pink-glow));
  box-shadow: 0 0 10px var(--pink-glow), 0 0 20px rgba(236, 72, 153, 0.5);
  border-top-color: #fff;
}

/* Tooltip displaying value */
.seq-automation-tooltip {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 8px;
  padding: 1px 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  white-space: nowrap;
}

.seq-automation-step:hover .seq-automation-tooltip {
  opacity: 1;
}

/* TEMPORARY AUTOMATION DESTINATIONS DEBUG SECTION */
.seq-destinations-debug-section {
  margin-top: 20px;
  background: rgba(13, 17, 30, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.seq-dest-table-container {
  margin-top: 12px;
  max-height: 250px;
  overflow-y: auto;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.seq-dest-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
}

.seq-dest-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--neon-cyan, #06b6d4);
  font-weight: 600;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  border-bottom: 2px solid rgba(139, 92, 246, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 1;
}

.seq-dest-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-muted, #94a3b8);
}

.seq-dest-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.seq-dest-table tr td:first-child {
  font-family: monospace;
  color: var(--pink-glow, #ec4899);
}

.refresh-dest-btn {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--neon-cyan, #06b6d4);
}

.refresh-dest-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

/* VISUALIZER styling */
.visualizer-container {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  height: 80px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.visualizer-container:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(139, 92, 246, 0.1);
}

#synth-visualizer {
  display: block;
  width: 100%;
  height: 100%;
}

.visualizer-label {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.visualizer-container:hover .visualizer-label {
  color: rgba(0, 242, 254, 0.6);
}

/* Collapsed Effect Module card - hides completely from layout grid */
.effects-grid .rack-module.collapsed {
  display: none !important;
}

/* E-Edit button inside FX Chain block */
.fx-node-edit-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted, #94a3b8);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.55rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  z-index: 10;
}

.fx-node-edit-btn:hover {
  color: #fff;
  border-color: var(--node-color);
  box-shadow: 0 0 5px var(--node-dim);
}

.fx-node-edit-btn.active {
  background: var(--node-color);
  border-color: var(--node-color);
  color: #020617;
  box-shadow: 0 0 8px var(--node-color);
}
