.gallery-modal {
  padding: 0;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: none;
}

.gallery-modal .image-panel {
  position: relative;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #020204;
  box-shadow: none;
}

.gallery-viewer-head {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 12px;
  z-index: 8;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.gallery-viewer-head > div {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(162, 155, 254, 0.22);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(5, 6, 10, 0.62);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.gallery-viewer-head .section-kicker {
  min-height: 24px;
}

.gallery-viewer-head strong {
  color: #d9d4ff;
  font-size: 12px;
}

.gallery-viewer-head .modal-close {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-color: rgba(162, 155, 254, 0.22);
  background: rgba(5, 6, 10, 0.62);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.gallery-viewer-stage {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
  padding: 0;
  background: #020204;
}

.gallery-viewer-stage:not(.is-video) {
  cursor: zoom-in;
}

.gallery-viewer-stage.is-zooming {
  cursor: crosshair;
}

.gallery-viewer-stage .modal-image {
  transition: transform 180ms ease, transform-origin 80ms linear;
}

.gallery-viewer-stage.is-zooming .modal-image {
  will-change: transform, transform-origin;
}

.gallery-zoom-lens {
  display: none !important;
}

.gallery-zoom-lens::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0.65;
}

.gallery-stage-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.gallery-viewer-stage .modal-image {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: #020204;
  box-shadow: none;
}

.gallery-viewer-stage .modal-video {
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
}

.gallery-arrow {
  z-index: 9;
  width: 52px;
  height: 86px;
  border-color: rgba(162, 155, 254, 0.18);
  background: rgba(5, 6, 10, 0.48);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.gallery-arrow.prev {
  left: 18px;
}

.gallery-arrow.next {
  right: 18px;
}

.gallery-thumb-strip {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 12px;
  z-index: 8;
  width: max-content;
  max-width: calc(100vw - 24px);
  display: flex;
  border: 1px solid rgba(162, 155, 254, 0.16);
  border-radius: 10px;
  padding: 7px;
  background: rgba(5, 6, 10, 0.56);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.gallery-thumb {
  flex: 0 0 96px;
  height: 56px;
}

.gallery-thumb img {
  filter: saturate(0.9) brightness(0.72);
}

@media (max-width: 760px) {
  .gallery-modal {
    padding: 0;
  }

  .gallery-modal .image-panel {
    height: 100dvh;
    max-height: none;
  }

  .gallery-viewer-head {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .gallery-viewer-head .modal-close {
    width: 40px;
    height: 40px;
  }

  .gallery-viewer-stage {
    padding: 0;
  }

  .gallery-viewer-stage .modal-image {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
  }

  .gallery-arrow {
    width: 38px;
    height: 64px;
  }

  .gallery-zoom-lens {
    width: 178px;
    height: 178px;
  }

  .gallery-arrow.prev {
    left: 10px;
  }

  .gallery-arrow.next {
    right: 10px;
  }

  .gallery-thumb-strip {
    bottom: 8px;
    max-width: calc(100vw - 16px);
    padding: 6px;
  }

  .gallery-thumb {
    flex-basis: 74px;
    height: 46px;
  }
}
