.guest-page.gallery-active::before { background-image: none; }
.guest-gallery {
  width: min(100% - 48px, 1060px);
  min-height: 100svh;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  color: #fff7e7;
}
.gallery-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 0 14px; border-bottom: 1px solid rgba(255,242,218,.28); }
.gallery-back,.gallery-refresh,.gallery-retry,.gallery-empty-upload,.gallery-pagination button,.gallery-detail-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 17px;
  color: #fff7e7;
  background: transparent;
}
.gallery-back { padding-left: 0; }
.gallery-back svg { width: 20px; height: 20px; }
.gallery-refresh { padding-right: 0; color: #eee1c8; }
.gallery-header button:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.gallery-heading { margin: 30px 0 25px; }
.gallery-heading h1 { font-size: clamp(28px, 7.5vw, 38px); font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; }
.gallery-heading h1:focus { outline: none; }
.gallery-heading p { margin-top: 9px; color: #eee1c8; font-size: 16px; line-height: 1.8; }
.gallery-message { margin: 0 0 20px; font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.gallery-message.error { color: #ffdbca; }
.gallery-retry { border-color: rgba(255,242,218,.65); margin-bottom: 24px; }
.guest-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px 14px; }
.guest-gallery-item { display: block; min-width: 0; width: 100%; padding: 0; color: #eee1c8; background: transparent; text-align: left; }
.guest-gallery-preview { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: #332c24; }
.guest-gallery-preview img { width: 100%; height: 100%; object-fit: cover; }
.guest-gallery-item:hover .guest-gallery-name { color: #fff7e7; text-decoration: underline; text-underline-offset: 5px; }
.guest-gallery-video { flex-direction: column; gap: 12px; color: #fff7e7; border: 1px solid rgba(255,242,218,.28); }
.guest-gallery-video svg { width: 36px; height: 36px; }
.guest-gallery-video span,.guest-gallery-image-fallback { padding: 10px; text-align: center; font-size: 16px; }
.guest-gallery-name { display: block; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.7; }
.gallery-empty { padding: 54px 0; border-top: 1px solid rgba(255,242,218,.28); text-align: center; }
.gallery-empty>p { font-size: 25px; }
.gallery-empty>span { display: block; margin: 14px auto 20px; max-width: 28ch; font-size: 17px; color: #eee1c8; line-height: 1.9; }
.gallery-empty-upload { background: #f3e4c8; color: #3a3024; padding: 11px 18px; }
.gallery-pagination,.gallery-detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,242,218,.28); }
.gallery-pagination button,.gallery-detail-nav button { border-color: rgba(255,242,218,.65); min-width: 82px; }
.gallery-pagination span,.gallery-detail-nav span { color: #eee1c8; font-size: 16px; font-variant-numeric: tabular-nums; }
.gallery-pagination button:hover,.gallery-detail-nav button:hover,.gallery-retry:hover { background: rgba(255,242,218,.12); }
.gallery-pagination button:disabled:hover,.gallery-detail-nav button:disabled:hover { background: transparent; }
.gallery-detail { max-width: 900px; margin-inline: auto; }
.gallery-media { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 180px; background: #100f0d; border-radius: 3px; }
.gallery-media img,.gallery-media video { display: block; width: 100%; height: auto; max-height: 68svh; object-fit: contain; }
.gallery-media video { min-height: min(54vw, 360px); }
.gallery-detail-name { margin-top: 13px; font-size: 16px; color: #eee1c8; overflow-wrap: anywhere; }
.gallery-media-help { margin-top: 16px; font-size: 16px; line-height: 1.9; color: #ffdbca; }
.gallery-detail-nav { margin-top: 22px; }
.guest-gallery button:disabled { cursor: default; opacity: .45; }
.guest-gallery button:focus-visible,.guest-gallery video:focus-visible { outline: 2px solid #fff7e7; outline-offset: 5px; }
@media (min-width: 720px) {
  .guest-gallery { width: min(100% - 80px, 1060px); }
  .guest-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 24px; }
  .guest-gallery-preview { aspect-ratio: 4 / 3; }
  .gallery-heading { margin-top: 38px; margin-bottom: 30px; }
  .gallery-heading p { font-size: 18px; }
  .gallery-pagination { justify-content: center; gap: 30px; }
}
@media (max-width: 360px) {
  .guest-gallery { width: calc(100% - 36px); }
  .gallery-header { gap: 8px; }
  .gallery-back,.gallery-refresh,.gallery-pagination button,.gallery-detail-nav button { font-size: 16px; }
  .gallery-heading p { font-size: 15px; }
  .guest-gallery-grid { gap: 20px 12px; }
  .guest-gallery-video svg { width: 30px; height: 30px; }
  .guest-gallery-video span,.guest-gallery-image-fallback { font-size: 14px; }
  .gallery-pagination,.gallery-detail-nav { gap: 10px; }
  .gallery-pagination button,.gallery-detail-nav button { min-width: 74px; padding-inline: 8px; }
  .gallery-pagination span,.gallery-detail-nav span { font-size: 14px; }
}
