body.pdf-preview-open { overflow: hidden; }
#pdfPreview { margin: auto; padding: 0; border: 1px solid #64748b; border-radius: 12px; width: min(1200px, 96vw); max-width: 96vw; height: 92vh; max-height: 96vh; background: #172638; color: #fff; }
#pdfPreview[open] { display: flex; flex-direction: column; }
#pdfPreview::backdrop { background: rgb(0 0 0 / 75%); }
#pdfPreview .pdf-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; }
#pdfPreview h2 { font-size: 1rem; overflow-wrap: anywhere; margin: 0; }
#pdfPreview .pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; }
#pdfPreview button { min-height: 40px; padding: 8px 12px; border: 1px solid #94a3b8; border-radius: 6px; background: #263b53; color: #fff; cursor: pointer; font-size: 1rem; }
#pdfPreview button:disabled { opacity: .45; cursor: default; }
#pdfPreview button:focus-visible, #pdfPages:focus-visible { outline: 3px solid #e4bc59; outline-offset: -3px; }
#pdfZoom { min-width: 52px; text-align: center; }
#pdfStatus { padding: 4px 16px 12px; margin: 0; font-size: .875rem; }
#pdfPages { overflow: auto; flex: 1; min-height: 0; background: #59616b; padding: 20px; overscroll-behavior: contain; }
#pdfPages .pdf-page { background: white; margin: 0 auto 20px; box-shadow: 0 2px 8px #0006; }
#pdfPages canvas { display: block; width: 100%; height: auto; }
@media (max-width: 600px) { #pdfPreview { width: 98vw; max-width: 98vw; height: 96dvh; } #pdfPreview button { min-height: 44px; } }
@media print {
  html:has(body.pdf-preview-open), body.pdf-preview-open { height: auto !important; overflow: visible !important; background: white !important; }
  body.pdf-preview-open > :not(#pdfPreview) { display: none !important; }
  #pdfPreview[open] { position: static !important; display: block !important; margin: 0 !important; padding: 0 !important; width: auto !important; max-width: none !important; height: auto !important; max-height: none !important; overflow: visible !important; border: 0 !important; background: white !important; }
  #pdfPreview::backdrop, #pdfPreview .pdf-header, #pdfPreview .pdf-toolbar, #pdfStatus { display: none !important; }
  #pdfPages { display: block !important; padding: 0 !important; overflow: visible !important; background: white !important; }
  #pdfPages .pdf-page { width: var(--pdf-print-width) !important; height: var(--pdf-print-height) !important; margin: 0 !important; box-shadow: none !important; break-inside: avoid; break-after: page; }
  #pdfPages .pdf-page:last-child { break-after: auto; }
  #pdfPages canvas { width: 100% !important; height: 100% !important; }
}
