.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: rgba(4, 12, 22, 0.92);
  backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none !important; }
body.lightbox-open { overflow: hidden; }

.lightbox__inner {
  max-width: min(96vw, 1200px);
  max-height: min(82vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  background: #ffffff;
  padding: clamp(0.5rem, 2vw, 1rem);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  background: #ffffff;
}
.lightbox__inner img {
  max-width: 100%;
  max-height: min(82vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: none;
  transform-origin: center center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox__inner--plan {
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.lightbox__inner--plan img {
  border-radius: 0;
  box-shadow: none;
}

.lightbox__close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox__nav--prev { left: max(0.5rem, env(safe-area-inset-left)); }
.lightbox__nav--next { right: max(0.5rem, env(safe-area-inset-right)); }

.lightbox__counter {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
}
