:root {
    --bg-main: #060911;
    --bg-card: #0d1424;
    --bg-card-header: #121d33;
    --border-color: #1e293b;
    --border-highlight: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #0ea5e9;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 40px;
}

/* Header */
.app-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-link {
    background: #1e293b;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-link:hover {
    border-color: var(--accent-blue);
}

/* Status Bar */
.status-bar {
    background: #090e18;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    font-size: 0.82rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    color: var(--text-muted);
}

.status-val {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.status-pill {
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.status-pill.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Main Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    padding: 24px;
    max-width: 1560px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Viewport 3D */
#turbine3dContainer {
    width: 100%;
    height: 440px;
    background: #060911;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Button groups */
.btn-group {
    display: flex;
    gap: 8px;
}

.mode-btn {
    background: #162032;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-btn:hover {
    background: #1e2c44;
    color: var(--text-primary);
}

.mode-btn.active {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Control Rows */
.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.slider-with-val {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 220px;
}

input[type=range] {
    flex: 1;
    accent-color: var(--accent-blue);
}

.slider-val-readout {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
    min-width: 55px;
    text-align: right;
}

.btn-action {
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-action:hover {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}

/* Responsive */
@media (max-width: 960px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    #turbine3dContainer {
        height: 320px;
    }
}

@media (max-width: 900px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important; height: 100dvh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    background: #02050b !important;
  }
  .app-header,
  .status-bar {
    display: none !important;
  }
  .dashboard-grid {
    display: block !important;
    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;
  }
  .live-sticky-screen {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #02050b !important;
    overflow: hidden !important;
  }
  .live-sticky-screen .card-header {
    display: none !important;
  }
  .live-sticky-screen .card-body {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    position: relative !important;
  }
  #turbine3dContainer, #turbine3dContainer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
  .live-sticky-screen .card-body > div:last-child {
    display: none !important;
  }

  .hud-overlay-layer {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    pointer-events: none !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(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-left: 1px solid rgba(0, 229, 255, 0.3) !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85) !important;
    z-index: 9995 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    pointer-events: auto !important;
    margin: 0 !important;
  }
  .telemetry-drawer.open {
    transform: translateX(0) !important;
  }
  
  /* Remove old drawer action bar */
  .mobile-drawer-header,
  .mobile-drawer-pane {
    display: none !important;
  }
  .btn-tour-launcher {
    display: none !important;
  }
}
@media (min-width: 901px) {
  .tour-card {
    bottom: 24px;
    right: 24px;
    width: 380px;
  }
}

.tour-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tour-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tour-step-badge {
  background: linear-gradient(135deg, #f59e0b, #ffd600);
  color: #050811;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tour-app-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}
.tour-btn-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.tour-btn-close:hover {
  color: #ffffff;
  border-color: #ffd600;
  background: rgba(255, 214, 0, 0.1);
}

.tour-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tour-instruction-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}
.tour-detail-row {
  font-size: 0.73rem;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 5px;
}
.tour-detail-happens {
  background: rgba(15, 23, 42, 0.85);
  border-left: 3px solid #ffd600;
  color: #e2e8f0;
}
.tour-detail-why {
  background: rgba(11, 17, 32, 0.85);
  border-left: 3px solid #38bdf8;
  color: #cbd5e1;
}

.tour-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
.tour-btn-prev {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.tour-btn-prev:hover {
  color: #ffffff;
  background: #334155;
}
.tour-btn-next {
  background: linear-gradient(135deg, #ffd600, #f59e0b);
  border: none;
  color: #050811;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(255, 214, 0, 0.4);
  transition: transform 0.15s;
}
.tour-btn-next:hover {
  transform: translateY(-1px);
}

/* Floating Tour Launcher Button */
.btn-tour-launcher {
  position: fixed;
  bottom: 58px;
  right: 14px;
  z-index: 8990;
  background: linear-gradient(135deg, #f59e0b, #ffd600);
  color: #050811;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 214, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
}
.btn-tour-launcher:hover {
  transform: translateY(-2px);
}

/* Universal Collapsible Bottom Sheet Drawer for Controls */
@media (max-width: 900px) {
  .mobile-drawer-pane {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9000 !important;
    max-height: 44vh !important;
    height: auto !important;
    background: rgba(8, 13, 24, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 2px solid #ffd600 !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9) !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateY(calc(100% - 44px)) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 !important;
  }
  .mobile-drawer-pane.drawer-expanded {
    transform: translateY(0) !important;
  }

  .mobile-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    height: 44px !important;
    min-height: 44px !important;
    background: rgba(14, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px 18px 0 0 !important;
    cursor: pointer !important;
    user-select: none !important;
    flex-shrink: 0 !important;
  }
  .drawer-title-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .drawer-badge {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #ffd600 !important;
    letter-spacing: 0.5px !important;
  }
  .drawer-toggle-btn {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .mobile-drawer-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px 14px 48px !important;
  }

  
  /* Sleek Compact Drawer Accordion Cards */
  .mobile-drawer-body .card,
  .mobile-drawer-body .panel,
  .mobile-drawer-body .control-card {
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  .mobile-drawer-body .card-header,
  .mobile-drawer-body .panel-header {
    padding: 8px 12px !important;
    font-size: 0.76rem !important;
    cursor: pointer !important;
    user-select: none !important;
  }

  /* Mobile touch controls optimization */
  input[type=range] {
    height: 38px !important;
    min-height: 38px !important;
  }
  input[type=range]::-webkit-slider-thumb {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: #ffd600 !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 10px rgba(255, 214, 0, 0.8) !important;
  }
  select, button {
    min-height: 40px !important;
  }
  .btn-tour-launcher {
    bottom: 52px !important;
    right: 10px !important;
    padding: 6px 12px !important;
    font-size: 0.72rem !important;
  }
}

/* Desktop layout rules */
@media (min-width: 901px) {
  .mobile-drawer-header {
    display: none !important;
  }
  .mobile-drawer-body {
    display: contents !important;
  }
}


/* Universal Drawer Accordions */
.accordion-arrow {
  font-size: 13px !important;
  color: #ffd600 !important;
  margin-left: auto !important;
  padding-left: 8px !important;
  display: inline-block !important;
  font-weight: 800 !important;
  transition: transform 0.2s ease !important;
}
.mobile-drawer-body .card-header,
.mobile-drawer-body .card-title,
.mobile-drawer-body .panel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
  user-select: none !important;
}


/* Universal Mobile Drawer Accordions */
.accordion-arrow {
  font-size: 13px !important;
  color: #ffd600 !important;
  margin-left: auto !important;
  padding-left: 8px !important;
  display: inline-block !important;
  font-weight: 800 !important;
  transition: transform 0.2s ease !important;
}
.mobile-drawer-body .card-header,
.mobile-drawer-body .card-title,
.mobile-drawer-body .panel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
  user-select: none !important;
}


/* ========================================================= */
/* Floating Engineering HUD Overlay & Avionics Styles        */
/* ========================================================= */

.live-sticky-screen {
  position: relative !important;
  overflow: hidden !important;
}

.hud-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: hidden;
}

/* 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;
}

/* 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 */
.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: 8px;
  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: 8px;
  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: 120px;
}
.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: #00e5ff;
  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: 8px;
  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 */
.hud-sim-transport {
  position: absolute;
  left: 58%;
  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: 9px;
  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 Mode Cards */
.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: 10px 14px;
  background: rgba(6, 11, 20, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.drawer-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  color: #00e5ff;
  letter-spacing: 0.5px;
}
.drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.drawer-close-btn:hover {
  background: rgba(255, 23, 68, 0.2);
  border-color: #ff1744;
  color: #ff5252;
}

.telemetry-drawer-body {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Avionics Dark Theme for ALL Drawer Elements (NEVER WHITE BUTTONS) */
.telemetry-drawer-body .card {
  background: rgba(11, 18, 32, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
.telemetry-drawer-body .card-header {
  background: rgba(15, 23, 42, 0.95) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 8px 12px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #00e5ff !important;
}
.telemetry-drawer-body .card-body {
  padding: 10px 12px !important;
  background: transparent !important;
}
.telemetry-drawer-body .btn,
.telemetry-drawer-body .mode-btn,
.telemetry-drawer-body .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;
}
.telemetry-drawer-body .btn:hover,
.telemetry-drawer-body .mode-btn:hover,
.telemetry-drawer-body .btn-action:hover {
  background: rgba(22, 36, 66, 0.95) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
}
.telemetry-drawer-body .btn.active,
.telemetry-drawer-body .mode-btn.active,
.telemetry-drawer-body .btn-action.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;
}
.telemetry-drawer-body .btn-danger {
  border-color: rgba(255, 23, 68, 0.4) !important;
  color: #ff5252 !important;
}
.telemetry-drawer-body .btn-danger:hover {
  background: rgba(255, 23, 68, 0.15) !important;
  border-color: #ff1744 !important;
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.3) !important;
}
.telemetry-drawer-body .control-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 6px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
}
.telemetry-drawer-body .slider-val-readout {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #00e5ff !important;
}

/* Immersive Fullscreen Mode (Universal Cross-Platform & iOS Safari) */
body.immersive-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100% !important; height: 100dvh !important;
  height: 100dvh !important;
  z-index: 999999 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #02050b !important;
}
body.immersive-fullscreen .app-header,
body.immersive-fullscreen .status-bar {
  display: none !important;
}
body.immersive-fullscreen .dashboard-grid,
body.immersive-fullscreen .workspace-grid {
  height: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.immersive-fullscreen .live-sticky-screen {
  height: 100% !important;
  height: 100dvh !important;
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: #0b1220;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #00e5ff;
}
.modal-body {
  padding: 14px 16px;
  color: #cbd5e1;
  font-size: 11.5px;
  line-height: 1.6;
}
.modal-body h4 {
  color: #38bdf8;
  margin: 10px 0 4px 0;
  font-size: 12px;
}
.modal-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  color: #00e5ff;
  font-family: 'JetBrains Mono', monospace;
}

/* Responsive Mobile & Desktop Layout Rules */
@media (max-width: 900px) {
  html, body {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #02050b !important;
  }
  .app-header {
    display: none !important;
  }
  .status-bar {
    display: none !important;
  }
  .dashboard-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important; height: 100dvh !important;
    height: 100dvh !important;
    margin: 0 auto !important;
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }
  .live-sticky-screen {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #02050b !important;
  }
  .live-sticky-screen .card-header {
    display: none !important;
  }
  .live-sticky-screen .card-body {
    height: 100% !important;
    padding: 0 !important;
  }
  #turbine3dContainer, #turbine3dContainer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }
  .live-sticky-screen .card-body > div:last-child {
    display: none !important;
  }
  
  /* Telemetry Drawer on Mobile (Slide-Over) */
  .telemetry-drawer {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 320px !important;
    max-width: 86vw !important;
    height: 100% !important;
    max-height: 100% !important;
    background: rgba(8, 14, 26, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-left: 1px solid rgba(0, 229, 255, 0.3) !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85) !important;
    z-index: 9995 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    pointer-events: auto !important;
  }
  .telemetry-drawer.open {
    transform: translateX(0) !important;
  }
  
  /* Remove old drawer action bar */
  .mobile-drawer-header {
    display: none !important;
  }
}

@media (min-width: 901px) {
  .hud-overlay-layer,
  .hud-vertical-rail,
  .hud-bottom-area,
  .telemetry-drawer-header,
  .telemetry-backdrop {
    display: none !important;
  }
  .telemetry-drawer {
    display: flex !important;
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
  }
}

/* Clean Mobile HUD: Strictly hide desktop tour cards, launcher buttons, modal footers & headers */
@media (max-width: 900px) {
  .guide-modal-footer,
  .btn-guide-start,
  #tourCard,
  .tour-card,
  .tour-overlay,
  #btnTourLauncher,
  .btnTourLauncher,
  .tour-launcher-btn,
  .app-header,
  header.app-header,
  section.status-bar,
  footer {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
