.ad-photo-open {
  display: block;
  color: inherit;
}
.ad-photo-open span {
  display: inline-block;
  margin: .5rem;
  text-decoration: underline;
}
.ad-photo-dialog {
  box-sizing: border-box;
  width: min(96vw, 72rem);
  max-width: none;
  max-height: 96dvh;
  padding: 1rem;
  border: 0;
  border-radius: 1rem;
  color: #221b20;
  background: #fff;
}
.ad-photo-dialog::backdrop {
  background: rgb(20 14 18 / 85%);
}
.ad-photo-dialog form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.ad-photo-dialog button {
  min-height: 44px;
  padding: .35rem .75rem;
}
.ad-photo-stage {
  position: relative;
  max-height: 76dvh;
  overflow: hidden;
}
.ad-photo-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 76dvh;
  margin-inline: auto;
  object-fit: contain;
}
.ad-photo-stage[data-zoomed] img {
  width: 200%;
  max-width: none;
  max-height: none;
  height: auto;
}
.ad-photo-thumbnails { display: flex; gap: .5rem; overflow-x: auto; }
.ad-photo-thumbnails img { display: block; width: 68px; height: 54px; object-fit: contain; }
.ad-photo-thumbnails [aria-pressed=true] { outline: 2px solid #a5224e; outline-offset: -2px; }
.ad-photo-stage { touch-action: pan-y; }
.ad-photo-stage[data-zoomed] { overflow: auto; touch-action: auto; }

.ad-photo-open { touch-action: pan-y pinch-zoom; }
[data-ad-photo-viewer] > .ad-photo-inline-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-bottom: .5rem;
}
[data-ad-photo-viewer] > .ad-photo-inline-controls[hidden] {
  visibility: hidden;
  pointer-events: none;
}
.ad-photo-inline-controls button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #ded2d8;
  border-radius: .5rem;
  background: #fff;
  color: #721d40;
  font-size: 1.35rem;
  cursor: pointer;
}
[data-ad-photo-viewer] {
  inline-size: min(100%, 28.25rem);
  min-inline-size: 0;
}
[data-ad-photo-viewer] .ad-photo-open > .detail-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 55vh;
  max-height: 55svh;
  aspect-ratio: 42 / 31;
  object-fit: contain;
  object-position: center;
  background: #f4f4f4;
}

[data-ad-photo-viewer] .ad-photo-open > .ad-photo-inline-frame {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 42 / 31;
  max-height: 55vh;
  max-height: 55svh;
  margin: 0;
  text-decoration: none;
  overflow: hidden;
  background: #f4f4f4;
}
[data-ad-photo-viewer] .ad-photo-inline-frame > .detail-photo {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: #f4f4f4;
}
