I('connecting');                 // link is up, but waiting for frames
      showToast("link up; waiting for telemetry…");
    });

    socket.on("disconnect", (reason) => {
      console.warn("[io] disconnected:", reason);
      clearTimeout(trafficTimer);
      setConnUI('disconnected');
      showToast("telemetry disconnected");
    });

    socket.on("connect_error", (err) => {
      console.warn("[io] connect_error", err?.message || err);
      setConnUI('connecting');
    });

    // When we see rea