/* GomSpace Aerospace Dark Mission Operations Theme */
:root {
  --bg-deep: #050811;
  --bg-panel: #0a1122;
  --bg-panel-header: #0e172e;
  --border-subtle: #182848;
  --border-active: #00e5ff;
  --text-main: #e2e8f0;
  --text-dim: #798da3;
  --accent-cyan: #00e5ff;
  --accent-blue: #2979ff;
  --accent-amber: #ffab00;
  --accent-green: #00e676;
  --accent-red: #ff1744;
  --accent-magenta: #e040fb;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* App Grid Layout */
.app-container {
  display: grid;
  grid-template-rows: 52px 1fr 140px;
  height: 100vh;
  width: 100vw;
}

/* Top Header Bar */
.top-nav {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 6px !important;
  height: 40px !important;
  min-height: 40px !important;
  background: rgba(4, 7, 15, 0.96) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  z-index: 50 !important;
  flex-wrap: nowrap !important;
}
.brand-section {
  display: flex !important;
  flex-direction: column !important;
  width: auto !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  gap: 1px !important;
}
.brand-logo {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.brand-title {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 800 !important;
  font-size: 11.5px !important;
  letter-spacing: 0.3px !important;
  color: #f1f5f9 !important;
  white-space: nowrap !important;
}
.brand-subtitle {
  font-size: 7.5px !important;
  color: #64748b !important;
  letter-spacing: 0.1px !important;
  white-space: nowrap !important;
}
.top-nav-status {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}
.aocs-flight-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.35);
  padding: 1.5px 5px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.sys-telemetry-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
}
.battery-status {
  display: flex;
  align-items: center;
  gap: 2px;
}
.battery-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  color: #94a3b8;
  font-weight: 600;
}

