/* Digital Postcard — botanical / hand-drawn design tokens (PRD Section 6.1) */
:root {
  --paper-cream: #F7F5EA;
  --paper-cream-dark: #EFEBDA;
  --ink: #33322C;
  --sage: #8FA97B;
  --sage-dark: #71905F;
  --blush: #E8A0A0;
  --dusty-blue: #8FB0C4;
  --ochre: #D9A441;
  --white: #FFFFFB;

  --font-wordmark: 'Alex Brush', cursive;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-wobble: 60% 40% 55% 45% / 45% 55% 40% 60%;
  --shadow-none: none;

  --root-pad: 12px;
  --content-pad: 12px;
  /* Mobile-first postcard scale — room for stamp + to/from without crowding the toolbar */
  --postcard-max-height: min(36vh, 220px);
  --postcard-width: min(calc(100vw - 40px), calc(var(--postcard-max-height) * 3 / 2));
  --landing-hero-width: min(calc(100vw - 40px), 300px);
  --landing-postcard-max: 158px;
  --landing-wordmark-size: clamp(42px, 12vw, 56px);
  --landing-greetings-size: clamp(28px, 8vw, 40px);
  --landing-country-size: clamp(18px, 4.5vw, 22px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper-cream);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
}

#root {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--root-pad) 24px;
  box-sizing: border-box;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.nav-back {
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
  padding: 4px;
}
.nav-step {
  font-size: 12px;
  color: var(--ink);
  opacity: 0.65;
}

