    :root {
  --app-bg:        radial-gradient(circle at top, #131927 0, #050711 55%, #020308 100%);
  --panel-bg:      rgba(8, 12, 22, 0.55);
  --panel-border:  rgba(255, 255, 255, 0.06);
  --panel-radius:  10px;
  --panel-shadow:  0 12px 24px rgba(0, 0, 0, 0.5);
  --accent:        #f63760;
  --accent-soft:   rgba(246, 55, 96, 0.18);
  --text-main:     #f5f7ff;
  --text-muted:    #9aa0c2;
  --grid-unit:     8px;
}

html, body, #cesiumContainer {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--app-bg);
  color: var(--text-main);
}

/* Help Modal */
#helpModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

#helpModalContent {
  background: rgba(20, 25, 40, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#helpModalBody h3 {
  color: #4fc3f7;
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 14px;
}

#helpModalBody p {
  margin: 8px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

#helpModalBody ul {
  margin: 8px 0;
  padding-left: 20px;
}

#helpModalBody li {
  margin: 4px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

#helpModalBody code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #4fc3f7;
}

/* Channel Mapping Modal */
#channelMappingModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

#channelMappingModalContent {
  background: rgba(20, 25, 40, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 24px;
  max-width: 550px;
  width: 90%;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#channelMappingModalContent label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}

#channelMappingModalContent .channel-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  padding: 4px 8px;
  font-size: 11px;
  width: 100%;
}

#channelMappingModalContent .channel-select:focus {
  outline: none;
  border-color: #4fc3f7;
}

/* Transmitter Mode Buttons */
.tx-mode-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}
.tx-mode-btn.active {
  background: rgba(79, 195, 247, 0.2) !important;
  border-color: #4fc3f7 !important;
  box-shadow: 0 0 6px rgba(79, 195, 247, 0.3);
}

/* HUD Configure Button */
.hud-configure {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.hud-configure:hover {
  color: #4fc3f7;
}

/* Fail Safe Border Frame */
#fsBorderFrame {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
}

#dismissFsBorder {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 40px;
  height: 40px;
  background: #F44336;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  pointer-events: auto;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#dismissFsBorder:hover {
  background: #D32F2F;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

.fs-border-top,
.fs-border-right,
.fs-border-bottom,
.fs-border-left {
  position: absolute;
  background: #F44336;
  color: white;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  animation: fsPulse 2s ease-in-out infinite;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes fsPulse {
  0%, 100% {
    opacity: 0.9;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(244, 67, 54, 0.4);
  }
  50% {
    opacity: 1;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), 0 0 50px rgba(244, 67, 54, 0.8);
  }
}

.fs-border-top {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 30px !important;
}

.fs-border-bottom {
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 30px !important;
}

.fs-border-left {
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 30px !important;
  writing-mode: vertical-rl !important;
  text-orientation: mixed;
}

.fs-border-right {
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 30px !important;
  writing-mode: vertical-rl !important;
  text-orientation: mixed;
}

/* Fail Safe Warning Modal */
#fsWarningModal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10001; /* Higher than help modal */
  display: none; /* Hidden by default */
  justify-content: center !important;
  align-items: center !important;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

#fsWarningModal.show {
  display: flex !important; /* Only show when .show class is added */
}

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

#fsWarningModalContent {
  background: rgba(20, 25, 40, 0.98);
  border: 2px solid #F44336;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(244, 67, 54, 0.3), 0 0 100px rgba(244, 67, 54, 0.2);
  animation: slideIn 0.3s ease;
  position: relative;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mobile Warning - Hidden by default, shown on mobile via media query */
#mobileWarning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

#mobileWarningContent {
  background: rgba(20, 25, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  max-width: 90%;
  width: 320px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

#closeMobileWarning:hover {
  background: rgba(255, 255, 255, 0.3);
}

