.image-gallery{--gallery-skew:0deg;--gallery-lean:0deg;--gallery-height:clamp(280px,32vw,440px);position:relative;min-width:0;background:#191a18;border-radius:24px;overflow:hidden;margin:48px 0 0}
.gallery-window{overflow-x:auto;overflow-y:hidden;padding:64px 0 76px;scrollbar-width:none;outline-offset:-4px;overscroll-behavior-x:contain}
.gallery-window::-webkit-scrollbar{display:none}
.gallery-window:focus-visible{outline:1px solid var(--ink)}
.gallery-track{display:flex;width:max-content;align-items:center}
.gallery-group{display:flex;gap:20px;align-items:center;padding-right:20px;flex:none}
.gallery-card{flex:none;width:calc(var(--gallery-height) * .75);height:var(--gallery-height);margin:0;border-radius:12px;overflow:hidden;background:#222;transform:skewX(var(--gallery-skew)) rotate(var(--gallery-lean));transform-origin:center;user-select:none}
.gallery-card img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;-webkit-user-drag:none}
.gallery-animated .gallery-window{overflow:hidden;touch-action:pan-y pinch-zoom;cursor:grab}
.gallery-animated .gallery-track{will-change:transform}
.gallery-animated .gallery-card{will-change:transform}
.image-gallery.is-dragging .gallery-window{cursor:grabbing}
.gallery-controls{position:absolute;bottom:16px;right:20px;display:flex;gap:8px}
.gallery-controls button{display:grid;place-items:center;width:42px;height:42px;padding:0;border:1px solid #ede9d940;border-radius:50%;background:#191a18;color:var(--ink);font-size:20px;line-height:1}
.gallery-controls button:hover{color:#222;background:var(--ink)}
.gallery-controls button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.gallery-controls button[hidden]{display:none}
#lab-content>.image-gallery:first-child{margin-top:0}
.gallery-preview{margin-top:38px}
@media(max-width:640px){.image-gallery{--gallery-height:clamp(250px,88vw,360px);border-radius:16px}.gallery-window{padding:44px 0 68px}.gallery-group{gap:14px;padding-right:14px}.gallery-card{border-radius:9px}.gallery-controls{bottom:12px;right:14px}.gallery-controls button{width:40px;height:40px}}
@media(prefers-reduced-motion:reduce){.gallery-card{transform:none}.gallery-animated .gallery-track,.gallery-animated .gallery-card{will-change:auto}}
.video-gallery{--gallery-height:clamp(210px,23vw,320px)}
.video-gallery-card{width:calc(var(--gallery-height) * var(--video-ratio));position:relative}
.video-gallery-card>button{display:block;position:relative;width:100%;height:100%;padding:0;border:0;background:#111;color:var(--ink);border-radius:inherit;overflow:hidden;touch-action:pan-y pinch-zoom}
.video-gallery-card>button:focus-visible{outline:3px solid var(--ink);outline-offset:-4px}
.video-gallery-card video{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.gallery-video-open{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;width:34px;height:34px;border:1px solid #ffffff70;border-radius:50%;background:#191a1880;color:#fff;font-size:20px;pointer-events:none}
.media-dialog.video-only{width:min(1240px,94vw);padding:58px 18px 18px;background:#111}
.media-dialog.video-only .dialog-content>video{max-height:78svh;width:100%;display:block;object-fit:contain;background:#111}
@media(max-width:640px){.video-gallery{--gallery-height:clamp(165px,47vw,250px)}.video-gallery .gallery-window{padding-top:36px}.media-dialog.video-only{width:96vw;padding:58px 8px 12px}.gallery-video-open{width:28px;height:28px;right:8px;bottom:8px;font-size:17px}}
