#memories {
  --camera-cream: #fff7eb;
  --camera-berry: #a53860;
  --style-size: clamp(44px, 13vw, 55px);
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  color: var(--camera-cream);
  background:
    linear-gradient(0deg, #102c24a8, transparent 43%),
    center / cover no-repeat url('../../img/camera-garden.webp'),
    #36554a;
}
.phone-app[data-screen='memories'] .bottom-nav {
  visibility: hidden;
  pointer-events: none;
}
.frame-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.frame-topbar,
.frame-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 5px clamp(12px, 5vw, 24px);
}
.frame-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--camera-cream);
  color: #873950;
  cursor: pointer;
  touch-action: manipulation;
}
.frame-topbar #booth-close {
  background: #a538609e;
  color: var(--camera-cream);
}
.frame-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  column-gap: 8px;
}
.frame-heading {
  text-align: center;
  text-shadow: 0 1px 5px #102c24;
}
.frame-heading h2 {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.frame-heading p {
  margin: 2px 0 0;
  font:
    italic clamp(17px, 5vw, 24px) / 1.1 'Cormorant Garamond',
    Georgia,
    serif;
}
.frame-icon-button svg,
.frame-icon-button img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.frame-icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.frame-stage {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}
.frame-display {
  position: relative;
  width: min(86%, 420px, calc((100dvh - 260px) * 0.8));
  aspect-ratio: 4 / 5;
  filter: drop-shadow(0 8px 12px #4509203a);
}
@supports (width: 1cqh) {
  .frame-display {
    width: min(86cqw, 420px, 78cqh);
  }
}
.frame-display.is-unframed {
  overflow: hidden;
  border-radius: 18px;
  background: #fff4e4be;
}
.frame-art,
.frame-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.frame-art {
  z-index: 1;
  pointer-events: none;
}
.frame-live {
  z-index: 0;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  pointer-events: none;
}
.frame-live video {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
}
#booth-live-photo {
  position: absolute;
}
.frame-camera-invite,
.frame-focus {
  z-index: 2;
  position: absolute;
  display: grid;
  place-items: center;
}
.frame-camera-invite {
  background: radial-gradient(ellipse, #fff6e8 0%, transparent 75%);
}
.frame-camera-invite > div {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.frame-camera-invite button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #873950;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.frame-camera-invite svg {
  width: 22px;
  height: 22px;
}
.frame-focus {
  pointer-events: none;
}
.frame-focus span {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 0 solid #8b3d4d;
  filter: drop-shadow(0 0 1px #fff7eb);
}
.frame-focus span:nth-child(1) {
  top: 9%;
  left: 9%;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 5px;
}
.frame-focus span:nth-child(2) {
  top: 9%;
  right: 9%;
  border-width: 2px 2px 0 0;
  border-top-right-radius: 5px;
}
.frame-focus span:nth-child(3) {
  right: 9%;
  bottom: 9%;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 5px;
}
.frame-focus span:nth-child(4) {
  bottom: 9%;
  left: 9%;
  border-width: 0 0 2px 2px;
  border-bottom-left-radius: 5px;
}
.frame-mode {
  display: flex;
  align-self: center;
  flex: none;
  margin: 5px 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--camera-cream);
}
.frame-mode button {
  min-width: clamp(76px, 24vw, 96px);
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #873950;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.frame-mode [aria-pressed='true'] {
  background: var(--camera-berry);
  color: white;
}
.wish-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.wish-panel {
  display: grid;
  flex: none;
  gap: 6px;
  width: min(90%, 360px);
  min-width: 0;
  margin: 0 auto 3px;
  padding: 6px;
  border: 1px solid #eed0bf;
  border-radius: 12px;
  background: #fff7eb;
}
.wish-panel :is(select, input) {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 6px;
  border: 1px solid #e6cbd6;
  border-radius: 7px;
  background: #fffdf8;
  color: #7f2949;
  font: inherit;
  font-size: 13px;
}
.wish-panel input {
  font-size: 16px;
}
.wish-options {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.75fr;
  gap: 5px;
}
.frame-carousel {
  position: relative;
  flex: none;
}
.frame-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px calc((100% - var(--style-size)) / 2);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.frame-strip::-webkit-scrollbar {
  display: none;
}
.frame-option {
  display: grid;
  place-items: center;
  flex: 0 0 var(--style-size);
  aspect-ratio: 1;
  border: 2px solid var(--camera-cream);
  border-radius: 12px;
  padding: 2px;
  background: var(--camera-cream);
  color: #873950;
  overflow: hidden;
  scroll-snap-align: center;
}
.frame-option :is(img, canvas) {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
}
.frame-option.is-selected {
  border-color: var(--camera-berry);
  outline: 2px solid var(--camera-cream);
  outline-offset: 2px;
}
.frame-none-icon {
  width: 22px;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(
    -45deg,
    transparent 46%,
    currentColor 47% 53%,
    transparent 54%
  );
}
.frame-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  justify-items: center;
}
.frame-fixed-shutter {
  width: clamp(58px, 10dvh, 78px);
  aspect-ratio: 1;
  flex: none;
  border: 3px solid var(--camera-cream);
  border-radius: 50%;
  background: var(--camera-cream);
  box-shadow:
    inset 0 0 0 5px var(--camera-berry),
    0 4px 16px #18231a74;
  touch-action: manipulation;
}
.frame-fixed-shutter:active {
  scale: 0.94;
}
#memories button:disabled {
  opacity: 0.55;
  cursor: default;
}
#memories button:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #873950;
}
#memories [hidden] {
  display: none;
}
.frame-status {
  flex: none;
  min-height: 22px;
  margin: 0;
  padding: 2px 14px 5px;
  color: var(--camera-cream);
  text-align: center;
  font-size: 11px;
  line-height: 1.3;
  text-shadow: 0 1px 4px #172f26;
}
.frame-status.is-error {
  color: #fff1bd;
}
@media (prefers-reduced-motion: no-preference) {
  .is-capturing .frame-stage {
    animation: frame-flash 0.35s ease-out;
  }
  @keyframes frame-flash {
    from {
      opacity: 0.25;
    }
    to {
      opacity: 1;
    }
  }
}

