export async function copyToClipboard(text: string): Promise { try { await navigator.clipboard.writeText(text); return true; } catch { // Fallback for older browsers const el = document.createElement('textarea'); el.value = text; el.style.position = 'fixed'; el.style.left = '-9999px'; document.body.appendChild(el); el.select(); const ok = document.execCommand('copy'); document.body.removeChild(el); return ok; } }