#gallery-viewer {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-right: max(1rem, env(safe-area-inset-right));
  background: transparent;
  container-type: size;
}
#gallery-viewer[open] {
  display: grid;
  place-items: center;
}
#gallery-viewer::backdrop { background: rgba(18, 18, 16, .96); }
html:has(#gallery-viewer[open]) { overflow: hidden; }
#gallery-viewer .photo-frame { position: relative; }
#gallery-viewer form { position: absolute; top: .5rem; right: .5rem; margin: 0; }
#gallery-viewer button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .4rem .9rem;
  border: 1px solid #a18442;
  border-radius: .65rem;
  background: #d7bd76;
  color: #24241f;
  font: inherit;
  cursor: pointer;
}
#gallery-viewer button svg { display: block; flex: none; }
#gallery-viewer button:hover { background: #ead69c; }
#gallery-viewer button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
#gallery-viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100cqw;
  max-height: 100cqh;
}
