@media screen {
    body.pdf-open { overflow: hidden; }
    .pdf-dialog { box-sizing: border-box; width: min(1000px, calc(100vw - 24px)); height: calc(100vh - 24px); height: calc(100dvh - 24px); max-width: none; max-height: none; padding: 0; border: 1px solid #bbc5d4; border-radius: 10px; background: #eef1f5; color: #243047; }
    .pdf-dialog[open] { display: flex; flex-direction: column; }
    .pdf-dialog::backdrop { background: #16203399; }
    .pdf-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 6px 10px; background: white; border-bottom: 1px solid #dce2eb; }
    .pdf-header h2 { margin: 0; font-size: 16px; }
    .pdf-header-actions { display: flex; gap: 6px; }
    .pdf-print-frame { position: fixed; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
    .pdf-dialog button { min-width: 36px; min-height: 36px; padding: 4px 10px; font-size: 13px; }
    .pdf-dialog button:disabled { opacity: 0.45; cursor: default; }
    .pdf-header .pdf-close { color: #fff; background: #514170; border-color: #514170; text-shadow: none; }
    .pdf-toolbar { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; flex-shrink: 0; gap: 4px; padding: 6px; }
    .pdf-page-count { min-width: 48px; text-align: center; font-size: 13px; }
    .pdf-status { margin: 0; padding: 8px 12px; font-size: 13px; }
    .pdf-status:empty { display: none; }
    .pdf-viewport { flex: 1; min-height: 0; overflow: auto; padding: 0 0 8px; overscroll-behavior: contain; }
    .pdf-viewport canvas { display: block; margin: 0 auto; background: white; }
    @media (max-width: 768px) {
        .pdf-dialog { width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
        .pdf-header { padding-top: max(6px, env(safe-area-inset-top)); }
        .pdf-dialog button { min-height: 40px; min-width: 36px; padding: 4px 6px; }
        .pdf-viewport { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    }
}
@media print { .pdf-dialog { display: none !important; } }
