:root {
  --hud-bg-glass: rgba(8, 15, 26, 0.78);
  --hud-bg-solid: #060b12;
  --hud-border-cyan: rgba(0, 229, 255, 0.28);
  --hud-border-cyan-glow: rgba(0, 229, 255, 0.65);
  --hud-border-dark: rgba(255, 255, 255, 0.1);
  --hud-cyan: #00e5ff;
  --hud-cyan-dim: rgba(0, 229, 255, 0.15);
  --hud-emerald: #00e676;
  --hud-amber: #ffab00;
  --hud-coral: #ff1744;
  --hud-blue: #2979ff;
  --hud-magenta: #f50057;
  --hud-text-primary: #e6f1fc;
  --hud-text-secondary: #8da2ba;
  --hud-text-muted: #556b82;
  --hud-font-tech: "Chakra Petch", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hud-font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--hud-bg-solid);
  color: var(--hud-text-primary);
  font-family: var(--hud-font-tech);
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   FULLSCREEN 3D WEBGPU CANVAS
   ========================================================================== */
#nwp-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  background: radial-gradient(circle at center, #0a1320 0%, #03060a 100%);
  cursor: grab;
}

#nwp-canvas:active {
  cursor: grabbing;
}

#nwp-canvas.cursor-crosshair {
  cursor: crosshair;
}

/* ==========================================================================
   CANVAS OVERLAY / RETICLE / WATERMARK
   ========================================================================== */
.hud-canvas-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.center-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(0, 229, 255, 0.2);
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.center-reticle::before,
.center-reticle::after {
  content: "";
  position: absolute;
  background: rgba(0, 229, 255, 0.4);
}

.center-reticle::before {
  top: 50%;
  left: -6px;
  right: -6px;
  height: 1px;
  transform: translateY(-50%);
}

.center-reticle::after {
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  transform: translateX(-50%);
}

.hud-coords-badge {
  position: absolute;
  bottom: 24px;
  left: 24px;
  padding: 6px 14px;
  background: var(--hud-bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--hud-border-cyan);
  border-radius: 6px;
  font-family: var(--hud-font-mono);
  font-size: 11px;
  color: var(--hud-cyan);
  display: flex;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hud-coords-badge .coord-label {
  color: var(--hud-text-secondary);
}

.hud-watermark {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--hud-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--hud-text-muted);
  opacity: 0.6;
}

/* ==========================================================================
   TOP FLOATING HUD BAR
   ========================================================================== */
.hud-topbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--hud-bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--hud-border-cyan);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(0, 229, 255, 0.05);
  max-width: calc(100vw - 32px);
}

.topbar-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-col {
  border-right: 1px solid var(--hud-border-dark);
  padding-right: 14px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hud-cyan);
  box-shadow: 0 0 8px var(--hud-cyan);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 14px var(--hud-cyan); }
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--hud-text-primary);
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.35);
  font-family: var(--hud-font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--hud-emerald);
  letter-spacing: 0.05em;
  transition: all 0.3s;
}

.health-pill.warning {
  background: rgba(255, 171, 0, 0.15);
  border-color: rgba(255, 171, 0, 0.4);
  color: var(--hud-amber);
}

.health-pill.critical {
  background: rgba(255, 23, 68, 0.2);
  border-color: rgba(255, 23, 68, 0.6);
  color: var(--hud-coral);
  animation: blink-crit 0.8s infinite alternate;
}

@keyframes blink-crit {
  from { opacity: 0.7; }
  to { opacity: 1; box-shadow: 0 0 12px rgba(255, 23, 68, 0.5); }
}

.health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.clock-col {
  border-right: 1px solid var(--hud-border-dark);
  padding-right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.clock-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.clock-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--hud-text-muted);
}

.clock-val {
  font-family: var(--hud-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--hud-cyan);
  letter-spacing: 0.05em;
}

.clock-sub {
  display: flex;
  gap: 6px;
}

.clock-sub .badge {
  font-family: var(--hud-font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--hud-text-secondary);
}

.controls-col {
  gap: 8px;
}

/* ==========================================================================
   HUD BUTTONS & SELECTS
   ========================================================================== */
