.gallery-trigger{display:block;position:relative;cursor:zoom-in}
.gallery-trigger:focus-visible{outline:3px solid var(--blue-deep);outline-offset:4px}
.gallery-hint{position:absolute;right:14px;bottom:14px;background:rgba(17,26,53,.85);color:#fff;padding:8px 12px;border-radius:8px;font-size:12px;line-height:1.4}
.gallery-modal{box-sizing:border-box;border:1px solid #37415a;border-radius:16px;padding:0;margin:auto;width:min(1400px,96vw);max-width:96vw;height:92vh;height:92dvh;max-height:94dvh;background:#111827;color:#fff;overflow:hidden}
.gallery-modal[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.gallery-modal::backdrop{background:rgba(4,8,18,.88)}
.gallery-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px}
.gallery-counter{font-size:14px;font-variant-numeric:tabular-nums;color:#d3dcf0}
.gallery-modal button{border:1px solid #58657e;border-radius:8px;background:#202c43;color:#fff;cursor:pointer;min-width:44px;min-height:44px;padding:8px 14px;font:inherit;flex-shrink:0}
.gallery-modal button:hover{background:#34466a}
.gallery-modal button:focus-visible{outline:3px solid #b4c6ff;outline-offset:2px}
.gallery-modal button[hidden]{display:none}
.gallery-stage{display:flex;align-items:center;justify-content:center;min-height:0;min-width:0;position:relative;padding:0 16px;touch-action:pan-y;cursor:zoom-out}
.gallery-image{display:block;width:100%;height:100%;object-fit:contain;user-select:none;cursor:zoom-out}
.gallery-image[hidden]{display:none}
.gallery-error{max-width:32em;padding:24px;text-align:center;color:#d3dcf0}
.gallery-controls{display:flex;gap:18px;align-items:center;justify-content:center;padding:12px 18px}
.gallery-meta{flex:1;min-width:0;text-align:center}
.gallery-caption{margin:0;font-size:14px;line-height:1.6;overflow-wrap:anywhere;max-height:5em;overflow:auto}
.gallery-source-link{display:inline-block;margin-top:3px;color:#d3dcf0;font-size:11px;text-decoration:underline;text-underline-offset:3px}
.gallery-source-link[hidden]{display:none}
.gallery-modal .gallery-prev,.gallery-modal .gallery-next{font-size:28px;line-height:1}
@media(max-width:600px){.gallery-modal{width:96vw;height:88dvh}.gallery-toolbar,.gallery-controls{padding:10px}.gallery-stage{padding:0 8px}.gallery-controls{gap:8px}.gallery-caption{font-size:12px}.gallery-hint{right:10px;bottom:10px}}