.app-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.app-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-soft);
}
.app-button:active {
  transform: translateY(1px);
}
.app-button.active {
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.hud-panel {
  position: absolute;
  cursor: default;
  background: var(--panel-bg);
  border-radius: var(--panel-radius);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  padding: calc(var(--grid-unit) * 1);
  color: var(--text-main);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 4px;
  margin-bottom: 4px;
  cursor: move;
  cursor: grab;
}

.hud-header:active {
  cursor: grabbing;
}

.hud-title {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 26px;
}

.hud-close {
  width: 18px;
  height: 18px;
  right: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 12px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.hud-close:hover {
  background: rgba(255,255,255,0.17);
}

.hud-close:active {
  transform: scale(0.9);
}

.hud-help {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  border: 1px solid rgba(79, 195, 247, 0.4);
  border-radius: 50%;
  background: rgba(79, 195, 247, 0.1);
  color: #4fc3f7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  line-height: 11px;
  transition: all 0.15s ease;
  z-index: 1;
}

.hud-help:hover {
  background: rgba(79, 195, 247, 0.25);
  border-color: rgba(79, 195, 247, 0.7);
  transform: scale(1.1);
}

.hud-help:active {
  transform: scale(0.95);
}

.hud-header-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-collapse {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  line-height: 12px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.hud-collapse:hover {
  background: rgba(255,255,255,0.17);
}

.hud-collapse:active {
  transform: scale(0.9);
}

.hud-panel.collapsed .hud-content {
  display: none;
}

/* IMAC panel collapsible sections */
.imac-section {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.imac-section:last-child {
  border-bottom: none;
}
.imac-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  user-select: none;
}
.imac-section-header:hover {
  color: rgba(255,255,255,0.95);
}
.imac-section-header .imac-chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
}
.imac-section.collapsed .imac-chevron {
  transform: rotate(-90deg);
}
.imac-section-content {
  padding-bottom: 8px;
}
.imac-section.collapsed .imac-section-content {
  display: none;
}

    html, body, #cesiumContainer {
      width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
    }
    #hud {
      position: absolute;
      top: 56px;
      left: 10px;
      padding: 8px 12px;
      color: #fff;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 13px;
      line-height: 1.4;
      border-radius: 6px;
      z-index: 10;
      max-width: 260px;
    }
    #hud strong { margin-right: 4px; }

    /* Channel select dropdowns */
    .channel-select {
      width: 100%;
      padding: 4px 8px;
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 4px;
      color: var(--text-main);
      font-size: 11px;
      font-family: inherit;
      cursor: pointer;
      transition: all 0.2s ease;
      outline: none;
    }

    .channel-select:hover {
      background: rgba(0, 0, 0, 0.5);
      border-color: rgba(255, 255, 255, 0.25);
    }

    .channel-select:focus {
      background: rgba(0, 0, 0, 0.6);
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(246, 55, 96, 0.2);
    }

    .channel-select option {
      background: #1a1f30;
      color: var(--text-main);
      padding: 4px;
    }

    /* ========================================
       HUD PANEL DEFAULT POSITIONS (Non-overlapping)
       ======================================== */

    /* LEFT COLUMN */
    #hud {
      position: absolute;
      top: 52px;
      left: 12px;
      max-width: 260px;
    }

    #windRosePanel {
      position: absolute;
      top: 280px;
      left: 12px;
      min-width: 170px;
      max-width: 220px;
      z-index: 10;
    }

    #weatherPanel {
      position: absolute;
      top: 520px;
      left: 12px;
      min-width: 220px;
      max-width: 260px;
      z-index: 10;
    }

    /* CENTER COLUMN */
    #viewerControlsPanel {
      position: absolute;
      top: 52px;
      left: 292px;
      z-index: 10;
    }

    #modelInfoPanel {
      position: absolute;
      top: 52px;
      left: 580px;
      padding: 8px 10px;
      color: #fff;
      border-radius: 6px;
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      line-height: 1.4;
      min-width: 300px;
      max-width: 300px;
    }

    #flyingSitePanel {
      position: absolute;
      top: 280px;
      left: 580px;
      padding: 8px 10px;
      color: #fff;
      border-radius: 6px;
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      line-height: 1.4;
      min-width: 300px;
      max-width: 300px;
    }

    #flyingSitePanel-main {
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }

    #flyingSiteImageWrapper {
      width: 64px;
      height: 64px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.3);
      flex-shrink: 0;
    }

    #flyingSiteImage {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: none;
      transition: opacity 0.2s ease;
    }

    #flyingSiteImage:hover {
      opacity: 0.8;
    }

    #flyingSiteName {
      font-weight: 600;
      font-size: 12px;
      margin-bottom: 2px;
    }

    #flyingSiteLocation {
      font-size: 10px;
      opacity: 0.8;
      margin-top: 2px;
    }

    #flyingSiteDistance {
      font-size: 10px;
      opacity: 0.8;
      margin-top: 2px;
    }

    #flyingSiteDescription {
      font-size: 10px;
      opacity: 0.8;
      margin-top: 4px;
      font-style: italic;
    }

    /* RIGHT COLUMN */
    #flightControls {
      position: absolute;
      top: 52px;
      right: 12px;
      padding: 8px 10px;
      background: var(--panel-bg);
      border-radius: var(--panel-radius);
      border: 1px solid var(--panel-border);
      box-shadow: var(--panel-shadow);
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      min-width: 260px;
    }

    #flightRecordsPanel {
      position: absolute;
      top: 450px;
      left: 580px;
      padding: 8px 10px;
      color: #fff;
      border-radius: 6px;
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      line-height: 1.4;
      min-width: 600px;
      max-width: 600px;
    }

    #modelSelector {
      position: absolute;
      top: 340px;
      right: 12px;
      padding: 6px 8px;
      border-radius: 6px;
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 12px;
      color: #fff;
    }

    #captureControls {
      position: absolute;
      top: 500px;
      right: 12px;
      min-width: 200px;
      z-index: 10;
    }

    #flightCompare {
      position: absolute;
      top: 640px;
      right: 12px;
      min-width: 260px;
      z-index: 10;
    }

    #fsWarning {
      position: absolute;
      top: 720px;
      right: 12px;
      max-width: 260px;
      z-index: 12;
    }

    /* BOTTOM RIGHT STACK */
    #throttleLegend {
      position: absolute;
      bottom: 430px;
      right: 12px;
      padding: 6px 10px;
      color: #fff;
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      line-height: 1.4;
      min-width: 180px;
    }


    #statsPanel {
      position: absolute;
      bottom: 90px;
      right: 12px;
      padding: 8px 12px;
      color: #fff;
      z-index: 10;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 12px;
      line-height: 1.4;
      min-width: 180px;
    }
    .fc-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 4px;
    }
    .fc-row:last-child {
      margin-bottom: 0;
    }
    .fc-group-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      white-space: nowrap;
    }
    .fc-buttons {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

 

    #statsPanel strong {
      margin-right: 4px;
    }

    #resetHudBtn {
      position: absolute;
      bottom: 8px;
      left: 12px;
    }

        #fsTimeline {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 32px;
      height: 14px;
      z-index: 9;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 10px;
      color: #fff;
      pointer-events: none;
    }
    #fsTimelineBar {
      position: relative;
      width: 100%;
      height: 4px;
      margin-top: 4px;
      border-radius: 3px;
      background: rgba(255, 255, 255, 0.1);
      box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
      pointer-events: auto;
    }
    .fs-tick {
      position: absolute;
      top: -2px;
      width: 2px;
      height: 8px;
      background: #ff3b3b;
      border-radius: 1px;
      transform: translateX(-50%);
      cursor: pointer;
    }
    .fs-tick:hover {
      height: 10px;
      background: #ff7777;
    }

    #keyEvents {
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid rgba(255,255,255,0.25);
      font-size: 11px;
    }
    #keyEvents div {
      margin-top: 1px;
    }

    #throttleLegend .legend-title {
      font-weight: 600;
      margin-bottom: 4px;
    }
    #throttleLegend .legend-bar {
      height: 10px;
      border-radius: 4px;
      margin-bottom: 4px;
      background: linear-gradient(
        to right,
        #0000ff,
        #00ff00,
        #ffff00,
        #ff0000
      );
    }
    #throttleLegend .legend-labels {
      display: flex;
      justify-content: space-between;
      opacity: 0.85;
    }
    #throttleLegend .legend-labels span {
      white-space: nowrap;
    }
