/* Same modal on desktop and phones, without a native embedded-PDF dependency. */
#pdfPreviewCard { min-width: 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
#pdfPreviewCard .pdf-preview-header h2 { min-width: 0; overflow-wrap: anywhere; }
#pdfPreviewFrame.demo-document-preview {
  display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: #dce2e8; padding: 12px; box-sizing: border-box;
}
.demo-pdf-pages { display: grid; gap: 12px; width: 100%; margin: 0 auto; max-width: 1040px; }
.demo-pdf-page { width: 100%; min-width: 0; background: white; box-shadow: 0 1px 5px #0002; }
.demo-pdf-page canvas { display: block; width: 100%; height: auto; }
.demo-pdf-status, .demo-pdf-page-error { padding: 16px; margin: 0; color: #24394f; font-size: 14px; line-height: 1.5; }
.demo-pdf-status.is-error, .demo-pdf-page-error { color: #a42c2c; }
.demo-pdf-invoice-image { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; background: white; }
.demo-pdf-invoice-text { margin: 0; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: white; color: #152b43; font: 13px/1.5 monospace; }
@media (max-width: 640px) {
  #pdfPreviewModal { padding: 6px; }
  #pdfPreviewCard { width: calc(100vw - 12px); max-width: 100%; height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); }
  #pdfPreviewFrame.demo-document-preview { padding: 6px; }
  .demo-pdf-pages { gap: 8px; }
}

.demo-pdf-controls { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
#pdfPreviewCard .demo-pdf-control { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 8px; font: inherit; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
#pdfPreviewCard .demo-pdf-zoom-value { width: 64px; min-width: 64px; padding-inline: 8px; font-size: 13px; text-align: left; justify-content: flex-start; }
#pdfPreviewCard .demo-pdf-control:focus-visible { outline: 2px solid var(--accent, #3473b4); outline-offset: 2px; }
#pdfPreviewCard .demo-pdf-control:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) {
  #pdfPreviewCard .pdf-preview-header { flex-wrap: wrap; gap: 6px; }
  #pdfPreviewCard .pdf-preview-header h2 { flex: 1 1 120px; }
  #pdfPreviewCard .pdf-preview-actions { margin-left: auto; flex: 0 0 auto; gap: 6px; }
}
