/* PURE CSS FOR BOA CREW 3D SUITE (REACT CLONE) */
#a3d-suite {
  position: fixed; inset: 0; z-index: 9999;
  background-color: rgba(0, 0, 0, 0.92); backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  overflow-y: auto; font-family: ui-sans-serif, system-ui, sans-serif;
}
.a3d-modal-container {
  position: relative; width: 100%; max-width: 64rem; background-color: #060a12;
  border: 1px solid rgba(51, 65, 85, 0.8); border-radius: 1rem;
  box-shadow: 0 0 60px rgba(0,0,0,0.95); overflow: hidden; display: flex;
  flex-direction: column; margin: auto; color: #f1f5f9;
}
/* Header */
.a3d-header { background-color: #0b121e; border-bottom: 1px solid #1e293b; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.a3d-logo-badge { width: 2.25rem; height: 2.25rem; border-radius: 0.75rem; background-color: rgba(245, 158, 11, 0.2); border: 1px solid rgba(245, 158, 11, 0.6); display: flex; align-items: center; justify-content: center; color: #f59e0b; font-family: monospace; font-weight: 900; font-size: 0.875rem; }
.a3d-flight-info { display: flex; align-items: center; gap: 0.5rem; }
.a3d-callsign { font-family: monospace; font-size: 1.125rem; font-weight: 900; color: #f59e0b; }
.a3d-badge-flight { font-size: 0.75rem; background-color: #1e293b; color: #e2e8f0; padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-family: monospace; font-weight: 700; border: 1px solid #334155; }
.a3d-badge-reg { font-size: 0.75rem; background-color: rgba(67, 30, 15, 0.8); color: #fcd34d; border: 1px solid rgba(217, 119, 6, 0.5); padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-family: monospace; font-weight: 700; }
.a3d-badge-type { font-size: 0.75rem; background-color: #083344; color: #67e8f9; border: 1px solid rgba(21, 94, 117, 0.6); padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-family: monospace; font-weight: 700; }
.a3d-live-status { font-size: 11px; color: #94a3b8; margin-top: 0.25rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; font-family: monospace; }
.a3d-pulse-dot { width: 6px; height: 6px; border-radius: 9999px; background-color: #10b981; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.a3d-tabs { display: flex; align-items: center; gap: 0.5rem; background-color: rgba(15, 23, 42, 0.8); padding: 0.25rem; border-radius: 0.75rem; border: 1px solid rgba(51, 65, 85, 0.5); font-family: monospace; }
.a3d-view-btn { padding: 0.375rem 1rem; border-radius: 0.5rem; font-size: 0.75rem; font-weight: 700; transition: all 0.2s; background: transparent; color: #94a3b8; border: 1px solid transparent; cursor: pointer; }
.a3d-view-btn.active { background-color: #1e2738; color: #ffffff; border-color: #2d3a54; }
.a3d-close-btn { width: 2rem; height: 2rem; border-radius: 9999px; background-color: rgba(30, 41, 59, 0.8); color: #94a3b8; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid #1e293b; }
/* Content */
.a3d-content { position: relative; width: 100%; background-color: #02060d; padding: 1rem; display: flex; align-items: center; justify-content: center; min-height: 400px; }
.view-panel { display: none; width: 100%; }
.view-panel.active-flex { display: flex; }
.view-panel.active-grid { display: grid; }
/* HUD */
#nx-view-hud { grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 1rem; width: 100%; }
@media (min-width: 768px) { #nx-view-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.a3d-hud-card { background-color: #0f172a; border: 1px solid #1e293b; padding: 1rem; border-radius: 0.75rem; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: monospace; }
.a3d-hud-val { font-size: 2.25rem; font-weight: 700; }
.a3d-hud-lbl { color: #94a3b8; font-size: 0.75rem; margin-top: 0.25rem; font-weight: 700;}
/* PFD */
#nx-view-pfd { position: relative; width: 100%; max-width: 840px; aspect-ratio: 16/10; background-color: #020712; border-radius: 0.75rem; overflow: hidden; border: 2px solid #1e293b; flex-direction: column; align-items: center; justify-content: center; font-family: monospace; padding: 1rem; margin: 0 auto; box-shadow: 0 0 50px rgba(0,0,0,0.9); }
.pfd-container { display: flex; align-items: center; justify-content: center; gap: 2rem; width: 100%; height: 100%; }
.pfd-tape { width: 6rem; }
.pfd-tape-lbl { text-align: center; color: #94a3b8; font-size: 10px; margin-bottom: 0.5rem; font-weight: 700; letter-spacing: 0.1em; }
.pfd-tape-box { position: relative; width: 100%; height: 16rem; background-color: #090b0e; border: 1px solid #1e293b; border-radius: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.pfd-val-box { position: relative; z-index: 10; width: 5rem; height: 3rem; border: 2px solid; border-radius: 0.25rem; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 1.125rem; }
.pfd-val-box.amber { border-color: #f59e0b; background-color: #141005; box-shadow: 0 0 15px rgba(245,158,11,0.4); }
.pfd-val-box.cyan { border-color: #06b6d4; background-color: #0c1017; box-shadow: 0 0 15px rgba(6,182,212,0.4); }
.pfd-horizon-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; }
.pfd-horizon-circle { position: relative; width: 18rem; height: 18rem; border-radius: 9999px; border: 6px solid #1e2532; overflow: hidden; background-color: #0284c7; box-shadow: 0 0 30px rgba(0,0,0,0.6); }
.pfd-horizon-inner { position: absolute; top: -100%; right: -100%; bottom: -100%; left: -100%; transition: transform 0.1s; }
.pfd-sky { position: absolute; top: 0; left: 0; right: 0; height: 50%; background-color: #004bb5; }
.pfd-ground { position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background-color: #5d3b1e; }
.pfd-center-line { position: absolute; top: 50%; left: 0; right: 0; height: 3px; background-color: white; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.pfd-wings { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pfd-wings-inner { width: 9rem; height: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
.pfd-wing-bar { width: 3rem; height: 0.375rem; background-color: #f59e0b; box-shadow: 0 0 8px rgba(251,191,36,0.8); }
.pfd-wing-dot { width: 0.625rem; height: 0.625rem; background-color: #f59e0b; border-radius: 2px; }
.pfd-bottom-hdg { margin-top: 1rem; text-align: center; }
.pfd-hdg-lbl { font-size: 10px; color: #64748b; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 0.25rem; }
.pfd-hdg-val { color: #f59e0b; font-weight: 900; font-size: 1.25rem; }
/* 3D EXT */
#nx-view-ext { position: relative; width: 100%; height: 525px; max-width: 840px; margin: 0 auto; background-color: #020712; border-radius: 0.75rem; overflow: hidden; border: 2px solid #1e293b; flex-direction: column; }
.a3d-ext-overlay { position: absolute; top: 1rem; background-color: rgba(2, 6, 23, 0.85); backdrop-filter: blur(4px); border: 1px solid rgba(51, 65, 85, 0.8); border-radius: 0.75rem; padding: 0.625rem; font-size: 0.75rem; color: #cbd5e1; z-index: 20; pointer-events: none; font-family: monospace; display: flex; flex-direction: column; gap: 0.25rem; }
.a3d-ext-left { left: 1rem; }
.a3d-ext-right { right: 1rem; text-align: right; }
.a3d-ext-bottom-left { position: absolute; bottom: 1rem; left: 1rem; background-color: rgba(2, 6, 23, 0.85); backdrop-filter: blur(4px); border: 1px solid rgba(51, 65, 85, 0.8); border-radius: 0.75rem; padding: 0.625rem; font-size: 0.75rem; color: #cbd5e1; z-index: 20; pointer-events: none; font-family: monospace; display: flex; flex-direction: column; gap: 0.25rem; }
.a3d-ext-bottom-right { position: absolute; bottom: 1rem; right: 1rem; background-color: rgba(2, 6, 23, 0.85); backdrop-filter: blur(4px); border: 1px solid rgba(51, 65, 85, 0.8); border-radius: 0.75rem; padding: 0.625rem; font-size: 0.75rem; color: #cbd5e1; z-index: 20; text-align: right; pointer-events: none; font-family: monospace; display: flex; flex-direction: column; gap: 0.25rem; }
.a3d-ext-controls { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5rem; z-index: 20; }
.a3d-ext-btn { padding: 0.25rem 0.5rem; border-radius: 0.25rem; background: #1e293b; color: #cbd5e1; font-size: 10px; font-weight: bold; border: 1px solid #334155; cursor: pointer; }
.a3d-ext-btn.active { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border-color: #f59e0b; }
/* FOOTER */
.a3d-footer { background-color: #090e17; border-top: 1px solid #1e293b; padding: 0.75rem 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; font-family: monospace; font-size: 0.75rem; }
@media (min-width: 640px) { .a3d-footer { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1rem; } }
.a3d-foot-card { background-color: #040810; padding: 0.625rem; border-radius: 0.75rem; border: 1px solid #1e293b; display: flex; flex-direction: column; gap: 0.125rem; }
.a3d-foot-lbl { font-size: 10px; color: #94a3b8; font-weight: 700; }
.a3d-foot-val { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The imported 3D suite keeps its desktop composition; on narrow screens the
   same controls are reflowed instead of being pushed outside the viewport. */
@media (max-width: 640px) {
  #a3d-suite { padding: 0 !important; overflow: hidden !important; }
  #a3d-suite > div { min-width: 0; height: 100dvh; }
  #a3d-suite > div > div:first-child {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px; padding: max(8px, env(safe-area-inset-top)) 8px 8px;
  }
  #a3d-suite > div > div:first-child > div:first-child { grid-column: 1 / -1; min-width: 0; gap: 8px; }
  #a3d-suite > div > div:first-child > div:first-child > div:first-child { width: 34px; height: 34px; flex: none; font-size: 11px; }
  #a3d-suite > div > div:first-child > div:first-child > div:last-child { min-width: 0; }
  #a3d-suite > div > div:first-child > div:first-child > div:last-child > div:first-child { flex-wrap: wrap; gap: 4px; }
  #nx-callsign { font-size: 15px; }
  #a3d-suite > div > div:first-child > div:first-child > div:last-child > div:last-child { font-size: 8px; gap: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #a3d-suite > div > div:first-child > div:nth-child(2) { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  #a3d-suite .a3d-view-btn { min-width: 0; width: 100%; padding: 7px 3px; font-size: 10px; line-height: 1.1; white-space: normal; }
  #a3d-suite > div > div:first-child > div:last-child { gap: 5px; }
  #a3d-suite #nx-audio, #a3d-suite #nx-close { width: 34px; height: 34px; flex: none; }
  #a3d-suite > div > div:nth-child(2) { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 5px; padding: 6px 2px; }
  #a3d-suite > div > div:nth-child(2) > div:nth-child(2) { border-right: 0; }
  #a3d-suite > div > div:nth-child(2) > div { min-width: 0; }
  #nx-views { min-height: 0; }
  #nx-view-pfd, #nx-view-ext { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }
  #nx-view-pfd { border: 0; border-radius: 0; box-shadow: none; }
  #nx-view-ext { border: 0; border-radius: 0; }
  #nx-view-hud, #nx-view-pfd { padding: 8px; }
  #nx-view-hud > div:first-child { width: 100%; max-width: none; height: min(64dvh, 500px); min-height: 340px; aspect-ratio: auto; }
  #nx-hud-hologram { width: 98%; height: 90%; font-size: 10px; }
  #nx-hud-hologram > div:nth-child(2) { padding-inline: 0; }
  #nx-hud-hologram > div:nth-child(2) > div:first-child,
  #nx-hud-hologram > div:nth-child(2) > div:last-child { flex: 0 0 57px; }
  #nx-hud-hologram > div:nth-child(2) > div:nth-child(2) { min-width: 0; }
  #a3d-suite #nx-hud-ladder { --hud-ladder-scale: .48; transform: translateY(var(--hud-pitch-offset, 0px)) scale(var(--hud-ladder-scale)); }
  #a3d-suite #nx-hud-hologram > div:first-child > div:first-child { gap: clamp(5px, 2vw, 12px); }
  #a3d-suite #nx-hud-hologram > div:nth-child(2) > div:first-child { flex-basis: 58px; min-width: 0; }
  #a3d-suite #nx-hud-hologram > div:nth-child(2) > div:last-child { flex-basis: 79px; min-width: 0; }
  #a3d-suite #nx-hud-gs-box, #a3d-suite #nx-hud-alt-box { font-size: clamp(15px, 4vw, 19px); line-height: 1.1; padding: 3px 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #a3d-suite #nx-hud-hologram > div:last-child { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 2px; font-size: 9px; line-height: 1.2; }
  #a3d-suite #nx-hud-hologram > div:last-child > div { min-width: 0; overflow-wrap: anywhere; }
  #nx-hud-hologram > div:last-child { padding-inline: 2px; font-size: 8px; gap: 4px; }
  #nx-view-pfd > div:first-child { padding: 10px; gap: 10px; max-height: 100%; overflow-y: auto; }
  #nx-view-pfd > div:first-child > div:first-child { flex-wrap: wrap; gap: 4px; }
  #nx-view-pfd > div:first-child > div:nth-child(2) { flex-wrap: wrap; gap: 4px; }
  #nx-view-pfd > div:first-child > div:nth-child(2) > div { padding: 4px; font-size: 9px; }
  #nx-view-pfd > div:first-child > div:nth-child(3) { gap: 4px; min-width: 0; }
  #a3d-suite #nx-view-pfd > div:first-child > div:nth-child(3) > div:first-child { width: clamp(48px, 13vw, 58px); flex: none; }
  #a3d-suite #nx-view-pfd > div:first-child > div:nth-child(3) > div:last-child > div:first-child { width: clamp(66px, 18vw, 76px); flex: none; }
  #nx-view-pfd > div:first-child > div:nth-child(3) > div:last-child { gap: 3px; }
  #nx-view-pfd > div:first-child > div:nth-child(3) > div:last-child > div:last-child { width: 22px; }
  #nx-view-pfd > div:first-child > div:nth-child(3) > div:nth-child(2) { min-width: 0; flex: 1 1 auto; }
  #nx-view-pfd > div:first-child > div:nth-child(3) > div:nth-child(2) > div:nth-child(2) { width: min(40vw, 150px); height: min(40vw, 150px); border-width: 3px; }
  #nx-view-pfd > div:first-child > div:nth-child(3) > div:nth-child(2) > div:first-child { width: min(40vw, 150px); }
  #a3d-suite #nx-pfd-spd-box { width: min(100%, 52px); font-size: 12px; }
  #a3d-suite #nx-pfd-alt-box { width: min(100%, 72px); font-size: clamp(11px, 3vw, 13px); letter-spacing: -.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #a3d-suite #nx-view-pfd > div:first-child > div:last-child { flex-wrap: wrap; gap: 5px; overflow-wrap: anywhere; }
  #nx-view-ext > div:nth-child(2) { top: 8px; left: 8px; right: 8px; transform: none; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 6px; }
  #nx-view-ext > div:nth-child(2) > div:first-child { margin-right: 0; }
  #nx-view-ext > div:nth-child(2) > div:nth-child(2) { display: none; }
  #nx-view-ext > div:nth-child(3), #nx-view-ext > div:nth-child(4) { top: 96px; left: 8px; right: auto; padding: 6px; font-size: 9px; }
  #nx-view-ext > div:nth-child(4) { left: auto; right: 8px; }
  #nx-view-ext > div:last-child { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); text-align: center; font-size: 10px; }
}
