.pciv-zoomable {
  cursor: zoom-in;
}

.pciv-zoomable:focus-visible {
  outline: 3px solid #ff78bc;
  outline-offset: 3px;
}

html.pciv-scroll-lock, body.pciv-scroll-lock {
  overflow: hidden !important;
}

#pc-image-viewer {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  color: #fff !important;
  z-index: 2147483647 !important;
  overscroll-behavior: contain;
}

#pc-image-viewer:not([open]) {
  display: none !important;
}

#pc-image-viewer::backdrop {
  background: #000 !important;
}

#pc-image-viewer .pciv-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: calc(64px + env(safe-area-inset-top, 0px)) calc(68px + env(safe-area-inset-right, 0px)) calc(42px + env(safe-area-inset-bottom, 0px)) calc(68px + env(safe-area-inset-left, 0px));
  background: #000;
  touch-action: pan-y pinch-zoom;
}

#pc-image-viewer .pciv-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  width: 100%;
}

#pc-image-viewer .pciv-image {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  cursor: default;
}

#pc-image-viewer button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #ffffff80 !important;
  border-radius: 50% !important;
  background: #111 !important;
  color: #fff !important;
  font: 400 34px/1 Arial, sans-serif !important;
  box-shadow: none !important;
  cursor: pointer;
  text-decoration: none;
}

#pc-image-viewer button:hover {
  background: #333 !important;
}

#pc-image-viewer button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

#pc-image-viewer [hidden] {
  display: none !important;
}

#pc-image-viewer .pciv-toolbar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  gap: 12px;
  z-index: 2;
}

#pc-image-viewer .pciv-prev, #pc-image-viewer .pciv-next {
  position: absolute;
  top: calc(50% - 24px);
}

#pc-image-viewer .pciv-prev {
  left: 10px;
}

#pc-image-viewer .pciv-next {
  right: 10px;
}

#pc-image-viewer .pciv-count {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: #ddd;
  font: 400 15px/1.3 Arial, sans-serif !important;
}

#pc-image-viewer .pciv-error {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 60px;
  color: #fff !important;
  text-align: center;
  font: 400 17px/1.4 Arial, sans-serif !important;
}

.pciv-builder-open {
  cursor: zoom-in;
  margin: 12px 0;
  padding: 10px 18px;
}

@media (max-width: 760px) {
  #pc-image-viewer .pciv-stage {
    padding: calc(66px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px)) calc(74px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
  }
  #pc-image-viewer .pciv-prev, #pc-image-viewer .pciv-next {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  #pc-image-viewer .pciv-count {
    bottom: max(28px, env(safe-area-inset-bottom));
  }
}