.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--hud-border-cyan);
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.07);
  color: var(--hud-text-primary);
  font-family: var(--hud-font-tech);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hud-btn:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--hud-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  transform: translateY(-1px);
}

.hud-btn:active:not(:disabled) {
  transform: translateY(0);
}

.hud-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.hud-btn-primary {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--hud-cyan);
  color: #ffffff;
}

.hud-btn-primary:hover:not(:disabled) {
  background: var(--hud-cyan);
  color: #03060a;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.6);
}

.hud-btn-ghost {
  border-color: var(--hud-border-dark);
  background: transparent;
  color: var(--hud-text-secondary);
}

.hud-btn-ghost:hover:not(:disabled) {
  border-color: var(--hud-text-secondary);
  color: var(--hud-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.hud-btn-icon {
  padding: 7px 9px;
}

.hud-btn-telemetry {
  background: rgba(255, 171, 0, 0.12);
  border-color: rgba(255, 171, 0, 0.4);
  color: var(--hud-amber);
}

.hud-btn-telemetry:hover:not(:disabled) {
  background: rgba(255, 171, 0, 0.25);
  border-color: var(--hud-amber);
  box-shadow: 0 0 14px rgba(255, 171, 0, 0.4);
}

.hud-control-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-label-inline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--hud-text-secondary);
}

.hud-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 26px 6px 10px;
  background: rgba(10, 20, 32, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300e5ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--hud-border-cyan);
  border-radius: 6px;
  color: var(--hud-text-primary);
  font-family: var(--hud-font-tech);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-select:hover:not(:disabled) {
  border-color: var(--hud-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.hud-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

.hud-select-sm {
  padding: 4px 22px 4px 8px;
  font-size: 11px;
}

/* ==========================================================================
   RIGHT FLOATING TOOLBOX
   ========================================================================== */
.hud-toolbox {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 10;
  width: 220px;
  padding: 12px;
  background: var(--hud-bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--hud-border-cyan);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 14px rgba(0, 229, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toolbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hud-border-dark);
}

.toolbox-drag-handle {
  cursor: grab;
  color: var(--hud-text-secondary);
  font-size: 13px;
  letter-spacing: -2px;
  user-select: none;
  padding: 0 4px;
}

.toolbox-drag-handle:active {
  cursor: grabbing;
}

.toolbox-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--hud-cyan);
}

.toolbox-min-btn {
  background: transparent;
  border: none;
  color: var(--hud-text-secondary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.toolbox-min-btn:hover {
  color: var(--hud-cyan);
}

.hud-toolbox.minimized {
  width: auto;
  gap: 0;
}

.hud-toolbox.minimized .toolbox-header {
  border-bottom: none;
  padding-bottom: 0;
}

.hud-toolbox.minimized .toolbox-body {
  display: none;
}

.layer-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.layer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--hud-text-secondary);
  font-family: var(--hud-font-tech);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.layer-btn:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--hud-border-cyan);
  color: var(--hud-text-primary);
}

.layer-btn.active {
  background: rgba(0, 229, 255, 0.22);
  border-color: var(--hud-cyan);
  color: var(--hud-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.layer-icon {
  font-size: 16px;
}

.toolbox-fine-tune {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  border-radius: 6px;
}

.hud-field-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-field-row label {
  font-size: 9px;
  font-weight: 600;
  color: var(--hud-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbox-divider {
  height: 1px;
  background: var(--hud-border-dark);
  margin: 2px 0;
}

.hud-btn-perturb-toggle {
  position: relative;
  width: 100%;
  padding: 9px;
  background: rgba(255, 23, 68, 0.14);
  border: 1px solid rgba(255, 23, 68, 0.45);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hud-btn-perturb-toggle:hover {
  background: rgba(255, 23, 68, 0.3);
  border-color: var(--hud-coral);
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.45);
}

.hud-btn-perturb-toggle.active {
  background: var(--hud-coral);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.6);
}

/* ==========================================================================
   INTERACTIVE PERTURBATION HUD WINDOW
   ========================================================================== */
.hud-perturb-panel {
  position: fixed;
  bottom: 24px;
  right: 18px;
  z-index: 15;
  width: 380px;
  background: var(--hud-bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 23, 68, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 23, 68, 0.06);
  display: none;
  flex-direction: column;
  animation: slide-up 0.25s ease-out;
}

.hud-perturb-panel.open {
  display: flex;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.perturb-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 23, 68, 0.25);
  background: rgba(255, 23, 68, 0.08);
}

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

.perturb-icon {
  color: var(--hud-coral);
}

.perturb-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffffff;
}

.hud-close-btn {
  background: transparent;
  border: 0;
  color: var(--hud-text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.hud-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.perturb-panel-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 75vh;
  overflow-y: auto;
}

.perturb-instruction {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--hud-text-secondary);
  background: rgba(0, 229, 255, 0.06);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--hud-cyan);
}