#fsWarning strong {
  color: #ffdddd;
}

    #modelSelector label {
      margin-right: 4px;
      font-size: 11px;
    }
    #modelSelector select {
      background: rgba(0, 0, 0, 0.7);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.4);
      border-radius: 4px;
      padding: 2px 4px;
      font-size: 11px;
    }

    #modelInfoPanel-main {
      display: flex;
      gap: 8px;
      align-items: flex-start;
    }
    #modelInfoImageWrapper {
      width: 64px;
      height: 64px;
      border-radius: 4px;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.3);
      flex-shrink: 0;
    }
    #modelInfoImage {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: none;
      transition: opacity 0.2s ease;
    }
    #modelInfoImage:hover {
      opacity: 0.8;
    }
    #modelInfoName {
      font-weight: 600;
      font-size: 12px;
      margin-bottom: 2px;
    }
    #modelInfoDesc {
      font-size: 11px;
      opacity: 0.85;
      max-height: 3.2em;
      overflow: hidden;
    }
    #modelInfoViews {
      font-size: 10px;
      margin-top: 4px;
      opacity: 0.8;
    }

    #modelInfoGallery {
      padding-top: 8px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    #modelInfoGalleryImages img {
      transition: transform 0.2s ease, border-color 0.2s ease;
    }

    #modelInfoGalleryImages img:hover {
      transform: scale(1.1);
      border-color: var(--accent) !important;
    }

    #modelImageLightbox {
      animation: fadeIn 0.2s ease;
    }

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

