.screenshot-gallery { grid-column: 1 / -1; min-width: 0; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr)); list-style: none; padding: 0; margin: 13px 0 0; gap: 12px; }
.gallery-thumbs li { min-width: 0; }
.gallery-thumbs a { display: block; aspect-ratio: 16 / 10; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.gallery-thumbs a:hover { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
#gallery-dialog { width: min(1240px, calc(100vw - 32px)); max-width: 100%; max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid #414147; border-radius: 14px; background: var(--panel); color: var(--ink); overflow: auto; }
#gallery-dialog::backdrop { background: rgb(0 0 0 / 82%); }
.gallery-bar { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 7px 10px 7px 14px; }
.gallery-caption { color: var(--secondary); font-size: 14px; }
.gallery-controls { display: flex; gap: 4px; }
.gallery-controls button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 7px; background: var(--control); color: var(--ink); }
.gallery-controls button:hover { background: #35353a; }
.gallery-controls .icon { width: 17px; height: 17px; }
.gallery-controls .gallery-close { margin-left: 5px; }
.gallery-stage { display: grid; place-items: center; background: #101012; min-height: min(35dvh, 250px); }
.gallery-full { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 82px); object-fit: contain; }
.gallery-stage [hidden] { display: none; }
.gallery-error { margin: 10px; color: var(--secondary); }
@media (max-width: 560px) {
  .screenshot-gallery { margin-top: 26px; }
  .gallery-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #gallery-dialog { width: calc(100vw - 12px); }
  .gallery-controls button { width: 40px; height: 40px; }
}
