
/* Gallery preview and ordering */
.gallery-row{align-items:center;padding:8px;border:1px solid #e5e0d7;border-radius:8px;background:#fff}.gallery-preview{width:64px;height:76px;object-fit:cover;border-radius:5px;background:#f1eee8;flex:0 0 64px}.gallery-row button:disabled,.queue-actions button:disabled{opacity:.35;cursor:not-allowed}.gallery-preview-title{font-size:13px;font-weight:700;margin:14px 0 8px}.gallery-queue-preview{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;margin:8px 0 14px}.queue-photo{display:flex;gap:9px;align-items:center;border:1px solid #ddd6ca;border-radius:8px;padding:8px;background:#fff}.queue-photo img{width:70px;height:82px;object-fit:cover;border-radius:5px;background:#eee}.queue-photo small{display:block;color:#777;margin:4px 0}.queue-actions{display:flex;gap:5px;margin-top:6px}.queue-actions button{padding:4px 9px;border:1px solid #ccc;background:#f8f6f2}@media(max-width:650px){.gallery-row{flex-wrap:wrap}.gallery-preview{width:58px;height:68px;flex-basis:58px}}

/* WhatsApp-style responsive gallery picker */
.mobile-gallery-stage{width:100%;height:clamp(190px,42vw,420px);background:#171717;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative}.mobile-gallery-stage img{width:100%;height:100%;object-fit:contain;min-height:0}.mobile-gallery-stage-meta{position:absolute;left:0;right:0;bottom:0;padding:8px 10px;background:linear-gradient(transparent,rgba(0,0,0,.72));color:#fff;font-size:12px}.mobile-gallery-thumbs{display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;padding:10px 2px 8px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}.mobile-gallery-thumb{position:relative;flex:0 0 66px;width:66px;scroll-snap-align:start}.mobile-gallery-thumb .thumb-select{display:block;width:100%;padding:2px;border:2px solid transparent;border-radius:8px;background:#eee;position:relative}.mobile-gallery-thumb.active .thumb-select{border-color:#b7791f}.mobile-gallery-thumb img{display:block;width:58px;height:62px;object-fit:cover;border-radius:5px}.mobile-gallery-thumb span{position:absolute;right:5px;bottom:5px;background:rgba(0,0,0,.7);color:white;border-radius:10px;padding:1px 5px;font-size:10px}.mobile-gallery-thumb .thumb-remove{position:absolute;right:-4px;top:-6px;border:0;border-radius:50%;width:21px;height:21px;padding:0;background:#b42318;color:#fff;font-size:16px;line-height:20px}.mobile-gallery-order-hint{font-size:11px;color:#777;margin:0 0 10px}@media(max-width:650px){.gallery-queue-preview{display:block;width:100%;min-width:0;margin:8px 0 12px}.mobile-gallery-stage{height:min(52vh,360px);min-height:190px;width:100%;border-radius:10px}.mobile-gallery-thumbs{gap:7px}.mobile-gallery-thumb{flex-basis:62px;width:62px}.mobile-gallery-thumb img{width:54px;height:58px}.gallery-preview-title{font-size:12px}.gallery-row{min-width:0;gap:6px}.gallery-row .gallery-url{min-width:0;flex:1 1 100%}}


/* FIX: load this stylesheet on admin.html; constrain the editor and all gallery media */
.editor-overlay{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:12px;overflow:auto;box-sizing:border-box}
.editor-overlay.hidden{display:none!important}
.editor{width:min(760px,calc(100vw - 24px));max-width:760px;max-height:calc(100dvh - 24px);overflow-x:hidden;overflow-y:auto;box-sizing:border-box;padding:18px}
.editor *{box-sizing:border-box}
#galleryRows{display:flex;flex-direction:column;gap:7px;width:100%;min-width:0;overflow:hidden}
#galleryRows .gallery-row{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;width:100%;min-width:0;max-width:100%;overflow:hidden;margin:0;padding:7px}
#galleryRows .gallery-preview{display:block!important;width:58px!important;height:68px!important;min-width:58px!important;max-width:58px!important;flex:0 0 58px!important;object-fit:cover!important;border-radius:6px}
#galleryRows .gallery-url{flex:1 1 120px!important;width:100px!important;min-width:0!important;max-width:100%;margin:0!important;padding:8px!important;font-size:12px!important}
#galleryRows .gallery-row button{flex:0 0 auto;padding:7px 9px;white-space:nowrap;font-size:12px}
.gallery-queue-preview{display:block!important;width:100%;max-width:100%;min-width:0;overflow:hidden;margin:8px 0 12px}
.mobile-gallery-stage{width:100%;height:clamp(150px,30vh,260px)!important;max-height:260px;min-height:150px;background:#171717;overflow:hidden;border-radius:10px;display:flex;align-items:center;justify-content:center;position:relative}
.mobile-gallery-stage img{display:block!important;width:100%!important;height:100%!important;max-width:100%;max-height:100%;object-fit:contain!important}
.mobile-gallery-thumbs{width:100%;max-width:100%;display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:8px;padding:10px 4px 12px;box-sizing:border-box}
.mobile-gallery-thumb{position:relative;flex:0 0 76px;width:76px;min-width:76px;height:96px}
.mobile-gallery-thumb .thumb-select{width:68px;height:68px;padding:2px}
.mobile-gallery-thumb img{width:60px!important;height:60px!important;object-fit:cover!important}
.mobile-gallery-thumb .thumb-order{display:flex;justify-content:center;gap:3px;margin-top:3px}
.mobile-gallery-thumb .thumb-order button{padding:0 7px;min-width:27px;height:20px;line-height:18px;font-size:14px}
.mobile-gallery-thumb .thumb-remove{right:0;top:-5px;width:20px;height:20px;padding:0}
.mobile-gallery-order-hint{font-size:11px;color:#666;white-space:normal}
@media(max-width:650px){.editor-overlay{padding:6px;align-items:flex-start}.editor{width:calc(100vw - 12px);max-height:calc(100dvh - 12px);padding:12px}.editor-grid{grid-template-columns:1fr}#galleryRows .gallery-row{gap:5px;padding:5px}#galleryRows .gallery-preview{width:48px!important;height:58px!important;min-width:48px!important;max-width:48px!important;flex-basis:48px!important}#galleryRows .gallery-url{font-size:11px!important;padding:6px!important;flex-basis:80px!important}#galleryRows .gallery-row button{padding:6px 7px;font-size:11px}.mobile-gallery-stage{height:clamp(140px,28vh,220px)!important;min-height:140px;max-height:220px}.mobile-gallery-thumb{flex-basis:68px;width:68px;min-width:68px}.mobile-gallery-thumb .thumb-select{width:60px;height:60px}.mobile-gallery-thumb img{width:52px!important;height:52px!important}}
