`;
}
inputs.forEach(input => input.addEventListener('input', calculateAndRender));
window.fhDownloadPDF = () => {
html2canvas(document.getElementById('fh-pdf-content'), { scale: 2 }).then(canvas => {
const pdf = new jspdf.jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' });
pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 40, 40, pdf.internal.pageSize.getWidth() - 80, 0);
pdf.save('Financial_Health_Report.pdf');
});
};
calculateAndRender(); // Initial render on page load
});