#channelMapSelector label {
  margin-right: 4px;
}
#channelMapSelector select {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 1px 3px;
  font-size: 11px;
  margin-right: 4px;
  margin-top: 2px;
  width: 120px;
}

    /* Timeline scrubber styling */
    #timeline-scrubber {
      -webkit-appearance: none;
      appearance: none;
      height: 6px;
      border-radius: 3px;
      background: rgba(255, 255, 255, 0.2);
      outline: none;
    }

    #timeline-scrubber::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      box-shadow: 0 0 4px rgba(246, 55, 96, 0.8);
    }

    #timeline-scrubber::-moz-range-thumb {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      border: none;
      box-shadow: 0 0 4px rgba(246, 55, 96, 0.8);
    }

    #timeline-scrubber:hover::-webkit-slider-thumb {
      width: 16px;
      height: 16px;
    }

    #timeline-scrubber:hover::-moz-range-thumb {
      width: 16px;
      height: 16px;
    }
    #weatherPanel .weather-title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
      color: var(--text-muted);
    }
    #weatherPanel .weather-row {
      font-size: 11px;
      margin-top: 2px;
      display: flex;
      justify-content: space-between;
      gap: 6px;
    }
    #weatherPanel .weather-label {
      opacity: 0.8;
      white-space: nowrap;
    }
    #weatherPanel .weather-value {
      text-align: right;
      font-weight: 500;
    }
    #weatherPanel .weather-source {
      margin-top: 4px;
      font-size: 10px;
      opacity: 0.75;
    }

    #weatherPanel .weather-source a {
      color: #4fc3f7;
      text-decoration: none;
      transition: color 0.2s ease, opacity 0.2s ease;
    }

    #weatherPanel .weather-source a:hover {
      color: #81d4fa;
      text-decoration: underline;
      opacity: 1;
    }

    #windRosePanel .wind-rose-title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
      color: var(--text-muted);
    }
    .wind-rose-compass {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 4px auto 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), rgba(10,10,20,0.4)),
    radial-gradient(circle at 70% 80%, rgba(246,55,96,0.16), rgba(0,0,0,0.5));
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.wind-rose-compass::before,
.wind-rose-compass::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.wind-rose-compass::before {
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
}

.wind-rose-compass::after {
  width: 80px;
  height: 80px;
  border: 1px dashed rgba(255,255,255,0.15);
}
.wind-rose-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 46px;
  margin-left: -2px;
  margin-top: -40px;
  background: linear-gradient(to bottom, rgba(246,55,96,0.95), rgba(246,55,96,0.2));
  border-radius: 999px;
  transform-origin: 50% 80%;
  box-shadow: 0 0 8px rgba(246,55,96,0.7);
}
.wind-rose-label {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0 0 4px rgba(0,0,0,0.7);
  color: rgba(255,255,255,0.85);
  /* Position will be set dynamically via JavaScript */
}
.wind-rose-meta {
  font-size: 11px;
  text-align: center;
  margin-top: 4px;
  opacity: 0.9;
}
.wind-rose-toggle {
  margin-top: 6px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.wind-rose-toggle input[type="checkbox"] {
  transform: scale(0.9);
}

.weather-wind-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  box-sizing: border-box;
  opacity: 0.95;
  vertical-align: middle;
}

.weather-wind-arrow::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 14px solid #ff406c;  /* brighter, larger arrow */
  filter: drop-shadow(0 0 3px rgba(255, 64, 108, 0.7));
}

/* G-Force Panel Styles */
#gforcePanel {
  position: absolute;
  top: 280px;
  right: 12px;
  width: 230px;
  z-index: 10;
}

.gforce-gauge-container {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.gforce-gauge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: filter 0.3s ease;
}

.gforce-gauge svg {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
  width: 200px;
  height: 200px;
}

/* Needle animation */
.gforce-needle {
  transform-origin: 100px 100px;
  transition: transform 0.15s ease-out;
}

/* Glow intensity classes applied by JS */
.gforce-gauge.glow-green {
  filter: drop-shadow(0 0 12px rgba(76, 175, 80, 0.3));
}
.gforce-gauge.glow-yellow {
  filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.4));
}
.gforce-gauge.glow-orange {
  filter: drop-shadow(0 0 18px rgba(255, 152, 0, 0.5));
}
.gforce-gauge.glow-red {
  filter: drop-shadow(0 0 22px rgba(244, 67, 54, 0.6));
}

#gforceGraph {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Artificial Horizon Styles */
.horizon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.horizon-instrument {
  width: 180px;
  height: 180px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

#horizonPanel {
  position: absolute;
  top: 280px;
  right: 245px;
  width: 220px;
  min-width: 220px;
  z-index: 10;
}

/* SVG transforms are applied via JavaScript setAttribute */
#horizonRotate,
#horizonPitch,
#bankPointer {
  transition: transform 0.1s ease-out;
}

    #resetHudBtn {
      position: absolute;
      bottom: 8px;
      left: 10px;
      padding: 4px 8px;
      background: rgba(0, 0, 0, 0.7);
      color: #fff;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.4);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      cursor: pointer;
      z-index: 15;
    }
    #resetHudBtn:hover {
      background: rgba(255, 255, 255, 0.15);
    }

#hudTopBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  padding: 0 14px;
  background: linear-gradient(to right, rgba(5, 8, 18, 0.98), rgba(10, 16, 32, 0.98));
  color: var(--text-main);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
#hudTopBar-title {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: 0.9;
  color: var(--text-muted);
}
#hudTopBar-subtitle {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 8px;
}
    #hudTopBar button {
      background: rgba(255, 255, 255, 0.12);
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 4px;
      padding: 3px 8px;
      font-size: 11px;
      cursor: pointer;
    }
    #hudTopBar button:hover {
      background: rgba(255, 255, 255, 0.22);
    }

    #hudManager {
      position: absolute;
      top: 32px;
      left: 0;
      right: 0;
      max-height: 0;
      overflow: hidden;
      background: rgba(0, 0, 0, 0.9);
      color: #fff;
      z-index: 19;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      box-sizing: border-box;
      padding: 0 10px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.15);
      transition:
        max-height 0.25s ease,
        padding-top 0.25s ease,
        padding-bottom 0.25s ease,
        opacity 0.25s ease;
      opacity: 0;
    }
    #hudManager.open {
      max-height: 480px;
      padding-top: 6px;
      padding-bottom: 6px;
      opacity: 1;
    }
    #hudManager h4 {
      margin: 2px 0 4px 0;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      opacity: 0.85;
    }
    #hudManager h4:not(:first-child) {
      border-top: 1px solid rgba(255, 255, 255, 0.15);
      padding-top: 8px;
      margin-top: 8px;
    }
    .hud-manager-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 12px;
      margin-bottom: 4px;
    }
    .hud-manager-row label {
      display: flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
      cursor: pointer;
    }
    #hudManagerSummary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 12px;
    }
    #hudManagerSummary div {
      opacity: 0.9;
    }
    #hudManagerSummary strong {
      margin-right: 3px;
    }

        #hudShare {
      font-size: 11px;
    }
    #hudShareTitle {
      margin-bottom: 4px;
      font-weight: 600;
      opacity: 0.9;
    }
    .share-icon-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-icon {
  font-size: 20px;
  color: white;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.2s;
}

.share-icon:hover {
  opacity: 1;
}
    .share-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }
    .share-btn {
      flex: 1 0 30%;
      padding: 3px 6px;
      font-size: 10px;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.35);
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
      cursor: pointer;
      text-align: center;
      white-space: nowrap;
    }
    .share-btn:hover {
      background: rgba(255, 255, 255, 0.16);
    }

        #resetHudBtn {
      position: absolute;
      bottom: 56px;
      left: 10px;
      padding: 4px 8px;
      background: rgba(0, 0, 0, 0.7);
      color: #fff;
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.4);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 11px;
      cursor: pointer;
      z-index: 15;
    }
    #resetHudBtn:hover {
      background: rgba(255, 255, 255, 0.15);
    }

    #appStatusBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  background: linear-gradient(to right, rgba(2, 4, 10, 0.96), rgba(5, 8, 18, 0.96));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
  z-index: 20;
}
#appStatusBar span {
  white-space: nowrap;
}

/* Status bar - clickable left text */
#statusLeft {
  cursor: pointer;
  transition: color 0.2s ease;
}
#statusLeft:hover {
  color: var(--text-main);
}
#statusLeft.status-loading { color: var(--text-muted); }
#statusLeft.status-success  { color: #4CAF50; }
#statusLeft.status-warning  { color: #FFC107; }
#statusLeft.status-error    { color: #F44336; }

/* Status history panel */
#statusHistoryPanel {
  position: absolute;
  bottom: 28px;
  left: 0;
  width: 380px;
  max-height: 320px;
  background: rgba(8, 12, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 21;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#statusHistoryPanel.open {
  display: flex;
  animation: statusSlideUp 0.15s ease-out;
}
@keyframes statusSlideUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
#statusHistoryPanel .status-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
#statusHistoryPanel .status-history-header button {
  background: rgba(255,255,255,0.07);
  border: none;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
#statusHistoryPanel .status-history-header button:hover {
  background: rgba(255,255,255,0.17);
}
#statusHistoryLog {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.status-entry {
  padding: 4px 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  font-size: 10px;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.status-entry.status-loading {
  border-left-color: var(--text-muted);
}
.status-entry.status-success {
  border-left-color: #4CAF50;
}
.status-entry.status-warning {
  border-left-color: #FFC107;
  background: rgba(255, 193, 7, 0.05);
}
.status-entry.status-error {
  border-left-color: #F44336;
  background: rgba(244, 67, 54, 0.05);
}
.status-entry .status-time {
  font-size: 9px;
  opacity: 0.45;
  font-family: monospace;
  white-space: nowrap;
  min-width: 55px;
}
.status-entry .status-msg {
  color: var(--text-main);
}

