/* Authenticated photo gallery overlay for Map and Search. */
.cm-property-gallery-open{display:block;width:100%;margin:10px 0;border:1px solid #cfe4f2;background:#f2f9ff;color:#003899;padding:11px;border-radius:8px;font-weight:700;cursor:pointer}
.cm-gallery-open-body{overflow:hidden}
.cm-gallery-backdrop{position:fixed;inset:0;background:rgba(10,21,42,.77);z-index:22000;display:flex;align-items:center;justify-content:center;padding:16px}
.cm-gallery-dialog{box-sizing:border-box;background:#fff;color:#111827;width:min(1120px,100%);max-height:90dvh;display:flex;flex-direction:column;padding:16px;border-radius:13px;box-shadow:0 15px 60px rgba(0,0,0,.3)}
.cm-gallery-header,.cm-gallery-tabs,.cm-gallery-footer{display:flex;justify-content:space-between;align-items:center;gap:10px}
.cm-gallery-header h2{font-size:20px;margin:0}.cm-gallery-close{font-size:28px;min-width:44px;min-height:44px;border:0;background:#f3f4f6;border-radius:8px;cursor:pointer}
.cm-gallery-tabs{justify-content:flex-start;margin:8px 0}.cm-gallery-tabs button{border:1px solid #cfe4f2;background:#f2f9ff;color:#003899;padding:8px 14px;border-radius:7px;cursor:pointer}.cm-gallery-tabs button.active{background:#003899;color:white}
.cm-gallery-stage{flex:1;min-height:160px;max-height:55dvh;display:flex;justify-content:center;align-items:center;background:#f3f4f6;border-radius:8px;overflow:hidden;position:relative}.cm-gallery-image{max-height:54dvh;max-width:calc(100% - 92px);object-fit:contain}.cm-gallery-prev,.cm-gallery-next{position:absolute;top:45%;z-index:1;width:40px;height:44px;border:0;border-radius:6px;background:#003899;color:white;cursor:pointer;font-size:27px}.cm-gallery-prev{left:5px}.cm-gallery-next{right:5px}.cm-gallery-prev:disabled,.cm-gallery-next:disabled{opacity:.3}
.cm-gallery-legend{font-size:13px;margin:10px 0;color:#374151}.cm-gallery-thumbs{display:flex;gap:6px;overflow-x:auto;min-height:72px;padding:4px 0}.cm-gallery-thumb{padding:2px;flex:0 0 82px;height:65px;background:#fff;border:2px solid transparent;border-radius:6px;cursor:pointer}.cm-gallery-thumb.active{border-color:#003899}.cm-gallery-thumb img{width:100%;height:100%;object-fit:cover}.cm-gallery-footer{justify-content:flex-end}.cm-gallery-report{border:1px solid #cfe4f2;border-radius:6px;background:white;padding:8px;color:#003899;cursor:pointer}.cm-gallery-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:760px){.cm-gallery-backdrop{padding:0}.cm-gallery-dialog{width:100%;height:100dvh;max-height:100dvh;border-radius:0;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}.cm-gallery-stage{max-height:48dvh}.cm-gallery-image{max-height:47dvh}.cm-gallery-thumb{flex-basis:64px;height:56px}}

/* Hotfix 1.7.5.4.7.1: source provenance and accessible image zoom. */
.cm-gallery-original{color:#003899;text-decoration:underline;font-weight:600;white-space:nowrap}
.cm-gallery-original[hidden]{display:none}
.cm-gallery-zoom{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:2;display:flex;gap:4px;background:rgba(255,255,255,.94);padding:4px;border-radius:8px}
.cm-gallery-zoom-button{border:1px solid #cfe4f2;background:white;color:#003899;border-radius:6px;padding:7px 9px;cursor:pointer;font-size:12px}
.cm-gallery-image{transition:transform .12s ease;transform-origin:center;}
.cm-gallery-image.is-zoomed{cursor:zoom-in}
.cm-gallery-report:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:760px){.cm-gallery-footer{flex-wrap:wrap}.cm-gallery-zoom-button{padding:8px 6px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.cm-gallery-image{transition:none}}

/* 1.7.5.4.7.2 — responsive detail inspection and pan/pinch gestures */
.cm-gallery-stage{touch-action:none;overscroll-behavior:contain;min-height:0;max-height:none;flex:1 1 320px;user-select:none}
.cm-gallery-image{transition:none;max-height:100%;max-width:100%;height:auto;width:auto;object-fit:contain;will-change:transform;pointer-events:none;cursor:grab}
.cm-gallery-stage:has(.is-zoomed){cursor:grab}
.cm-gallery-stage:has(.is-zoomed):active{cursor:grabbing}
.cm-gallery-zoom{bottom:12px;max-width:calc(100% - 100px);align-items:center}
.cm-gallery-zoom-level{font:600 12px system-ui,sans-serif;padding:0 5px;min-width:35px;text-align:center}
.cm-gallery-dialog{height:min(90dvh,900px);gap:4px;min-width:0}
.cm-gallery-thumbs{flex:0 0 auto;scrollbar-width:thin;max-width:100%}
.cm-gallery-footer{flex:0 0 auto;justify-content:flex-start;flex-wrap:wrap;min-height:35px}
.cm-gallery-prev,.cm-gallery-next{top:50%;transform:translateY(-50%);min-width:44px;min-height:44px}
.cm-gallery-tabs button,.cm-gallery-zoom-button,.cm-gallery-report{min-height:40px}
@media(max-width:760px){.cm-gallery-dialog{height:100dvh;max-height:100dvh;gap:6px}.cm-gallery-header h2{font-size:18px}.cm-gallery-stage{min-height:0;max-height:none;flex:1 1 auto}.cm-gallery-image{max-height:100%;max-width:100%}.cm-gallery-zoom{bottom:8px;gap:3px;max-width:calc(100% - 96px)}.cm-gallery-zoom-button{font-size:11px;padding:7px 5px}.cm-gallery-thumbs{min-height:56px;flex-shrink:0}.cm-gallery-thumb{flex-basis:68px;height:56px}.cm-gallery-legend{margin:2px 0;min-height:16px}.cm-gallery-footer{gap:8px}}
@media(max-width:380px){.cm-gallery-dialog{padding:8px}.cm-gallery-header h2{font-size:16px}.cm-gallery-tabs button{padding:7px 9px}.cm-gallery-zoom-button{font-size:10px;padding:6px 4px}.cm-gallery-thumb{flex-basis:56px;height:48px}}
@media(orientation:landscape) and (max-height:500px){.cm-gallery-dialog{padding:6px 12px}.cm-gallery-header h2{font-size:16px}.cm-gallery-header .cm-gallery-close{min-height:36px}.cm-gallery-thumb{height:45px;flex-basis:55px}.cm-gallery-tabs{margin:0}.cm-gallery-legend{margin:0}.cm-gallery-footer{min-height:28px}}
