wsletter-form');
      if (!form) return;
      form.addEventListener('submit', function (e) {
        e.preventDefault();
        const emailEl = document.getElementById('newsletter-email');
        const email = emailEl ? emailEl.value.trim() : '';
        const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
        if (!re.test(email)) { alert('Please enter a valid email address.'); return; }
        const toast = document.getElementById('toast');
        if (toast) {
          toast.classList.remove('toas