// Depends on: core/utils.js ($) let toastTimer = null; function showToast(msg, type = 'default') { const el = $('toast'); if (!el) return; el.textContent = msg; el.className = 'toast show' + (type !== 'default' ? ' ' + type : ''); clearTimeout(toastTimer); toastTimer = setTimeout(() => { el.className = 'toast'; }, 2800); } function copyToClipboard(text, btnEl) { navigator.clipboard.writeText(text).then(() => { if (btnEl) { btnEl.classList.add('copied'); setTimeout(() => btnEl.classList.remove('copied'), 1500); } showToast('Copied to clipboard', 'success'); }).catch(() => showToast('Copy failed', 'error')); }