:root {
  color-scheme: light;
  --page: #f4f0e8;
  --ink: #3b312d;
  --muted: #806f69;
  --pink: #d5a0ad;
  --pink-soft: #f0dce1;
  --pink-pale: #f7eaed;
  --burgundy: #794951;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
}

.app-splash {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: var(--page);
  color: var(--burgundy);
  pointer-events: none;
  transition: opacity 340ms ease;
}

.app-splash img {
  display: block;
  width: 96px;
  height: 96px;
}

.app-splash span {
  font: italic 17px Georgia, "Times New Roman", serif;
  letter-spacing: 0.045em;
}

.app-splash.is-leaving {
  opacity: 0;
}

button,
input {
  font: inherit;
}

button {
  border-radius: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.app-screen {
  min-height: calc(100svh - 48px);
}

.app-screen[hidden] {
  display: none;
}

.app-screen.is-entering {
  animation: screen-in 220ms ease-out both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.wordmark,
.screen-progress {
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: lowercase;
}

.wordmark {
  color: var(--burgundy);
  font: italic 16px Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
}

.wordmark-heart {
  display: inline-block;
  margin-left: 4px;
  color: #a65e6d;
  font-size: 11px;
  font-style: normal;
  transform: rotate(-9deg);
}

.screen-progress {
  color: var(--muted);
}

.back-button {
  width: auto;
  margin: 0;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--burgundy);
  font-size: 11px;
  cursor: pointer;
}

.back-button:focus-visible,
button:focus-visible {
  outline: 1px solid var(--burgundy);
  outline-offset: 4px;
}

.screen-content {
  width: 100%;
}

.upload-content {
  display: flex;
  min-height: calc(100svh - 112px);
  flex-direction: column;
  justify-content: center;
  padding-bottom: 6vh;
}

.upload-intro {
  margin-bottom: 28px;
  text-align: center;
}

.upload-intro h1 {
  margin: 0;
  color: var(--ink);
  font: 400 27px/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: -0.015em;
}

.upload-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.015em;
}

.selector-group.layout-selector {
  margin-bottom: 22px;
}

