/* W-3-only presentation: protected master and shared components remain unchanged. */
body.epay-preview-v2 #w3PreviewModal .w3-modal-content.epay-pv2-dialog{width:min(960px,75vw,calc((100dvh - 64px)*17/11))!important;max-width:100%!important;height:auto!important;aspect-ratio:17/11!important;max-height:calc(100dvh - 32px)!important;padding:6px!important;border-radius:12px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal{justify-content:flex-start!important;gap:8px!important;min-height:56px!important;padding:7px 0!important;background:#fff!important;border:0!important;overflow:visible!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal .epay-pv2-control,body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal #closeW3Modal{box-sizing:border-box!important;flex:0 0 auto!important;min-width:42px!important;width:42px!important;height:42px!important;border:1px solid #b9ccd5!important;border-radius:8px!important;padding:0!important;background:#fff!important;color:#023047!important;font:600 17px/1 Poppins,sans-serif!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal .epay-pv2-control--reset{width:66px!important;min-width:66px!important;font-size:12.5px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal [data-pv2-action=fit]{width:96px!important;min-width:96px!important;font-size:12.5px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal #closeW3Modal{position:static!important;inset:auto!important;transform:none!important;margin:0 0 0 auto!important;align-self:center!important;box-shadow:none!important;font-size:22px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal button:focus-visible{outline:2px solid rgba(26,155,168,.35)!important;outline-offset:1px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-modal-viewport{touch-action:pan-x pan-y!important}
body.epay-preview-v2.epay-create-preview-standard #w3PreviewModal.epay-preview-standard-modal .w3-modal-content.epay-pv2-dialog:has(#w3ModalSample:not([hidden])){overflow:hidden!important}
@media(max-width:991.98px){body.epay-preview-v2 #w3PreviewModal .w3-modal-content.epay-pv2-dialog{width:min(720px,calc(100vw - 32px))!important;height:calc(100dvh - 32px)!important;aspect-ratio:auto!important;max-height:900px!important}}
@media(max-width:767.98px){body.epay-preview-v2 #w3PreviewModal .w3-modal-content.epay-pv2-dialog{width:calc(100vw - 24px)!important;height:calc(100dvh - 24px)!important;aspect-ratio:auto!important;max-height:none!important;padding:4px!important;border-radius:10px!important}}
@media(max-width:480px){body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal{gap:5px!important;min-height:50px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal .epay-pv2-control,body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal #closeW3Modal{width:36px!important;min-width:36px!important;height:36px!important;font-size:15px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal .epay-pv2-control--reset{width:56px!important;min-width:56px!important;font-size:12.5px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal [data-pv2-action=fit]{width:78px!important;min-width:78px!important;font-size:12px!important}
body.epay-preview-v2 #w3PreviewModal .epay-pv2-toolbar--modal #closeW3Modal{font-size:20px!important}}

body.epay-preview-v2.epay-create-preview-standard #w3PreviewModal.epay-preview-standard-modal .w3-modal-content:has(#w3ModalSample) .epay-pv2-toolbar--modal #closeW3Modal{position:static!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;margin:0 0 0 auto!important;flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:42px!important;align-self:center!important;border-radius:8px!important;box-shadow:none!important}
@media(max-width:480px){body.epay-preview-v2.epay-create-preview-standard #w3PreviewModal.epay-preview-standard-modal .w3-modal-content:has(#w3ModalSample) .epay-pv2-toolbar--modal #closeW3Modal{flex-basis:36px!important;width:36px!important;min-width:36px!important;height:36px!important}}

/* Reuse the existing PDF.js renderer for generated W-3 documents on mobile. */
#w3PreviewModal .epay-1099-pdf-pages{box-sizing:border-box;width:100%;padding:12px;background:#fff;overflow:visible}
#w3PreviewModal .epay-1099-pdf-pages[hidden]{display:none!important}
#w3PreviewModal .epay-1099-pdf-page{width:100%!important;max-width:none!important;margin:0 auto 12px;background:#fff}
#w3PreviewModal .epay-1099-pdf-page canvas{display:block;width:100%!important;height:auto!important;max-width:none!important}
.epay-w3-generator .w3-preview-frame .epay-1099-pdf-pages{box-sizing:border-box;width:100%;height:100%;padding:8px;overflow:auto}
.epay-w3-generator .w3-preview-frame .epay-1099-pdf-page{width:100%!important;max-width:none!important;margin:0 auto 8px}
.epay-w3-generator .w3-preview-frame .epay-1099-pdf-page canvas{display:block;width:100%!important;height:auto!important}
.epay-w3-generator .w3-preview-frame .epay-1099-pdf-pages[hidden]{display:none!important}

/* Inset the blank landscape image and size its frame from the image itself. */
.epay-w3-generator .w3-preview-frame:has(#w3PreviewEmpty:not([hidden])){
    height:auto!important;
    aspect-ratio:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:10px!important;
    overflow:hidden!important;
}
.epay-w3-generator .w3-preview-frame:has(#w3PreviewEmpty:not([hidden])) #w3PreviewEmpty{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    overflow:hidden!important;
}

/* Keep padding outside the zoom layer so 125% is exactly 1.25 times fit width. */
body.epay-preview-v2 #w3PreviewModal .epay-pv2-modal-viewport:has(.epay-1099-pdf-pages:not([hidden])){padding:12px!important}
#w3PreviewModal .epay-1099-pdf-pages{padding:0!important}
.epay-w3-generator .w3-preview-frame:has(.epay-1099-pdf-pages:not([hidden])){padding:8px!important}
.epay-w3-generator .w3-preview-frame .epay-1099-pdf-pages{padding:0!important}

#w3PreviewModal .epay-1099-pdf-pages{margin:0 auto}
