.modal-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.modal-root.is-open {
  pointer-events: auto;
}

.lightbox {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom))
    18px;
  background: rgba(7, 14, 11, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox__content {
  position: relative;
  width: min(100%, 520px);
}

.auth-sheet {
  width: min(100%, 520px);
}

.auth-sheet__card {
  padding: 20px;
}

.auth-sheet__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: flex-start;
  margin-top: 14px;
}

.lightbox__close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(28, 49, 39, 0.08);
  box-shadow:
    0 14px 24px rgba(18, 38, 30, 0.12),
    0 1px 0 rgba(255,255,255,0.85) inset;
  color: #17372b;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  appearance: none;
  -webkit-appearance: none;
}

.lightbox__close span {
  transform: translateY(-1px);
}

.lightbox__frame {
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 50px rgba(0,0,0,0.3);
}

.lightbox__frame img,
.lightbox__frame video {
  width: 100%;
  display: block;
}

.lightbox__content--gallery {
  width: min(92vw, 560px);
  max-width: min(92vw, 560px);
}

.lightbox__gallery-head {
  margin-bottom: 14px;
}

.lightbox__gallery-head h3 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lightbox__gallery {
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .lightbox__close {
  background: rgba(19, 28, 24, 0.96);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 16px 28px rgba(0,0,0,0.32),
    0 1px 0 rgba(255,255,255,0.04) inset;
  color: #eef8f2;
}
