(function () { var root = document.documentElement; var button = document.getElementById('theme-toggle'); if (!button) { return; } button.addEventListener('click', function () { var next = root.getAttribute('data-theme') === 'light' ? 'dark' : 'light'; root.setAttribute('data-theme', next); try { localStorage.setItem('tinyauth-web-theme', next); } catch (e) {} }); })();