:root {
  --bg-base: #0A0A0B;
  --surface-1: #151618;
  --surface-2: #1E2023;
  --surface-3: #26292E;
  --divider: #282B30;
  --divider-bright: #3D4148;
  --silver: #E2E8F0;
  --silver-brushed: #C9CCD1;
  --silver-bright: #FFFFFF;
  --text-secondary: #A1A5AC;
  --text-tertiary: #83878E;
  --text-disabled: #46484E;
  --glow-ambient: rgba(226, 232, 240, 0.12);
  --glow-active: rgba(226, 232, 240, 0.28);
  --status-cyan: #00FFAA;
  --status-magenta: #FF0055;
  --status-amber: #FFAA00;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Space Grotesk', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

html {
  color-scheme: dark;
}

body {
  background: var(--bg-base);
  color: var(--silver);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  body {
    padding: 32px 24px;
  }
}

@media (min-width: 1200px) {
  body {
    padding: 40px 32px;
  }
}

/* Tabular figures for monospace elements */
.mono, .tabular, code, pre, button, input, .telemetry, h1, h2, h3, h4, h5, .label-tag {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Master Rack Shell */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
}

/* Header & Hardware Console Top */
.console-header {
  border: 1px solid var(--divider);
  background: var(--surface-1);
  padding: 16px 20px;
  margin-bottom: 20px;
  position: relative;
}

.rack-ears {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.rack-bolt {
  width: 6px;
  height: 6px;
  border: 1px solid var(--divider-bright);
  background: var(--bg-base);
}

.header-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .header-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon-wrapper {
  width: 48px;
  height: 48px;
  border: 1px solid var(--divider);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-meta h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--silver-bright);
}

.brand-meta .system-sub {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.system-status-dot {
  width: 6px;
  height: 6px;
  background: var(--status-cyan);
  display: inline-block;
  box-shadow: 0 0 6px var(--status-cyan);
}

.system-status-dot.offline {
  background: var(--text-disabled);
  box-shadow: none;
}

/* Master Hardware Switches in Header */
.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.switch-btn {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  color: var(--silver);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: 40px;
}

.switch-btn:hover {
  border-color: var(--silver-brushed);
  color: var(--silver-bright);
}

.switch-btn:focus-visible {
  outline: 1px solid var(--silver-bright);
  outline-offset: 2px;
}

.switch-btn.active {
  background: var(--silver);
  color: var(--bg-base);
  border-color: var(--silver-bright);
}

.switch-btn.pwr-toggle.active {
  background: #E2E8F0;
  color: #0A0A0B;
}

.switch-btn.pwr-toggle.pwr-off {
  background: #151618;
  color: var(--text-disabled);
  border-color: var(--divider);
}

.btn-icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Master Rack Grid Layout */
.rack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .rack {
    grid-template-columns: 7fr 5fr;
    gap: 24px;
  }
}

@media (min-width: 1280px) {
  .rack {
    grid-template-columns: 6.5fr 5.5fr;
    gap: 24px;
  }
}

.rack-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Module Chassis Units */
.module {
  background: var(--surface-1);
  border: 1px solid var(--divider);
  padding: 20px;
  position: relative;
  transition: border-color 0.2s ease;
}

.module:focus-within {
  border-color: var(--divider-bright);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 12px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.module-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.channel-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 600;
}

.label-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 3px 8px;
  display: inline-block;
  white-space: nowrap;
}

h2, h3 {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--silver-bright);
  text-transform: uppercase;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-base);
  border: 1px solid var(--divider);
  padding: 2px;
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 32px;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--silver);
}

.tab:focus-visible {
  outline: 1px solid var(--silver);
}

.tab.active {
  background: var(--surface-2);
  color: var(--silver-bright);
  border-color: var(--divider-bright);
}

.sub-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

/* Scene Preset Grids */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}

