/* ==========================================================================
   LOOPVECTOR ENGINE PRO — SKEUOMORPHIC HARDWARE SAMPLER DESIGN SYSTEM
   Visual System Architecture: Tactile Physical Instrument Console
   Materials: Brushed graphite metal, dark walnut wood cheeks, hex bolts,
   CRT/OLED display with scanlines & glare, 4x4 silicone pads with LED bloom,
   rotary encoders with knurled grips, milled panel seams & silkscreen typography.
   ========================================================================== */

/* ==========================================================================
   1. HARDWARE DESIGN TOKENS
   ========================================================================== */
:root {
  /* Chassis & Metal Materials */
  --chassis-base: #121418;
  --chassis-brushed: linear-gradient(180deg, #242931 0%, #15181f 42%, #0e1014 100%);
  --chassis-metal-texture: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(255, 255, 255, 0.015) 1px,
    rgba(255, 255, 255, 0.015) 2px
  );
  --chassis-bevel-light: rgba(255, 255, 255, 0.12);
  --chassis-bevel-shadow: rgba(0, 0, 0, 0.95);
  --chassis-cheek-wood: linear-gradient(90deg, #180f0a 0%, #3a2015 40%, #26150d 75%, #130a06 100%);
  --chassis-shadow-stack:
    0 50px 100px rgba(0, 0, 0, 0.9),
    0 24px 48px rgba(0, 0, 0, 0.8),
    0 8px 16px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -2px 6px rgba(0, 0, 0, 0.95);

  /* Panel Seams & Milled Grooves */
  --seam-bevel:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.85);
  --seam-groove:
    inset 0 2px 4px rgba(0, 0, 0, 0.9),
    inset 0 1px 1px rgba(0, 0, 0, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);

  /* 4x4 Silicone Pads */
  --pad-rubber-base: #1b1e25;
  --pad-rubber-grad: linear-gradient(145deg, #272d37 0%, #15181f 100%);
  --pad-border: rgba(0, 0, 0, 0.9);
  --pad-shadow-idle:
    0 5px 8px rgba(0, 0, 0, 0.7),
    0 2px 3px rgba(0, 0, 0, 0.85),
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    inset 0 -2px 4px rgba(0, 0, 0, 0.8);
  --pad-shadow-pressed:
    0 1px 2px rgba(0, 0, 0, 0.9),
    inset 0 2px 6px rgba(0, 0, 0, 0.95),
    inset 0 -1px 2px rgba(255, 255, 255, 0.1);
  --pad-led-red: #ff2a2a;
  --pad-led-amber: #ff9d00;
  --pad-active-glow-red:
    0 0 18px rgba(255, 42, 42, 0.85),
    0 0 38px rgba(255, 42, 42, 0.45),
    inset 0 0 14px rgba(255, 120, 120, 0.9),
    inset 0 2px 2px rgba(255, 255, 255, 0.7),
    inset 0 -2px 6px rgba(180, 0, 0, 0.95);
  --pad-active-glow-amber:
    0 0 18px rgba(255, 157, 0, 0.85),
    0 0 38px rgba(255, 157, 0, 0.45),
    inset 0 0 14px rgba(255, 210, 120, 0.9),
    inset 0 2px 2px rgba(255, 255, 255, 0.75),
    inset 0 -2px 6px rgba(180, 80, 0, 0.95);

  /* OLED / CRT Display Bezel */
  --screen-bg: #040609;
  --screen-border-recess:
    inset 0 4px 10px rgba(0, 0, 0, 0.98),
    inset 0 1px 3px rgba(0, 0, 0, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.05);
  --screen-glass-glare: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 36%,
    transparent 38%,
    transparent 100%
  );
  --screen-scanline: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.45) 0px,
    rgba(0, 0, 0, 0.45) 1px,
    transparent 1px,
    transparent 2px
  );

  /* Phosphor Display Colors */
  --phosphor-green: #68ff88;
  --phosphor-amber: #ffb43a;
  --phosphor-orange: #ff6822;
  --phosphor-red: #ff3838;
  --phosphor-cyan: #3fe0ff;
  --phosphor-text: #f0f8ff;

  /* Rotary Encoders */
  --knob-cap: radial-gradient(circle at 35% 35%, #424956 0%, #1e222a 58%, #0d0f13 100%);
  --knob-shadow:
    0 8px 16px rgba(0, 0, 0, 0.85),
    0 2px 4px rgba(0, 0, 0, 0.95),
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.85);
  --knob-knurl: conic-gradient(
    from 0deg,
    #2c313a 0deg, #16181e 10deg,
    #2c313a 20deg, #16181e 30deg,
    #2c313a 40deg, #16181e 50deg,
    #2c313a 60deg, #16181e 70deg,
    #2c313a 80deg, #16181e 90deg,
    #2c313a 100deg, #16181e 110deg,
    #2c313a 120deg, #16181e 130deg,
    #2c313a 140deg, #16181e 150deg,
    #2c313a 160deg, #16181e 170deg,
    #2c313a 180deg, #16181e 190deg,
    #2c313a 200deg, #16181e 210deg,
    #2c313a 220deg, #16181e 230deg,
    #2c313a 240deg, #16181e 250deg,
    #2c313a 260deg, #16181e 270deg,
    #2c313a 280deg, #16181e 290deg,
    #2c313a 300deg, #16181e 310deg,
    #2c313a 320deg, #16181e 330deg,
    #2c313a 340deg, #16181e 350deg,
    #2c313a 360deg
  );

  /* Silkscreen & Industrial Typography */
  --font-mono: "IBM Plex Mono", "Roboto Mono", monospace;
  --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --silk-color: rgba(188, 196, 208, 0.55);
  --silk-bright: rgba(220, 228, 240, 0.85);
  --silk-spacing: 0.15em;

  /* Shared Accents */
  --amber: #ffab3d;
  --amber-dim: #cc8429;
  --red: #ed4547;
  --green: #68ff88;
  --text: #f5f3ed;
  --text-muted: #838b96;
  --text-dim: #4f5661;
}

