/* Active invoice designs use a shared US Legal sheet; estimates/retired designs keep their paper. */
@page fc-invoice-legal { size:8.5in 14in; margin:0; }
@media screen {
 .document.invoice-legal,.invoice-photo-page.invoice-legal-photo{box-sizing:border-box;width:816px!important;max-width:none!important;height:auto;margin:0 auto!important;zoom:var(--invoice-paper-scale,1)}
 /* Screen previews show complete content, not blank physical-paper length. */
 .document.invoice-legal{font-size:14px;min-height:0!important}
 .invoice-photo-page.invoice-legal-photo{min-height:1344px!important;margin-top:16px!important;padding:48px}
 .invoice-legal-photo img{max-height:1050px}
 #preset-document-sample>.document.invoice-legal{width:816px!important;zoom:var(--invoice-paper-scale,1)}
}
@media print {
 .document.invoice-legal,.invoice-photo-page.invoice-legal-photo{page:fc-invoice-legal;box-sizing:border-box;width:8.5in!important;max-width:none!important;min-height:14in!important;height:auto;zoom:1!important;margin:0!important;overflow:visible!important;box-shadow:none;border-radius:0}
 .document.invoice-legal table{break-inside:auto}
 .document.invoice-legal tr{break-inside:avoid-page}
 .document.invoice-legal thead{display:table-header-group}
 .document.invoice-legal .doc-note{break-inside:auto;orphans:3;widows:3}
 .invoice-photo-page.invoice-legal-photo{break-before:page;break-inside:avoid;padding:.5in}
 .invoice-legal-photo img{max-height:11in;max-width:100%;object-fit:contain}
 /* Keep decorative waves within paper bounds without clipping document text. */
 .invoice-legal.layout-wave-mono .doc-art{bottom:0;left:0;width:100%;height:70px;border-radius:50% 50% 0 0;transform:none;box-shadow:0 -22px 0 #e8eaeb}
}
@media print{
 body>dialog[open]:has(.document.invoice-legal){position:static!important;page:fc-invoice-legal;width:8.5in!important;max-width:none!important;height:auto;overflow:visible!important}
}
@media print{
 /* Chromium modal print needs the named paper on the root formatting context. */
 html:has(dialog[open] .document.invoice-legal):not(:has(body.print-report)){page:fc-invoice-legal}
}
