          cellMode = 'edit';
            const editor = editorInstances.get(currentCellId);
            if (editor) {
                editor.focus();
            }
        }
        
        // Theme management
        function toggleTheme() {
            const currentTheme = document.body.dataset.theme || 'light';
            const newTheme = currentTheme === 'light' ? 'dark' : 'light';
            document.body.dataset.theme = newTheme;
            localStorage.setItem('notebook-theme', newTheme);
       