/* ==========================================================================
   2. BASE RESET & WORKSPACE ENVIRONMENT
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  background: #050608;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lv-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 140, 0, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(237, 69, 71, 0.03) 0%, transparent 50%),
    #050608;
  display: flex;
  justify-content: center;
  padding: 24px 12px 48px;
}

/* ==========================================================================
   3. CHASSIS ENCLOSURE — OUTER HARDWARE CASING & WOOD CHEEKS
   ========================================================================== */
.chassis-enclosure {
  position: relative;
  width: 100%;
  max-width: 1160px;
  padding: 34px 52px 38px;
  background: var(--chassis-brushed);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--chassis-shadow-stack);
}

/* Brushed Metal Horizontal Micro-texture */
.chassis-enclosure::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--chassis-metal-texture);
  border-radius: 14px;
  pointer-events: none;
  z-index: 1;
}

/* Dark Walnut Wood Cheek Side-Plates */
.chassis-cheek {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 16px;
  background: var(--chassis-cheek-wood);
  z-index: 3;
}
.chassis-cheek::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 6px rgba(0, 0, 0, 0.95),
    inset 1px 0 1px rgba(255, 255, 255, 0.08);
  border-radius: inherit;
}
.chassis-cheek--left {
  left: 0;
  border-radius: 14px 0 0 14px;
  border-right: 1px solid #000;
  background:
    repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(0,0,0,0.2) 3px, rgba(0,0,0,0.2) 4px),
    var(--chassis-cheek-wood);
  box-shadow: 2px 0 5px rgba(0,0,0,0.5);
}
.chassis-cheek--right {
  right: 0;
  border-radius: 0 14px 14px 0;
  border-left: 1px solid #000;
  background:
    repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(0,0,0,0.2) 3px, rgba(0,0,0,0.2) 4px),
    var(--chassis-cheek-wood);
  box-shadow: -2px 0 5px rgba(0,0,0,0.5);
}

/* Corner Hex Socket Bolts */
.hex-bolt {
  position: absolute;
  width: 13px;
  height: 13px;
  background: radial-gradient(circle, #5a626f 25%, #24272f 70%, #0d0f13 100%);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.95);
  z-index: 4;
}
.hex-bolt::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 900;
  line-height: 1;
}
.hex-bolt--tl { top: 14px; left: 26px; }
.hex-bolt--tr { top: 14px; right: 26px; }
.hex-bolt--bl { bottom: 14px; left: 26px; }
.hex-bolt--br { bottom: 14px; right: 26px; }

/* Inner Chassis Content Plate */
.chassis-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================================
   4. TOP PLATE — BRAND BADGE & SYSTEM CONTROLS
   ========================================================================== */
.hw-brand-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(12, 14, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  box-shadow: var(--seam-bevel);
}

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

