rk-mode");
            if (theme === "light") {
                if (isDark) root.classList.remove("dark-mode");
                set_light_mode();
            } else if (theme === "dark") {
                if (!isDark) root.classList.add("dark-mode");
                set_dark_mode();
            } else {
                // No theme in localStorage, fall back to system preference
                if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
                    root.classList.add("dark-mode"