/* Screenshot gallery: preserve every image edge and keep controls off the artwork. */
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.gallery-tile { display: block; align-self: start; overflow: hidden; border: 1px solid #ffffff24; border-radius: 12px; background: #15161d; }
.gallery-tile img { display: block; width: 100%; height: auto; }
.gallery-tile:hover { border-color: #b0a1ff; }
.gallery-tile:focus-visible, .gallery-dialog :focus-visible { outline: 3px solid #b0a1ff; outline-offset: 4px; }
.example-screenshot { width: 100%; margin-top: 24px; }
.gallery-actions { display: flex; justify-content: center; margin-top: 32px; }
.gallery-dialog { inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: #f5f5fa; background: #090a0f; overflow: hidden; }
.gallery-dialog::backdrop { background: #090a0f; }
.gallery-dialog[open] { display: flex; flex-direction: column; }
.gallery-toolbar { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 8px; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid #ffffff24; }
.gallery-toolbar button, .gallery-toolbar a { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 10px 16px; border: 1px solid #ffffff38; border-radius: 8px; background: #171820; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.gallery-toolbar [data-gallery-close] { margin-left: auto; }
.gallery-toolbar [hidden], .gallery-dialog [hidden] { display: none !important; }
.gallery-overview { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; align-content: start; grid-auto-rows: max-content; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-viewer { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: 20px; overflow: hidden; }
.gallery-viewer img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-fallback { padding-top: 36px; padding-bottom: 64px; }
.gallery-fallback > a { display: inline-block; margin-bottom: 28px; }
@media (min-width: 701px) and (max-width: 1000px) {
  #gallery .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 16px; }
  .gallery-overview { padding: 16px; }
  .gallery-viewer { padding: 8px; }
  .gallery-toolbar { gap: 6px; padding: max(8px, env(safe-area-inset-top)) 8px 8px; }
  .gallery-toolbar button, .gallery-toolbar a { padding: 8px 12px; }
  .gallery-toolbar [data-gallery-original] { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .gallery-dialog *, #gallery * { scroll-behavior: auto; transition: none; animation: none; } }
