var DebugPanel = { breakpoints: [], variables: {}, callStack: [], isPaused: false, toggleBreakpoint: function(file, line) { var key = file + ':' + line; var idx = this.breakpoints.indexOf(key); if (idx >= 0) this.breakpoints.splice(idx, 1); else this.breakpoints.push(key); this.render(); }, setVariable: function(name, value) { this.variables[name] = value; this.render(); }, pushFrame: function(name) { this.callStack.push({ name: name, time: new Date().toISOString() }); this.render(); }, popFrame: function() { this.callStack.pop(); this.render(); }, pause: function(reason) { this.isPaused = true; this.setVariable('_pauseReason', reason); this.render(); }, resume: function() { this.isPaused = false; this.callStack = []; this.variables = {}; this.render(); }, clear: function() { this.breakpoints = []; this.variables = {}; this.callStack = []; this.isPaused = false; this.render(); }, getState: function() { return { paused: this.isPaused, breakpoints: this.breakpoints.length, variables: Object.keys(this.variables).length, frames: this.callStack.length }; }, render: function() { var panel = document.getElementById('debug-content'); if (!panel) return; var html = '