/* Full photograph, natural proportions and no dark frame. */
#gallery-dialog{width:max-content;height:fit-content;max-width:calc(100vw - 32px);max-height:calc(100dvh - 96px);margin:auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;color:var(--ink)}
#gallery-dialog::backdrop{background:var(--paper);backdrop-filter:none}
#gallery-dialog img{display:block;width:auto;height:auto;max-width:calc(100vw - 32px);max-height:calc(100dvh - 112px);object-fit:contain;border-radius:2px}
#gallery-dialog .icon-button{position:absolute;inset-inline-end:0;inset-block-start:-50px;width:44px;height:44px;min-width:44px;margin:0;padding:0;border:1px solid #d9d0c4;border-radius:50%;background:var(--paper);color:var(--ink);font-size:1.75rem;line-height:1;z-index:1}
#gallery-dialog .icon-button:hover{background:#eee8df}
#gallery-dialog.is-pending{width:min(320px,calc(100vw - 32px))}
.gallery-loading,.gallery-error{min-height:140px;padding:28px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;text-align:center}
.gallery-error p{font-size:.9375rem;overflow-wrap:anywhere}.gallery-error .text-link{font-size:.875rem}
.gallery-spinner{display:block;width:28px;height:28px;border:2px solid var(--line);border-top-color:var(--ink);border-radius:50%;animation:gallery-loading 1s linear infinite}
@keyframes gallery-loading{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.gallery-spinner{animation:none}}
@media(max-height:440px){#gallery-dialog{max-height:calc(100dvh - 66px)}#gallery-dialog img{max-height:calc(100dvh - 80px)}#gallery-dialog .icon-button{inset-block-start:6px;inset-inline-end:6px}}
