.im-photo-viewer:not([open]) { display: none; }
.im-photo-viewer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: calc(100vw - 32px);
  height: calc(100dvh - 32px);
  max-width: 1440px;
  max-height: none;
  margin: auto;
  padding: 60px 56px 16px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #fff1e6;
  color: #433228;
  font: 500 14px/1.5 Montserrat, Arial, sans-serif;
}
.im-photo-viewer::backdrop { background: rgba(18, 14, 12, .9); }
.im-photo-viewer__toolbar { position: absolute; inset: 8px 8px auto 20px; display: flex; align-items: center; gap: 8px; }
.im-photo-viewer__status { margin-right: auto; }
.im-photo-viewer__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.im-photo-viewer__button[hidden] { display: none; }
.im-photo-viewer__button svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.im-photo-viewer__button:disabled { opacity: .4; cursor: default; }
.im-photo-viewer__button:focus-visible, img[data-im-photo-src]:focus-visible { outline: 2px solid #433228; outline-offset: 2px; }
.im-photo-viewer__stage { display: grid; width: 100%; height: 100%; place-items: center; overflow: auto; overscroll-behavior: contain; }
.im-photo-viewer__image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; touch-action: pan-y pinch-zoom; }
.im-photo-viewer--enlarged .im-photo-viewer__stage { display: block; }
.im-photo-viewer--enlarged .im-photo-viewer__image { max-width: none; max-height: none; cursor: zoom-out; touch-action: auto; }
.im-photo-viewer__previous, .im-photo-viewer__next { position: absolute; top: 50%; transform: translateY(-50%); }
.im-photo-viewer__previous { left: 6px; }
.im-photo-viewer__next { right: 6px; }
.im-photo-viewer__error { padding: 20px; text-align: center; }
img[data-im-photo-src] { cursor: zoom-in; }
@media (hover: hover) and (pointer: fine) {
  .im-photo-viewer__button:not(:disabled):hover { background: #ffe3b3; }
}
@media (max-width: 640px) {
  .im-photo-viewer { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 60px 40px 12px; }
  .im-photo-viewer__previous { left: 0; }
  .im-photo-viewer__next { right: 0; }
}
