
// Uses global window.mermaid provided by mermaid.min.js
function renderMermaid() {
  if (!window.mermaid) {
    console.error('Mermaid not found on window');
    return;
  }
  window.mermaid.initialize({ startOnLoad: false });
  window.mermaid.run({ querySelector: '.mermaid' });
}

if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', renderMermaid, { once: true });
} else {
  renderMermaid();
}

