';const w=window.open('','_blank');if(!w){alert('Permita pop-ups para gerar o PDF.');return;}w.document.open();w.document.write(doc);w.document.close();}
document.querySelectorAll('.option[data-name]').forEach(o=>o.addEventListener('click',()=>{formData[o.dataset.name]=o.dataset.value;document.querySelectorAll('.option[data-name="'+o.dataset.name+'"]').forEach(i=>i.classList.toggle('selected',i===o));save();}));if(paletaStatus)paletaStatus.addEventListener('change',()=>{collect();toggleCores();save();});document.querySelectorAll('input,textarea,select').forEach(f=>{f.addEventListener('input',collect);f.addEventListener('change',collect);});nextBtn.addEventListener('click',()=>{if(!validate(currentStep))return;if(currentStep{collect();if(currentStep>0)showStep(currentStep-1)});printBtn.addEventListener('click',printBriefing);load();restore();update();})();