Fix mermaid and dot SPA: poll for CDN script load
On SPA navigation, the MutationObserver fires when content is swapped
but the CDN scripts (mermaid.js, viz.js) may not have loaded yet.
renderAll() returns early since the global isn't defined. When the
CDN script finally loads, there's no further mutation to trigger
renderAll().
Fix: when pending elements exist but the CDN library isn't loaded,
start polling (200ms interval) until it becomes available, then
render.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>