
      (() => {
        try {
          const stored = localStorage.getItem("lvonce-theme");
          const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
          const theme = stored || (prefersLight ? "light" : "dark");
          document.documentElement.dataset.theme = theme;
        } catch {
          document.documentElement.dataset.theme = "dark";
        }
      })();
    
