// GuardDog Nexus — shared UI utilities function toggleFindings() { var container = document.getElementById('findings-container'); if (!container) return; var details = container.querySelectorAll('details'); if (details.length === 0) return; var isOpen = details[0].open; details.forEach(function (d) { d.open = !isOpen; }); var btn = document.querySelector('.toggle-all-btn'); if (btn) btn.textContent = isOpen ? 'Expand All' : 'Collapse All'; } function copyCode(btn, codeId) { var el = document.getElementById(codeId); if (!el) return; navigator.clipboard.writeText(el.textContent).then(function () { btn.textContent = 'Copied!'; btn.classList.add('copied'); setTimeout(function () { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 2000); }); }