/* Power Indicator LED */
.hw-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--phosphor-green);
  box-shadow:
    0 0 10px var(--phosphor-green),
    0 0 20px rgba(104, 255, 136, 0.4),
    inset 0 1px 2px #fff;
  flex-shrink: 0;
  animation: ledPulse 3s infinite ease-in-out;
}
@keyframes ledPulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.65; }
}

.hw-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: var(--silk-spacing);
  color: var(--text);
  line-height: 1.2;
}

.hw-brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--silk-color);
  letter-spacing: 0.12em;
}

.hw-brand-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hw-config-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-silkscreen-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: var(--silk-spacing);
  color: var(--silk-color);
  text-transform: uppercase;
}

/* Hardware Mini Select */
.hw-mini-select {
  background: #0d0f13;
  color: var(--amber);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}
.hw-mini-select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 6px rgba(255, 171, 61, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.hw-top-buttons {
  display: flex;
  gap: 6px;
}

/* Center Headline Strip */
.hw-headline-strip {
  text-align: center;
  padding: 2px 0 6px;
}

.hw-sublabel {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: var(--silk-spacing);
  color: var(--silk-color);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.hw-chassis-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hw-amber-glow {
  color: var(--amber);
  text-shadow: 0 0 12px rgba(255, 171, 61, 0.4);
}

.hw-brand-limits {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ==========================================================================
   5. RECESSED OLED / CRT DISPLAY BEZEL — HERO SCREEN
   ========================================================================== */
.display-bezel {
  position: relative;
  background: var(--screen-bg);
  border-radius: 10px;
  border: 2px solid #080a0f;
  padding: 18px 22px;
  box-shadow: var(--screen-border-recess);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* CRT Scanlines Overlay */
.display-bezel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--screen-scanline);
  pointer-events: none;
  z-index: 2;
  opacity: 0.65;
}

/* Diagonal Glass Glare Reflection */
.display-bezel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--screen-glass-glare);
  pointer-events: none;
  z-index: 3;
}

/* Scanline Active Sweep Animation (triggered by app.js triggerScanlineEffect) */
.display-bezel.scanline-active .screen-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(104, 255, 136, 0.18) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 4;
  animation: scanlineSweep 0.5s ease-out forwards;
}
@keyframes scanlineSweep {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.screen-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 4;
}

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

.screen-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor-green);
  box-shadow: 0 0 6px var(--phosphor-green);
}

.screen-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--silk-spacing);
  color: var(--phosphor-green);
  text-shadow: 0 0 6px rgba(104, 255, 136, 0.5);
  text-transform: uppercase;
}

.screen-sync-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--phosphor-green);
  background: rgba(104, 255, 136, 0.1);
  border: 1px solid rgba(104, 255, 136, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Hero Readout */
.screen-hero-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
  z-index: 4;
}

.screen-hero-value {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  color: var(--amber);
  text-shadow:
    0 0 12px rgba(255, 171, 61, 0.8),
    0 0 28px rgba(255, 171, 61, 0.35);
  line-height: 1;
  letter-spacing: -0.02em;
}

.screen-subtext {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.12em;
  position: relative;
  z-index: 4;
}

/* Telemetry Strip */
.screen-telemetry {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  position: relative;
  z-index: 4;
}

.screen-tel-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.screen-tel-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--phosphor-text);
  text-shadow: 0 0 6px rgba(240, 248, 255, 0.4);
}

.screen-tel-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--silk-color);
  letter-spacing: var(--silk-spacing);
  text-transform: uppercase;
}

