.pdf-dialog { width: min(96vw, 1100px); max-width: 96vw; max-height: 94vh; max-height: 94dvh; padding: 1rem; border: 1px solid #c9d2db; border-radius: .75rem; color: #172638; background: #fff; overflow: auto; }
.pdf-dialog::backdrop { background: rgba(15, 25, 40, .65); }
.pdf-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.pdf-dialog-header h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
.pdf-dialog-header button { flex-shrink: 0; }
.pdf-dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.pdf-dialog [hidden] { display: none !important; }
.pdf-dialog-frame:not(:empty) { background: #f5f6f8; padding: .5rem; }
.pdf-dialog-frame img { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid #c9d2db; background: #fff; }
.pdf-dialog-frame img + img { margin-top: .75rem; }
@media (max-width: 430px) { .pdf-dialog { padding: .75rem; } .pdf-dialog-header { flex-wrap: wrap; } .pdf-dialog-actions .btn { width: 100%; } }
@media print {
  @page poster-a4 { size: A4 portrait; margin: 0; }
  .pdf-dialog { display: none; }
  body.printing-pdf > :not(.pdf-dialog), body.printing-pdf .pdf-dialog > :not(.pdf-dialog-frame) { display: none !important; }
  body.printing-pdf .pdf-dialog[open] { display: block; position: static; width: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: visible; }
  body.printing-pdf .pdf-dialog::backdrop { display: none; }
  body.printing-pdf .pdf-dialog-frame { padding: 0; background: transparent; }
  body.printing-pdf .pdf-dialog-frame img { max-width: 100%; max-height: 240mm; border: 0; object-fit: contain; break-inside: avoid; }
  body.printing-pdf .pdf-dialog-frame img + img { break-before: page; margin-top: 0; }
  html:has(body.printing-pdf .pdf-a4-portrait[open]) {
    page: poster-a4;
  }
  body.printing-pdf:has(.pdf-a4-portrait[open]) {
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
  }
  body.printing-pdf .pdf-a4-portrait[open] {
    position: absolute;
    inset: 0 auto auto 0;
    box-sizing: border-box;
    width: 210mm;
    height: 296.5mm;
  }
  body.printing-pdf .pdf-dialog.pdf-a4-portrait .pdf-dialog-frame img {
    width: 100%;
    height: auto;
    max-height: 296.5mm;
  }
}