@media (min-width: 600px) {
  .genre-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.genre-card {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.genre-card:hover {
  border-color: var(--silver-brushed);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.genre-card:focus-visible {
  outline: 1px solid var(--silver-bright);
}

.genre-card.active {
  background: #18191c;
}

.genre-title-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.genre-color-pip {
  width: 6px;
  height: 6px;
  display: inline-block;
  flex-shrink: 0;
}

.genre-card h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--silver);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.genre-card.active h4 {
  color: var(--silver-bright);
}

.active-chip-dot {
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.genre-card.active .active-chip-dot {
  opacity: 1;
  box-shadow: 0 0 6px currentColor;
  animation: genreActiveBlink 1.4s infinite ease-in-out;
}

@keyframes genreActiveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.9); }
}

.genre-palette-strip {
  display: flex;
  height: 9px;
  margin: 8px 0;
  border: 1px solid var(--divider);
  overflow: hidden;
  background: var(--bg-base);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.genre-palette-chip {
  flex: 1;
  height: 100%;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease, transform 0.1s ease;
}

.genre-palette-chip:last-child {
  border-right: none;
}

.genre-palette-chip:hover {
  filter: brightness(1.25);
}

.genre-card .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
  overflow: hidden;
}

.genre-card.active .meta-row {
  color: var(--text-secondary);
}

.genre-effect-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.genre-card.active .genre-effect-tag {
  color: var(--silver);
}

.genre-bpm-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.genre-card.active .genre-bpm-tag {
  font-weight: 700;
}