/* --- Release notes overlay --- */
.release-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* toggled to flex in JS */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.release-panel {
  width: min(520px, 90vw);
  max-height: 80vh;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 16px;
  background: var(--panel-bg);
  border-radius: var(--panel-radius);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.release-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.release-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.release-subtitle {
  font-size: 11px;
  opacity: 0.8;
}

.release-body {
  font-size: 12px;
  line-height: 1.5;
}

.release-section {
  margin-bottom: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.release-section-header {
  font-weight: 500;
  margin-bottom: 4px;
}

.release-notes {
  margin: 0;
  padding-left: 16px;
}

.release-notes li {
  margin-bottom: 3px;
}

.vc-section {
  margin-bottom: 6px;
  font-size: 11px;
}

.vc-heading {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  font-weight: 600;
  opacity: 0.9;
}

.vc-heading i {
  font-size: 12px;
}

.vc-list {
  padding-left: 16px;
  margin: 0;
}

.vc-list li {
  margin-bottom: 2px;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet and smaller (landscape tablets, large phones) */
@media (max-width: 1024px) {
  /* Show mobile warning on load */
  #mobileWarning {
    display: flex;
  }

  /* Hide all information panels on mobile/tablet by default (but allow them to be shown when toggled) */
  /* Exclude release panel which is controlled by its overlay parent */
  .hud-panel:not([style*="display: block"]):not(.release-panel) {
    display: none;
  }

  /* When panels are shown on mobile, center them on screen initially */
  /* Only apply centering if panel hasn't been manually positioned (no inline left/top style) */
  .hud-panel[style*="display: block"]:not(.release-panel):not([style*="left:"]):not([style*="top:"]) {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  /* Size constraints for all visible panels on mobile */
  .hud-panel[style*="display: block"]:not(.release-panel) {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  /* When panel has been dragged (has inline positioning), remove transform */
  .hud-panel[style*="display: block"][style*="left:"]:not(.release-panel) {
    transform: none;
  }

  /* Release panel should remain centered via its overlay parent */
  .release-panel {
    position: relative;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }

  /* Adjust HUD panel positioning for tablets */
  #modelInfoPanel {
    max-width: 260px;
  }

  #viewerControlsPanel {
    max-width: 260px;
  }

  /* Stack controls vertically */
  #flightControls {
    min-width: 200px;
  }

  #throttleLegend {
    bottom: 320px;
  }
}

/* Mobile devices (portrait and landscape phones) */
@media (max-width: 768px) {
  /* Top bar adjustments */
  #hudTopBar {
    height: 48px;
    padding: 0 8px;
    font-size: 12px;
  }

  #hudTopBar-title {
    font-size: 10px;
  }

  #hudTopBar-subtitle {
    display: none; /* Hide subtitle on mobile */
  }

  #hudTopBar button {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Main HUD - move to top and make narrower */
  #hud {
    top: 50px;
    left: 6px;
    right: auto;
    max-width: calc(50% - 12px);
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Flight controls - stack on right side, smaller */
  #flightControls {
    top: 50px;
    right: 6px;
    left: auto;
    min-width: auto;
    max-width: calc(50% - 12px);
    padding: 6px 8px;
  }

  .fc-group-label {
    font-size: 9px;
  }

  .app-button {
    font-size: 9px;
    padding: 3px 6px;
  }

  /* Collapse (but don't force-hide) secondary panels on mobile by default
     Users can still toggle them on via Settings panel */
  /* Removed forced display:none - panels are now controlled via Settings checkboxes */

  /* Stats panel - move to bottom left, make compact */
  #statsPanel {
    bottom: 32px;
    right: auto;
    left: 6px;
    min-width: auto;
    max-width: calc(50% - 12px);
    padding: 6px 8px;
    font-size: 10px;
  }

  /* Weather panel - hide on mobile or make very compact */
  #weatherPanel {
    bottom: 100px;
    left: 6px;
    min-width: auto;
    max-width: 200px;
    font-size: 9px;
  }

  /* Wind rose - hide on mobile */
  #windRosePanel {
    display: none;
  }

  /* Throttle legend - position above bottom panels */
  #throttleLegend {
    bottom: auto;
    top: 180px;
    right: 6px;
    left: auto;
    min-width: auto;
    max-width: 140px;
    padding: 4px 6px;
    font-size: 9px;
  }

  /* Failsafe warning - make compact */
  #fsWarning {
    top: 240px;
    right: 6px;
    max-width: 180px;
    font-size: 10px;
  }

  /* Timeline at bottom - keep full width */
  #fsTimeline {
    left: 6px;
    right: 6px;
    bottom: 28px;
    font-size: 9px;
  }

  /* Status bar - reduce height */
  #appStatusBar {
    height: 20px;
    font-size: 8px;
    padding: 0 6px;
  }

  /* Reset HUD button */
  #resetHudBtn {
    bottom: 6px;
    left: 6px;
    font-size: 9px;
    padding: 3px 6px;
  }

  /* HUD panels - ensure they're draggable and not overlapping */
  .hud-panel {
    max-width: calc(100vw - 12px);
  }

  /* Touch-friendly sizes for interactive elements */
  .hud-close {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
  }

  /* Make buttons touch-friendly (minimum 44x44px) */
  button, .app-button, .share-btn {
    min-height: 36px;
    padding: 6px 10px;
  }

  /* FS timeline ticks */
  .fs-tick {
    width: 3px;
    height: 12px;
  }

  /* Release notes panel */
  .release-panel {
    width: calc(100vw - 20px);
    max-height: 80vh;
    padding: 12px;
  }

  /* HUD manager */
  #hudManager {
    font-size: 10px;
  }

  #hudManager.open {
    max-height: 520px;
  }
}