.screen-tel-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* Screen Waveform Oscilloscope Container */
.screen-waveform-bay {
  position: relative;
  z-index: 4;
  height: 64px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(104, 255, 136, 0.15);
  border-radius: 6px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.screen-waveform-bay svg {
  width: 100%;
  height: 100%;
  display: block;
}

.screen-copy-all-bay {
  position: relative;
  z-index: 4;
}

/* Screen Copy Button */
.screen-copy-btn {
  background: rgba(255, 171, 61, 0.12);
  color: var(--amber);
  border: 1px solid rgba(255, 171, 61, 0.35);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.12s ease;
}
.screen-copy-btn:hover {
  background: rgba(255, 171, 61, 0.25);
  border-color: var(--amber);
  box-shadow: 0 0 8px rgba(255, 171, 61, 0.4);
}
.screen-copy-btn:active {
  transform: translateY(1px);
}

/* Flash update highlight from app.js */
.flash-update {
  animation: flashYellow 0.3s ease-out;
}
@keyframes flashYellow {
  0% { color: #fff; text-shadow: 0 0 16px #fff; }
  100% { color: inherit; text-shadow: inherit; }
}

/* ==========================================================================
   6. DUAL DASHBOARD: PARAMETER CONSOLE (KNOBS) + 4×4 PAD GRID
   ========================================================================== */
.hw-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Reusable Hardware Panel Bay */
.hw-panel {
  background: #111419;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  box-shadow: var(--seam-bevel);
  overflow: hidden;
}

.hw-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(18, 22, 28, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hw-panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: var(--silk-spacing);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-module-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: #000;
  color: var(--amber);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 171, 61, 0.3);
}

.hw-panel-status {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--silk-color);
  text-transform: uppercase;
}
.hw-panel-status--amber {
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 171, 61, 0.4);
}

.hw-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   ROTARY ENCODERS MATRIX
   -------------------------------------------------------------------------- */
.hw-encoders-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hw-encoder-cell {
  background: #0b0d11;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 10px;
  box-shadow: var(--seam-groove);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rotary-knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  width: 100%;
}

.rotary-dial-scale {
  display: flex;
  justify-content: space-between;
  width: 68px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--silk-color);
  letter-spacing: 0.05em;
  padding: 0 2px;
}
.rotary-dial-scale .scale-mid {
  color: var(--amber-dim);
}

.rotary-knob-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}

.rotary-knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--knob-cap);
  box-shadow: var(--knob-shadow);
  border: 1px solid #000;
  position: relative;
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.rotary-knob:active {
  cursor: grabbing;
}

/* Knurled Grip Ring */
.rotary-knob::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--knob-knurl);
  z-index: -1;
  box-shadow:
    inset 0 0 2px rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.9);
}

/* Amber Indicator Tick Notch */
.rotary-knob::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  background: var(--amber);
  border-radius: 2px;
  box-shadow: 0 0 5px rgba(255, 171, 61, 0.9);
}

/* Angular offsets representing knob positions */
.rotary-knob--bpm { transform: rotate(15deg); }
.rotary-knob--bars { transform: rotate(-25deg); }
.rotary-knob--meter { transform: rotate(0deg); }
.rotary-knob--steps { transform: rotate(30deg); }

.rotary-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: var(--silk-spacing);
  color: var(--silk-color);
  text-transform: uppercase;
  text-align: center;
}

/* Precision Hardware Input Bays Under Encoders */
.hw-input-bay {
  display: flex;
  align-items: center;
  background: #06070a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.04);
  width: 100%;
  overflow: hidden;
}

.hw-input-bay--readonly {
  opacity: 0.9;
  background: #090b0e;
}

.hw-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 8px;
  outline: none;
  text-align: right;
}
.hw-input:focus {
  color: #fff;
  text-shadow: 0 0 6px var(--amber);
}

.hw-select {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
}
.hw-select option {
  background: #111419;
  color: var(--text);
}

.hw-unit-suffix {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--silk-color);
  padding-right: 8px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.hw-inline-error {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--red);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   4×4 SILICONE PAD MATRIX
   -------------------------------------------------------------------------- */
.pad-grid-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pad-grid-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: var(--silk-spacing);
  color: var(--silk-color);
  text-transform: uppercase;
  padding: 0 2px;
}

/* Physical 4x4 Grid Housing */
.pad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: #090a0d;
  padding: 14px;
  border-radius: 10px;
  box-shadow: var(--seam-groove);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Tactile Silicone Rubber Pad Styling */
.preset-btn {
  position: relative;
  aspect-ratio: 1;
  background: var(--pad-rubber-grad);
  border: 1px solid var(--pad-border);
  border-radius: 8px;
  box-shadow: var(--pad-shadow-idle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Micro-lip concave indent on pad surface */
.preset-btn::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* Hover State */
.preset-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow:
    0 7px 12px rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* Active Press Depression */
.preset-btn:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: var(--pad-shadow-pressed);
}

/* ARMED / ACTIVE STATE (.active applied by app.js updateActivePreset) */
.preset-btn.active {
  background: radial-gradient(circle at 50% 50%, #ff3b3b 0%, #b80d0d 75%, #420404 100%);
  border-color: #ff6e6e;
  color: #ffffff;
  box-shadow: var(--pad-active-glow-red);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}
.preset-btn.active::before {
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,0.8) 0%, transparent 50%);
}