/* Palettes Grid */
.palettes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.palette-card {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.palette-card:hover {
  border-color: var(--silver-brushed);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.palette-card:focus-visible {
  outline: 1px solid var(--silver-bright);
}

.palette-card.active {
  background: #18191c;
}

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

.palette-swatches {
  display: flex;
  height: 24px;
  margin: 9px 0;
  border: 1px solid var(--divider);
  overflow: hidden;
  background: var(--bg-base);
}

.palette-swatch {
  flex: 1;
  height: 100%;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, filter 0.12s ease;
  border-right: 1px solid rgba(0, 0, 0, 0.45);
}

.palette-swatch:last-child {
  border-right: none;
}

.palette-swatch:hover {
  filter: brightness(1.22);
  transform: scaleY(1.12);
  z-index: 2;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.palette-card h4 {
  font-size: 0.72rem;
  color: var(--silver);
  letter-spacing: 0.05em;
}

.palette-card.active h4 {
  color: var(--silver-bright);
}

.palette-desc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.palette-desc {
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.palette-hex {
  color: var(--silver-brushed);
  font-size: 0.60rem;
}

/* Effects Grid */
.effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.effect-card {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.effect-card:hover {
  border-color: var(--silver-brushed);
}

.effect-card.active {
  border-color: var(--silver-bright);
  background: #202328;
}

.effect-card h4 {
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.effect-meta {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-tertiary);
  display: flex;
  justify-content: space-between;
}

/* Color & Dimmer Control Section */
.picker-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.color-preview-well {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-base);
  border: 1px solid var(--divider);
  padding: 12px 16px;
}

.color-preview-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.picker-color-disc {
  width: 28px;
  height: 28px;
  border: 1px solid var(--silver-brushed);
  background: #ff0055;
  transition: background 0.1s ease;
  box-shadow: 0 0 8px var(--glow-ambient);
}

.color-readout-col {
  display: flex;
  flex-direction: column;
}

.color-readout-col .hue-large {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--silver-bright);
}

.color-readout-col .color-hex {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.color-readout-telemetry {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Hue Track with Tactile Fader */
.fader-control-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fader-label-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.fader-label-row span:last-child {
  color: var(--silver);
  font-weight: 600;
}

.picker-track {
  position: relative;
  height: 32px;
  background: linear-gradient(
    90deg,
    #FF0000 0%,
    #FFFF00 17%,
    #00FF00 33%,
    #00FFFF 50%,
    #0000FF 67%,
    #FF00FF 83%,
    #FF0000 100%
  );
  border: 1px solid var(--divider);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.picker-thumb {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 40px;
  background: var(--silver-bright);
  border: 1px solid var(--bg-base);
  box-shadow: 0 0 0 1px var(--divider-bright), 0 2px 6px rgba(0,0,0,0.5);
  transform: translateX(-50%);
  pointer-events: none;
}

.picker-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bg-base);
  transform: translateY(-50%);
}

/* Dimmer / Brightness Slider */
.dimmer-track {
  position: relative;
  height: 28px;
  background: var(--bg-base);
  border: 1px solid var(--divider);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
}

.dimmer-fill {
  height: 100%;
  background: var(--surface-3);
  border-right: 2px solid var(--silver-bright);
  pointer-events: none;
  width: 100%;
  transition: width 0.05s ease;
}

.dimmer-thumb {
  position: absolute;
  top: -3px;
  width: 12px;
  height: 34px;
  background: var(--silver);
  border: 1px solid var(--bg-base);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Quick Temperature Chips */
.temp-presets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.temp-chip {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.temp-chip:hover {
  border-color: var(--silver-brushed);
  color: var(--silver-bright);
}

.temp-chip.active {
  border-color: var(--silver);
  color: var(--silver-bright);
  background: var(--surface-3);
}

.temp-chip-dot {
  width: 4px;
  height: 4px;
  display: inline-block;
}

/* Music Sync & Acoustic Telemetry */
.sync-controls-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}

.btn-primary {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  color: var(--silver);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-primary:hover {
  border-color: var(--silver);
  color: var(--silver-bright);
  background: var(--surface-3);
}

.btn-primary:focus-visible {
  outline: 1px solid var(--silver-bright);
}

.btn-primary.active {
  background: var(--silver-bright);
  color: var(--bg-base);
  border-color: var(--silver-bright);
}

.source-select-group {
  display: flex;
  border: 1px solid var(--divider);
  background: var(--bg-base);
}

.source-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--divider);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.source-btn:last-child {
  border-right: none;
}

.source-btn:hover {
  color: var(--silver);
}

.source-btn.active {
  background: var(--surface-2);
  color: var(--silver-bright);
}

/* Real-Time Audio Canvas Spectrum Visualizer */
.spectrum-canvas-wrap {
  background: var(--bg-base);
  border: 1px solid var(--divider);
  padding: 10px;
  margin-bottom: 12px;
  position: relative;
}

.spectrum-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

#spectrumCanvas {
  width: 100%;
  height: 64px;
  display: block;
  background: #0A0A0B;
}

/* Segmented Hardware VU Meter */
.vu-meter-rack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-base);
  border: 1px solid var(--divider);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.vu-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-secondary);
}

.vu-meter-bar {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 2px;
  height: 12px;
}

.vu-segment {
  background: #18191B;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.05s ease;
}

.vu-segment.lit-low {
  background: #46484E;
}

.vu-segment.lit-mid {
  background: var(--silver-brushed);
}

.vu-segment.lit-peak {
  background: var(--silver-bright);
  box-shadow: 0 0 6px var(--silver-bright);
}

.vu-segment.lit-clip {
  background: var(--status-magenta);
  box-shadow: 0 0 8px var(--status-magenta);
}

/* Timers & Schedule Module */
.timer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.timer-card {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 10px 12px;
}

.timer-card label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.input-time {
  background: var(--bg-base);
  border: 1px solid var(--divider);
  color: var(--silver-bright);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 10px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-time:focus {
  border-color: var(--silver);
}

.ramp-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.ramp-btn {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.ramp-btn:hover {
  color: var(--silver);
  border-color: var(--silver-brushed);
}

.ramp-btn.active {
  background: var(--surface-3);
  color: var(--silver-bright);
  border-color: var(--silver);
}

.btn-secondary {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  color: var(--silver);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.btn-secondary:hover {
  border-color: var(--silver);
  color: var(--silver-bright);
}

.btn-secondary:focus-visible {
  outline: 1px solid var(--silver-bright);
}

/* Bluetooth Module */
.protocol-select-bar {
  display: flex;
  border: 1px solid var(--divider);
  background: var(--bg-base);
  margin-bottom: 12px;
}

.protocol-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--divider);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.protocol-btn:last-child {
  border-right: none;
}

.protocol-btn:hover {
  color: var(--silver);
}

.protocol-btn.active {
  background: var(--surface-2);
  color: var(--silver-bright);
}

.ble-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-connect {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  color: var(--silver-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}

.btn-connect:hover {
  background: var(--silver);
  color: var(--bg-base);
  border-color: var(--silver-bright);
}

.btn-connect:focus-visible {
  outline: 1px solid var(--silver-bright);
}

.device-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.device-entry-card {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.device-entry-card.reconnecting {
  border-color: var(--status-amber);
}

.device-entry-card.offline {
  border-color: var(--divider);
  opacity: 0.75;
}

.device-entry-card.connected {
  border-color: var(--divider-bright);
}

.device-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.device-info-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.device-name-text {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--silver-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-sub-text {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
}

.device-protocol-badge {
  background: var(--bg-base);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 1px 5px;
  text-transform: uppercase;
}

.device-status-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.device-status-badge.online {
  color: var(--status-cyan);
}

.device-status-badge.reconnecting {
  color: var(--status-amber);
}

.device-status-badge.offline {
  color: var(--text-disabled);
}

.device-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--divider);
  padding-top: 8px;
  margin-top: 4px;
}

.btn-device-action {
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 26px;
}

.btn-device-action:hover {
  color: var(--silver-bright);
  border-color: var(--silver);
}

.btn-device-action.danger:hover {
  border-color: var(--status-magenta);
  color: var(--status-magenta);
}

.btn-device-action.accent {
  border-color: rgba(0, 204, 255, 0.45);
  color: var(--silver-bright);
}

.btn-device-action.accent:hover {
  border-color: var(--status-cyan);
  color: var(--status-cyan);
  background: rgba(0, 204, 255, 0.08);
}

/* Generic Telemetry Row */
.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 12px;
  border-top: 1px solid var(--divider);
  padding-top: 10px;
}

.telemetry-row span:last-child {
  color: var(--silver);
  font-weight: 600;
}

/* Sensitivity range fader */
.range-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-base);
  border: 1px solid var(--divider);
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 20px;
  background: var(--silver);
  border: 1px solid var(--bg-base);
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  width: 12px;
  height: 20px;
  background: var(--silver);
  border: 1px solid var(--bg-base);
  cursor: pointer;
}

/* Toast Notifications in Bottom Corner */
.toast-rack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-1);
  border: 1px solid var(--silver);
  color: var(--silver-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8);
  pointer-events: auto;
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Accessibility & Focus-Visible Refinements */
button:focus-visible,
.genre-card:focus-visible,
.palette-card:focus-visible,
.effect-card:focus-visible,
.picker-track:focus-visible,
.dimmer-track:focus-visible,
.input-time:focus-visible,
.range-input:focus-visible {
  outline: 1px solid var(--silver-bright) !important;
  outline-offset: 2px !important;
}