/* Small mobile devices (portrait phones) */
@media (max-width: 480px) {
  /* Even more compact on very small screens */
  #hud {
    max-width: calc(100% - 12px);
    left: 6px;
    right: 6px;
  }

  /* Stack flight controls below HUD */
  #flightControls {
    top: auto;
    bottom: 70px;
    left: 6px;
    right: 6px;
    max-width: none;
  }

  /* Weather panel controlled via Settings on very small screens */
  /* Removed forced display:none - panel controlled via Settings checkboxes */

  /* Stats - full width at bottom */
  #statsPanel {
    max-width: none;
    left: 6px;
    right: 6px;
    bottom: 130px;
  }

  /* Throttle legend - move to top */
  #throttleLegend {
    top: 120px;
    left: 6px;
    right: 6px;
    max-width: none;
  }

  /* Compact fonts */
  #hud, #flightControls, #statsPanel {
    font-size: 10px;
  }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  /* In landscape, use more horizontal space */
  #hud {
    max-width: 240px;
    left: 6px;
    right: auto;
  }

  #flightControls {
    max-width: 240px;
    right: 6px;
    left: auto;
    bottom: auto;
    top: 50px;
  }

  #statsPanel {
    bottom: 6px;
    left: 6px;
    max-width: 200px;
  }

  /* Show throttle legend in landscape */
  #throttleLegend {
    display: block;
    top: auto;
    bottom: 60px;
    right: 6px;
    max-width: 160px;
  }
}

/* Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Print styles */
@media print {
  #hudTopBar,
  #hudManager,
  #resetHudBtn,
  .hud-close {
    display: none;
  }

  .hud-panel {
    background: white;
    color: black;
    border: 1px solid black;
  }
}

/* ===== VISUAL TRANSMITTER STYLES ===== */
#visualTxBody {
  padding: 3px;
}

.tx-housing {
  position: relative;
  width: 380px;
  height: 200px;
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%);
  border-radius: 8px;
  border: 2px solid #0a0a0a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 2px rgba(0,0,0,0.8),
    0 2px 8px rgba(0,0,0,0.4),
    0 8px 24px rgba(0,0,0,0.7);
  padding: 8px 10px 10px 10px;

  /* Futaba-style subtle texture */
  background-image:
    repeating-linear-gradient(90deg, transparent 0px, rgba(255,255,255,0.008) 1px, transparent 2px),
    repeating-linear-gradient(0deg, transparent 0px, rgba(255,255,255,0.008) 1px, transparent 2px),
    linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%);
  background-size: 2px 2px, 2px 2px, 100% 100%;
}

/* Shoulder Pots */
.tx-shoulders {
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 45px;
  z-index: 5;
}

.tx-shoulder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tx-pot {
  width: 28px;
  height: 9px;
  background: #0a0a0a;
  border-radius: 4.5px;
  border: 0.5px solid #1a1a1a;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.9);
  position: relative;
}

.tx-pot-indicator {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 6px;
  background: linear-gradient(90deg, #555 0%, #3a3a3a 100%);
  border-radius: 1.5px;
  box-shadow: 0 0.5px 1.5px rgba(0,0,0,0.6);
  transition: left 0.1s ease-out;
}

.tx-pot-label {
  font-size: 6px;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
}

/* Stick Gimbals */
.tx-gimbal {
  position: absolute;
  width: 75px;
  height: 75px;
}

.tx-gimbal-left {
  left: 25px;
  top: 35px;
}

.tx-gimbal-right {
  right: 25px;
  top: 35px;
}

.tx-gimbal-background {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 48% 48%, #1a1a1a 0%, #0d0d0d 50%, #050505 100%);
  border-radius: 50%;
  border: 2.5px solid #1a1a1a;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.95),
    inset 0 -1px 3px rgba(255,255,255,0.03),
    0 2px 5px rgba(0,0,0,0.4);
}

/* Center dot */
.tx-gimbal-center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(255,255,255,0.2);
}

