.se-gallery,.gallery-admin{min-width:0;max-width:100%;box-sizing:border-box}
.se-gallery *, .gallery-admin *{box-sizing:border-box}
.se-gallery{margin:28px auto 38px;padding:clamp(18px,3vw,40px);width:100%;border:1px solid #e5d7b8;border-radius:28px;background:linear-gradient(145deg,#fffdf8,#f5efdf);box-shadow:0 20px 60px #34210b0d;color:#272218;overflow:hidden}
.gallery-heading,.gallery-album-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.gallery-heading h2{font-size:clamp(1.7rem,4vw,2.6rem);line-height:1.1;margin:6px 0}
.gallery-heading>span,.gallery-hint{color:#71644f;font-size:.9rem}
.gallery-album-tabs{display:flex;gap:10px;overflow-x:auto;max-width:100%;padding:4px 2px 16px;margin-bottom:16px;scrollbar-width:thin}
.gallery-album-tabs button{flex:0 0 auto;max-width:min(300px,80vw);text-align:left;border:1px solid #ddc998;border-radius:16px;background:#fffcf5;color:#57401c;padding:12px 18px;white-space:normal;overflow-wrap:anywhere;font:inherit;font-weight:700;cursor:pointer}
.gallery-album-tabs button[aria-pressed=true]{background:#332b22;color:#fff5de;border-color:#332b22}
.gallery-album-tabs small{display:block;font-size:.75rem;font-weight:400;margin-top:4px;opacity:.8}
.gallery-album[hidden]{display:none!important}
.gallery-album h3{font-size:clamp(1.2rem,3vw,1.75rem);line-height:1.2;margin:0 0 8px;overflow-wrap:anywhere}
.gallery-album-heading>div:first-child{min-width:0;flex:1 1 220px}
.gallery-album-heading p{margin:0;color:#75664f;font-size:.9rem;overflow-wrap:anywhere}
.gallery-controls{display:flex;gap:8px}
.gallery-controls button,.gallery-lightbox button{width:48px;height:48px;min-width:48px;border-radius:50%;border:1px solid #d6be87;background:#fff8e7;color:#513b18;font-size:1.35rem;cursor:pointer;display:grid;place-items:center;padding:0}
.gallery-track{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin;padding-bottom:12px;-webkit-overflow-scrolling:touch}
.gallery-photo{position:relative;flex:0 0 calc((100% - 32px)/3);min-width:0;scroll-snap-align:start;border-radius:18px;overflow:hidden;background:#1e1b18;text-decoration:none;color:#fff;aspect-ratio:4/3}
.gallery-photo img{width:100%;height:100%;object-fit:contain;display:block}
.gallery-photo span{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent,#000b);padding:32px 14px 12px;font-size:.78rem;text-align:right}
.gallery-hint{margin:12px 0 0}
.gallery-lightbox{position:fixed;inset:0;max-width:1400px;width:96vw;height:94dvh;max-height:94dvh;border:1px solid #8c7658;border-radius:20px;padding:16px;background:#161513;color:#fff9ed;margin:auto;overflow:hidden}
.gallery-lightbox[open]{display:flex;flex-direction:column;gap:12px}
.gallery-lightbox::backdrop{background:#000d;backdrop-filter:blur(5px)}
.gallery-lightbox-top,.gallery-lightbox-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}
.gallery-lightbox-top strong{font-size:1.1rem;overflow-wrap:anywhere;min-width:0}
.gallery-lightbox-stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:0;flex:1;gap:10px;touch-action:pan-y pinch-zoom}
.gallery-lightbox-stage img{width:calc(100% - 116px);height:100%;object-fit:contain;min-width:0;min-height:0}
.gallery-lightbox button{background:#ffffff18;color:#fff;border-color:#ffffff40}
.gallery-lightbox-bottom p{margin:4px 0;font-size:.85rem;color:#ddd0bd;overflow-wrap:anywhere}
.gallery-lightbox-bottom a{color:#201a12;background:#edcb7d;border-radius:12px;padding:12px 16px;text-decoration:none;min-height:44px;font-weight:700;white-space:nowrap}
.gallery-lightbox-bottom>div{min-width:0}
.se-gallery :focus-visible,.gallery-admin :focus-visible{outline:3px solid #b7862c;outline-offset:3px}
.gallery-admin .panel{min-width:0}
.gallery-admin .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.gallery-admin input,.gallery-admin select,.gallery-admin label{min-width:0;max-width:100%}
.gallery-admin input[type=file]{width:100%;margin:12px 0}
.gallery-admin details summary{cursor:pointer;font-weight:700;margin:12px 0}
.gallery-logo-preview{display:block;width:150px;height:110px;object-fit:contain;background:#e9e1d2;border-radius:12px;margin:12px 0}
.gallery-check{display:flex;align-items:center;gap:10px}.gallery-check input{width:20px;height:20px}
.gallery-admin progress{display:block;width:100%;height:16px;margin-top:20px;accent-color:#b78a36}
.gallery-admin [data-upload-errors]{color:#a42c28;overflow-wrap:anywhere}
.gallery-admin-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-top:20px}
.gallery-admin-thumbs img{width:100%;height:130px;object-fit:contain;background:#211d19;border-radius:12px}
.gallery-album-list{display:grid;gap:14px}
.gallery-album-list article{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap;border:1px solid #e5d7b8;padding:18px;border-radius:18px}
.gallery-album-list article>div{min-width:0;overflow-wrap:anywhere}.gallery-album-list article>div:first-child{flex:1 1 220px}
.gallery-album-list p{margin:6px 0}.gallery-actions{display:flex;gap:10px;flex-wrap:wrap}.gallery-actions button{min-height:44px}
.gallery-admin button:disabled{opacity:.6;cursor:wait}
@media(max-width:900px){.gallery-photo{flex-basis:calc((100% - 16px)/2)}}
@media(max-width:600px){.se-gallery{border-radius:20px;margin:20px 0;padding:18px}.gallery-photo{flex-basis:88%;aspect-ratio:4/3}.gallery-heading>span{display:none}.gallery-track{gap:12px}.gallery-admin .form-grid{grid-template-columns:minmax(0,1fr)}.gallery-lightbox{width:100vw;height:100dvh;max-height:100dvh;border:0;border-radius:0;padding:12px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(12px,env(safe-area-inset-bottom))}.gallery-lightbox-stage img{width:100%}.gallery-lightbox-stage button{position:absolute;z-index:1;width:44px;height:44px;min-width:44px;background:#0008}.gallery-lightbox-stage [data-lightbox-prev]{left:0}.gallery-lightbox-stage [data-lightbox-next]{right:0}.gallery-lightbox-bottom{flex-wrap:wrap}.gallery-lightbox-bottom a{text-align:center;width:100%}.gallery-lightbox-top strong{font-size:1rem}}

/* One compact photo at a time on every screen. */
.gallery-viewer{position:relative;min-width:0}
.gallery-track{gap:0;padding-bottom:0;scrollbar-width:none;scroll-snap-type:x mandatory}
.gallery-track::-webkit-scrollbar{display:none}
.gallery-photo{flex:0 0 100%;height:clamp(220px,30vw,380px);aspect-ratio:auto;border-radius:18px;scroll-snap-stop:always}
.gallery-photo span{padding-right:64px}
.gallery-viewer .gallery-controls{position:absolute;inset:0;pointer-events:none;z-index:2;justify-content:space-between;align-items:center;padding:0 10px}
.gallery-viewer .gallery-controls button{pointer-events:auto;background:#1f1a16c9;color:#fff;border-color:#ffffff50;box-shadow:0 2px 14px #0003}
@media(max-width:600px){.gallery-photo{height:240px;flex-basis:100%}.gallery-viewer .gallery-controls{padding:0 6px}.gallery-controls button{width:44px;height:44px;min-width:44px}.gallery-photo span{font-size:.7rem}.gallery-hint{font-size:.76rem}}