/* Utility Silicone Pads (TRIM & COPY) */
.pad-btn--util {
  background: linear-gradient(145deg, #2b2722 0%, #171512 100%);
  border-color: rgba(255, 171, 61, 0.2);
}
.pad-btn--util:hover {
  border-color: var(--amber);
}
.pad-btn--util:active {
  background: radial-gradient(circle at 50% 50%, #ff9d00 0%, #aa5800 75%, #3d1c00 100%);
  box-shadow: var(--pad-active-glow-amber);
  color: #fff;
}
.pad-btn-val {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.pad-btn-sub {
  font-size: 8px;
  font-weight: 600;
  opacity: 0.6;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* ==========================================================================
   7. MODULE BAYS — AUDIO DSP & WAVEFORM TRIMMER
   ========================================================================== */
.hw-panel--audio {
  margin-top: 2px;
}

/* Audio Drop Zone */
.hw-drop-zone {
  background: #090b0e;
  border: 2px dashed rgba(255, 171, 61, 0.35);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}
.hw-drop-zone:hover,
.hw-drop-zone.drag-over {
  border-color: var(--amber);
  background: rgba(255, 171, 61, 0.05);
  box-shadow:
    inset 0 0 16px rgba(255, 171, 61, 0.2),
    0 0 12px rgba(255, 171, 61, 0.2);
}

.hw-drop-icon {
  font-size: 20px;
  color: var(--amber);
  margin-bottom: 4px;
}

.hw-drop-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 4px;
}

.hw-drop-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--silk-color);
  letter-spacing: 0.08em;
}

/* Decoded Meta Strip */
.hw-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.hw-meta-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.hw-meta-specs {
  color: var(--silk-color);
  font-size: 9px;
}

.hw-bpm-detect-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-detected-bpm {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--phosphor-green);
  text-shadow: 0 0 6px rgba(104, 255, 136, 0.4);
}

/* Tempo Multipliers Bar */
.hw-tempo-analysis-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hw-multipliers-group {
  display: flex;
  gap: 8px;
}

.hw-mult-pill {
  background: #0d0f14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 6px 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}
.hw-mult-pill:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}
.hw-mult-pill.active {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(255, 171, 61, 0.1);
  box-shadow: 0 0 8px rgba(255, 171, 61, 0.25);
}
.hw-mult-tag {
  font-size: 8px;
  font-weight: 700;
  opacity: 0.7;
}

/* Waveform Oscilloscope & Toolbar */
.hw-waveform-trim-bay {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-waveform-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hw-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-toolbar-right {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--silk-color);
}
.hw-amber-text {
  color: var(--amber);
  font-weight: 700;
}

.hw-canvas-container {
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  height: 120px;
}
.hw-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hw-cue-inputs-strip {
  display: flex;
  gap: 16px;
}

.hw-cue-field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #080a0e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 4px 8px;
}

.hw-cue-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}
.hw-cue-label--start { color: var(--red); }
.hw-cue-label--end { color: var(--amber); }

.hw-input--mini {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: 70px;
  outline: none;
}

/* ==========================================================================
   8. SAMPLE REGION MODULE & VISUAL TRACK RULER
   ========================================================================== */
.hw-region-equation {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hw-eq-group {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hw-eq-operator {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--silk-color);
  padding: 16px 2px 0;
}

.hw-sample-warning {
  background: rgba(237, 69, 71, 0.15);
  border: 1px solid var(--red);
  color: #ff9999;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 4px;
}

.hw-region-track-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.hw-track-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--silk-color);
  letter-spacing: 0.1em;
}

.hw-region-track {
  position: relative;
  height: 28px;
  background: #06070a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.hw-region-active-span {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(237,69,71,0.25) 0%, rgba(255,171,61,0.35) 100%);
  border-left: 2px solid var(--red);
  border-right: 2px solid var(--amber);
  box-shadow: 0 0 10px rgba(255, 171, 61, 0.3);
}

.hw-region-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  z-index: 2;
}
.hw-region-marker--start {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}
.hw-region-marker--end {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}
.hw-marker-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 900;
  color: #000;
}

/* ==========================================================================
   9. BATCH TABLE & SAVED PRESETS
   ========================================================================== */
.hw-table-container {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--seam-groove);
}

.hw-batch-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
}
.hw-batch-table th {
  background: #090c10;
  color: var(--silk-color);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: var(--silk-spacing);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hw-batch-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}