.upload-area {
  position: relative;
  display: grid;
  min-height: 108px;
  place-items: center;
  border: 1px solid #a28180;
  background: rgba(255, 250, 246, 0.24);
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.upload-area::before {
  position: absolute;
  top: 15px;
  left: 50%;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: #c894a0;
  content: "";
  transform: translateX(-50%) rotate(-0.7deg);
}

.upload-area.is-dragging {
  border-color: var(--burgundy);
  background: var(--pink-pale);
}

.upload-area input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-area label {
  display: grid;
  gap: 10px;
  padding: 24px;
  cursor: pointer;
}

.upload-area label > span {
  color: #5e4142;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
}

.upload-area small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-area:focus-within {
  outline: 1px solid var(--burgundy);
  outline-offset: 4px;
}

.customize-content { display: grid; gap: 18px; padding: 14px 0 10px; }

.selector-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.selector-group legend,
.caption-field > span {
  margin-bottom: 13px;
  padding: 0;
  font-size: 10px;
  color: #76585a;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}

.selector-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selector-options label {
  cursor: pointer;
}

.selector-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.selector-options span {
  display: block;
  padding: 12px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.selector-options input:checked + span {
  border-color: #c9919e;
  background: var(--pink-soft);
  color: #5c373d;
}

.selector-options label:hover span {
  border-color: #dab5bd;
}

.selector-options input:focus-visible + span {
  outline: 1px solid var(--burgundy);
  outline-offset: 4px;
}

.caption-field {
  display: grid;
}

.caption-field em {
  color: #9b7d78;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.caption-field input {
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid #b49b94;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: 16px Georgia, "Times New Roman", serif;
}

.caption-field input:focus {
  border-color: #b87584;
}

.caption-field input::placeholder {
  color: #a18e88;
  opacity: 1;
}

#continueButton,
#developButton,
#saveButton {
  width: 100%;
  margin-top: 28px;
  padding: 13px 18px;
  border: 1px solid #a96d7a;
  border-radius: 3px;
  background: var(--pink);
  color: #3f292d;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

@media (hover: hover) {
  #continueButton:hover, #developButton:hover, #saveButton:hover { background: #cb8f9e; }
}

.customize-content #developButton {
  margin-top: 3px;
}

button:disabled {
  border-color: #b9aaa4 !important;
  background: transparent !important;
  color: #9a8c86 !important;
  cursor: not-allowed !important;
}

.status {
  min-height: 15px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.developing-screen {
  display: grid;
  place-items: center;
  padding: 7vh 0 4vh;
}

.developing-content {
  width: 100%;
}

.developing-text {
  min-height: 14px;
  margin: 0 0 18px;
  color: #87656b;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
}

.camera {
  position: relative;
  z-index: 2;
  width: 86.5%;
  height: auto;
  aspect-ratio: 3.7 / 1;
  margin: 0 auto;
  border: 1px solid #9e747f;
  border-radius: 4px 4px 2px 2px;
  background: #c995a2;
  box-shadow: 0 6px 12px rgba(73, 47, 52, 0.14);
}

.camera::before {
  position: absolute;
  top: 8px;
  right: 9px;
  left: 9px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  content: "";
}

.camera-lens {
  position: absolute;
  top: 23%;
  left: 50%;
  width: clamp(34px, 10%, 48px);
  aspect-ratio: 1;
  border: 3px solid #5c484d;
  border-radius: 50%;
  background: #302a2b;
  transform: translateX(-50%);
}

.camera-flash {
  position: absolute;
  top: 25%;
  left: 8%;
  width: clamp(20px, 8%, 30px);
  height: clamp(9px, 12%, 13px);
  border: 1px solid #a89091;
  background: #e5d5d1;
}

.camera-light {
  position: absolute;
  top: 26%;
  right: 7%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c7a96c;
}

.camera-slot {
  position: absolute;
  right: 8px;
  bottom: 4px;
  left: 8px;
  height: 2px;
  background: #5a4147;
}

.developing-print-host {
  width: 100%;
}

.print-reveal {
  position: relative;
  width: 100%;
  margin-top: -4px;
  overflow: hidden;
  aspect-ratio: 1292 / 1552;
}

.print-object {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0.82;
  filter: contrast(0.97) brightness(1.015);
  transform: translateY(-98%);
  transform-origin: center top;
  will-change: transform, opacity, filter;
}

.developing-screen.is-preparing .print-object {
  visibility: hidden;
}

.print-object canvas {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.developing-screen.is-printing .print-object {
  animation: print-out 2.65s cubic-bezier(0.32, 0.05, 0.18, 1) forwards;
}

@keyframes print-out {
  0% {
    opacity: 0.82;
    filter: contrast(0.97) brightness(1.015);
    transform: translateY(-98%);
  }

  80% {
    opacity: 1;
    filter: contrast(0.995) brightness(1.004);
    transform: translateY(0);
  }

  91% {
    opacity: 1;
    filter: none;
    transform: translateY(7px) rotate(0.08deg);
  }

  100% {
    opacity: 1;
    filter: none;
    transform: translateY(0);
  }
}

.result-screen {
  padding-bottom: 3vh;
}

.result-header {
  margin-bottom: 24px;
}

.result-photo-host {
  width: 100%;
}

.result-photo-host .print-reveal {
  margin: 0;
  overflow: visible;
}

.result-photo-host .print-object {
  visibility: visible;
  opacity: 1;
  filter: none;
  transform: none;
  will-change: auto;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.result-actions button {
  width: auto;
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
  cursor: pointer;
}

.result-actions #saveButton {
  width: auto;
  margin: 0;
  padding: 10px 16px;
}

.result-actions .try-again-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--burgundy);
}

.result-actions .try-again-button:hover {
  border-color: #c99ba5;
}

@media (min-width: 700px) {
  .app-shell {
    padding-right: 0;
    padding-left: 0;
  }

  .upload-area {
    min-height: 120px;
  }
}

@media (max-height: 680px) {
  .upload-intro {
    margin-bottom: 18px;
  }



  .developing-screen {
    place-items: start center;
    padding-top: 5vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .app-screen.is-entering {
    animation: none;
  }

  .app-splash {
    transition: none;
  }

  .developing-screen.is-printing .print-object {
    animation: print-fade 180ms ease-out forwards;
  }

  @keyframes print-fade {
    from {
      opacity: 0;
      filter: none;
      transform: translateY(0);
    }

    to {
      opacity: 1;
      filter: none;
      transform: translateY(0);
    }
  }
}
/* Layout-first controls; the camera and print transition above are preserved. */
.app-screen:focus { outline: none; }
.app-shell { max-width: 500px; }
.wordmark { font-size: 23px; }
.back-button { min-height: 44px; font-size: 13px; }
.upload-content { justify-content: flex-start; padding-top: 20px; padding-bottom: 0; }
.upload-intro { margin-bottom: 28px; }
.upload-intro h1 { font-size: 35px; }
.upload-intro .eyebrow { margin: 0 0 12px; font: italic 13px Georgia, serif; color: var(--burgundy); }
.layout-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.layout-options label { position: relative; cursor: pointer; }
.layout-options input { position: absolute; opacity: 0; }
.layout-options span { display: grid; justify-items: center; gap: 6px; padding: 9px 2px; border-bottom: 2px solid transparent; font-size: 12px; color: var(--muted); }
.layout-options svg { width: 52px; height: 58px; fill: var(--page); stroke: #9b7177; stroke-width: 1.5; stroke-linejoin: round; }
.layout-options input:checked + span { background: #eddbdb; border-color: var(--burgundy); color: var(--burgundy); }
.layout-options input:focus-visible + span { outline: 2px solid var(--burgundy); }
.variation-selector { margin-bottom: 18px; }
.selector-options { flex-wrap: nowrap; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.selector-options label { flex-shrink: 0; }
.selector-options span { letter-spacing: 0; font-size: 13px; }
.selector-group legend, .caption-field > span { margin-bottom: 8px; font-size: 12px; letter-spacing: .06em; }
legend em, .edit-heading em { margin-left: 8px; color: #907b73; font-size: 11px; font-style: normal; letter-spacing: 0; }
.photo-slots { margin-top: 10px; }
.photo-slot { position: relative; display: flex; align-items: center; gap: 12px; min-height: 47px; border-bottom: 1px solid #d5c4ba; cursor: pointer; }
.photo-slot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-slot.has-photo .slot-plus { font-size: 0; }
.photo-slot.has-photo .slot-plus::after { content: "change"; font-size: 11px; }
.photo-slot:focus-within { outline: 2px solid var(--burgundy); }
.photo-slot img { width: 32px; height: 32px; object-fit: cover; }
.slot-number { color: #a7767f; font-size: 11px; }
.slot-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 14px Georgia, serif; }
.slot-plus { font-size: 20px; color: var(--burgundy); }
.upload-hint, .privacy-note { color: var(--muted); font-size: 11px; text-align: center; margin: 13px 0 0; }
#continueButton { margin-top: 15px; }
.preview-host { height: 205px; display: flex; justify-content: center; align-items: center; }
.preview-host .print-reveal { height: 100%; width: auto; max-width: 100%; margin: 0; overflow: visible; }
.preview-host .print-object { transform: none; opacity: 1; filter: none; will-change: auto; }
.preview-host canvas { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.edit-heading { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #76585a; }
.text-button { border: 0; background: transparent; color: var(--burgundy); padding: 8px; min-height: 44px; font-size: 12px; cursor: pointer; }
.edit-tools { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: thin; padding: 2px 0 6px; }
.edit-tools button { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; min-height: 44px; min-width: 44px; background: transparent; color: #806f69; font-size: 14px; cursor: pointer; }
.edit-tools button[aria-pressed="true"] { color: var(--burgundy); border-color: var(--burgundy); background: #eedcdd; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input { min-width: 0; flex: 1; height: 44px; accent-color: var(--burgundy); }
.slider-row output { width: 83px; font-size: 11px; color: var(--muted); text-align: right; }
.develop-action { position: sticky; bottom: 0; background: var(--page); padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.develop-action #developButton { margin: 0; font-size: 14px; min-height: 46px; }
.customize-content .status:empty { display: none; }
.customize-content > * { min-width: 0; }
.edit-section { min-width: 0; }
.missing-photos { text-align: center; padding: 35px 12px; border-bottom: 1px solid #d5c4ba; font: italic 17px Georgia, serif; }
.developing-screen { align-content: start; padding-top: 6vh; }
.camera { width: 89%; }
.camera-lens { width: 12%; min-width: 18px; }
.camera-flash { width: 8%; height: 12%; }
.result-photo-host { margin: 0 auto; }
.result-actions button, .result-actions #saveButton { min-height: 44px; font-size: 13px; }
@media (max-width: 600px) {
  .result-photo-host[data-layout="strip"] { width: 60vw; max-width: 270px !important; }
}
@media (max-height: 730px) { .preview-host { height: 160px; } .customize-content { gap: 13px; } .upload-content { padding-top: 15px; } }

/* Phone-first: quiet default controls, comfortable targets, and safe scrolling. */
button, summary, .selector-options label, .layout-options label, .photo-slot { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.screen-header { min-height: 44px; }
.screen-progress { font-size: 11px; letter-spacing: .04em; }
.selector-options, .edit-tools { overscroll-behavior-x: contain; }
.selector-options input { width: 1px; height: 1px; }
.style-options label { flex: 1; text-align: center; }
.style-options span { padding-inline: 8px; font-size: 14px; }
.edit-section { border-top: 1px solid #d5c4ba; border-bottom: 1px solid #d5c4ba; }
.edit-section summary { display: flex; align-items: center; min-height: 48px; gap: 10px; cursor: pointer; color: var(--burgundy); font-size: 14px; list-style: none; }
.edit-section summary::-webkit-details-marker { display: none; }
.edit-section summary span { color: var(--muted); font-size: 12px; }
.edit-section summary::after { content: "+"; margin-left: auto; font-size: 21px; }
.edit-section[open] summary::after { content: "−"; }
.edit-section summary:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; }
.edit-heading { font-size: 11px; }
.slider-row { padding-bottom: 8px; }
.slider-row input { -webkit-appearance: none; appearance: none; background: transparent; margin: 0; }
.slider-row input::-webkit-slider-runnable-track { height: 4px; background: #d8bec1; border-radius: 2px; }
.slider-row input::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px; border: 3px solid var(--page); border-radius: 50%; background: var(--burgundy); }
.slider-row input::-moz-range-track { height: 4px; background: #d8bec1; }
.slider-row input::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid var(--page); border-radius: 50%; background: var(--burgundy); }
.caption-field input { min-height: 48px; scroll-margin-block: 100px; }
.customize-content:has(.caption-field input:focus) .develop-action { position: static; }
#continueButton, #saveButton { min-height: 48px; font-size: 14px; }
.upload-area label { width: 100%; }
.upload-area.is-selected { min-height: 48px; border: 0; background: transparent; }
.upload-area.is-selected::before { display: none; }
.upload-area.is-selected label { padding: 10px 0; }
.upload-area.is-selected label > span { font: 14px Arial, sans-serif; color: var(--burgundy); }
.upload-area.is-selected small { display: none; }
.status:empty { min-height: 0; margin: 0; }
.result-actions { position: sticky; bottom: 0; background: var(--page); padding-block: 10px max(10px, env(safe-area-inset-bottom)); }
@media (pointer: coarse) { .upload-area small { font-size: 0; } .upload-area small::after { content: "choose from your photo library"; font-size: 11px; letter-spacing: 0; text-transform: none; } }
@media (max-width: 374px) { .app-shell { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); } .layout-options { gap: 4px; } }
