elativeTime(lastDataTimestamp);
        }
      }

      async function handleManualRefresh() {
        if (isRefreshing) return;

        isRefreshing = true;
        refreshButton.disabled = true;

        try {
          await fetchHeartRateData();
          // Update only the countdown timer reference point
          lastUpdated = new Date();
          updateCountdown(); // Update countdown immediately
        } finally {
          isRefreshing = false;
          updateCountdown(); // This will re-enabl