:root {
  color-scheme: light;
  --ivory: #fffdf8;
  --paper: #fffefa;
  --sage: #59634a;
  --olive: #77805b;
  --petal: #dde77f;
  --soft: #f0f2e9;
  --line: #dfe2d4;
  --ink: #30352b;
  --muted: #686f5d;
  --danger: #b8483f;
  --photo-aspect: 3 / 2;
  --shadow: 0 18px 50px rgba(74, 76, 57, .12);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(66px + env(safe-area-inset-top) + 14px); background: var(--ivory); }
html.is-step-changing { scroll-behavior: auto; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 88% 3%, rgba(221,231,127,.18), transparent 24rem), var(--ivory); }
body.is-photo-editing { overflow: hidden; overscroll-behavior: none; }
button, input, textarea { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.site-header { height: 66px; padding: 0 max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(119,128,91,.16); background: rgba(255,253,248,.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 11px/1 Georgia,serif; letter-spacing: .08em; background: var(--sage); }
.brand strong,.brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.preview-badge { border-radius: 999px; padding: 7px 10px; color: var(--sage); background: var(--soft); font-size: 12px; font-weight: 700; }

.app { width: min(680px, 100%); margin: 0 auto; padding: 34px 18px 130px; }
.intro { text-align: center; }
.eyebrow { margin: 0 0 9px; color: var(--olive); font: 700 10px/1.4 Georgia,serif; letter-spacing: .16em; }
.intro h1 { margin: 0; color: var(--sage); font-family: Georgia,"Batang",serif; font-size: clamp(34px, 9vw, 48px); font-weight: 500; letter-spacing: -.04em; }
.intro > p:not(.eyebrow) { max-width: 440px; margin: 11px auto 16px; color: var(--muted); font-size: 14px; line-height: 1.65; word-break: keep-all; }
.privacy-pill { display: inline-flex; gap: 6px; align-items: center; padding: 9px 13px; border-radius: 999px; color: var(--sage); background: #f2f4ea; font-size: 12px; font-weight: 700; }

.stepper { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; margin: 30px auto 20px; max-width: 420px; }
.step-chip { min-width: 68px; border: 0; padding: 3px; background: transparent; color: #686f5d; cursor: pointer; }
.step-chip b { width: 30px; height: 30px; margin: 0 auto 5px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #c9ccbf; font-size: 13px; }
.step-chip span { font-size: 12px; font-weight: 700; }
.step-chip.is-current,.step-chip.is-done { color: var(--sage); }
.step-chip.is-current b { background: var(--sage); box-shadow: 0 0 0 5px rgba(89,99,74,.12); }
.step-chip.is-done b { color: var(--sage); background: var(--petal); }
.step-line { height: 1px; margin: -18px 3px 0; background: var(--line); }

.step-panel { scroll-margin-top: calc(66px + env(safe-area-inset-top) + 14px); padding: 24px 18px; border: 1px solid rgba(119,128,91,.16); border-radius: 24px; background: rgba(255,254,250,.96); box-shadow: var(--shadow); }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.section-heading .number { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--sage); background: var(--petal); font-weight: 800; font-size: 13px; }
.section-heading h2 { margin: 2px 0 5px; font-size: 20px; letter-spacing: -.04em; word-break: keep-all; }
.section-heading h2:focus { outline: none; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; word-break: keep-all; }
.section-heading.centered { display: block; text-align: center; }
.completion-mark { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: var(--sage); background: var(--petal); font-weight: 900; font-size: 21px; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.baby-count { margin-bottom: 18px; }
.baby-count legend { margin-bottom: 9px; font-size: 14px; font-weight: 800; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 15px; background: #f0f2ea; }
.segmented button { min-height: 48px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.segmented button.is-selected { color: #fff; background: var(--sage); box-shadow: 0 4px 12px rgba(89,99,74,.22); }
.segmented.single-option { grid-template-columns: 1fr; }

.photo-step-workspace { display: grid; grid-template-areas: "preview" "main"; gap: 18px; }
.photo-step-main { grid-area: main; min-width: 0; }
.live-preview-card { grid-area: preview; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: #f8f9f3; }
.live-preview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 1px 10px; }
.live-preview-heading span,.live-preview-heading strong { display: block; }
.live-preview-heading span { margin-bottom: 3px; color: var(--olive); font-size: 10px; font-weight: 900; }
.live-preview-heading strong { font-size: 15px; }
.live-preview-heading small { color: var(--muted); font-size: 10px; text-align: right; }
.live-preview-canvas-wrap { position: relative; width: 100%; display: block; overflow: hidden; border: 0; border-radius: 10px; padding: 0; background: #eeefe7; box-shadow: 0 9px 24px rgba(53,57,43,.13); cursor: zoom-in; }
.live-preview-canvas-wrap:focus-visible { outline: 3px solid rgba(89,99,74,.38); outline-offset: 3px; }
#photoLivePreviewCanvas { width: 100%; height: auto; display: block; background: var(--ivory); }
.live-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--sage); background: rgba(255,253,248,.88); font-size: 11px; font-weight: 800; }
.live-preview-loading[hidden] { display: none; }
.live-preview-zoom { position: absolute; right: 8px; bottom: 8px; padding: 6px 8px; border-radius: 999px; color: #fff; background: rgba(37,43,32,.76); font-size: 9px; font-weight: 800; }
.live-preview-card > p { margin: 10px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; word-break: keep-all; }
.photo-grid { display: grid; gap: 16px; margin-top: 18px; }
.photo-card { overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.photo-card[aria-busy="true"] { opacity: .72; }
.photo-tap-target { width: 100%; display: block; border: 0; padding: 0; background: transparent; cursor: pointer; }
.photo-tap-target:focus-visible { outline: 3px solid rgba(89,99,74,.38); outline-offset: 3px; border-radius: 13px; }
.photo-placeholder { position: relative; width: 100%; aspect-ratio: var(--photo-aspect); overflow: hidden; display: flex; flex-direction: column; gap: 7px; align-items: center; justify-content: center; border: 1px dashed #cbd1b9; border-radius: 13px; color: var(--olive); background: #f0f2e9; font-size: 13px; font-weight: 800; }
.photo-placeholder::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: var(--photo-preview-image, none); background-position: var(--photo-preview-position, center); background-repeat: no-repeat; background-size: var(--photo-preview-size, cover); filter: brightness(var(--photo-preview-brightness, 1)); transform-origin: var(--photo-preview-origin-x,50%) var(--photo-preview-origin-y,50%); transform: translateZ(0) rotate(var(--photo-preview-rotation,0deg)); }
.photo-placeholder.has-frame-preview::before { display: none; }
.photo-frame-canvas { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; }
.photo-placeholder > * { position: relative; z-index: 1; }
.photo-placeholder > .photo-frame-canvas { position: absolute; z-index: 0; }
.photo-placeholder.has-photo { border-style: solid; }
.photo-placeholder.is-cutout { background-color: #f4efe2; }
.photo-placeholder.has-photo .photo-icon,.photo-placeholder.has-photo .photo-empty-label { display: none; }
.photo-icon { font-size: 30px; font-weight: 300; }
.photo-change-label { display: none; position: absolute; right: 10px; bottom: 10px; padding: 8px 10px; border-radius: 999px; color: #fff; background: rgba(37,43,32,.78); font-size: 11px; }
.photo-placeholder.has-photo .photo-change-label { display: block; }
.photo-card-meta { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 2px 0; }
.photo-copy strong,.photo-copy small { display: block; }
.photo-side-badge { width: fit-content; margin-bottom: 6px; padding: 4px 8px; border-radius: 999px; color: var(--sage); background: var(--soft); font-size: 10px; font-weight: 900; }
.photo-copy strong { margin-bottom: 4px; font-size: 15px; }
.photo-copy small { color: var(--muted); font-size: 12px; line-height: 1.5; }
em { padding: 2px 6px; border-radius: 6px; color: var(--olive); background: var(--soft); font-style: normal; font-size: 10px; vertical-align: 1px; }
.photo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.button.blush-toggle { flex: 1 1 142px; border: 1px solid #efd8dc; color: #835c63; background: #fff8f8; transition: border-color .18s ease,background-color .18s ease,color .18s ease,box-shadow .18s ease; }
.button.blush-toggle:hover { border-color: #e6bdc5; background: #fff2f4; }
.button.blush-toggle.is-active { border-color: #dfabb5; color: #70484f; background: #fce7eb; box-shadow: inset 0 0 0 1px rgba(223,171,181,.16); }
.blush-toggle-icon { width: 30px; height: 18px; display: inline-flex; align-items: center; justify-content: space-between; }
.blush-toggle-icon i { width: 13px; height: 10px; display: block; border-radius: 50%; background: radial-gradient(ellipse at center,rgba(239,139,158,.76) 0%,rgba(244,163,178,.42) 48%,rgba(249,196,205,0) 100%); }
.blush-toggle.is-loading .blush-toggle-icon { animation: blush-toggle-pulse .9s ease-in-out infinite alternate; }
.face-effect-status { min-height: 0; margin: 9px 3px 0; color: #765f63; font-size: 11px; line-height: 1.5; word-break: keep-all; }
.face-effect-status:empty { display: none; }
@keyframes blush-toggle-pulse { from { opacity: .42; transform: scale(.9); } to { opacity: 1; transform: scale(1.06); } }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 13px; padding: 0 17px; font-weight: 800; cursor: pointer; text-decoration: none; }
.button.primary { color: #fff; background: var(--sage); }
.button.secondary { color: var(--sage); background: var(--soft); }
.button:disabled { opacity: .5; cursor: wait; }
.text-button { min-height: 44px; border: 0; padding: 6px 4px; color: var(--olive); background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.remove-photo { grid-column: 1/-1; justify-self: end; min-height: 34px; font-size: 12px; }
.tip { display: flex; gap: 10px; margin-top: 18px; padding: 13px; border-radius: 14px; background: #faf9ec; }
.tip p { margin: 0; font-size: 12px; line-height: 1.6; }

.form-section + .form-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0 0 15px; font-size: 16px; }
.form-section h3 small { color: var(--muted); font-weight: 500; }
.compact-parent-row { margin-top: 2px; }
.field-row { display: grid; gap: 12px; }
.field-row.two-columns { grid-template-columns: 1fr 1fr; }
.field-row.three-columns { grid-template-columns: repeat(3,1fr); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
.required-dot { color: #ad6d57; font-style: normal; font-size: 7px; vertical-align: 2px; }
.field input,.field textarea { width: 100%; min-height: 50px; border: 1px solid #d9ddcf; border-radius: 12px; padding: 13px 14px; outline: 0; color: var(--ink); background: #fff; font-size: 16px; }
.field textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
.field input:focus,.field textarea:focus { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(119,128,91,.13); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 0; margin: 6px 0 0; color: var(--danger); font-size: 11px; font-weight: 700; }
.char-count { display: block; margin-top: 5px; text-align: right; color: var(--muted); font-size: 11px; }
.optional-box { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcf8; }
.optional-box summary { min-height: 48px; padding: 14px; cursor: pointer; font-size: 13px; font-weight: 800; }
.optional-box summary small { color: var(--muted); font-weight: 500; }
.details-body { padding: 4px 14px 1px; border-top: 1px solid var(--line); }
.default-copy-note { margin: 9px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.sub-label { margin: 12px 0 9px; color: var(--olive); font-size: 12px; font-weight: 800; }
.optional-action { margin-top: 10px; }
.optional-add-button { width: 100%; min-height: 48px; border: 1px dashed #cbd1b9; border-radius: 12px; color: var(--sage); background: #fbfcf8; font-size: 14px; font-weight: 800; cursor: pointer; }
.optional-add-button:focus-visible { outline: 3px solid rgba(119,128,91,.2); outline-offset: 2px; }
.optional-inline-panel { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcf8; }
.optional-inline-panel .field { margin-bottom: 0; }
.remove-optional { display: block; margin: 3px 0 0 auto; font-size: 12px; }

.basic-summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #f8f9f3; }
.summary-copy > span,.summary-copy > strong,.summary-copy > small { display: block; }
.summary-copy > span { margin-bottom: 5px; color: var(--olive); font-size: 11px; font-weight: 900; }
.summary-copy > strong { margin-bottom: 4px; font-size: 15px; }
.summary-copy > small { color: var(--muted); font-size: 12px; line-height: 1.5; word-break: keep-all; }
.summary-edit { min-width: 64px; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; color: var(--sage); background: #fff; font-size: 12px; font-weight: 900; cursor: pointer; }
.twin-photo-order { margin: -4px 0 18px; padding: 13px 14px; border: 1px solid #d7dcc8; border-radius: 14px; color: var(--ink); background: #f5f7ef; }
.twin-photo-order strong { display: block; margin-bottom: 7px; font-size: 13px; }
.twin-photo-order p { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 0; color: var(--sage); font-size: 12px; font-weight: 800; }
.twin-photo-order i { color: #bdc3ad; font-style: normal; }

.canvas-wrap { position: relative; overflow: hidden; margin: 0 auto; border-radius: 10px; background: #f0f1eb; box-shadow: 0 12px 34px rgba(53,57,43,.18); }
#invitationCanvas { display: block; width: 100%; height: auto; background: var(--ivory); cursor: zoom-in; }
#invitationCanvas:focus-visible { outline: 4px solid rgba(119,128,91,.38); outline-offset: -4px; }
.preview-hint { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; word-break: keep-all; }
.preview-hint span { color: var(--sage); font-size: 16px; font-weight: 900; }
.rendering-cover { position: absolute; inset: 0; display: flex; gap: 9px; align-items: center; justify-content: center; color: var(--sage); background: rgba(255,253,248,.88); font-size: 13px; font-weight: 800; }
.rendering-cover[hidden] { display: none; }
.spinner { width: 20px; height: 20px; border: 2px solid #d8dccb; border-top-color: var(--sage); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-actions { display: grid; gap: 10px; margin-top: 20px; }
.button.share { min-height: 58px; color: #fff; background: var(--sage); font-size: 16px; box-shadow: 0 9px 22px rgba(89,99,74,.24); }
.button.save { min-height: 52px; color: var(--sage); border: 1px solid var(--line); background: #fff; }
.save-help { margin: 12px 0 2px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.55; }
.result-panel > .text-button { display: block; margin: 8px auto 0; }

.bottom-bar { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px; padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-top: 1px solid rgba(89,99,74,.13); background: rgba(255,253,248,.94); backdrop-filter: blur(13px); }
.bottom-bar .back { color: var(--sage); border: 1px solid var(--line); background: #fff; }
.bottom-bar .next { color: #fff; background: var(--sage); }
.bottom-bar .back[hidden] + .next { grid-column: 1/-1; }

dialog { width: min(100% - 24px, 620px); border: 0; border-radius: 22px; padding: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 25px 80px rgba(31,35,27,.32); }
dialog::backdrop { background: rgba(25,28,22,.72); backdrop-filter: blur(3px); }
.crop-dialog { max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
.dialog-head { display: grid; grid-template-columns: 48px 1fr 56px; align-items: center; }
.dialog-head h2 { margin: 0; text-align: center; font-size: 16px; white-space: nowrap; }
.icon-button,.done-button { min-height: 48px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.icon-button:focus-visible,.done-button:focus-visible { outline: 3px solid rgba(89,99,74,.38); outline-offset: 1px; }
.icon-button { font-size: 28px; }
.done-button { color: var(--sage); font-weight: 900; }
.crop-dialog > p { margin: 5px 0 14px; text-align: center; color: var(--muted); font-size: 12px; }
.crop-stage { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #20221e; touch-action: none; }
.crop-stage[data-tool="move"] { cursor: grab; }
.crop-stage[data-tool="move"]:active { cursor: grabbing; }
.crop-stage[data-tool="hard"],.crop-stage[data-tool="soft"],.crop-stage[data-tool="restore"] { cursor: crosshair; }
#cropCanvas { display: block; width: 100%; height: 100%; }
.crop-guide { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.78); border-radius: 12px; pointer-events: none; }
.crop-stage[data-shape^="arch"] .crop-guide { display: none; }
.crop-stage[data-shape="cutout"] .crop-guide { display: none; }
.photo-retouch-tools { margin: 9px 0 5px; }
.photo-retouch-tools[hidden] { display: none; }
.retouch-tools-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 7px; }
.retouch-tools-heading b { color: var(--ink); font-size: 12px; }
.retouch-tools-heading small { color: var(--muted); font-size: 10px; }
.retouch-tool-dock { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: #f3f3ed; }
.photo-retouch-tools.without-restore .retouch-tool-dock { grid-template-columns: repeat(2,minmax(0,1fr)); }
.retouch-tool { min-width: 0; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; padding: 7px 8px; color: var(--sage); background: transparent; font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; word-break: keep-all; }
.retouch-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 9px; color: var(--sage); background: rgba(89,99,74,.09); }
.retouch-icon svg { width: 18px; height: 18px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.retouch-tool.is-active { color: #fff; background: var(--sage); box-shadow: 0 5px 12px rgba(89,99,74,.2); }
.retouch-tool.is-active .retouch-icon { color: #fff; background: rgba(255,255,255,.16); }
.retouch-tool:focus-visible { outline: 3px solid rgba(89,99,74,.32); outline-offset: 1px; }
.photo-adjust-controls { display: grid; gap: 10px; margin: 15px 0 8px; }
.photo-adjust-controls[hidden] { display: none; }
.adjust-control { display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fafbf7; }
.adjust-control[hidden] { display: none; }
.adjust-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.adjust-title b { color: var(--ink); font-size: 12px; }
.adjust-title small,.adjust-title output { color: var(--muted); font-size: 10px; }
.adjust-title output { padding: 4px 7px; border-radius: 999px; color: var(--sage); background: var(--soft); font-weight: 900; }
.range-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; color: var(--muted); font-size: 10px; }
.range-row input { width: 100%; min-height: 34px; accent-color: var(--sage); }
.rotation-control { display: grid; gap: 9px; }
.rotation-control .adjust-title { margin-bottom: 0; }
.rotation-buttons { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.rotation-buttons button { min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 5px; color: var(--sage); background: #fff; font-size: 11px; font-weight: 850; line-height: 1.25; cursor: pointer; word-break: keep-all; }
.rotation-buttons button:active { color: #fff; border-color: var(--sage); background: var(--sage); }
.rotation-buttons button:focus-visible { outline: 3px solid rgba(89,99,74,.32); outline-offset: 1px; }
.rotation-range { margin-top: -2px; }
.eraser-controls { display: grid; gap: 8px; margin: 13px 0 7px; }
.eraser-controls[hidden] { display: none; }
.eraser-controls > p { display: none; }
.eraser-controls > .text-button { min-height: 48px; justify-self: center; }
.crop-dialog > .text-button { display: block; margin: 3px auto 0; }
.tool-guide-layer { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 18px; }
.tool-guide-layer[hidden] { display: none; }
.tool-guide-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: rgba(28,31,25,.68); backdrop-filter: blur(3px); cursor: pointer; }
.tool-guide-card { position: relative; width: min(100%,430px); max-height: calc(100dvh - 36px); overflow: auto; border: 1px solid rgba(89,99,74,.12); border-radius: 24px; padding: 23px 20px 20px; color: var(--ink); background: #fffefa; box-shadow: 0 24px 70px rgba(24,27,21,.34); text-align: center; }
.tool-guide-close { position: absolute; z-index: 2; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 26px; cursor: pointer; }
.tool-guide-close:focus-visible,.guide-choice:focus-visible,.tool-guide-replay:focus-visible { outline: 3px solid rgba(89,99,74,.35); outline-offset: 2px; }
.tool-motion-demo { position: relative; width: 240px; height: 160px; margin: 0 auto 2px; }
.motion-photo { position: absolute; inset: 4px 8px 28px; overflow: hidden; border: 1px solid #d9ddcf; border-radius: 20px; background-color: #f7f5ee; background-image: linear-gradient(45deg,#e7e8e1 25%,transparent 25%),linear-gradient(-45deg,#e7e8e1 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e7e8e1 75%),linear-gradient(-45deg,transparent 75%,#e7e8e1 75%); background-position: 0 0,0 7px,7px -7px,-7px 0; background-size: 14px 14px; }
.motion-baby { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 24%; user-select: none; }
.motion-soft-residue { position: absolute; z-index: 3; left: 24px; top: 23px; width: 36px; height: 70px; border-radius: 50% 12px 18px 46%; background: rgba(250,247,239,.96); box-shadow: 7px 0 9px rgba(250,247,239,.78); }
.motion-hard-residue { position: absolute; z-index: 3; right: 14px; bottom: 6px; width: 42px; height: 55px; border-radius: 10px 27px 7px 13px; background: #faf7ef; }
.motion-hole { position: absolute; z-index: 4; left: 118px; bottom: 0; width: 42px; height: 36px; border-radius: 55% 45% 13px 12px; background-color: #f7f5ee; background-image: linear-gradient(45deg,#e7e8e1 25%,transparent 25%),linear-gradient(-45deg,#e7e8e1 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e7e8e1 75%),linear-gradient(-45deg,transparent 75%,#e7e8e1 75%); background-position: 0 0,0 6px,6px -6px,-6px 0; background-size: 12px 12px; opacity: 0; }
.motion-tool-mark { position: absolute; z-index: 6; left: 31px; top: 37px; width: 42px; height: 42px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--sage); box-shadow: 0 8px 18px rgba(50,57,42,.27); }
.motion-tool-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.motion-restore { display: none; }
.motion-tool-labels { position: absolute; left: 0; right: 0; bottom: 0; min-height: 22px; display: grid; place-items: center; color: var(--sage); font-size: 10px; font-weight: 900; }
.motion-tool-labels span { grid-area: 1/1; opacity: 0; }
.tool-guide-replay { min-height: 36px; display: inline-flex; align-items: center; gap: 5px; margin: 0 auto 4px; border: 0; color: var(--olive); background: transparent; font-size: 11px; font-weight: 850; cursor: pointer; }
.tool-motion-demo[data-guide="restore"] .motion-eraser,.tool-motion-demo[data-guide="restore"] .motion-soft-residue,.tool-motion-demo[data-guide="restore"] .motion-hard-residue { display: none; }
.tool-motion-demo[data-guide="restore"] .motion-restore { display: block; }
.tool-motion-demo[data-guide="restore"] .motion-hole { opacity: 1; }
.tool-motion-demo[data-guide="restore"] .motion-tool-mark { left: 119px; top: 93px; background: #68866f; }
.tool-motion-demo[data-guide="eraser"].is-playing .motion-tool-mark { animation: eraser-sweep 4.8s ease-in-out 2 both; }
.tool-motion-demo[data-guide="eraser"].is-playing .motion-soft-residue { animation: erase-soft-residue 4.8s ease-in-out 2 both; }
.tool-motion-demo[data-guide="eraser"].is-playing .motion-hard-residue { animation: erase-hard-residue 4.8s ease-in-out 2 both; }
.tool-motion-demo[data-guide="eraser"].is-playing .motion-soft-label { animation: motion-soft-label 4.8s ease-in-out 2 both; }
.tool-motion-demo[data-guide="eraser"].is-playing .motion-hard-label { animation: motion-hard-label 4.8s ease-in-out 2 both; }
.tool-motion-demo[data-guide="restore"].is-playing .motion-tool-mark { animation: restore-sweep 3.2s ease-in-out 2 both; }
.tool-motion-demo[data-guide="restore"].is-playing .motion-hole { animation: restore-piece 3.2s ease-in-out 2 both; }
.tool-motion-demo[data-guide="restore"].is-playing .motion-restore-label { animation: motion-restore-label 3.2s ease-in-out 2 both; }
.tool-guide-kicker { margin: 0 0 5px; color: var(--olive); font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.tool-guide-card h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.tool-guide-card > p:not(.tool-guide-kicker) { margin: 9px auto 16px; max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.65; word-break: keep-all; }
.tool-guide-actions { display: grid; gap: 8px; }
.tool-guide-actions[hidden] { display: none; }
.guide-choice { min-height: 58px; display: grid; align-content: center; gap: 3px; width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px; color: var(--sage); background: #fafbf7; font: inherit; cursor: pointer; }
.guide-choice b { font-size: 14px; }
.guide-choice small { color: var(--muted); font-size: 10px; font-weight: 500; }
.guide-choice.primary { color: #fff; border-color: var(--sage); background: var(--sage); }
.guide-choice.primary small { color: rgba(255,255,255,.76); }
.restore-warning { margin: 0 0 2px!important; padding: 9px 11px; border-radius: 11px; color: #7c5a48!important; background: #faf2eb; font-size: 11px!important; }
@keyframes eraser-sweep { 0%,10% { transform: translate(0,0) rotate(-9deg); } 34% { transform: translate(5px,44px) rotate(-9deg); } 42% { transform: translate(124px,48px) rotate(-9deg); } 67%,100% { transform: translate(124px,48px) rotate(-9deg); } }
@keyframes erase-soft-residue { 0%,12% { opacity: 1; filter: blur(0); } 35%,100% { opacity: 0; filter: blur(7px); } }
@keyframes erase-hard-residue { 0%,43% { opacity: 1; } 58%,100% { opacity: 0; } }
@keyframes motion-soft-label { 0%,8% { opacity: 0; } 14%,38% { opacity: 1; } 46%,100% { opacity: 0; } }
@keyframes motion-hard-label { 0%,42% { opacity: 0; } 50%,100% { opacity: 1; } }
@keyframes restore-sweep { 0%,16% { transform: translate(0,0) rotate(-5deg); } 72%,100% { transform: translate(8px,-27px) rotate(-5deg); } }
@keyframes restore-piece { 0%,22% { opacity: 1; } 72%,100% { opacity: 0; } }
@keyframes motion-restore-label { 0%,10% { opacity: 0; } 22%,100% { opacity: 1; } }
.processing-dialog,.cutout-failure-dialog { max-width: 420px; text-align: center; }
.processing-dialog[open] { display: grid; justify-items: center; gap: 12px; }
.processing-spinner { width: 52px; height: 52px; border: 4px solid color-mix(in srgb,var(--sage) 18%,transparent); border-top-color: var(--sage); border-radius: 50%; animation: spin .85s linear infinite; }
.processing-dialog h2,.cutout-failure-dialog h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.03em; word-break: keep-all; }
.processing-dialog p,.cutout-failure-dialog p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; word-break: keep-all; }
.processing-dialog small { color: var(--muted); font-size: 11px; line-height: 1.55; word-break: keep-all; }
.processing-progress { width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.processing-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sage); transition: width .2s ease; }
.failure-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: #fff; background: #a56c55; font-size: 22px; font-weight: 900; }
.failure-actions { display: grid; gap: 8px; margin-top: 18px; }
.failure-actions .button { width: 100%; }
.failure-actions .text-button { justify-self: center; }
.preview-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; overflow: hidden; border-radius: 0; padding: 0; color: #fff; background: #101412; }
.preview-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.preview-dialog::backdrop { background: #101412; backdrop-filter: none; }
.preview-dialog-head { position: relative; z-index: 2; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid rgba(255,255,255,.13); background: rgba(16,20,18,.97); }
.preview-dialog-head h2 { margin: 0 0 4px; font-size: 17px; }
.preview-dialog-head p { margin: 0; color: rgba(255,255,255,.68); font-size: 11px; line-height: 1.45; word-break: keep-all; }
.preview-close { flex: 0 0 auto; min-width: 58px; min-height: 44px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; color: #fff; background: rgba(255,255,255,.1); font-weight: 800; cursor: pointer; }
.preview-viewport { position: relative; min-height: 0; overflow: hidden; overscroll-behavior: contain; background: #101412; touch-action: none; }
.preview-image-stage { position: absolute; inset: 0; overflow: hidden; }
#previewImage { position: absolute; display: block; max-width: none; max-height: none; transform-origin: center; -webkit-touch-callout: none; user-select: none; will-change: transform; }
.preview-controls { position: relative; z-index: 2; min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.13); background: rgba(16,20,18,.97); }
.preview-controls button { min-width: 64px; min-height: 44px; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; color: #fff; background: rgba(255,255,255,.1); font-size: 18px; font-weight: 900; cursor: pointer; }
.preview-controls #previewReset { min-width: 82px; font-size: 13px; }
.preview-close:focus-visible,.preview-controls button:focus-visible { outline: 3px solid rgba(221,231,127,.82); outline-offset: 2px; }
.preview-controls button:disabled { opacity: .36; cursor: default; }
.help-dialog { max-width: 620px; max-height: calc(100dvh - 24px); overflow: auto; text-align: center; }
.help-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: var(--sage); background: var(--petal); font-weight: 900; }
.help-dialog h2 { margin: 0; font-size: 19px; }
.help-dialog p { color: var(--muted); line-height: 1.65; word-break: keep-all; }
.help-dialog .button { width: 100%; }
.long-press-preview { margin: 14px auto 16px; overflow: auto; border-radius: 10px; background: #f1f2eb; }
.long-press-preview img { display: block; width: 100%; height: auto; max-height: 64dvh; object-fit: contain; -webkit-touch-callout: default; user-select: auto; }
.browser-guide-dialog { max-width: 480px; padding: 26px 22px 22px; }
.browser-guide-dialog[open] { display: block; }
.browser-guide-icon { color: #6b4f19; background: #f6dfa1; font-size: 24px; }
.browser-guide-steps { margin: 18px 0; padding: 17px 18px 17px 38px; border-radius: 14px; color: var(--ink); background: var(--soft); text-align: left; line-height: 1.7; word-break: keep-all; }
.browser-guide-steps li + li { margin-top: 7px; }
.browser-guide-actions { display: grid; gap: 9px; }
.browser-guide-note { margin: 14px 0 0; font-size: 11px; }
.kakao-save-privacy { text-align: left; }
.kakao-save-actions .text-button { min-height: 42px; color: #73776c; font-weight: 700; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100% - 36px); transform: translate(-50%,20px); padding: 11px 16px; border-radius: 999px; color: #fff; background: rgba(47,52,42,.94); opacity: 0; pointer-events: none; transition: .22s; text-align: center; font-size: 12px; font-weight: 700; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
[hidden] { display: none!important; }

@media (max-width: 480px) {
  .app { padding-inline: 12px; padding-top: 18px; }
  .eyebrow { margin-bottom: 5px; }
  .intro h1 { font-size: 32px; }
  .intro > p:not(.eyebrow) { margin-block: 7px 10px; padding-inline: 6px; font-size: 13px; line-height: 1.55; }
  .privacy-pill { padding: 7px 10px; }
  .stepper { margin-block: 20px 16px; }
  .step-panel { padding: 20px 14px; border-radius: 20px; }
  .field-row.two-columns,.field-row.three-columns { grid-template-columns: 1fr; gap: 0; }
  .photo-card { padding: 10px; }
  .photo-step-workspace { gap: 14px; }
  .live-preview-card { padding: 11px; }
  .live-preview-canvas-wrap { width: min(230px, 72vw); margin-inline: auto; }
  .live-preview-card > p { text-align: center; }
  .photo-card-meta { grid-template-columns: 1fr; gap: 10px; }
  .twin-photo-order p { display: grid; grid-template-columns: 1fr; gap: 4px; }
  .twin-photo-order i { display: none; }
  .photo-actions { justify-content: stretch; }
  .photo-actions .button { flex: 1 1 130px; }
  .remove-photo { justify-self: start; }
  dialog.crop-dialog { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .crop-dialog .dialog-head { position: sticky; z-index: 5; top: 0; min-height: calc(58px + env(safe-area-inset-top)); margin: 0 -12px; padding: env(safe-area-inset-top) 12px 0; border-bottom: 1px solid rgba(89,99,74,.13); background: rgba(255,254,250,.97); backdrop-filter: blur(12px); }
  .crop-dialog .dialog-head h2 { font-size: 17px; }
  .crop-dialog .done-button { min-width: 62px; min-height: 42px; border-radius: 11px; color: #fff; background: var(--sage); }
  .crop-dialog > p { min-height: 36px; display: grid; place-items: center; margin: 7px 4px 9px; font-size: 11px; line-height: 1.45; }
  .crop-stage { border-radius: 14px; }
  .photo-retouch-tools { margin-top: 7px; }
  .retouch-tools-heading { margin-bottom: 5px; }
  .retouch-tools-heading small { font-size: 9px; }
  .retouch-tool-dock { gap: 4px; padding: 4px; }
  .retouch-tool { min-height: 52px; gap: 5px; padding: 5px 4px; font-size: 11px; }
  .retouch-icon { width: 23px; height: 23px; flex-basis: 23px; }
  .retouch-icon svg { width: 17px; height: 17px; }
  .photo-adjust-controls { gap: 7px; margin: 9px 0 5px; }
  .adjust-control { padding: 7px 10px; }
  .adjust-title { margin-bottom: 2px; }
  .range-row { gap: 7px; }
  .range-row input { min-height: 40px; margin-block: -4px; }
  .rotation-control { gap: 5px; }
  .rotation-buttons { gap: 4px; }
  .rotation-buttons button { min-height: 42px; padding-inline: 3px; font-size: 10px; }
  .rotation-range { margin-top: 0; }
  .eraser-controls { gap: 5px; margin: 8px 0 4px; }
  .crop-dialog > .text-button { min-height: 42px; margin-top: 0; }
  .tool-guide-layer { place-items: end center; padding: 0; }
  .tool-guide-card { width: 100%; max-height: min(82dvh,690px); border-width: 1px 0 0; border-radius: 24px 24px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
  .tool-motion-demo { transform: scale(.92); margin-block: -2px 7px; }
}

@media (max-width: 480px) and (max-height: 600px) {
  dialog.crop-dialog:not(.has-edge-tools) .dialog-head { min-height: calc(54px + env(safe-area-inset-top)); }
  dialog.crop-dialog:not(.has-edge-tools) > p { min-height: 30px; margin: 4px 4px 6px; }
  .tool-guide-card { max-height: min(90dvh,690px); }
}

@media (min-width: 700px) {
  .bottom-bar { left: 50%; right: auto; width: 680px; transform: translateX(-50%); border: 1px solid rgba(89,99,74,.13); border-bottom: 0; border-radius: 18px 18px 0 0; }
}

@media (min-width: 900px) {
  body.is-photo-step .app { width: min(1120px,100%); }
  body.is-photo-step .step-panel[data-step="2"] { padding: 28px; }
  .photo-step-workspace { grid-template-columns: minmax(0,1fr) 330px; grid-template-areas: "main preview"; align-items: start; gap: 24px; }
  .live-preview-card { position: sticky; top: 88px; }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .photo-grid:has(.photo-card[hidden]) > [data-photo-card="1"] { grid-column: 1/-1; max-width: 520px; }
  .photo-card-meta { grid-template-columns: 1fr; }
  .photo-actions { justify-content: stretch; }
  .photo-actions .button { flex: 1 1 130px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto!important; animation-duration: .01ms!important; transition-duration: .01ms!important; }
  .tool-motion-demo[data-guide="eraser"] .motion-soft-residue,.tool-motion-demo[data-guide="eraser"] .motion-hard-residue { opacity: 0; }
  .tool-motion-demo[data-guide="eraser"] .motion-hard-label,.tool-motion-demo[data-guide="restore"] .motion-restore-label { opacity: 1; }
  .tool-motion-demo[data-guide="restore"] .motion-hole { opacity: 0; }
  .tool-motion-demo .motion-tool-mark { display: none; }
}

/* Optional photo tools do not interrupt the ordinary upload-to-result flow. */
.photo-extra-options { width:100%; border-top:1px solid var(--line, #e6e6df); padding-top:12px; margin-top:4px; }
.photo-extra-options summary { cursor:pointer; font-size:13px; }
.photo-extra-options summary span { margin-left:8px; opacity:.65; font-size:11px; }
.photo-extra-options p { font-size:12px; line-height:1.7; margin:10px 0; }
.photo-extra-options .button, .photo-extra-options .text-button { margin:4px 6px 4px 0; }

.retouch-history-controls { display: flex; gap: 12px; }
.retouch-history-controls .text-button { flex: 1; min-height: 44px; margin: 0; }
.retouch-history-controls .text-button:disabled { opacity: .45; cursor: default; }

/* Photo adjustment v19: named controls and copy preview at the point of editing. */
.info-preview-card { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8f9f3; }
.info-preview-card p,.blush-adjustment p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.info-preview-card canvas { display:block; width:100%; height:auto; }
.info-preview-card .live-preview-canvas-wrap { max-width: 300px; margin: 12px auto 0; }
.blush-adjustment { margin: 12px 0; padding: 12px; border:1px solid var(--line); border-radius:12px; }
.blush-adjustment input[type=range] { width:100%; min-width:0; min-height:36px; }
.blush-adjustment select { width:100%; min-height:44px; }
.blush-adjustment .adjust-title { display:flex; justify-content:space-between; align-items:center; }

.adjustment-scroll > .text-button { display:block; margin:8px auto; }
@media (max-width: 600px) {
  dialog.crop-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
  .crop-dialog .dialog-head,.crop-dialog > p,.crop-dialog #cropStage { flex-shrink:0; }
  .crop-dialog #cropStage { position:relative; top:auto; margin-inline:auto; }
  .crop-dialog .adjustment-scroll { min-height:0; flex:1; overflow-y:auto; overscroll-behavior:contain; margin-top:8px; padding-bottom:16px; border-top:1px solid var(--line); }
}


.adjustment-tabs { position:sticky; top:0; z-index:1; display:grid; grid-template-columns:1fr 1fr; gap:6px; background:var(--paper); padding:8px 0; }
.adjustment-tabs[hidden] { display:none; }
.adjustment-tabs button { min-height:44px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--sage); font-weight:700; }
.adjustment-tabs button[aria-pressed=true] { background:var(--sage); color:white; }
.blush-adjustment[hidden] { display:none; }

.info-preview-card .live-preview-canvas-wrap { max-width:none; background:var(--paper); }
.info-preview-card .live-preview-zoom { position:static; display:block; margin-top:8px; padding:12px; border-radius:8px; font-size:13px; color:#fff; background:var(--sage); }
.info-preview-card .live-preview-canvas-wrap { width:100%; }

.design-switch-dialog { max-height:90dvh; overflow-y:auto; }
.design-switch-dialog > p { color:var(--muted); font-size:13px; line-height:1.6; }
.design-switch-dialog .dialog-head { grid-template-columns:0 1fr 44px; }
.design-switch-dialog .dialog-head h2 { white-space:normal; }
.design-switch-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.design-switch-grid button { border:1px solid var(--line); border-radius:12px; padding:8px; background:white; color:var(--ink); cursor:pointer; }
.design-switch-grid button[aria-pressed=true] { border:2px solid var(--sage); opacity:.6; }
.design-switch-grid img { display:block; width:100%; aspect-ratio:1240/1754; object-fit:cover; border-radius:6px; }
.design-switch-grid span { display:block; padding:10px 0 4px; font-size:13px; }
@media(max-width:400px) { .header-actions {gap:5px;} .header-actions button {padding-inline:8px;font-size:11px;} .brand small {display:none;} }