/* ---------- Buttons ---------- */
.btn {
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 22px;
  border: 1.5px solid var(--ink);
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--sage);
  color: var(--white);
  border-color: var(--sage-dark);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-block { width: 100%; text-align: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Landing ---------- */
.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.landing-wordmark {
  font-family: var(--font-wordmark);
  font-size: var(--landing-wordmark-size);
  color: var(--sage);
  line-height: 1;
}
.landing-tagline {
  font-size: clamp(12px, 3.2vw, 14px);
  color: var(--ink);
  opacity: 0.7;
  margin-bottom: clamp(12px, 3vw, 20px);
}
.landing-hero {
  width: var(--landing-hero-width);
  max-width: 100%;
  min-height: 0;
  margin-inline: auto;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
}

.landing-greetings {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0;
  min-height: 1.1em;
  text-align: center;
  transform: none;
  font-family: "Homemade Apple", cursive;
}

.landing-greetings-text {
  font-family: "Homemade Apple", cursive !important;
  font-size: var(--landing-greetings-size);
  font-weight: 400;
  font-style: normal;
  color: var(--sage);
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transform: none;
  font-synthesis: none;
}

.landing-caret {
  display: inline-block;
  width: 2px;
  height: 0.8em;
  margin-left: 2px;
  background: var(--sage);
  opacity: 0.55;
  animation: landing-caret-blink 0.85s steps(1) infinite;
  vertical-align: baseline;
}

@keyframes landing-caret-blink {
  0%, 45% { opacity: 0.55; }
  50%, 100% { opacity: 0; }
}

.landing-reveal {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s;
}

.landing-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.landing-destination {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: landing-destination-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.landing-cta-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  max-width: 100%;
}

.landing-cta-flower {
  position: absolute;
  width: 46px;
  height: 70px;
  right: 2px;
  left: auto;
  top: 50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate(18%, -25%) rotate(10deg) scale(0.4);
  transition:
    opacity 0.28s ease,
    transform 0.38s cubic-bezier(0.22, 1.2, 0.36, 1);
}

.landing-cta-wrap:hover .landing-cta-flower,
.landing-cta-wrap:focus-within .landing-cta-flower {
  opacity: 1;
  transform: translate(18%, -102%) rotate(6deg) scale(1);
}

.landing-cta {
  position: relative;
  z-index: 1;
  margin-top: 0;
  max-width: 100%;
  padding-inline: 18px;
  white-space: normal;
  line-height: 1.25;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.landing-cta-wrap:hover .landing-cta {
  transform: translateY(1px);
}

.landing-postcard {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: var(--landing-postcard-max);
  margin-inline: auto;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(51, 50, 44, 0.08);
}

/* Keep landing sample sized to the hero — don't inherit step postcard width */
.landing-postcard.postcard-back {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.landing-postcard .message-area {
  padding: clamp(4px, 1.2vw, 8px) clamp(6px, 1.5vw, 10px) clamp(4px, 1.2vw, 8px) clamp(4px, 1vw, 6px);
}

.landing-postcard-message {
  font-size: clamp(10px, 2.8vw, 15px);
  line-height: 1.28;
  white-space: pre-wrap;
  text-align: left;
  overflow: hidden;
}

.landing-postcard .stamp-slot {
  width: clamp(38px, 10vw, 58px);
  height: clamp(46px, 12vw, 72px);
}

.landing-postcard .stamp-slot-empty {
  width: clamp(34px, 9vw, 52px);
  height: clamp(40px, 11vw, 64px);
}

.landing-postcard-to-from {
  font-family: "Homemade Apple", cursive;
  font-size: clamp(9px, 2.4vw, 13px);
  text-align: right;
  line-height: 1.35;
}

.landing-destination-name {
  font-family: "Shadows Into Light", cursive;
  font-style: normal;
  font-weight: 400;
  font-size: var(--landing-country-size);
  color: var(--blush);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.landing-sample-mode {
  font-size: clamp(10px, 2.5vw, 12px);
  color: var(--ink);
  opacity: 0.55;
  margin-top: -2px;
  letter-spacing: 0.02em;
}

@keyframes landing-destination-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.landing-footnote {
  font-size: 11px;
  color: var(--ink);
  opacity: 0.5;
  margin-top: 18px;
}

/* ---------- Step shell ---------- */
.step-title {
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--ink);
  opacity: 0.6;
  margin-bottom: 4px;
  text-align: center;
  width: 100%;
}
.step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 48px);
}
.step-body--postcard,
.step-body--country {
  min-height: calc(100vh - 48px);
  justify-content: center;
  gap: 8px;
}

.postcard-stage {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.step-footer {
  width: 100%;
  flex-shrink: 0;
  padding-inline: var(--content-pad);
}

.step-body--postcard > .step-footer {
  margin-top: 24px;
}

.step-body--postcard > .step-title {
  flex-shrink: 0;
  width: 100%;
  padding-inline: var(--content-pad);
  margin-bottom: 0;
}

/* Nudge title + postcard up slightly on the photo step */
.step-body--photo > .step-title,
.step-body--photo > .postcard-stage {
  transform: translateY(-12px);
}

.step-body > .step-title,
.step-body > .location-note {
  padding-inline: var(--content-pad);
}

.step-body > .step-actions {
  width: 100%;
  align-self: stretch;
  padding-inline: var(--content-pad);
}

.step-footer .step-actions {
  margin-top: 0;
}

.step-footer .stamp-strip {
  margin-top: 6px;
}

.step-footer .stamp-strip:first-child {
  margin-top: 0;
}

.step-footer .location-note:first-child {
  margin-top: 0;
}
.step-body > .preview-scene,
.step-body > .center-col {
  width: 100%;
  align-self: stretch;
}
.step-actions {
  display: flex;
  gap: 10px;
  margin-top: 0;
}
.step-actions .btn { flex: 1; }

/* ---------- Postcard sizing — centered, viewport-tall ---------- */
.photo-frame,
.flip-card,
.postcard-back,
.export-preview-img {
  width: var(--postcard-width);
  margin-inline: auto;
  flex-shrink: 0;
}

/* ---------- Photo step ---------- */
.photo-frame {
  position: relative;
  aspect-ratio: 3 / 2;
  max-height: var(--postcard-max-height);
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 24px 60px 24px 60px / 60px 24px 60px 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-frame img,
.photo-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-view {
  width: 100%;
  height: 100%;
}
.photo-view--interactive {
  cursor: grab;
}
.photo-view--interactive.dragging {
  cursor: grabbing;
}
.photo-frame:has(.photo-view) {
  cursor: default;
}
.photo-frame:has(.photo-view.dragging) .photo-replace {
  opacity: 0;
  pointer-events: none;
}
.photo-frame .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  opacity: 0.55;
  font-size: 13px;
}
.photo-frame .placeholder .icon { font-size: 30px; }
.photo-replace {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  background: rgba(255,255,251,0.9);
  border: 1px solid var(--ink);
  border-radius: 14px;
  padding: 5px 10px;
}

.stamp-strip {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.stamp-strip .change-link {
  color: var(--dusty-blue);
  font-weight: 500;
  text-decoration: underline;
}
.location-note {
  font-size: 11px;
  opacity: 0.55;
  margin-top: 0;
  margin-bottom: 0;
}

/* ---------- Stamp picker / place animation ---------- */
.stamp-picker {
  width: 100%;
  max-width: var(--postcard-width);
  margin-inline: auto;
  padding-inline: var(--content-pad);
  flex-shrink: 0;
}

.stamp-picker-label {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.stamp-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.stamp-picker-item {
  padding: 6px;
  border: 1.5px solid rgba(51, 50, 44, 0.2);
  border-radius: 12px;
  background: var(--paper-cream-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.stamp-picker-item.selected {
  border-color: var(--sage-dark);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(143, 169, 123, 0.35);
}

.stamp-picker-item:active {
  transform: scale(0.97);
}

.stamp-slot {
  width: clamp(34px, 11vw, 58px);
  height: clamp(42px, 13.5vw, 72px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
}

.stamp-slot-empty {
  width: clamp(30px, 10vw, 52px);
  height: clamp(36px, 12vw, 64px);
  border: 1.5px dashed rgba(51, 50, 44, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 251, 0.5);
}

.stamp-slot .stamp-badge {
  width: 100% !important;
  height: 100% !important;
}

.stamp-slot .stamp-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.side-column > .stamp-badge {
  width: clamp(34px, 11vw, 58px) !important;
  height: clamp(42px, 13.5vw, 72px) !important;
}

.side-column > .stamp-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stamp-place {
  transform-origin: center center;
}

.stamp-place--animating {
  animation: stamp-place 0.75s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes stamp-place {
  0% {
    opacity: 0;
    transform: translate(28px, -72px) rotate(-22deg) scale(1.45);
    filter: drop-shadow(0 12px 16px rgba(51, 50, 44, 0.25));
  }
  55% {
    opacity: 1;
    transform: translate(-2px, 3px) rotate(3deg) scale(1.06);
    filter: drop-shadow(0 4px 6px rgba(51, 50, 44, 0.18));
  }
  78% {
    transform: translate(1px, -1px) rotate(-2deg) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
    filter: drop-shadow(0 1px 3px rgba(51, 50, 44, 0.12));
  }
}

.stamp-badge {
  position: relative;
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;
}

.stamp-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(51, 50, 44, 0.18);
  background: #fff;
}

.stamp-badge--emoji {
  background: #FFFFFB;
  border: 1.5px solid var(--ink-navy, #4A5F8C);
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(51, 50, 44, 0.18);
  overflow: hidden;
}

.stamp-emoji-face {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  border: 1px dashed rgba(74, 95, 140, 0.45);
}

.emoji-stamp-picker {
  width: 100%;
  max-width: var(--postcard-width);
  margin-inline: auto;
  padding-inline: var(--content-pad);
  flex-shrink: 0;
  margin-bottom: 4px;
}

.emoji-stamp-input {
  width: 100%;
  font-size: 28px;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid rgba(51, 50, 44, 0.2);
  border-radius: 12px;
  background: var(--white);
  margin-bottom: 8px;
  line-height: 1.2;
}

.emoji-stamp-input:focus {
  outline: none;
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 2px rgba(143, 169, 123, 0.35);
}

.emoji-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.emoji-chip {
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(51, 50, 44, 0.2);
  border-radius: 10px;
  background: var(--paper-cream-dark);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.emoji-chip.selected {
  border-color: var(--sage-dark);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(143, 169, 123, 0.35);
}

.stamp-badge-fallback {
  background: var(--paper-cream);
  border: 1.5px dashed rgba(51, 50, 44, 0.25);
  border-radius: 2px;
}

.stamp-postmark {
  position: absolute;
  top: 14%;
  right: 8%;
  transform: rotate(-12deg);
  width: 42%;
  aspect-ratio: 1;
  border: 1.5px dashed var(--ink-navy, #4A5F8C);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Homemade Apple", cursive;
  font-size: clamp(7px, 22%, 11px);
  color: var(--ink-navy, #4A5F8C);
  pointer-events: none;
  opacity: 0.92;
}

/* ---------- Country step ---------- */
.country-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-inline: var(--content-pad);
  margin-bottom: 0;
}

.country-selected-name {
  font-size: 15px;
  font-weight: 500;
}

.country-search {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--postcard-width);
  margin-inline: auto;
  padding-inline: var(--content-pad);
  position: relative;
  z-index: 2;
}

.country-search-input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(51, 50, 44, 0.28);
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--white);
  flex-shrink: 0;
}

.country-search-input:focus {
  outline: none;
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 2px rgba(143, 169, 123, 0.28);
}

.country-search-input::placeholder {
  color: rgba(51, 50, 44, 0.55);
}

.country-list {
  position: absolute;
  left: var(--content-pad);
  right: var(--content-pad);
  top: calc(100% + 4px);
  overflow-y: auto;
  max-height: 168px;
  border: 1px solid rgba(51, 50, 44, 0.2);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 8px 20px rgba(51, 50, 44, 0.12);
  z-index: 5;
}

.country-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-bottom: 1px solid rgba(51, 50, 44, 0.08);
  font-size: 13px;
  cursor: pointer;
  line-height: 1.25;
}

.country-row:last-child {
  border-bottom: none;
}

.country-row.selected {
  background: var(--paper-cream-dark);
  font-weight: 500;
}

.country-row:hover {
  background: rgba(143, 169, 123, 0.12);
}

/* ---------- Country picker overlay (legacy fallback) ---------- */
.country-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(51,50,44,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.country-picker {
  background: var(--paper-cream);
  width: 100%;
  max-width: 680px;
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  padding: 18px 18px 24px;
  border: 1.5px solid var(--ink);
  border-bottom: none;
}

.country-picker .country-search {
  padding-inline: 0;
  max-width: none;
}

.country-picker .country-list {
  position: static;
  max-height: 50vh;
  box-shadow: none;
}

/* ---------- Message step ---------- */
.postcard-back {
  position: relative;
  aspect-ratio: 3 / 2;
  max-height: var(--postcard-max-height);
  width: var(--postcard-width);
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 24px 60px 24px 60px / 60px 24px 60px 24px;
  padding: 10px 14px 12px 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.step-toolbar {
  width: 100%;
  flex-shrink: 0;
  padding-inline: var(--content-pad);
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-toolbar .mode-toggle {
  margin-bottom: 0;
}

.step-toolbar .field-picker,
.step-toolbar .color-row,
.step-toolbar .brush-row,
.step-toolbar .size-row {
  margin-top: 0;
}

.mode-toggle { display: flex; gap: 8px; }
.mode-pill {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--ink);
  font-weight: 500;
}
.mode-pill.active { background: var(--sage); color: var(--white); border-color: var(--sage-dark); }
.mode-pill:not(.active) { background: transparent; color: var(--ink); }

.postcard-back-grid {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.message-area { flex: 0 0 56%; display: flex; flex-direction: column; min-height: 0; padding: 6px 8px 6px 4px; }
.message-area--layered {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 0 0 56%;
  min-height: 0;
  padding: 6px 8px 6px 4px;
  box-sizing: border-box;
}
.message-text-layer {
  position: absolute;
  inset: 6px 8px 6px 4px;
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  resize: none;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  outline: none;
  padding: 6px 4px;
  box-sizing: border-box;
  z-index: 1;
  overflow: auto;
}
.message-text-layer--static {
  white-space: pre-wrap;
  overflow: hidden;
  pointer-events: none;
}
.message-draw-layer {
  position: absolute;
  inset: 6px 8px 6px 4px;
  z-index: 2;
}
.message-draw-layer canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.message-area textarea {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: none;
  background: transparent;
  resize: none;
  font-size: clamp(14px, 4.2vw, 18px);
  line-height: 1.35;
  color: var(--ink);
  outline: none;
  padding: 6px 4px;
  box-sizing: border-box;
}
.mode-hint {
  font-size: 11px;
  opacity: 0.55;
  margin-top: -2px;
}
.divider { width: 1px; background: rgba(51,50,44,0.3); flex-shrink: 0; }
.side-column {
  flex: 1 1 0;
  min-width: 0;
  max-width: 42%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 2px 2px 0 0;
  box-sizing: border-box;
}

.field-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.font-chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid var(--ink);
  background: var(--white);
}
.font-chip.active { background: var(--ink); color: var(--paper-cream); }
.size-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.size-chip {
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.size-chip.active {
  background: var(--ink);
  color: var(--paper-cream);
}
.color-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}
.color-dot.active { outline: 2px solid var(--sage); outline-offset: 2px; }
.color-row, .brush-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.brush-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.brush-btn.active { background: var(--ink); }
.brush-btn .dot { border-radius: 50%; background: var(--ink); }
.brush-btn.active .dot { background: var(--paper-cream); }
.tool-row { display: flex; gap: 10px; margin-top: 10px; }
.tool-link { font-size: 11px; text-decoration: underline; opacity: 0.7; }

.to-from { width: 100%; margin-top: auto; min-width: 0; }
.to-from-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 4px;
  font-family: 'Homemade Apple', cursive;
  font-size: clamp(11px, 3.2vw, 14px);
  color: var(--ink);
  max-width: 100%;
}
.to-from-prefix { flex-shrink: 0; }
.to-from input {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1px dotted var(--ink);
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: right;
  padding: 2px 0;
  outline: none;
}
.to-from input::placeholder { opacity: 0.45; }

/* ---------- Preview ---------- */
.preview-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
}
.flip-card {
  aspect-ratio: 3 / 2;
  max-height: var(--postcard-max-height);
  flex-shrink: 0;
  perspective: 1200px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.flip-card-inner.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 20px 50px 20px 50px / 50px 20px 50px 20px;
  overflow: hidden;
  background: var(--white);
}
.flip-face.back { transform: rotateY(180deg); padding: 14px; }
.flip-face.back.flip-face--flat { padding: 0; }
.flip-face img { width: 100%; height: 100%; object-fit: cover; }
.flip-hint { font-size: 15px; opacity: 0.6; }

/* ---------- Export ---------- */
.step-body--export {
  justify-content: flex-start;
  gap: 8px;
  min-height: auto;
}

.step-body--export .export-center {
  flex: 0 0 auto;
  gap: 10px;
}

.step-body--export > .step-actions {
  margin-top: 4px;
}

.export-preview-img {
  width: var(--postcard-width);
  max-height: var(--postcard-max-height);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-inline: auto;
  border-radius: 20px 50px 20px 50px / 50px 20px 50px 20px;
  border: 1.5px solid var(--ink);
}
.export-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
}
.export-note { font-size: 11px; opacity: 0.6; text-align: center; }

.send-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--sage);
  border-radius: 18px 28px 16px 24px / 22px 16px 26px 18px;
  background:
    radial-gradient(circle at 12% 20%, rgba(232, 160, 160, 0.18), transparent 42%),
    radial-gradient(circle at 88% 80%, rgba(143, 169, 123, 0.2), transparent 46%),
    var(--white);
  box-sizing: border-box;
  animation: send-banner-in 0.45s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}
.send-banner-flower {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(232, 160, 160, 0.22);
  color: var(--blush);
  font-size: 18px;
  line-height: 1;
}
.send-banner-title {
  font-family: "Homemade Apple", cursive;
  font-size: 18px;
  color: var(--ink);
  line-height: 1.2;
}
.send-banner-sub {
  font-size: 12px;
  color: var(--sage-dark);
  opacity: 0.9;
  margin-top: 2px;
}
@keyframes send-banner-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Utility ---------- */
.hidden-input { display: none; }
.center-col { display: flex; flex-direction: column; align-items: center; }

@media (min-width: 480px) {
  :root {
    --postcard-max-height: min(46vh, 250px);
    --landing-hero-width: min(calc(100vw - 48px), 340px);
    --landing-postcard-max: 180px;
    --landing-wordmark-size: 52px;
    --landing-greetings-size: 36px;
    --landing-country-size: 20px;
  }
}

/* iPad / small tablet */
@media (min-width: 768px) {
  :root {
    --root-pad: 20px;
    --content-pad: 0px;
    --postcard-max-height: min(50vh, 320px);
    --postcard-width: min(100%, calc(var(--postcard-max-height) * 3 / 2));
    --landing-hero-width: min(100%, 400px);
    --landing-postcard-max: 220px;
    --landing-wordmark-size: 60px;
    --landing-greetings-size: 42px;
    --landing-country-size: 22px;
  }

  #root {
    max-width: 720px;
    padding: 0 var(--root-pad) 36px;
  }
}

/* Laptop */
@media (min-width: 1024px) {
  :root {
    --root-pad: 24px;
    --postcard-max-height: min(58vh, 400px);
    --landing-hero-width: min(100%, 440px);
    --landing-postcard-max: 248px;
    --landing-wordmark-size: 64px;
    --landing-greetings-size: 48px;
    --landing-country-size: 24px;
  }

  #root {
    max-width: 760px;
    padding: 0 var(--root-pad) 40px;
  }
}

/* Large monitor */
@media (min-width: 1440px) {
  :root {
    --postcard-max-height: min(64vh, 460px);
    --landing-hero-width: min(100%, 480px);
    --landing-postcard-max: 272px;
    --landing-wordmark-size: 68px;
    --landing-greetings-size: 52px;
    --landing-country-size: 26px;
  }

  #root {
    max-width: 820px;
  }
}
