.xidown-gallery {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(1100px, calc(100vw - 48px));
  height: min(860px, 90vh);
  height: min(860px, 90dvh);
  max-width: calc(100vw - 24px);
  max-height: 94vh;
  max-height: 94dvh;
  margin: auto;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #202124;
  font: inherit;
  box-shadow: 0 12px 48px rgb(32 33 36 / 20%);
}
.xidown-gallery[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.xidown-gallery::backdrop { background: rgb(32 33 36 / 70%); }
.xidown-gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.xidown-gallery-header h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.xidown-gallery button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  color: #01875f;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
}
.xidown-gallery button:hover { background: #f8f9fa; }
.xidown-gallery button:disabled { color: #5f6368; opacity: .5; cursor: default; }
.xidown-gallery button:focus-visible,
[data-gallery-item]:focus-visible { outline: 2px solid #01875f; outline-offset: 3px; }
[data-gallery-item] { cursor: zoom-in; }
.gp-screenshot-rail [data-gallery-item] { display: block; }
.xidown-gallery-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; margin: 0; background: #f8f9fa; touch-action: pan-y pinch-zoom; }
.xidown-gallery-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.xidown-gallery-stage img[hidden], .xidown-gallery-stage p[hidden] { display: none; }
.xidown-gallery-stage p { margin: 0; padding: 20px; color: #5f6368; font-size: 14px; text-align: center; }
.xidown-gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.xidown-gallery-caption { min-width: 0; margin: 0; font-size: 13px; line-height: 20px; color: #5f6368; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xidown-gallery-controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-shrink: 0; }
.xidown-gallery-controls span { min-width: 48px; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .xidown-gallery { width: calc(100vw - 16px); max-width: calc(100vw - 16px); padding: 12px; }
  .xidown-gallery-footer { flex-direction: column; gap: 8px; }
  .xidown-gallery-caption { align-self: stretch; text-align: center; }
}