.instruction-badge {
  font-family: var(--hud-font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--hud-cyan);
  background: rgba(0, 229, 255, 0.15);
  padding: 2px 5px;
  border-radius: 3px;
}

.perturb-target-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.coord-input-card {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--hud-border-dark);
}

.coord-input-card label {
  font-size: 9px;
  font-weight: 600;
  color: var(--hud-text-muted);
  display: block;
  margin-bottom: 2px;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-with-unit input,
.dial-inputs input[type="number"],
.advanced-perturb-grid input {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--hud-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--hud-cyan);
}

.input-with-unit input:focus,
.dial-inputs input[type="number"]:focus,
.advanced-perturb-grid input:focus {
  outline: none;
  border-color: var(--hud-cyan);
  background: rgba(0, 229, 255, 0.08);
}

.input-with-unit .unit {
  color: var(--hud-text-muted);
  font-size: 13px;
}

.perturb-quick-dials {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 8px;
}

.dial-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dial-title-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.dial-title-row label {
  color: var(--hud-text-secondary);
  font-weight: 600;
}

.dial-value {
  font-family: var(--hud-font-mono);
  color: var(--hud-cyan);
  font-weight: 600;
}

.dial-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dial-inputs input[type="number"] {
  width: 90px;
}

.hud-range {
  flex: 1;
  accent-color: var(--hud-cyan);
  cursor: pointer;
}

.anomaly-preview-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(41, 121, 255, 0.2);
  border: 1px solid rgba(41, 121, 255, 0.5);
  font-family: var(--hud-font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--hud-blue);
  transition: all 0.25s;
}

.anomaly-preview-pill.high {
  background: rgba(255, 23, 68, 0.2);
  border-color: rgba(255, 23, 68, 0.6);
  color: var(--hud-coral);
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.3);
}

.anomaly-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.perturb-specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.spec-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-field label {
  font-size: 9px;
  font-weight: 600;
  color: var(--hud-text-muted);
}

.hud-details-group {
  border: 1px solid var(--hud-border-dark);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
}

.hud-details-group summary {
  cursor: pointer;
  color: var(--hud-text-secondary);
  font-weight: 600;
}

.advanced-perturb-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hud-border-dark);
}

.perturb-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-btn-inject {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, rgba(255, 23, 68, 0.8), rgba(255, 77, 0, 0.8));
  border: 1px solid var(--hud-coral);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(255, 23, 68, 0.4);
}

.hud-btn-inject:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 23, 68, 1), rgba(255, 77, 0, 1));
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.7);
  transform: translateY(-1px);
}

.perturb-status-msg {
  font-family: var(--hud-font-mono);
  font-size: 11px;
  color: var(--hud-coral);
  min-height: 1.2em;
  text-align: center;
}

/* ==========================================================================
   SLIDE-OUT DRAWER: ADVANCED SCIENCE DASHBOARD
   ========================================================================== */
.hud-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: var(--hud-bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--hud-border-cyan);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.8);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--hud-border-cyan);
  background: rgba(0, 229, 255, 0.05);
}

.drawer-title-group h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--hud-cyan);
  margin-bottom: 2px;
}

.drawer-subtitle {
  font-size: 11px;
  color: var(--hud-text-secondary);
}

.drawer-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Custom scrollbar */
.drawer-scroll-container::-webkit-scrollbar,
.perturb-panel-body::-webkit-scrollbar {
  width: 6px;
}

.drawer-scroll-container::-webkit-scrollbar-track,
.perturb-panel-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.drawer-scroll-container::-webkit-scrollbar-thumb,
.perturb-panel-body::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.25);
  border-radius: 3px;
}

