.hc-universal-lightbox {
  width: min(96vw, 1280px);
  max-width: 1280px;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.42);
}

.hc-universal-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.78);
}

.hc-universal-lightbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 6px 10px 6px 14px;
}

.hc-universal-lightbox__title,
.hc-universal-lightbox__description,
.hc-universal-lightbox figcaption {
  margin: 0;
  color: #f8fafc;
  font-size: 0.9rem;
  line-height: 1.3;
}

html body:not([data-hc-page^="/admin"]):not(.hc-admin-page):not(.hc-page-admin)
  .hc-universal-lightbox[open]
  :is(.hc-universal-lightbox__title, .hc-universal-lightbox__description, figcaption) {
  color: #f8fafc;
}

.hc-universal-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.hc-universal-lightbox__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(94vh - 42px);
  min-height: 0;
  max-height: calc(94vh - 42px);
  padding: 0 10px 10px;
  overflow: hidden;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.hc-universal-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.hc-universal-lightbox__caption {
  flex: 0 0 auto;
  width: 100%;
  margin: 8px 0 0;
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.hc-universal-lightbox__caption:empty {
  display: none;
}

[data-hc-lightbox] {
  cursor: zoom-in;
}

[data-hc-lightbox]:focus-visible,
.hc-universal-lightbox__close:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

@media (max-width: 575.98px) {
  .hc-universal-lightbox {
    width: 96vw;
    border-radius: 14px;
  }

  .hc-universal-lightbox__head {
    min-height: 38px;
    padding: 4px 8px 4px 10px;
  }

  .hc-universal-lightbox__body {
    height: calc(94vh - 76px);
    max-height: calc(94vh - 76px);
    padding: 0 6px 6px;
    justify-content: flex-start;
    overflow: auto;
  }

  .hc-universal-lightbox__image {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hc-universal-lightbox__image {
    transition: none !important;
  }
}
