.image-zoom {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  box-shadow: none;
  color: inherit;
  cursor: zoom-in;
  appearance: none;
}
.image-zoom:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 5px; }
.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border: 0;
  background: #171816;
  color: #fff;
  overflow: hidden;
}
.photo-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}
.photo-viewer::backdrop { background: #171816; }
.photo-viewer-toolbar,
.photo-viewer-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.photo-viewer button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #85857f;
  border-radius: 12px;
  background: #30312e;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.photo-viewer button:hover { background: #454640; }
.photo-viewer button:focus-visible { outline: 3px solid #ef7e3f; outline-offset: 3px; }
.photo-viewer button[hidden] { display: none; }
.photo-viewer-stage { min-height: 0; min-width: 0; touch-action: pan-y pinch-zoom; }
.photo-viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo-viewer-caption {
  flex: 1;
  margin: 0;
  text-align: center;
  line-height: 1.4;
  max-height: 20vh;
  overflow: auto;
}
@media (max-width: 600px) {
  .photo-viewer-toolbar > span { display: none; }
  .photo-viewer-toolbar { justify-content: flex-end; }
  .photo-viewer-navigation { flex-wrap: wrap; gap: 8px; }
  .photo-viewer-caption { flex-basis: 100%; order: -1; font-size: 0.9rem; }
}
