.invoice-pdf-dialog { width: min(1000px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #bfc8cb; border-radius: 6px; background: #e9edef; color: #263b42; }
.invoice-pdf-dialog::backdrop { background: rgba(25, 35, 39, .6); }
.invoice-pdf-toolbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #cad3d6; background: #fff; }
.invoice-pdf-toolbar strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.invoice-pdf-count { flex-shrink: 0; color: #65747b; font-size: 12px; }
.invoice-pdf-actions { display: flex; gap: 6px; }
.invoice-pdf-actions .icon-button { width: 36px; height: 36px; padding: 8px; border-radius: 4px; }
.invoice-pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px; }
.invoice-pdf-sheet { width: min(100%, 794px); aspect-ratio: 210 / 297; background: #fff; box-shadow: 0 2px 8px rgba(25, 35, 39, .15); }
.invoice-pdf-sheet canvas { display: block; width: 100%; height: auto; }
.invoice-pdf-message { padding: 16px; margin: 0; font-size: 14px; }
@media (max-width: 600px) {
  .invoice-pdf-dialog { width: 100vw; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .invoice-pdf-toolbar { gap: 8px; padding: 10px; flex-wrap: wrap; }
  .invoice-pdf-count { display: none; }
  .invoice-pdf-pages { padding: 8px; }
}
@media print {
  @page { size: A4 portrait; margin: 0; }
  body:has(#invoicePdfDialog[open]) > :not(#invoicePdfDialog) { display: none !important; }
  #invoicePdfDialog[open] { display: block !important; position: static; width: 210mm; max-width: none; max-height: none; margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 0; background: #fff; }
  #invoicePdfDialog::backdrop, .invoice-pdf-toolbar, .invoice-pdf-message { display: none !important; }
  .invoice-pdf-pages { display: block; padding: 0; }
  .invoice-pdf-sheet { width: 210mm; height: 297mm; margin: 0; box-shadow: none; break-inside: avoid; break-after: page; }
  .invoice-pdf-sheet:last-child { break-after: auto; }
  .invoice-pdf-sheet canvas { width: 210mm; height: 297mm; }
}