/* Top-Left HUD Controls */
.hud-top-left {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
  z-index: 25;
}
.hud-pill-box {
  position: relative;
  width: 155px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.hud-pill-box:hover {
  border-color: rgba(0, 229, 255, 0.4);
}
.hud-pill-inner {
  display: flex;
  align-items: center;
  padding: 4px 7px;
  gap: 6px;
}
.hud-pill-icon {
  color: #94a3b8;
  flex-shrink: 0;
}
.hud-text-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.hud-mini-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.4px;
  line-height: 1;
}
.hud-val-text {
  font-size: 9.5px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.hud-caret {
  font-size: 9px;
  color: #64748b;
  margin-left: auto;
}
.hud-hidden-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Tag Pills Row */
.hud-tags-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hud-tag-wrapper {
  position: relative;
}
.hud-tag-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 3.5px 7px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.hud-tag-pill:hover {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
}
.hud-tag-pill.active {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}
.hud-dot-active {
  color: #00e5ff;
  font-size: 8px;
  text-shadow: 0 0 6px #00e5ff;
}
.hud-dot-dim {
  color: #64748b;
  font-size: 8px;
}

/* Top-Right Floating Circular Buttons */
.hud-top-right {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: auto;
  z-index: 25;
}
.hud-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.hud-circle-btn:hover, .hud-circle-btn:active {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  transform: scale(1.05);
}

/* Floating Vertical Sliders (SPEED & TIME Rails) */
.hud-vertical-rail {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 200px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 3px;
  pointer-events: auto;
  z-index: 22;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease;
}
.hud-vertical-rail:hover {
  border-color: rgba(0, 229, 255, 0.35);
}
.hud-left-rail {
  left: 8px;
}
.hud-right-rail {
  right: 8px;
}
.hud-rail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #94a3b8;
}
.hud-rail-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
}
.hud-rail-track-container {
  position: relative;
  width: 18px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
}
.hud-rail-track {
  position: absolute;
  width: 3.5px;
  height: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: visible;
}
.hud-rail-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #2979ff, #00e5ff);
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}
.hud-rail-thumb {
  position: absolute;
  left: 50%;
  bottom: 0%;
  width: 13px;
  height: 13px;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.hud-vertical-rail:hover .hud-rail-thumb,
.hud-rail-track-container.active .hud-rail-thumb {
  background: #00e5ff;
  box-shadow: 0 0 10px #00e5ff;
}
.hud-rail-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.hud-rail-val-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #00e5ff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 22px;
  text-align: center;
}
.hud-rail-val-pill.is-paused {
  color: #ff9100;
  border-color: rgba(255, 145, 0, 0.3);
}
.hud-rail-val-pill.is-live {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.3);
}
.hud-rail-pause-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(14, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hud-rail-pause-btn:hover {
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Bottom Controls Area */
.hud-bottom-area {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  z-index: 25;
}
.hud-bottom-subrow {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
}
.hud-aocs-trigger-pill {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 2px 8px;
  border-radius: 16px;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 2;
  max-width: 105px;
}
.hud-aocs-trigger-pill:hover, .hud-aocs-trigger-pill:active {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}
.aocs-trigger-icon {
  color: var(--accent-cyan);
  font-size: 13px;
  flex-shrink: 0;
}
.aocs-trigger-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.1;
  min-width: 0;
}
.aocs-trigger-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 800;
  color: #f1f5f9;
}
.aocs-trigger-sub {
  font-size: 6.5px;
  color: #64748b;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.aocs-trigger-chevron {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}

/* Simulation Transport Cluster Centered between cards 2 & 3 */
.hud-sim-transport {
  position: absolute;
  left: 56%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 2px 4px;
  border-radius: 16px;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.hud-transport-step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hud-transport-step:hover, .hud-transport-step:active {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}
.hud-transport-pause {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: rgba(0, 229, 255, 0.12);
  border: 1.5px solid #00e5ff;
  color: #00e5ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  transition: all 0.2s ease;
}
.hud-transport-pause:hover, .hud-transport-pause:active {
  background: rgba(0, 229, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.55);
}
.hud-transport-pause.is-paused {
  background: rgba(255, 145, 0, 0.15);
  border-color: #ff9100;
  color: #ff9100;
  box-shadow: 0 0 12px rgba(255, 145, 0, 0.35);
}

/* Bottom Row: 4 Primary AOCS Flight Modes */
.hud-flight-modes-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}
.hud-mode-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 4px 4px;
  height: 44px;
  border-radius: 7px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  min-width: 0;
  overflow: hidden;
}
.hud-mode-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(16, 26, 46, 0.9);
}
.hud-mode-card.active {
  background: rgba(0, 229, 255, 0.12) !important;
  border-color: #00e5ff !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.4) !important;
}
.mode-card-header {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
}
.mode-card-icon {
  font-size: 9.5px;
  color: #94a3b8;
  flex-shrink: 0;
}
.hud-mode-card.active .mode-card-icon {
  color: #00e5ff;
}
.mode-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.2px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-mode-card.active .mode-card-title {
  color: #00e5ff;
}
.mode-card-sub {
  font-size: 6.5px;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.hud-mode-card.active .mode-card-sub {
  color: #80f0ff;
}

/* Telemetry Drawer Slide-Over Panel */
.telemetry-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.telemetry-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.telemetry-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(14, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.drawer-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}
.drawer-close-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.drawer-close-btn:hover {
  background: #334155;
  border-color: #00e5ff;
  color: #00e5ff;
}

/* Responsive Mobile Layout Rules */
@media (max-width: 900px) {
  html, body {
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #02050b !important;
  }
  .app-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .workspace-grid {
    display: block !important;
    width: 100% !important;
    height: calc(100% - 42px) !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  .viewport-container {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    overflow: hidden !important;
  }
  #three-canvas-container, #three-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
  }
  
  /* Telemetry Drawer on Mobile (Slide-Over) */
  .telemetry-drawer {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 310px !important;
    max-width: 86vw !important;
    height: 100% !important;
    max-height: 100% !important;
    background: rgba(8, 14, 26, 0.96) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-left: 1px solid rgba(0, 229, 255, 0.3) !important;
    border-top: none !important;
    border-radius: 0 !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.9) !important;
    z-index: 9995 !important;
    transform: translateX(100%) !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
  }
  .telemetry-drawer.open {
    transform: translateX(0) !important;
  }
  .telemetry-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    background: rgba(14, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .telemetry-drawer-body {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px 12px 40px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .telemetry-drawer-body * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .mobile-drawer-pane {
    transform: translateX(100%) !important;
  }
  .mobile-drawer-header {
    display: none !important;
  }
  .btn-tour-launcher {
    display: none !important;
  }
}

/* Desktop Layout Rules */
@media (min-width: 901px) {
  .hud-vertical-rail,
  .hud-bottom-area,
  .telemetry-drawer-header,
  .telemetry-backdrop {
    display: none !important;
  }
  .workspace-grid {
    display: grid !important;
    grid-template-columns: 1fr 360px !important;
  }
  .flight-sidebar {
    display: flex !important;
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
  }
}


.vector-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(8, 14, 26, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  min-width: 170px;
}
.vector-popover.open {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
}
.vector-popover-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  color: #cbd5e1;
  cursor: pointer;
}
.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ========================================================= */
/* Telemetry Drawer & Sidebar Engineering Avionics Styles    */
/* ========================================================= */

.flight-sidebar {
  background: #070c18 !important;
  color: #e2e8f0;
  font-family: var(--font-sans);
}

/* Panel Accordion Headers */
.panel-header {
  background: rgba(14, 23, 42, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  color: var(--accent-cyan) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  cursor: pointer !important;
  margin-top: 6px !important;
  margin-bottom: 4px !important;
  user-select: none !important;
  transition: all 0.15s ease !important;
}
.panel-header:hover {
  border-color: rgba(0, 229, 255, 0.4) !important;
  background: rgba(18, 30, 56, 0.95) !important;
}
.accordion-arrow {
  font-size: 11px !important;
  color: #64748b !important;
  transition: transform 0.2s ease !important;
}
.panel-header.is-collapsed .accordion-arrow {
  color: #94a3b8 !important;
}

/* Panel Sections */
.panel-section {
  padding: 8px 4px 10px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.panel-section.is-collapsed {
  display: none !important;
}

.section-title {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  margin-bottom: 6px !important;
  letter-spacing: 0.4px !important;
}

/* Mode Selector Grid & Buttons (AVIONICS DARK THEME - NEVER WHITE!) */
.mode-selector-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  margin-bottom: 6px !important;
}

.btn-mode {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;
  text-align: left !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.btn-mode:hover {
  border-color: rgba(0, 229, 255, 0.5) !important;
  background: rgba(22, 36, 66, 0.95) !important;
  color: #00e5ff !important;
}
.btn-mode.active {
  background: rgba(0, 229, 255, 0.14) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35) !important;
}
.btn-mode .sub-label {
  font-size: 8px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
}
.btn-mode.active .sub-label {
  color: #80f0ff !important;
}

/* Action Buttons (PAUSE, TUMBLE, ZERO WHEELS) */
.btn-action {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
  padding: 7px 12px !important;
  border-radius: 6px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}
.btn-action:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
}
.btn-danger {
  border-color: rgba(255, 23, 68, 0.4) !important;
  color: #ff5252 !important;
}
.btn-danger:hover {
  background: rgba(255, 23, 68, 0.15) !important;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.3) !important;
}

