// Apply the preference before CSS loads; unavailable storage never blocks the page. (() => { try { const theme = localStorage.getItem("ytdl-site-theme"); if (["light", "dark"].includes(theme)) document.documentElement.dataset.theme = theme; } catch { /* System theme remains the default. */ } })();