.lightbox.lightbox-gallery {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  border: 0;
  color: #edf2f7;
  overflow: hidden;
}

.lightbox.lightbox-gallery:not([open]),
.lightbox-gallery .lightbox-pager[hidden] {
  display: none;
}

.lightbox-gallery .lightbox-toolbar {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.lightbox-gallery .lightbox-close { position: static; }

.lightbox-gallery .lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.lightbox-gallery .lightbox-stage:active { cursor: grabbing; }

.lightbox-gallery .lightbox-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}

.lightbox-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.lightbox-gallery :is(.lightbox-close, .lightbox-page-button) {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #405267;
  border-radius: 7px;
  background: #192530;
  color: #edf2f7;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.lightbox-gallery :is(.lightbox-close, .lightbox-page-button):hover,
.lightbox-gallery :is(.lightbox-close, .lightbox-page-button):focus-visible {
  border-color: #eab54f;
  color: #eab54f;
}

.lightbox-gallery :is(.lightbox-close, .lightbox-page-button):focus-visible {
  outline: 2px solid #eab54f;
  outline-offset: 2px;
}

.lightbox-position {
  min-width: 6ch;
  margin: 0;
  color: #c8d4df;
  text-align: center;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
