body.image-viewer-open {
  overflow: hidden;
}

[data-image-viewer-trigger] {
  cursor: zoom-in;
}

[data-image-viewer-trigger]:focus-visible {
  outline: 3px solid rgba(85, 70, 245, .34);
  outline-offset: 3px;
}

.studio-shot-wrap > [data-image-viewer-trigger],
.software-hero-shot > [data-image-viewer-trigger],
.software-browser-shot > [data-image-viewer-trigger],
.software-settings-shot > [data-image-viewer-trigger] {
  display: block;
}

.image-viewer {
  inset: 0;
  width: min(1480px, calc(100vw - 48px));
  max-width: none;
  height: auto;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  color-scheme: only light;
  box-shadow: 0 28px 90px rgba(17, 24, 39, .34);
}

.image-viewer::backdrop {
  background: rgba(17, 24, 39, .76);
  backdrop-filter: blur(4px);
}

.image-viewer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #ffffff;
}

.image-viewer-header {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 20px;
  border-bottom: 1px solid #e8eaf0;
  background: #ffffff;
}

.image-viewer-header h2 {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font: 650 15px/1.3 Inter, system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-close {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  background: #ffffff;
  color: #475467;
  cursor: pointer;
}

.image-viewer-close:hover {
  border-color: #d3d6df;
  background: #f7f8fa;
  color: #111827;
}

.image-viewer-close:focus-visible {
  outline: 3px solid rgba(85, 70, 245, .34);
  outline-offset: 2px;
}

.image-viewer-close .icon {
  width: 20px;
  height: 20px;
}

.image-viewer-stage {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 14px;
  background: #f7f8fa;
  overscroll-behavior: contain;
  touch-action: pinch-zoom;
}

.image-viewer-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 156px);
  max-height: calc(100dvh - 156px);
  object-fit: contain;
}

.image-viewer-caption {
  min-height: 44px;
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid #e8eaf0;
  background: #ffffff;
  color: #667085;
  font: 500 12px/1.55 Inter, system-ui, sans-serif;
  text-align: center;
}

@media (max-width: 680px) {
  .image-viewer {
    width: 100vw;
    max-width: none;
    max-height: none;
    margin: auto 0;
    border-radius: 0;
  }

  .image-viewer-panel {
    max-height: 100vh;
    max-height: 100dvh;
  }

  .image-viewer-header {
    min-height: calc(56px + env(safe-area-inset-top));
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px 14px;
  }

  .image-viewer-stage {
    padding: 8px;
  }

  .image-viewer-image {
    max-height: calc(100vh - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .image-viewer-caption {
    min-height: calc(44px + env(safe-area-inset-bottom));
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-viewer,
  .image-viewer::backdrop,
  .image-viewer-close {
    animation: none !important;
    transition: none !important;
  }
}
