toggleDarkTheme runs inside the layout $effect; without untrack the effect starts depending on inputState.mermaid and re-adds the default theme whenever a loaded config replaces it (caught by the unsafe-config scrub e2e test). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>