log.className = 'modal-overlay';
                                    resultsDialog.classList.add('visible');
                                    resultsDialog.innerHTML = `
                                        <div class="modal">
                                            <div class="modal-header">
                                                <h2>Tool Result</h2>
                                                <button class="close-button">×</button>
                                            </div>