.drawer-scroll-container::-webkit-scrollbar-thumb:hover,
.perturb-panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--hud-cyan);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--hud-text-secondary);
  margin-bottom: 10px;
  border-left: 3px solid var(--hud-cyan);
  padding-left: 8px;
}

/* ==========================================================================
   REAL-TIME CHARTS
   ========================================================================== */
.charts-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-card {
  background: rgba(4, 9, 16, 0.7);
  border: 1px solid var(--hud-border-dark);
  border-radius: 8px;
  padding: 10px 12px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  margin-bottom: 6px;
}

.chart-name {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hud-text-primary);
}

.chart-legend {
  font-family: var(--hud-font-mono);
  font-size: 9px;
  color: var(--hud-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
}

.dot-cyan { background: var(--hud-cyan); }
.dot-blue { background: var(--hud-blue); }
.dot-amber { background: var(--hud-amber); }
.dot-emerald { background: var(--hud-emerald); }
.dot-magenta { background: var(--hud-magenta); }

.telemetry-chart {
  display: block;
  width: 100%;
  height: 80px;
  border-radius: 4px;
  background: #020508;
}

.chart-footer {
  display: flex;
  justify-content: flex-end;
  font-family: var(--hud-font-mono);
  font-size: 10px;
  color: var(--hud-text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   29 TELEMETRY ACCORDIONS & GRIDS
   ========================================================================== */
.hud-telemetry-accordion {
  border: 1px solid var(--hud-border-dark);
  border-radius: 8px;
  background: rgba(5, 11, 20, 0.5);
  margin-bottom: 10px;
  overflow: hidden;
}

.hud-telemetry-accordion summary {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--hud-cyan);
  cursor: pointer;
  background: rgba(0, 229, 255, 0.04);
  border-bottom: 1px solid transparent;
  transition: background 0.2s;
}

.hud-telemetry-accordion[open] summary {
  border-bottom-color: var(--hud-border-dark);
}

.hud-telemetry-accordion summary:hover {
  background: rgba(0, 229, 255, 0.09);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px 12px;
  padding: 12px 14px;
}

.status-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-grid dt {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--hud-text-muted);
  text-transform: uppercase;
}

.status-grid dd {
  font-family: var(--hud-font-mono);
  font-size: 11px;
  color: var(--hud-text-primary);
  overflow-wrap: anywhere;
}

.status-grid dd.hard-stop {
  color: var(--hud-coral);
  font-weight: 700;
  animation: blink-crit 0.8s infinite alternate;
}

.budget-grid {
  grid-template-columns: 1fr;
  max-height: 280px;
  overflow-y: auto;
}

.budget-grid div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hint {
  font-size: 10px;
  color: var(--hud-text-secondary);
  padding: 8px 14px;
  line-height: 1.5;
}

.memory-hint {
  font-family: var(--hud-font-mono);
  color: var(--hud-amber);
}

.journal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
}

.hud-btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.hud-file-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--hud-text-secondary);
  border: 1px solid var(--hud-border-dark);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.hud-file-label:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--hud-text-primary);
}

.hud-file-label input[type="file"] {
  display: none;
}

.journal-log {
  padding: 10px 14px;
  font-family: var(--hud-font-mono);
  font-size: 11px;
  color: var(--hud-text-secondary);
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-footer {
  margin-top: auto;
}

.status-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--hud-border-dark);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.status-badge {
  font-family: var(--hud-font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--hud-cyan);
  background: rgba(0, 229, 255, 0.15);
  padding: 2px 4px;
  border-radius: 3px;
}

#status {
  font-family: var(--hud-font-mono);
  font-size: 11px;
  color: var(--hud-text-secondary);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .hud-topbar {
    max-width: 96vw;
    padding: 6px 10px;
    gap: 8px;
  }
  .brand-title {
    display: none;
  }
  .clock-display {
    font-size: 11px;
  }
  .hud-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .hud-toolbox {
    top: auto;
    bottom: 24px;
    right: 14px;
    width: 190px;
  }
  .hud-perturb-panel {
    width: calc(100vw - 28px);
    right: 14px;
    bottom: 14px;
  }
}