/* Effect Controller Bar */
.effect-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  padding: 8px 12px;
  margin-bottom: 12px;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.effect-speed-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-effect-speed {
  background: var(--bg-base);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-effect-speed.active {
  background: var(--surface-3);
  color: var(--silver-bright);
  border-color: var(--silver);
}

.btn-stop-effect {
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--status-magenta);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stop-effect:hover {
  background: var(--status-magenta);
  color: #000;
}

/* High-precision Chrono Countdown */
.chrono-countdown {
  color: var(--status-cyan);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Hardware System Console Footer */
.console-footer {
  margin-top: 24px;
  border: 1px solid var(--divider);
  background: var(--surface-1);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  position: relative;
}

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

.footer-spec {
  color: var(--silver-brushed);
  letter-spacing: 0.06em;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dotted var(--divider-bright);
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--silver-bright);
}

/* Settings Hardware Drawer / Modal */
.settings-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.15s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-modal-dialog {
  background: var(--surface-1);
  border: 1px solid var(--silver-brushed);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--divider);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider);
}

.settings-modal-header h3 {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--silver-bright);
}

.btn-close-modal {
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  background: var(--status-magenta);
  color: #000;
  border-color: var(--status-magenta);
}

.btn-close-modal:focus-visible {
  outline: 1px solid var(--silver-bright);
}

.settings-modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-embedded-module {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}
