/* Fit the frame to the media, not the media to an arbitrary frame. */
html body #image-dialog{max-width:calc(100vw - 32px);max-height:calc(100dvh - 24px);padding:16px;box-sizing:content-box;overflow:auto}
html body #image-dialog .image-viewer-bar{gap:12px;margin-bottom:12px;min-width:0}
html body #image-dialog .image-viewer-bar h2{overflow-wrap:anywhere;min-width:0}
html body #image-dialog .image-viewer-stage{background:none!important;max-height:none;max-width:100%;margin:0 auto;overflow:hidden;line-height:0;border-radius:8px}
html body #image-dialog .image-viewer-stage :is(img,svg){display:block;margin:0;padding:0;max-width:none!important;max-height:none!important;object-fit:contain;background:none!important;transform:none!important}
html body .peek-preview-v78{height:auto;max-width:100%;margin:0 auto 14px;padding:0;background:none!important;display:block;overflow:hidden}
html body .peek-preview-v78 :is(img,svg){display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0;padding:0!important;object-fit:contain!important;background:none!important;transform:none!important}
html body .peek-preview-v78>span{display:block!important;width:100%!important;height:100%!important;aspect-ratio:auto!important;background:none!important;margin:0;padding:0!important}
html body #image-dialog [data-image-close]:focus-visible{outline:3px solid var(--ap-action);outline-offset:2px}
@media(max-width:650px){html body #image-dialog{padding:10px;max-width:calc(100vw - 24px)}html body #image-dialog .image-viewer-bar h2{font-size:14px}}
html body .peek-preview-v78{box-sizing:content-box;border:0!important}
html body .peek-preview-v78 :is(img,svg){border:0!important;box-sizing:border-box}