.booth-dialog {
  width: min(94vw, 440px);
  max-height: 88dvh;
  padding: 0;
  border: 1px solid #e6cbd6;
  border-radius: 20px;
  background: #fff9ee;
  color: #a53860;
  box-shadow: 0 20px 90px #45092055;
}
.booth-dialog[open] {
  display: flex;
  flex-direction: column;
}
.booth-dialog::backdrop {
  background: #45092099;
  backdrop-filter: blur(4px);
}
.booth-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid #e6cbd6;
  gap: 10px;
}
.booth-dialog .overline {
  text-align: left;
  font-size: 8px;
  color: #7d5866;
  letter-spacing: 0.18em;
  margin-bottom: 5px;
}
.booth-dialog h2 {
  font:
    500 30px/1 'Cormorant Garamond',
    Georgia,
    serif;
  margin: 0;
}
.gallery-header-actions {
  display: flex;
  flex: none;
  gap: 6px;
}
.gallery-header-actions button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #f7e8ee;
  border: 0;
  border-radius: 50%;
  color: #a53860;
  font-size: 15px;
}
.gallery-header-actions button:disabled {
  opacity: 0.55;
}
.gallery-header-actions svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#booth-dialog [hidden] {
  display: none;
}
.gallery-control {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #e6cbd6;
  border-radius: 999px;
  background: #fff9ee;
  color: #8b2850;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.gallery-primary {
  background: #a53860;
  border-color: #a53860;
  color: white;
}
.gallery-control:disabled {
  opacity: 0.55;
}
.gallery-feedback {
  margin: 0;
  padding: 6px 16px;
  color: #8b3d4d;
  font-size: 13px;
}
.gallery-feedback:empty {
  padding: 0;
}
.booth-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 12px;
  padding: 20px 16px 24px;
  margin: 7px 8px;
  background-color: #f5edde;
  background-image: radial-gradient(#a5386026 0.7px, transparent 0.7px);
  background-size: 9px 9px;
  border-radius: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}
.booth-gallery-grid:empty {
  display: none;
}
.gallery-photo-open {
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  transform: rotate(-2deg);
}
.gallery-photo-open:nth-child(4n + 2),
.gallery-photo-open:nth-child(4n + 3) {
  transform: rotate(2deg);
}
.gallery-photo-open:focus-visible {
  outline: 2px solid #a53860;
  outline-offset: 2px;
}
.booth-gallery-grid img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.gallery-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 12px 16px 16px;
  overflow: auto;
  overscroll-behavior: contain;
}
.gallery-preview img {
  display: block;
  flex: none;
  width: min(100%, 400px, 44dvh);
  height: auto;
  object-fit: contain;
}
.gallery-preview-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.gallery-pagination {
  display: grid;
  flex: none;
  place-items: center;
  padding: 4px 12px 12px;
}
.capture-review {
  width: min(92vw, 400px);
  padding: 16px;
  text-align: center;
  overflow: auto;
}
.capture-review[open] {
  display: block;
}
.capture-review > img {
  display: block;
  width: auto;
  height: min(54dvh, 470px);
  max-width: 100%;
  object-fit: contain;
  margin: 12px auto;
}
.capture-review > p {
  font-size: 13px;
  line-height: 1.45;
}
.capture-actions > button {
  flex: 1;
}
@media (min-width: 600px) {
  #booth-dialog {
    width: min(92vw, 720px);
  }
  .booth-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
