/* Room renders keep the source framing in the page and in the gallery. */
#views .photo-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

#views .photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: max(180px, calc(100svh - 8rem));
  margin-inline: auto;
  object-fit: contain;
}

.ref img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: max(180px, calc(100svh - 8rem));
  margin-inline: auto;
  object-fit: contain;
}

#viewer {
  box-sizing: border-box;
  width: calc(100% - 16px);
  height: calc(100dvh - 16px);
  max-width: none;
  max-height: none;
  margin: auto;
  overflow: hidden;
}

#viewer[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.viewer-stage {
  min-height: 0;
}

.viewer-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  background: #293027;
}

.viewer-info {
  flex: 1 1 240px;
  min-width: 0;
}

.viewer-controls {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  margin-inline-start: auto;
}

#viewer .viewer-controls button {
  position: static;
  transform: none;
  padding: 0;
}
