// Server-side invoice PDF rendering via the shared HTML -> PDF pipeline
// (OPL-2602). This is the HTML-first replacement for the imperative
// `@libpdf/core` path in `./app-renderer`: it renders the SAME config-driven
// `templates-html` React template the user sees on screen to a self-contained
// HTML document, then hands that document to `@scribe.cool/core/pdf`'s
// `renderPdf()` so what prints matches the preview.
//
// Like `./app-renderer` and `../pdf`, this module pulls in the heavy renderer
// (playwright-core, and on serverless @sparticuz/chromium), so it is
// intentionally NOT re-exported from `./index`. Import it directly from
// "@scribe.cool/core/invoice/render-html-pdf" only on PDF download/email paths.
//
// SECURITY (untrusted config):
// - The template config is user/org-controlled (DB-backed). Its brand colors
// are serialized into a RAW