.tx-stick {
  position: absolute;
  width: 20px;
  height: 20px;
  left: 25px; /* Center: (75 - 20) / 2 + 2.5px border = 25px */
  top: 25px;
  background: radial-gradient(circle at 40% 35%, #e74c3c 0%, #c0392b 40%, #a02820 85%, #7a1f18 100%);
  border-radius: 50%;
  box-shadow:
    0 2.5px 6px rgba(0,0,0,0.7),
    inset 0 1px 2px rgba(255,255,255,0.35),
    inset 0 -2px 4px rgba(0,0,0,0.4);
  border: 1.5px solid #8e2a1f;
  transition: left 0.025s ease-out, top 0.025s ease-out;
  z-index: 10;
  cursor: grab;
}

.tx-stick:active {
  cursor: grabbing;
}

.tx-gimbal-label {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.tx-gimbal-axes {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6px;
  color: #555;
  white-space: nowrap;
  text-align: center;
  font-weight: 600;
}

/* Switches */
.tx-switches-top {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
}

.tx-switches-right {
  position: absolute;
  right: calc(50% - 10px);
  top: 130px;
  transform: translateX(0);
  display: flex;
  flex-direction: row;
  gap: 16px;
}

.tx-switches-left {
  position: absolute;
  left: calc(50% + 10px);
  top: 130px;
  transform: translateX(0);
  display: flex;
  flex-direction: row;
  gap: 16px;
}

.tx-switch-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.tx-switch {
  position: relative;
  background: #0a0a0a;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.8),
    0 1px 3px rgba(0,0,0,0.5);
  border: 1px solid #333;
}

.tx-switch-2pos {
  width: 16px;
  height: 32px;
}

.tx-switch-3pos {
  width: 16px;
  height: 44px;
}

.tx-switch-lever {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 13px;
  background: linear-gradient(145deg, #4a4a4a 0%, #2a2a2a 100%);
  border-radius: 3px;
  box-shadow:
    0 1px 4px rgba(0,0,0,0.6),
    inset 0 1px 1px rgba(255,255,255,0.2);
  border: 1px solid #555;
  transition: top 0.08s ease-out;
}

/* 2-position switch states */
.tx-switch-2pos .tx-switch-lever {
  top: 3px;
}

.tx-switch-2pos.switch-down .tx-switch-lever {
  top: 16px;
}

/* 3-position switch states */
.tx-switch-3pos .tx-switch-lever {
  top: 3px;
}

.tx-switch-3pos.switch-mid .tx-switch-lever {
  top: 15px;
}

.tx-switch-3pos.switch-down .tx-switch-lever {
  top: 28px;
}

.tx-switch-label {
  font-size: 7px;
  color: #888;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* Center Screen */
.tx-screen {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 36px;
  background: #0d2515;
  border-radius: 4px;
  border: 2px solid #1a3a2a;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.6),
    inset 0 0 20px rgba(76,175,80,0.15),
    0 1px 4px rgba(0,0,0,0.4);
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.tx-model-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.4;
  z-index: 1;
}

.tx-screen-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 4px;
}

.tx-screen-model {
  font-size: 8px;
  font-weight: bold;
  color: #4CAF50;
  font-family: 'Courier New', monospace;
  text-shadow:
    0 0 4px rgba(76,175,80,0.8),
    0 0 8px rgba(76,175,80,0.4),
    1px 1px 2px rgba(0,0,0,0.8);
  letter-spacing: 0.3px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-screen-mode {
  font-size: 7px;
  color: rgba(76, 175, 80, 0.7);
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 4px rgba(76,175,80,0.4);
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.tx-screen-settings {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(76, 175, 80, 0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  z-index: 3;
  transition: color 0.2s ease;
}

.tx-screen-settings:hover {
  color: #4CAF50;
}

/* Bottom Sliders */
.tx-sliders-bottom {
  position: absolute;
  top: 182px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
}

.tx-slider-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.tx-slider-track {
  width: 52px;
  height: 8px;
  background: #0a0a0a;
  border-radius: 4px;
  border: 1px solid #333;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.8);
  position: relative;
}

.tx-slider-thumb {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 11px;
  background: linear-gradient(90deg, #555 0%, #333 100%);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
  border: 1px solid #666;
  transition: left 0.1s ease-out;
}

.tx-slider-label {
  font-size: 7px;
  color: #888;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

/* Panel positioning */
#visualTransmitter {
  right: 10px;
  top: 460px;
  max-width: 270px;
}