document.addEventListener('click', e => {
  const btn = e.target.closest('.sidebar-toggle');
  if (!btn) return;

  const target = document.getElementById(btn.dataset.target);
  if (!target) return;

  const isOpen = btn.getAttribute('aria-expanded') === 'true';

  btn.setAttribute('aria-expanded', String(!isOpen));
  target.classList.toggle('open', !isOpen);
});