/* Telemetry Key-Value Rows */
.telem-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 4.5px 8px !important;
  background: rgba(4, 8, 17, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 5px !important;
  margin-bottom: 4px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 9.5px !important;
}
.telem-label {
  color: #94a3b8 !important;
  font-weight: 600 !important;
}
.telem-val {
  color: var(--accent-cyan) !important;
  font-weight: 700 !important;
}

/* Reaction Wheel & Magnetorquer Gauges */
.gauge-container {
  margin-bottom: 7px !important;
}
.gauge-label-row {
  display: flex !important;
  justify-content: space-between !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 9px !important;
  margin-bottom: 3px !important;
  color: #cbd5e1 !important;
}
.gauge-bar-bg {
  width: 100% !important;
  height: 6px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 3px !important;
  overflow: hidden !important;
  position: relative !important;
}
.gauge-bar-fill {
  height: 100% !important;
  background: linear-gradient(to right, #2979ff, #00e5ff) !important;
  border-radius: 3px !important;
  transition: width 0.08s linear !important;
}
.gauge-bar-fill.saturated {
  background: #ff1744 !important;
}

/* Immersive Fullscreen Mode (Universal Cross-Platform including iOS Safari) */
body.immersive-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 999999 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #02050b !important;
}
body.immersive-fullscreen .top-nav {
  display: none !important;
}
body.immersive-fullscreen .workspace-grid {
  height: 100% !important;
  height: 100dvh !important;
}
body.immersive-fullscreen .viewport-container {
  height: 100% !important;
}
