// theme-init.js — Apply saved theme before paint to avoid flash. // Must be loaded synchronously in before any CSS renders. (function() { var theme; try { theme = localStorage.getItem('pistar-theme'); } catch (e) {} document.documentElement.setAttribute('data-theme', theme || 'default-light'); })();