.hw-batch-table tr:hover td {
  background: rgba(255, 171, 61, 0.04);
  color: var(--text);
}

.hw-presets-wrap,
.hw-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hw-preset-chip,
.hw-history-chip {
  background: #0d0f14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
}
.hw-preset-chip:hover,
.hw-history-chip:hover {
  border-color: var(--amber);
  color: var(--text);
}

/* ==========================================================================
   10. CONVERTER MODULES
   ========================================================================== */
.hw-converters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hw-converter-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hw-converter-result-bay {
  background: #07090d;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.hw-converter-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 171, 61, 0.4);
}

/* ==========================================================================
   11. BOTTOM SWITCH RAIL & HARDWARE TOGGLES
   ========================================================================== */
.hw-switch-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(14, 16, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  box-shadow: var(--seam-bevel);
}

.hw-switch-rail-left,
.hw-switch-rail-right {
  display: flex;
  gap: 8px;
}

.hw-switch-rocker {
  background: linear-gradient(180deg, #2b303a 0%, #15181f 100%);
  border: 1px solid rgba(0, 0, 0, 0.9);
  border-radius: 5px;
  box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -2px 3px rgba(0, 0, 0, 0.7);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s ease;
  user-select: none;
}
.hw-switch-rocker:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}
.hw-switch-rocker:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.9),
    0 1px 1px rgba(0, 0, 0, 0.8);
}

.rocker-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 5px var(--red);
}
.rocker-led--amber {
  background: var(--amber);
  box-shadow: 0 0 5px var(--amber);
}
.rocker-led--green {
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}
.rocker-led--midi {
  background: #3fe0ff;
  box-shadow: 0 0 5px #3fe0ff;
}
.hw-switch-rocker.active .rocker-led--midi {
  background: #68ff88;
  box-shadow: 0 0 8px #68ff88;
}

.hw-switch-rail-center {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--silk-color);
  letter-spacing: 0.1em;
}

.hw-limit-sep {
  opacity: 0.3;
}

