function aiAddScope() { // Clear the description ready for next scope const descEl = document.getElementById('ai-desc'); if(descEl) { descEl.value = ''; descEl.placeholder = 'e.g. Bathroom renovation — new tiles, vanity, shower screen, toilet...'; descEl.focus(); } // Clear image uploads for next scope if(typeof aiImages !== 'undefined') { aiImages = []; const preview = document.getElementById('ai-img-preview'); if(preview) preview.innerHTML = ''; const drop = document.getElementById('ai-img-drop'); if(drop) drop.querySelector('div').textContent = 'Drop photos here or click to upload'; } // Hide the add scope button until next generation completes const scopeBtn = document.getElementById('ai-add-scope-btn'); if(scopeBtn) scopeBtn.style.display = 'none'; // Scroll back up to the description descEl.closest('.card').scrollIntoView({behavior:'smooth', block:'start'}); // Show a hint document.getElementById('ai-st').style.display = 'block'; document.getElementById('ai-st-msg').textContent = 'Ready for next scope — new items will be added to existing lines'; document.getElementById('ai-spinner').className = 'ti ti-plus'; document.getElementById('ai-spinner').style.animation = 'none'; document.getElementById('ai-spinner').style.color = 'var(--brand)'; setTimeout(() => { document.getElementById('ai-st').style.display = 'none'; }, 3000); }