                   editorOverlay.style.display = 'none';
                }
            }

            async function updateMindmapFromEdit() {
                const textarea = document.getElementById('markdown-textarea');
                const newMarkdown = textarea.value;

                if (newMarkdown !== currentMarkdown) {
                    const urlParams = new URLSearchParams(window.location.search);
                    const id = urlParams.get('id');
                    if (!id) {
                