/* Chassis Footer */
.hw-footer {
  text-align: center;
  padding: 6px 0 2px;
}
.hw-footer-branding {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hw-footer-sep {
  opacity: 0.3;
}

/* ==========================================================================
   12. HARDWARE BUTTONS & ACTION CONTROLS
   ========================================================================== */
.hw-btn {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.12s ease;
  user-select: none;
  outline: none;
}

.hw-btn--nano {
  font-size: 9px;
  padding: 4px 8px;
}

.hw-btn--block {
  width: 100%;
  padding: 10px;
  font-size: 12px;
}

/* Primary Spring-loaded Button */
.hw-btn--primary {
  background: linear-gradient(180deg, #ed4547 0%, #b82224 100%);
  color: #fff;
  border-color: #8c1012;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(0, 0, 0, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.hw-btn--primary:hover {
  background: linear-gradient(180deg, #ff5759 0%, #cb2a2c 100%);
  box-shadow:
    0 0 12px rgba(237, 69, 71, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.7);
}
.hw-btn--primary:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Amber Hardware Button */
.hw-btn--amber {
  background: linear-gradient(180deg, #ffab3d 0%, #cc7a14 100%);
  color: #0b0d11;
  border-color: #995500;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -2px 3px rgba(0, 0, 0, 0.7);
}
.hw-btn--amber:hover {
  background: linear-gradient(180deg, #ffb857 0%, #dd8a24 100%);
  box-shadow:
    0 0 12px rgba(255, 171, 61, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.7);
}
.hw-btn--amber:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Ghost / Subtle Metal Button */
.hw-btn--ghost {
  background: #111419;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hw-btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
  background: #181c24;
}
.hw-btn--ghost:active {
  transform: translateY(1px);
}

.hw-btn--subtle {
  background: #161a22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--amber);
  padding: 4px 8px;
  font-size: 10px;
}
.hw-btn--subtle:hover {
  border-color: var(--amber);
  background: rgba(255, 171, 61, 0.1);
}

/* ==========================================================================
   13. HARDWARE SUB-PANEL MODALS (DIALOGS)
   ========================================================================== */
dialog.hw-modal {
  background: transparent;
  border: none;
  max-width: 680px;
  width: 90vw;
  margin: auto;
  padding: 0;
  outline: none;
}
dialog.hw-modal::backdrop {
  background: rgba(3, 4, 6, 0.82);
  backdrop-filter: blur(5px);
}

.hw-modal-content {
  background: #14171d;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.95),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -2px 6px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #0d0f14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hw-modal-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: var(--silk-spacing);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-led-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.hw-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.hw-modal-close:hover {
  color: var(--red);
}

.hw-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}

.hw-modal-intro {
  font-size: 12px;
  color: var(--text-muted);
}

/* Export Cards Grid */
.hw-export-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hw-export-card {
  background: #090b0f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 12px;
  box-shadow: var(--seam-groove);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hw-export-card h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.05em;
}
.hw-export-card p {
  font-size: 11px;
  color: var(--text-dim);
  flex: 1;
  line-height: 1.4;
}

.hw-export-card--hw {
  background: #0d1016;
  border-color: rgba(255, 171, 61, 0.15);
}
.hw-export-card--hw h4 {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hw-export-card--hw:hover {
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(255, 171, 61, 0.15), var(--seam-groove);
}

.hw-direct-drive-bay {
  background: rgba(8, 10, 14, 0.8) !important;
  border: 1px dashed rgba(255, 171, 61, 0.35) !important;
}
.hw-direct-drive-bay:hover {
  border-color: var(--amber) !important;
}

/* Hardware Guide Manual Sections */
.hw-guide-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hw-guide-section h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: var(--silk-spacing);
}
.hw-guide-section p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hw-shortcut-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.hw-shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}
kbd {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--amber);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hw-disclaimer {
  font-size: 10px;
  color: var(--text-dim);
}

.hw-modal-footer {
  padding: 12px 18px;
  background: #0d0f14;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   14. TOAST NOTIFICATIONS (ARIA LIVE)
   ========================================================================== */
.hw-notifications {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.lv-toast {
  pointer-events: auto;
  background: #15181f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.lv-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.lv-toast-icon {
  font-weight: 900;
}
.lv-toast--info .lv-toast-icon { color: var(--amber); }
.lv-toast--success .lv-toast-icon { color: var(--green); }
.lv-toast--error .lv-toast-icon { color: var(--red); }

/* ==========================================================================
   PHASE 2: MIR KEY DETECTION, TRANSIENT SLICING & TIME-STRETCHER
   ========================================================================== */

/* Key & Scale OLED Badge */
.hw-key-detect-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hw-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #06090e;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 240, 255, 0.15);
}
.hw-key-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
  transition: all 0.3s ease;
}
#detectedKeyName {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #00f0ff;
  letter-spacing: 0.05em;
}
.hw-key-camelot {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7ce8ff;
  background: rgba(0, 240, 255, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

/* DSP Subconsole Bay */
.hw-dsp-subconsole {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-slice-control-bar,
.hw-stretch-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  box-shadow: var(--seam-groove);
}

.hw-slice-bar-left,
.hw-stretch-bar-left,
.hw-slice-bar-right,
.hw-stretch-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-sublabel-inline {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.hw-slice-pills,
.hw-stretch-pills {
  display: inline-flex;
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
}

.hw-slice-pill,
.hw-stretch-pill {
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hw-slice-pill:hover,
.hw-stretch-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.hw-slice-pill.active {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
}

.hw-stretch-pill.active {
  background: rgba(255, 171, 61, 0.25);
  color: var(--amber);
  box-shadow: 0 0 6px rgba(255, 171, 61, 0.3);
}

.hw-stretch-pill--sync {
  color: #7ce8ff;
  border: 1px dashed rgba(0, 240, 255, 0.3);
}

.hw-stretch-pill--sync:hover {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
}

.hw-badge--cyan {
  background: rgba(0, 240, 255, 0.12);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.hw-select--mini {
  background: #05070a;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 6px;
  cursor: pointer;
}

.hw-slider--mini {
  width: 70px;
  height: 4px;
  accent-color: var(--amber);
  cursor: pointer;
}

.hw-val-readout {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 2px 6px;
}

/* ==========================================================================
   PHASE 3: WEBGPU NEURAL STEM SEPARATOR & 4-TRACK MIXER CONSOLE
   ========================================================================== */

.hw-panel--stems {
  border-color: rgba(0, 240, 255, 0.2);
  background: linear-gradient(180deg, #10141b 0%, #090c10 100%);
}

.hw-stem-progress-wrap {
  background: #06090e;
  border: 1px solid rgba(255, 171, 61, 0.25);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.hw-stem-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.hw-progress-track {
  width: 100%;
  height: 8px;
  background: #0d1016;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9);
}

.hw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffab3d, #00f0ff);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  transition: width 0.15s ease-out;
}

/* 4-Channel Mixer Console Grid */
.hw-stem-strips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .hw-stem-strips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .hw-stem-strips-grid {
    grid-template-columns: 1fr;
  }
}

.hw-stem-strip {
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--seam-groove);
  position: relative;
  transition: border-color 0.2s ease;
}

.hw-stem-strip--drums { border-top: 3px solid #ffab3d; }
.hw-stem-strip--bass   { border-top: 3px solid #b066ff; }
.hw-stem-strip--vocals { border-top: 3px solid #00f0ff; }
.hw-stem-strip--other  { border-top: 3px solid #ffd700; }

.hw-strip-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-strip-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
}

.hw-strip-led--drums  { background: #ffab3d; box-shadow: 0 0 6px #ffab3d; }
.hw-strip-led--bass   { background: #b066ff; box-shadow: 0 0 6px #b066ff; }
.hw-strip-led--vocals { background: #00f0ff; box-shadow: 0 0 6px #00f0ff; }
.hw-strip-led--other  { background: #ffd700; box-shadow: 0 0 6px #ffd700; }

.hw-strip-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fff;
  letter-spacing: 0.05em;
}

.hw-strip-waveform-box {
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  height: 42px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hw-stem-mini-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hw-strip-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-stem-btn {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #15181f;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hw-stem-btn--solo:hover { color: #ffd700; }
.hw-stem-btn--solo.active {
  background: #ffd700;
  color: #070a0e;
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

.hw-stem-btn--mute:hover { color: #ff3b30; }
.hw-stem-btn--mute.active {
  background: #ff3b30;
  color: #fff;
  border-color: #ff3b30;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.7);
}

.hw-strip-fader-bay {
  flex: 1;
}

.hw-fader {
  width: 100%;
  height: 4px;
  accent-color: var(--amber);
  cursor: pointer;
}

/* Master Stem Transport & Hardware Dispatch Bar */
.hw-stem-master-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hw-stem-master-left,
.hw-stem-master-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   15. RESPONSIVE ARCHITECTURE
   ========================================================================== */
@media (max-width: 960px) {
  .chassis-enclosure {
    padding: 28px 30px 32px;
  }
  .chassis-cheek {
    width: 10px;
  }
  .hex-bolt--tl, .hex-bolt--bl { left: 16px; }
  .hex-bolt--tr, .hex-bolt--br { right: 16px; }

  .hw-dashboard-grid,
  .hw-converters-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.lv-body {
    padding: 10px 4px 30px;
  }
  .chassis-enclosure {
    padding: 24px 14px 28px;
    border-radius: 8px;
  }
  .chassis-cheek {
    display: none;
  }
  .hex-bolt {
    display: none;
  }

  .screen-hero-value {
    font-size: 32px;
  }

  .hw-encoders-matrix {
    grid-template-columns: 1fr;
  }

  .pad-grid {
    gap: 6px;
    padding: 10px;
  }

  .hw-export-options-grid {
    grid-template-columns: 1fr;
  }

  .hw-switch-rail {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hw-switch-rail-left,
  .hw-switch-rail-right,
  .hw-switch-rail-center {
    justify-content: center;
  }
}

/* ==========================================================================
   16. METADATA PROVENANCE & STATE BADGES
   ========================================================================== */
.sl-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

/* Detected: Generated by analysis */
.sl-state-detected {
  background: rgba(0, 240, 255, 0.12);
  color: #00f0ff;
  border-color: rgba(0, 240, 255, 0.35);
}

/* Imported: Read from filename or embedded metadata */
.sl-state-imported {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}

/* Confirmed: Explicitly accepted by the user */
.sl-state-confirmed {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

/* Overridden: User-provided value takes precedence */
.sl-state-overridden {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Unknown: System cannot determine a reliable value */
.sl-state-unknown {
  background: rgba(107, 114, 128, 0.12);
  color: #9ca3af;
  border-color: rgba(107, 114, 128, 0.3);
}

.sl-provenance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090c10;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.sl-provenance-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sl-provenance-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.sl-provenance-val {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.sl-provenance-source {
  font-size: 10px;
  color: var(--text-muted);
}

.sl-provenance-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sl-prov-btn {
  background: #141820;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sl-prov-btn:hover {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
}

.sl-prov-btn-confirm:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

