:root {
  --desk: #24211c;
  --desk-deep: #1b1814;
  --desk-text: #f3ede0;
  --desk-muted: #a69c8b;
  --desk-line: rgba(243, 237, 224, 0.18);
  --paper: #f6f1e6;
  --paper-back: #f4eee1;
  --ink: #283845;
  --ink-muted: #6c6a64;
  --accent: #1f5c59;
  --accent-hover: #174744;
  --gold: #d5b278;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  background: radial-gradient(circle at top center, #2d2923 0%, var(--desk) 45%, var(--desk-deep) 100%);
  color: var(--desk-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 14px 32px;
}

/* Minimal Header Bar */
.topbar {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-stamp {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--desk);
  background:
    radial-gradient(circle at 0 50%, transparent 1.6px, #f3ede0 1.8px) left center / 4px 7px repeat-y,
    radial-gradient(circle at 100% 50%, transparent 1.6px, #f3ede0 1.8px) right center / 4px 7px repeat-y,
    radial-gradient(circle at 50% 0, transparent 1.6px, #f3ede0 1.8px) top center / 7px 4px repeat-x,
    radial-gradient(circle at 50% 100%, transparent 1.6px, #f3ede0 1.8px) bottom center / 7px 4px repeat-x,
    linear-gradient(#f3ede0, #f3ede0) center / calc(100% - 6px) calc(100% - 6px) no-repeat;
}

.brand-stamp svg {
  width: 14px;
  height: 14px;
}

.brand h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--desk-text);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-pill {
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--desk-line);
  background: rgba(243, 237, 224, 0.06);
  color: var(--desk-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.icon-pill:hover {
  color: var(--desk-text);
  border-color: rgba(243, 237, 224, 0.38);
}

.pro-pill {
  color: var(--gold);
  border-color: rgba(213, 178, 120, 0.35);
}

.pro-pill.unlocked {
  background: var(--accent);
  color: #f6f1e6;
  border-color: var(--accent);
}

.pick-photo-btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(243, 237, 224, 0.28);
  background: rgba(243, 237, 224, 0.08);
  color: var(--desk-text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.pick-photo-btn:hover {
  background: rgba(243, 237, 224, 0.16);
  border-color: rgba(243, 237, 224, 0.48);
}

/* Single-Column Centered Studio */
.studio {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Quiet Launch Prompt above Postcard */
.launch-prompt {
  width: 100%;
  padding: 4px 2px;
  font-size: 13.5px;
  color: var(--desk-muted);
  text-align: left;
  line-height: 1.3;
}

.launch-prompt[hidden],
.location-bar[hidden] {
  display: none;
}

/* Progressive Disclosure: Hide post-photo chrome on launch screen */
.reveal-after-photo {
  transition: opacity 0.24s ease;
}

.studio.is-launch .reveal-after-photo {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.studio.is-launch .card-front {
  padding-top: 6.4%;
}

.studio.is-launch .front-caption-row {
  height: 0;
  margin-top: 14px;
  overflow: hidden;
}

/* Location & Date Bar above Postcard */
.location-bar {
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--desk-text);
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.location-bar:hover {
  background: rgba(243, 237, 224, 0.06);
}

.loc-pin {
  font-size: 13px;
  flex-shrink: 0;
}

.loc-bar-text {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.3;
  min-width: 0;
}

.loc-bar-text strong {
  font-weight: 600;
  color: var(--desk-text);
}

.loc-sep {
  color: var(--desk-muted);
  opacity: 0.65;
}

.loc-bar-country {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--desk-muted);
  text-transform: uppercase;
}

.loc-bar-date {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--desk-text);
  opacity: 0.92;
}

.loc-edit-icon {
  font-size: 12.5px;
  color: var(--desk-muted);
  margin-left: 2px;
  opacity: 0.85;
}

/* 3D Postcard Stage */
.scene {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  perspective: 1500px;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --sheen-x: 28%;
  --sheen-y: 18%;
}

.card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  --flip-y: 0deg;
  transform: rotateX(var(--tilt-x)) rotateY(calc(var(--flip-y) + var(--tilt-y)));
  transition: transform 0.82s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 3px;
  will-change: transform;
}

.card-3d.is-tilting {
  transition: transform 0.16s ease-out;
}

.card-3d.is-flipped {
  --flip-y: 180deg;
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--paper);
  background-image: linear-gradient(
    155deg,
    rgba(255, 253, 248, 0.62) 0%,
    rgba(246, 241, 230, 0) 48%,
    rgba(182, 166, 138, 0.16) 100%
  );
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(40, 34, 26, 0.08),
    0 18px 44px -10px rgba(0, 0, 0, 0.56),
    0 6px 16px -4px rgba(0, 0, 0, 0.35);
  overflow: visible;
  display: flex;
  flex-direction: column;
}

/* Fine archival cotton paper tooth */
.card-face::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0.036;
  mix-blend-mode: multiply;
  border-radius: 3px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.card-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  border-radius: 3px;
  background: radial-gradient(
    circle at var(--sheen-x) var(--sheen-y),
    rgba(255, 253, 247, 0.3) 0%,
    rgba(255, 253, 247, 0.07) 32%,
    transparent 65%
  );
  transition: opacity 0.35s ease;
}

.scene:hover .card-sheen {
  opacity: 1;
}

/* Floating Card Pills (Bottom-right flip pill, Top-right stamp controls) */
.card-float-pill {
  position: relative;
  border: 1px solid rgba(40, 56, 69, 0.24);
  background: rgba(252, 249, 242, 0.96);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 3px 10px rgba(24, 20, 14, 0.16);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.card-float-pill:hover {
  background: #ffffff;
  border-color: rgba(31, 92, 89, 0.5);
  transform: translateY(-1px);
}

.is-flip-pill {
  position: absolute;
  bottom: 9.8%;
  right: 6.4%;
  z-index: 9;
  font-size: 11.5px;
  padding: 4px 11px;
}

.is-flip-pill.is-flip-back {
  bottom: 10.6%;
  right: 7.4%;
}

.illustrated-float-group {
  position: absolute;
  top: 2.2%;
  right: 28%;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.illustrated-float-group.is-back-float-group {
  top: 2.2%;
  right: 29.2%;
}

.illustrated-float-group[hidden] {
  display: none;
}

.is-illustrated-pill.is-active {
  background: var(--accent);
  color: #f6f1e6;
  border-color: var(--accent);
}

.is-classic-back-pill,
.is-side-pill {
  font-size: 11px;
  padding: 4px 8.5px;
  color: var(--ink-muted);
}

.is-side-pill:hover {
  color: var(--accent);
}

.is-classic-back-pill[hidden],
.pill-lock-dot[hidden] {
  display: none;
}

.pill-lock-dot {
  font-size: 10px;
  opacity: 0.82;
}

/* Front Face */
.card-front {
  padding: 8.2% 6.4% 4.8%;
  transition: padding 0.22s ease;
}

.card-front.is-stamp-on-back {
  padding-top: 6.4%;
}

.photo-frame {
  position: relative;
  width: 100%;
  flex: 1;
  background: #fcfaf5;
  padding: 8px;
  border-radius: 1.5px;
  box-shadow:
    inset 0 0 0 1px rgba(40, 56, 69, 0.06),
    0 1px 2px rgba(45, 38, 30, 0.12),
    0 9px 20px -10px rgba(45, 38, 30, 0.2);
  display: flex;
}

.photo-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg, #dad4c8 0%, #c8c0b0 100%);
  touch-action: none;
}

.photo-viewport:not(.is-empty) {
  cursor: grab;
}

.photo-viewport.is-dragging {
  cursor: grabbing;
}

.photo-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(40, 34, 26, 0.11);
  z-index: 2;
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: filter 0.3s ease, opacity 0.28s ease;
}

.photo-viewport.is-empty .photo-img {
  opacity: 0;
  pointer-events: none;
}

.photo-warm-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* Serene Minimalist Empty Photo Mount (matches launch reference) */
.photo-mount {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  border: none;
  cursor: pointer;
  background: #e7e0d0;
  color: #7b7365;
  transition: background 0.2s ease, color 0.2s ease;
}

.photo-viewport.is-empty .photo-mount {
  display: flex;
}

.photo-mount:hover,
.photo-viewport.is-dragover .photo-mount {
  background: #e1d8c5;
  color: var(--ink);
}

.mount-title {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: inherit;
}

.photo-viewport.is-dragover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Filter presets: warm, tinted, natural */
.filter-warm .photo-img {
  filter: contrast(0.95) saturate(0.9) sepia(0.14) brightness(1.02);
}
.filter-warm .photo-warm-tint {
  background: #f5e5c6;
  mix-blend-mode: multiply;
  opacity: 0.16;
}

.filter-tinted .photo-img {
  filter: contrast(0.9) saturate(0.84) hue-rotate(-6deg) brightness(1.03);
}
.filter-tinted .photo-warm-tint {
  background: linear-gradient(155deg, rgba(44, 88, 92, 0.22), rgba(226, 206, 174, 0.22));
  mix-blend-mode: soft-light;
  opacity: 0.85;
}

.filter-natural .photo-img {
  filter: contrast(0.99) saturate(1);
}
.filter-natural .photo-warm-tint {
  opacity: 0;
}

/* Perforated Vintage Stamp (Tap directly to reroll / cycle) */
.stamp-slot {
  position: absolute;
  top: 4.8%;
  right: 3.2%;
  width: 23.5%;
  aspect-ratio: 4 / 5;
  z-index: 8;
  padding: 4.5px;
  transform: rotate(1.6deg);
  cursor: pointer;
  user-select: none;
  background:
    radial-gradient(circle at 0 50%, transparent 2.2px, #f6efe2 2.45px) left center / 5px 9px repeat-y,
    radial-gradient(circle at 100% 50%, transparent 2.2px, #f6efe2 2.45px) right center / 5px 9px repeat-y,
    radial-gradient(circle at 50% 0, transparent 2.2px, #f6efe2 2.45px) top center / 9px 5px repeat-x,
    radial-gradient(circle at 50% 100%, transparent 2.2px, #f6efe2 2.45px) bottom center / 9px 5px repeat-x,
    linear-gradient(#f6efe2, #f6efe2) center / calc(100% - 8px) calc(100% - 8px) no-repeat;
  filter:
    drop-shadow(0 1px 1.5px rgba(38, 31, 23, 0.24))
    drop-shadow(0 4px 8px rgba(38, 31, 23, 0.16));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease;
}

.stamp-slot:hover {
  transform: rotate(1.6deg) scale(1.04);
}

.stamp-slot.is-illustrated {
  top: 4.2%;
  right: 2.8%;
  width: 24.5%;
  aspect-ratio: 160 / 221;
  padding: 0;
  background: none;
}

.stamp-slot.is-rolling {
  animation: stampPop 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stampPop {
  0% { transform: rotate(1.6deg) scale(0.91); }
  55% { transform: rotate(2.9deg) scale(1.06); }
  100% { transform: rotate(1.6deg) scale(1); }
}

.stamp-slot svg,
.stamp-slot img.stamp-artwork {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.stamp-pro-pill {
  position: absolute;
  right: 6%;
  bottom: 5%;
  z-index: 2;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(31, 44, 52, 0.86);
  color: #f6efe2;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.stamp-slot[hidden],
.postmark[hidden],
.postmark.is-hidden,
.back-stamp-box[hidden] {
  display: none;
}

.stamp-slot.is-back-stamp {
  top: 6.2%;
  right: 5.8%;
  width: 21%;
}

.stamp-slot.is-back-stamp.is-illustrated {
  top: 5.6%;
  right: 5.4%;
  width: 22%;
}

/* Clickable Wavy Ink Postmark */
.postmark {
  position: absolute;
  top: 7.4%;
  right: 17.5%;
  width: 39%;
  aspect-ratio: 3 / 2;
  z-index: 8;
  cursor: pointer;
  transform: rotate(-7deg);
  mix-blend-mode: multiply;
  opacity: 0.74;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.postmark.is-back-postmark {
  top: 8.2%;
  right: 19.2%;
  width: 35%;
}

.postmark:hover {
  opacity: 0.94;
  transform: rotate(-7deg) scale(1.03);
}

.front-caption-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 82px;
}

.front-caption {
  font-family: "Caveat", "Noto Serif TC", cursive, serif;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  cursor: text;
  max-width: calc(100% - 22px);
}

.front-caption:focus {
  background: rgba(31, 92, 89, 0.08);
}

.caption-edit-cue {
  font-size: 13px;
  color: var(--ink-muted);
  opacity: 0.52;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.front-caption:focus + .caption-edit-cue {
  opacity: 0;
}

.front-footer {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(40, 56, 69, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 2.1px;
  color: #6b655c;
}

.front-footer-mark {
  font-size: 8px;
  letter-spacing: 0;
  color: var(--accent);
  opacity: 0.6;
}

.front-region {
  outline: none;
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
  cursor: text;
}

.front-region:focus {
  background: rgba(31, 92, 89, 0.08);
}

/* Back Face */
.card-back {
  transform: rotateY(180deg);
  background-color: var(--paper-back);
  padding: 8.2% 7.4% 6.4%;
  justify-content: space-between;
}

.back-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(40, 56, 69, 0.16);
  padding-bottom: 13px;
  min-height: 82px;
}

.back-title {
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 3.2px;
  color: var(--ink);
  opacity: 0.78;
}

.back-subtitle {
  font-family: Georgia, serif;
  font-size: 7.5px;
  letter-spacing: 2.4px;
  color: var(--ink-muted);
  opacity: 0.75;
  margin-top: 2px;
}

.back-coords {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  color: var(--accent);
  margin-top: 7px;
  outline: none;
  border-radius: 3px;
}

.back-coords:focus {
  background: rgba(31, 92, 89, 0.08);
}

.back-stamp-box {
  position: relative;
  width: 56px;
  height: 68px;
  border: 1px dashed rgba(40, 56, 69, 0.28);
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 7.5px;
  line-height: 1.45;
  letter-spacing: 1.1px;
  color: rgba(40, 56, 69, 0.48);
  text-align: center;
}

.back-stamp-box::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(40, 56, 69, 0.11);
  pointer-events: none;
}

.back-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 14px 0;
}

.back-note {
  font-family: "Caveat", "Noto Serif TC", cursive, serif;
  font-size: 20.5px;
  line-height: 32px;
  color: var(--ink);
  min-height: 128px;
  outline: none;
  background-image: repeating-linear-gradient(
    transparent 0,
    transparent 31px,
    rgba(40, 56, 69, 0.13) 31px,
    rgba(40, 56, 69, 0.13) 32px
  );
  padding: 0 4px;
  cursor: text;
}

.back-note:focus {
  background-color: rgba(31, 92, 89, 0.05);
}

.back-recipient {
  align-self: flex-end;
  width: 72%;
  border-top: 1px solid rgba(40, 56, 69, 0.18);
  padding-top: 10px;
  padding-bottom: 18px;
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 1.6px;
  color: var(--ink-muted);
}

.back-recipient span {
  display: block;
  font-family: "Caveat", "Noto Serif TC", cursive, serif;
  font-size: 21px;
  letter-spacing: 0;
  color: var(--ink);
  margin-top: 2px;
  outline: none;
}

.back-footer {
  display: flex;
  justify-content: space-between;
  font-family: Georgia, serif;
  font-size: 8.5px;
  letter-spacing: 1.9px;
  color: rgba(40, 56, 69, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .card-3d,
  .card-3d.is-tilting {
    transition: none;
  }
  .scene:hover .card-sheen {
    opacity: 0;
  }
}

/* Inline PRO Preview Notice (compact single-line when previewing a locked illustrated stamp) */
.pro-inline-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--gold);
  background: rgba(213, 178, 120, 0.1);
  border: 1px solid rgba(213, 178, 120, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
}

.pro-inline-strip[hidden] {
  display: none;
}

.pro-inline-sep {
  opacity: 0.45;
}

.pro-inline-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--desk-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.pro-inline-link.is-gold {
  color: var(--gold);
}

/* Minimalist 3-Circle Color Filter Swatches */
.filter-swatches {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 2px;
}

.swatch-btn {
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--desk-muted);
  transition: color 0.16s ease, transform 0.16s ease;
}

.swatch-btn:hover {
  color: var(--desk-text);
}

.swatch-btn.active {
  color: #ffffff;
}

.swatch-btn.active .swatch-label {
  font-weight: 600;
}

.swatch-ring {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #ebe4d5;
  border: 2px solid rgba(243, 237, 224, 0.24);
  display: grid;
  place-items: center;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.swatch-btn.active .swatch-ring {
  background: #f7f3ea;
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(243, 237, 224, 0.24);
  transform: scale(1.05);
}

.swatch-fill {
  width: 17px;
  height: 17px;
  border-radius: 2.5px;
  border: 1px solid rgba(40, 56, 69, 0.16);
}

.swatch-fill.is-warm {
  background: linear-gradient(135deg, #c6a57c 0%, #9b8468 100%);
}

.swatch-fill.is-tinted {
  background: linear-gradient(135deg, #8ea3ae 0%, #6d858c 100%);
}

.swatch-fill.is-natural {
  background: linear-gradient(135deg, #a6b7ca 0%, #869eb7 100%);
}

.swatch-label {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.stage-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--desk-muted);
  text-align: center;
  max-width: 360px;
}

/* Primary 2-Button Action Bar */
.bottom-actions {
  width: 100%;
  max-width: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.cta-primary,
.cta-secondary {
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cta-primary {
  border: none;
  background: #f3ede0;
  color: #23201b;
}

.cta-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.cta-secondary {
  border: 1px solid rgba(243, 237, 224, 0.26);
  background: rgba(243, 237, 224, 0.05);
  color: var(--desk-text);
}

.cta-secondary:hover {
  background: rgba(243, 237, 224, 0.12);
  border-color: rgba(243, 237, 224, 0.45);
  transform: translateY(-1px);
}

/* Quiet Footer */
.site-footer {
  width: 100%;
  max-width: 440px;
  margin-top: 18px;
  text-align: center;
  font-size: 11.5px;
  color: var(--desk-muted);
  line-height: 1.6;
}

.site-footer a {
  color: var(--desk-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.test-bar {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--desk-muted);
}

.test-bar button {
  background: none;
  border: none;
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
  font-size: 11.5px;
}

/* Modals (Archival Cream Cards on Dark Backdrop) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 11, 9, 0.68);
  backdrop-filter: blur(5px);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: 100%;
  max-width: 410px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.48);
  position: relative;
}

.compact-modal {
  max-width: 390px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
}

.modal h2 {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  color: var(--ink);
  font-size: 20px;
}

.modal-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.modal-desc {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.modal-field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.loc-field-wrap,
.date-field-wrap {
  position: relative;
}

.text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(40, 56, 69, 0.2);
  border-radius: 10px;
  font-size: 13.5px;
  background: #fff;
  color: var(--ink);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 92, 89, 0.14);
}

.date-text-input {
  padding-right: 38px;
}

.date-picker-trigger {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  overflow: hidden;
}

.date-picker-trigger:hover {
  color: var(--accent);
  background: rgba(31, 92, 89, 0.08);
}

.date-picker-trigger svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.date-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
}

.date-native-input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Location Autocomplete Dropdown inside Modal */
.loc-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 230px;
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid rgba(40, 56, 69, 0.18);
  border-radius: 11px;
  box-shadow: 0 14px 30px -10px rgba(40, 34, 26, 0.24);
  padding: 4px;
  z-index: 40;
}

.loc-dropdown[hidden] {
  display: none;
}

.loc-option {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--ink);
}

.loc-option:hover,
.loc-option.is-active {
  background: rgba(31, 92, 89, 0.1);
}

.loc-option-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.loc-option-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-option-alt {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-option-meta {
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.loc-status {
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* Download Checkboxes & Share Radio Format Rows */
.format-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.format-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(40, 56, 69, 0.14);
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.format-option:hover {
  border-color: rgba(31, 92, 89, 0.45);
}

.format-option:has(input:checked) {
  border-color: var(--accent);
  background: #edf4f2;
}

.format-option input[type="checkbox"],
.format-option input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.format-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.format-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.format-desc {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 1px;
}

.format-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5ecea;
  color: var(--accent);
  flex-shrink: 0;
}

.format-badge.is-pro {
  background: #f3e4c8;
  color: #7c5821;
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #f6f1e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.18s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.modal-submit-btn {
  justify-content: center;
}

.btn-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.btn-ghost-link {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.btn-ghost-link[hidden] {
  display: none;
}

.perk-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  color: #36332e;
}

.perk-list li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: bold;
}

.restore-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(40, 56, 69, 0.12);
  display: flex;
  gap: 6px;
}

.chip {
  border: 1px solid rgba(40, 56, 69, 0.16);
  background: #fff;
  color: var(--ink);
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 94-Stamp Illustrated Gallery Modal */
.gallery-modal {
  max-width: 660px;
  max-height: min(84vh, 720px);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-right: 28px;
}

.gallery-header h2 {
  font-size: 19px;
  margin-bottom: 3px;
}

.gallery-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.gallery-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-scroll {
  overflow-y: auto;
  padding: 2px 2px 8px;
  flex: 1;
  min-height: 220px;
}

.gallery-matched-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(40, 56, 69, 0.12);
}

.gallery-matched-section[hidden] {
  display: none;
}

.gallery-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--accent);
  margin-bottom: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

.gallery-card {
  position: relative;
  border: 1.5px solid rgba(40, 56, 69, 0.13);
  background: #fbf8f1;
  border-radius: 12px;
  padding: 9px 7px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 92, 89, 0.5);
}

.gallery-card.active {
  border-color: var(--accent);
  background: #eaf2f0;
  box-shadow: 0 0 0 2px rgba(31, 92, 89, 0.2);
}

.gallery-card img {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 160 / 221;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(38, 31, 23, 0.22));
}

.gallery-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-meta {
  font-size: 10px;
  color: var(--ink-muted);
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-lock-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(31, 44, 52, 0.84);
  color: #f6efe2;
  font-size: 9.5px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.gallery-empty {
  padding: 36px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.gallery-empty[hidden] {
  display: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #f3ede0;
  color: #23201b;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  transition: all 0.24s ease;
  z-index: 70;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
