     <div class="modal-footer">
          <button id="qgcCancel" type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
        </div>
      </div>
    </div>
  </div>

  <script>
    document.addEventListener("DOMContentLoaded", function () {
      // ... keep your existing code above ...
  
      const launchBtn = document.getElementById('open_qgc');
      let controller = null;
      let timeoutId = null;
      const LAUNCH_TIMEOUT_MS = 6000;
  
      function setBusy(bus