// ── Contacts pane resizer (overlay approach) ───────────────────────────── function initContactsResizer() { const handle = document.getElementById('contactsResizeHandle'); const pane = document.getElementById('contactsDetailPane'); if (!handle || !pane) return; handle.addEventListener('mousedown', function(e) { e.preventDefault(); const startX = e.clientX; const startW = pane.offsetWidth; handle.classList.add('dragging'); // Full-screen overlay captures ALL mouse events while dragging const overlay = document.createElement('div'); overlay.style.cssText = 'position:fixed;inset:0;z-index:999999;cursor:col-resize;'; document.body.appendChild(overlay); overlay.addEventListener('mousemove', function(e) { const delta = startX - e.clientX; const newW = Math.min(Math.max(startW + delta, 280), window.innerWidth * 0.78); pane.style.width = newW + 'px'; }); function stopDrag() { handle.classList.remove('dragging'); if (overlay.parentNode) document.body.removeChild(overlay); } overlay.addEventListener('mouseup', stopDrag); overlay.addEventListener('mouseleave', stopDrag); }); } window.addEventListener('load', initContactsResizer);