.gallery-dialog{position:fixed;inset:0;width:min(1100px,calc(100vw - 24px));height:min(840px,calc(100vh - 24px));height:min(840px,calc(100dvh - 24px));max-width:none;max-height:none;padding:0;border:1px solid #c6d2c6;border-radius:16px;background:#fff;color:#263b33;box-shadow:0 16px 80px #0006;overflow:hidden;margin:auto}
.gallery-dialog::backdrop{background:#0d1e18cf}
.gallery-layout{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%}
.gallery-header,.gallery-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 18px;background:#fff}
.gallery-header{border-bottom:1px solid #d9dfd9}.gallery-heading{min-width:0}.gallery-title{margin:0;font-size:17px;overflow-wrap:anywhere}.gallery-count{display:block;color:#66766e;font-size:13px}.gallery-close{flex-shrink:0}
.gallery-viewport{position:relative;min-height:0;display:flex;align-items:center;justify-content:center;background:#14231c;overflow:hidden;touch-action:pan-y}
.gallery-image,.gallery-video{display:block;width:100%;height:100%;min-height:0;object-fit:contain}
.gallery-message{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:24px;text-align:center;color:#fff;overflow-wrap:anywhere;background:#14231cd9}.gallery-message p{max-width:540px}.gallery-message[hidden]{display:none}
.gallery-footer{border-top:1px solid #d9dfd9;flex-wrap:wrap}.gallery-navigation{display:flex;gap:10px}.gallery-dialog button:disabled,.gallery-download[aria-disabled=true]{opacity:.45;cursor:default}.gallery-download[aria-disabled=true]{pointer-events:none}.gallery-dialog button:disabled:hover{background:white}
@media(max-width:600px){.gallery-dialog{width:calc(100vw - 12px);height:calc(100vh - 12px);height:calc(100dvh - 12px);border-radius:12px}.gallery-header,.gallery-footer{padding:12px;gap:10px}.gallery-title{font-size:15px}.gallery-navigation{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:10px}.gallery-navigation button{width:100%}.gallery-download{width:100%}.gallery-close{padding:9px 12px}.gallery-footer{padding-bottom:max(12px,env(safe-area-inset-bottom))}}
