.panel-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 12px;
}

.panel-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.device-select-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

label.control-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 90px;
}

.value-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  min-width: 75px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: var(--bg-control);
  border-radius: 2px;
  outline: none;
  border: 1px solid var(--border-bright);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-cyan-glow);
  transition: transform 0.1s ease, background-color 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

button.hud-btn {
  background: var(--bg-control);
  color: var(--text-main);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

button.hud-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

button.hud-btn.active {
  background: var(--accent-cyan);
  color: #ffffff;
  font-weight: bold;
  border-color: var(--accent-cyan);
}

[data-theme="dark"] button.hud-btn.active {
  color: var(--bg-deep);
}

select.hud-select {
  background: var(--bg-control);
  color: var(--text-main);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  width: 100%;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

select.hud-select:focus {
  border-color: var(--accent-cyan);
}

.meter-container {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 16px;
}

.meter-track {
  flex: 1;
  height: 6px;
  background: var(--bg-control);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-dim);
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-amber) 75%, var(--accent-red) 95%);
  transition: width 0.05s linear;
}

canvas#hud-visualizer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

.canvas-telemetry {
  position: absolute;
  top: 12px;
  right: 14px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  background: var(--bg-panel);
  opacity: 0.94;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.spatial-tracks-rack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.spatial-track-card {
  background: var(--bg-panel-hover);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease;
}

.spatial-track-card.active-track {
  border-color: var(--border-active);
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
}

.track-badge {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.preset-selector-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-control);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
}

/* Pre-Flight Health HUD Styling */
.health-hud-card {
  background: var(--bg-control);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
}

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

.health-pill {
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: bold;
}
.health-pill.healthy { background: rgba(22, 163, 74, 0.15); color: var(--accent-green); }
.health-pill.degraded { background: rgba(217, 119, 6, 0.15); color: var(--accent-amber); }
.health-pill.locked { background: rgba(220, 38, 38, 0.15); color: var(--accent-red); }
