(function () { if (window.toast) return; const rootId = 'toast-root'; function ensureRoot() { let el = document.getElementById(rootId); if (!el) { el = document.createElement('div'); el.id = rootId; el.setAttribute('data-toast-root', '1'); el.className = 'fixed right-3 z-[10050] flex w-[min(340px,calc(100vw-1.5rem))] flex-col gap-2 hidden'; el.style.top = 'calc(var(--bar-height, 56px) + 0.75rem)'; document.body.appendChild(el); } return el; } function create(type, message, opts = {}) { const root = ensureRoot(); const ttl = opts.duration ?? 4800; const title = opts.title || { info: 'Info', success: 'Success', warn: 'Warning', error: 'Error' }[type] || 'Notice'; const accent = { info: 'var(--color-info)', success: 'var(--color-success)', warn: 'var(--color-warning)', error: 'var(--color-danger)', }[type] || 'var(--color-accent)'; const el = document.createElement('div'); el.setAttribute('data-toast-item', '1'); el.className = 'relative isolate flex items-start gap-3 overflow-hidden rounded-md border border-[var(--color-border)] border-l-4 bg-[var(--color-surface)] px-4 py-3 text-[var(--font-size-sm)] leading-[1.3] text-[var(--color-text)] shadow-[var(--shadow-lg)]'; el.style.setProperty('--_accent', accent); el.style.borderLeftColor = 'var(--_accent)'; el.setAttribute('role', 'status'); el.setAttribute('aria-live', 'polite'); el.innerHTML = `