.photo-gallery {
  width: 100%;
  max-width: 900px;
  margin: 10px auto 36px;
}

.gallery-stage {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 14px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.gallery-stage > img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: min(72vh, 680px) !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center !important;
}

.gallery-count {
  position: absolute;
  right: 24px;
  bottom: 24px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(23, 53, 45, .86);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
  flex: 0 0 78px;
  width: 78px;
  height: 62px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--sand);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
}

.gallery-thumb.is-active { border-color: var(--green); }

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.photo-manager { background: #f7faf8; }
.gallery-file-status { display: block; color: var(--muted); line-height: 1.4; }
.upload-preview { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; }
.upload-preview img { flex: 0 0 72px; width: 72px; height: 58px; object-fit: contain; border-radius: 9px; border: 1px solid var(--line); background: var(--sand); }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.admin-gallery label,
.admin-gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.admin-gallery img { display: block; width: 100%; height: 100px; object-fit: contain; border-radius: 7px; background: var(--sand); }
.admin-gallery span,
.admin-gallery figcaption { display: block; margin-top: 7px; font-size: 11px; color: var(--muted); }

@media (max-width: 800px) {
  .photo-gallery { margin-bottom: 24px; }
  .gallery-stage { padding: 8px; border-radius: 14px; }
  .gallery-stage > img { max-height: 62vh !important; }
  .gallery-count { right: 16px; bottom: 16px; }
  .gallery-thumb { flex-basis: 70px; width: 70px; height: 56px; }
}
