yle.display = 'block';
                    toggleButton.textContent = 'Thinking ...';
                    g_thought_start_time = performance.now();
                }
                g_thought_src += chunk;
                render_throught();

                if (isAtBottom) {
                    window.scrollTo(0, document.body.scrollHeight);
                }
            }

            function ai_append_chunk(chunk) {
                const isAtBottom = (window.innerHeight + window.scrollY) >= document.body