ckbox.checked = false;
        }
        checkbox.addEventListener('click', (e) => {
          window.setTheme(e.target.checked ? 'dark' : 'light');
        });
        window
          .matchMedia('(prefers-color-scheme: dark)')
          .addEventListener('change', (e) => {
            if (localStorage.getItem('userTheme') == null) {
              if (e.matches) {
                window.setTheme('dark');
              } else {
                window.setTheme('light');
              }
            }
       