/** * Document export helpers: inline-styled HTML (email-safe), Word (.doc) and * print-to-PDF. All three start from the *live, rendered* content DOM so the * output reflects exactly what the user sees — chosen fonts, colours, * alignment and table borders — rather than a re-derived approximation. * * These functions are dependency-free. PDF export relies on the browser's own * print-to-PDF pipeline (see buildPrintDocument); Word export emits an HTML * document Word opens natively. */ /** * Serializes the live content root to an HTML string with all styling folded * into inline `style` attributes. Suitable for pasting into email clients that * strip `