/* Native dialog top layer keeps the return control above the app navigation. */
dialog.package-pdf-viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #08043f;
    color: #fff;
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: contain;
}
dialog.package-pdf-viewer[open] { display: flex; flex-direction: column; }
.package-pdf-viewer::backdrop { background: #08043f; }
.package-pdf-viewer [hidden] { display: none !important; }
.package-pdf-viewer button {
    min-width: 44px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #85849e;
    border-radius: 12px;
    background: #24214e;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    touch-action: manipulation;
}
.package-pdf-viewer button:disabled { opacity: .5; cursor: default; }
.package-pdf-viewer button:focus-visible { outline: 3px solid #64e0f7; outline-offset: 2px; }
.package-pdf-header {
    flex: 0 0 auto;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    border-bottom: 1px solid #444165;
}
.package-pdf-header button.package-pdf-back { width: 100%; background: #ff811b; border-color: #ff811b; color: #08043f; }
.package-pdf-header h2 { margin: 8px 0 0; color: #fff; font-size: 16px; text-align: center; }
.package-pdf-status { flex: 0 0 auto; padding: 8px 16px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.package-pdf-stage {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 12px;
    overflow: auto;
    overscroll-behavior: contain;
    background: #d9dce3;
    box-sizing: border-box;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}
.package-pdf-stage canvas { display: block; max-width: none; margin: 0 auto; background: white; box-shadow: 0 2px 10px #0003; }
.package-pdf-controls {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid #444165;
    background: #08043f;
}
.package-pdf-pagination, .package-pdf-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.package-pdf-page { min-width: 70px; text-align: center; }
.package-pdf-print-panel { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px; }
.package-pdf-print-panel h3 { font-size: 20px; color: #fff; margin: 0 0 12px; }
.package-pdf-print-panel p { margin: 12px 0; line-height: 1.5; overflow-wrap: anywhere; }
.package-pdf-print-panel label { display: block; margin-bottom: 8px; }
.package-pdf-print-panel select { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 8px; font-size: 16px; border-radius: 8px; background: #24214e; color: #fff; }
.package-pdf-print-panel button { display: block; width: 100%; margin-top: 12px; }
.package-pdf-print-panel .package-pdf-print-send { background: #ff811b; color: #08043f; border-color: #ff811b; }
