.jaf-gallery { box-sizing: border-box; width: min(1100px, 94vw); height: min(900px, 94dvh); max-width: 94vw; max-height: 94dvh; padding: 14px; border: 1px solid #444; background: #0d0d0d; color: #eee; }
.jaf-gallery[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 12px; }
.jaf-gallery::backdrop { background: rgba(0,0,0,.95); }
.jaf-gallery-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.jaf-gallery-caption { margin: 0; font: 12px/1.6 'Inter',sans-serif; }
.jaf-gallery-stage { position: relative; min-height: 0; overflow: hidden; }
.jaf-gallery-stage img { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.jaf-gallery-stage img[hidden] { display: none; }
.jaf-gallery-message { position: absolute; top: 50%; left: 5%; width: 90%; margin: 0; transform: translateY(-50%); text-align: center; color: #aaa; font: 12px/1.8 'Inter',sans-serif; }
.jaf-gallery-message[hidden] { display: none; }
.jaf-gallery button { min-height: 44px; padding: 10px 16px; border: 1px solid #666; background: transparent; color: #eee; font: 12px/1.5 'Inter',sans-serif; cursor: pointer; }
.jaf-gallery button:disabled { opacity: .4; cursor: default; }
.jaf-gallery button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.jaf-gallery-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.jaf-gallery-controls[hidden], .jaf-gallery-hint[hidden] { display: none; }
.jaf-gallery-hint { margin: 0; text-align: center; color: #999; font: 11px/1.6 'Inter',sans-serif; }
@media(max-width: 640px) { .jaf-gallery { padding: 10px; } .jaf-gallery[open] { gap: 10px; } .jaf-gallery button { padding: 10px 12px; } }
