/* Gallery, attachment studio and shared map feedback. */
.media-gallery-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-block:18px}
.gallery-filters{display:flex;gap:6px;flex-wrap:wrap}
.gallery-filters button,.viewer-actions button,.viewer-footer>button,.viewer-state button,.upload-preview-dialog>button{font:inherit;border:1px solid #d1dce0;border-radius:10px;padding:10px 14px;min-height:44px;background:#fff;color:#193a36}
.gallery-filters button[aria-pressed=true]{background:#193a36;color:#fff;border-color:#193a36}
.place-gallery.gallery-ready{display:grid;grid-template-columns:2fr 1fr 1fr;grid-template-rows:repeat(2,minmax(160px,210px));gap:10px;overflow:hidden;scroll-snap-type:none}
.place-gallery.gallery-ready[data-visible="1"]{grid-template-columns:1fr;grid-template-rows:minmax(280px,500px)}
.place-gallery.gallery-ready[data-visible="2"]{grid-template-columns:1fr 1fr;grid-template-rows:minmax(280px,440px)}
.place-gallery.gallery-ready[data-visible="3"]{grid-template-columns:2fr 1fr}
.place-gallery.gallery-ready[data-visible="4"]{grid-template-columns:2fr 1fr 1fr}
.place-gallery.gallery-ready>.gallery-photo,.place-gallery.gallery-ready>.gallery-clip{position:relative;min-width:0;width:100%;height:100%;min-height:0;max-height:none;margin:0;border:0;border-radius:16px;background:#132523;overflow:hidden}
.place-gallery.gallery-ready>.gallery-lead{grid-row:1 / -1}
.place-gallery.gallery-ready[data-visible="4"]>.gallery-last{grid-column:2 / 4}
.place-gallery.gallery-ready>[hidden]{display:none!important}
.place-gallery.gallery-ready img,.place-gallery.gallery-ready video{display:block;width:100%;height:100%;max-height:none;object-fit:contain;transform:none}
.gallery-media-badge,.gallery-expand-video{position:absolute;top:12px;right:12px;padding:8px 12px;border-radius:10px;background:#0b191ddd;color:white;font:inherit;font-size:.78rem;font-weight:600;border:1px solid #ffffff44;pointer-events:none}
.gallery-expand-video{pointer-events:auto;min-height:44px;font:inherit;font-size:.8rem}
.gallery-clip>span{display:none}
.gallery-is-open{overflow:hidden}
dialog.media-viewer{box-sizing:border-box;width:min(1280px,96vw);max-width:96vw;height:92dvh;max-height:92dvh;padding:0;border:1px solid #405253;border-radius:20px;background:#0e1a1c;color:#fff;overflow:hidden}
dialog.media-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
dialog.media-viewer:fullscreen{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0}
.media-viewer::backdrop{background:#061015e8;backdrop-filter:blur(9px)}
.viewer-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid #ffffff20}
.viewer-title{display:block;font-size:1.05rem}.viewer-count{display:block;font-size:.8rem;color:#bfcdcd;margin-top:5px}
.viewer-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.viewer-actions button,.viewer-footer>button,.viewer-state button{background:#203233;border-color:#405657;color:#fff;font-size:.85rem}
.viewer-actions button[hidden],.viewer-state button[hidden]{display:none}
.viewer-stage{position:relative;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
.viewer-media{width:100%;height:100%;display:grid;place-items:center}
.media-viewer .viewer-media img,.media-viewer .viewer-media video{display:block;width:100%;height:100%;max-height:100%;object-fit:contain;min-height:0}
.viewer-stage.is-zoomed{touch-action:pan-x pan-y}.viewer-stage.is-zoomed .viewer-media{width:200%;height:200%}.viewer-stage.is-zoomed img{cursor:zoom-out}
.viewer-state{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;background:#101e22b8;padding:24px;text-align:center}
.viewer-state[hidden]{display:none}
.viewer-footer{display:flex;align-items:center;gap:12px;padding:12px 20px;border-top:1px solid #ffffff20;min-width:0}
.viewer-footer>button{flex:0 0 44px;padding:8px;font-size:1.4rem}
.viewer-thumbnails{display:flex;align-items:center;gap:8px;flex:1;overflow-x:auto;scrollbar-width:thin;padding:4px;min-width:0}
.viewer-thumbnails button{flex:0 0 70px;width:70px;height:54px;padding:0;border:2px solid transparent;border-radius:8px;overflow:hidden;background:#283f42;color:white;font:inherit}
.viewer-thumbnails button[aria-current=true]{border-color:#ffb38b;box-shadow:0 0 0 2px #ffb38b55}
.media-viewer .viewer-thumbnails img{width:100%;height:100%;object-fit:cover}
.media-dropzone{position:relative;display:grid;justify-items:center;gap:8px;border:2px dashed #a8c2bf;border-radius:18px;background:linear-gradient(135deg,#eff7f3,#f7faf9);padding:28px 20px;text-align:center;color:#244843;transition:border-color .15s,background .15s}
.media-dropzone>strong{font-size:1.15rem}.media-dropzone>span{font-size:.9rem;font-weight:400;color:#45655f}
.media-dropzone input[type=file]{width:100%;max-width:440px;background:white;border:1px solid #bacfc9;padding:10px;font-size:.85rem}
.media-dropzone input::file-selector-button{border:0;border-radius:8px;padding:10px 12px;background:#234e45;color:white;font:inherit;margin-right:12px;cursor:pointer}
.media-dropzone.dragging,.media-dropzone:focus-within{border-color:#246350;background:#e1f2e9;outline:3px solid #a2c9b988;outline-offset:2px}
.media-dropzone.is-full{border-style:solid}
.upload-queue{list-style:none;padding:0;display:grid;gap:10px;margin:16px 0}.upload-queue[hidden]{display:none}
.upload-job{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;gap:12px;background:#fff;border:1px solid #d1dfdb;border-radius:14px;padding:12px}
.upload-job-preview{width:64px;height:64px;object-fit:contain;border-radius:9px;background:#eaf0ed}
.upload-job-copy{display:grid;gap:5px;min-width:0}.upload-job-copy strong{font-size:.9rem;overflow-wrap:anywhere}.upload-job-copy small,.upload-job-message{font-size:.8rem;color:#47615a}
.upload-job progress{width:100%;height:7px;accent-color:#27624e}
.upload-job-actions{display:flex;gap:6px;flex-wrap:wrap}.upload-job-actions button,.attachment-actions button{font:inherit;min-height:40px;border:1px solid #cbdad4;border-radius:8px;padding:8px 10px;color:#294d42;background:#f6faf7;font-size:.8rem}
.upload-job[data-state=failed],.upload-job[data-state=cancelled]{border-color:#cb8b65;background:#fffaf5}.upload-validation{border-left:3px solid #ba552d;padding:10px 14px;background:#fff4eb;color:#833717}
#photo-previews.photo-previews,#video-previews.video-previews{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
#photo-previews>.attachment-card,#video-previews>.attachment-card{display:flex;flex-direction:column;width:auto;min-width:0;border:1px solid #d2dfd9;border-radius:14px;overflow:hidden;background:#fff;padding:10px;gap:10px}
.attachment-position{font-size:.78rem;color:#315b4c;text-transform:uppercase;letter-spacing:.06em}
#photo-previews .attachment-card img,#video-previews .attachment-card video{width:100%;height:160px;object-fit:contain;background:#e9eeeb;border-radius:9px}
.attachment-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}
#photo-previews .attachment-actions button,#video-previews .attachment-actions button{display:inline-flex;width:auto;justify-content:center;align-items:center}
.attachment-actions button[hidden]{display:none!important}.attachment-actions .attachment-remove{color:#8c3e2b}
.attachment-actions button:disabled,.viewer-footer>button:disabled{opacity:.4;cursor:default}
.upload-preview-dialog{width:min(960px,95vw);max-height:90dvh;padding:16px;background:#102320;border:1px solid #37564a;border-radius:16px;text-align:right}
.upload-preview-content img,.upload-preview-content video{display:block;width:100%;max-height:75dvh;object-fit:contain;margin-top:12px}
.photo-edit-dialog{box-sizing:border-box;width:min(860px,calc(100vw - 24px));max-height:92dvh;padding:24px;border:1px solid #cbdad4;border-radius:18px;background:#f6faf7;color:#193a36;overflow:auto}
.photo-edit-dialog::backdrop{background:#061015cf;backdrop-filter:blur(6px)}
.photo-edit-dialog h2{margin:0 0 8px}.photo-edit-dialog p{font-size:.9rem;line-height:1.5}
.photo-edit-canvas{display:block;max-width:100%;max-height:48dvh;width:auto;height:auto;margin:18px auto;border-radius:8px;background:repeating-conic-gradient(#dbe4df 0% 25%,#eff4f1 0% 50%) 50%/20px 20px}
.photo-edit-tools,.photo-edit-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.photo-edit-dialog button,.photo-edit-dialog select{font:inherit;min-height:44px;padding:10px 14px;border:1px solid #b6ccc0;border-radius:9px;background:#fff;color:#244e3d}
.photo-edit-dialog button[aria-pressed=true]{background:#244e3d;color:#fff}
.photo-edit-dialog button:disabled{opacity:.5}.photo-edit-dialog :focus-visible{outline:3px solid #27624e;outline-offset:3px}
.photo-edit-tools label{display:flex;align-items:center;gap:8px;font-size:.9rem}
.photo-edit-position{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}.photo-edit-position[hidden]{display:none}
.photo-edit-position label{display:grid;gap:8px;margin:0;font-size:.85rem}.photo-edit-position input{width:100%;margin:0;accent-color:#27624e}
.photo-edit-actions{position:sticky;bottom:0;justify-content:flex-end;margin-top:16px;padding-block:12px;background:#f6faf7;border-top:1px solid #d2dfd9}.photo-edit-actions button:last-child{background:#244e3d;color:#fff}
@media(max-width:500px){.photo-edit-dialog{padding:16px}.photo-edit-tools button{flex:1 1 42%}.photo-edit-tools label,.photo-edit-tools select{width:100%}.photo-edit-position{grid-template-columns:1fr}.photo-edit-actions button{flex:1}}
.map-loading-host{position:relative;background-color:#eaf0ec}
.map-load-state{position:absolute;z-index:800;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:12px;width:max-content;max-width:calc(100% - 48px);padding:18px 22px;border-radius:16px;background:#ffffffed;border:1px solid #cbdbd4;box-shadow:0 12px 38px #183c3026;color:#294e43;font:500 .9rem/1.5 system-ui,sans-serif;text-align:center;pointer-events:auto}
.map-load-state[hidden]{display:none}.map-load-compact{top:14px;transform:translateX(-50%);padding:8px 14px;font-size:.8rem}
.map-load-state button{font:inherit;border:1px solid #a9c0b4;border-radius:8px;padding:8px 12px;min-height:44px;color:#244e3d;background:#f1f8f4}
.media-spinner{display:inline-block;width:22px;height:22px;border:3px solid #cadcd2;border-top-color:#295e46;border-radius:50%;animation:media-spin .9s linear infinite;flex-shrink:0}
.media-spinner[hidden]{display:none}@keyframes media-spin{to{transform:rotate(360deg)}}
@media(max-width:700px){
 .place-gallery.gallery-ready{grid-template-columns:1fr 1fr;grid-template-rows:260px 140px 140px;gap:8px}
 .place-gallery.gallery-ready>.gallery-lead{grid-column:1 / -1;grid-row:1}
 .place-gallery.gallery-ready[data-visible="1"]{grid-template-rows:320px}
 .place-gallery.gallery-ready[data-visible="2"]{grid-template-columns:1fr 1fr;grid-template-rows:260px 190px}
 .place-gallery.gallery-ready[data-visible="2"]>.gallery-last{grid-column:1 / -1}
 .place-gallery.gallery-ready[data-visible="3"]{grid-template-columns:1fr 1fr;grid-template-rows:260px 160px}
 .place-gallery.gallery-ready[data-visible="4"]{grid-template-columns:1fr 1fr;grid-template-rows:260px 140px 140px}
 .place-gallery.gallery-ready[data-visible="4"]>.gallery-last{grid-column:1 / -1}
 .media-gallery-toolbar{align-items:stretch}.media-gallery-toolbar>.btn{width:100%}
 dialog.media-viewer{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0}
 .viewer-header{padding:12px;gap:10px;flex-wrap:wrap}.viewer-header>div:first-child{width:100%}.viewer-actions{width:100%;justify-content:flex-end}
 .viewer-footer{padding:10px;gap:8px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
 .viewer-thumbnails button{flex-basis:58px;width:58px;height:46px}
 .upload-job{grid-template-columns:48px minmax(0,1fr);gap:10px}.upload-job-preview{width:48px;height:48px}.upload-job-actions{grid-column:2}
 .media-dropzone{padding:20px 12px}#photo-previews.photo-previews,#video-previews.video-previews{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}
 .map-load-state{max-width:calc(100% - 24px);padding:14px}
}
@media(prefers-reduced-motion:reduce){.media-spinner{animation:none}.media-dropzone{transition:none}}
