.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 13000;
  background: rgba(8, 10, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.img-lightbox__close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0));
  right: calc(12px + env(safe-area-inset-right, 0));
  z-index: 2;
  width: var(--touch-min, 44px);
  height: var(--touch-min, 44px);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.img-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: var(--touch-min, 44px);
  height: var(--touch-min, 44px);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.img-lightbox__nav--prev {
  left: calc(8px + env(safe-area-inset-left, 0));
}

.img-lightbox__nav--next {
  right: calc(8px + env(safe-area-inset-right, 0));
}

.img-lightbox__stage {
  max-width: min(96vw, 1100px);
  max-height: 88vh;
  max-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.img-lightbox__stage img {
  max-width: 100%;
  max-height: calc(88vh - 40px);
  max-height: calc(88svh - 40px);
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
}

.img-lightbox__counter {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .img-lightbox__nav {
    display: none;
  }
}
