:root {
  --ivory: #f6efe6;
  --paper: #fffcf7;
  --ink: #221d19;
  --muted: #7a6d62;
  --gold: #a9844e;
  --gold-hi: #f1dcaa;
  --gold-soft: #dcc8a4;
  --blush: #efd3cb;
  --sage: #c9d3c0;
  --line: rgba(120, 95, 60, .16);
  --glass: rgba(255, 252, 247, .62);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
  --script: "Pinyon Script", cursive;
  --radius: 18px;
  --radius-lg: 30px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gold-grad: linear-gradient(110deg, #9c7a45 0%, #d8b878 22%, #f6e6bd 38%, #c9a86b 52%, #9c7a45 70%, #e9d29d 86%, #9c7a45 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img, video, canvas { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
h1 em, h2 em { font-style: italic; color: var(--gold); }
h1 > em { font-family: var(--script); font-style: normal; }

.eyebrow {
  margin: 0 0 10px; font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
}
.eyebrow.light { color: #f3e7d3; }
.date { font-family: var(--serif); font-size: 18px; letter-spacing: 0.3em; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); margin: 10px 0 0; }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(70px); opacity: .55; mix-blend-mode: multiply;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { background: radial-gradient(circle, var(--blush), transparent 65%); top: -25vmax; left: -20vmax; }
.aurora i:nth-child(2) { background: radial-gradient(circle, var(--gold-soft), transparent 65%); bottom: -30vmax; right: -25vmax; animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { background: radial-gradient(circle, var(--sage), transparent 65%); top: 30%; left: 35%; width: 50vmax; height: 50vmax; animation-duration: 38s; animation-delay: -15s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vmax, 6vmax) scale(1.12); }
  100% { transform: translate(-6vmax, 10vmax) scale(.95); }
}
.petals { position: fixed; inset: 0; z-index: -1; width: 100vw; height: 100vh; pointer-events: none; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 30px 60px -30px rgba(80, 55, 25, .35);
}

/* gold foil text that catches the light */
.shine-text {
  background: var(--gold-grad); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 6s linear infinite;
}
@keyframes foil { to { background-position: -250% 0; } }

/* staggered entrance */
.rise { opacity: 0; transform: translateY(18px); filter: blur(6px); animation: rise .9s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }

/* scroll reveal (fx.js adds .in) */
.reveal { opacity: 0; transform: translateY(40px) scale(.98); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- monogram ---------- */
.monogram {
  width: 96px; height: 96px; margin: 0 auto 22px; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--serif); font-size: 34px; color: var(--ink);
  animation: rise 1s var(--ease) .25s both;
}
.monogram i { font-family: var(--script); font-style: normal; color: var(--gold); font-size: 30px; margin: 0 2px; }
.monogram.small { width: 64px; height: 64px; font-size: 20px; margin-bottom: 12px; border: 1px solid var(--gold-soft); border-radius: 50%; animation: none; }
.monogram.small i { font-size: 18px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; position: relative; overflow: hidden;
  padding: 14px 30px; font-size: 12px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--ink); color: var(--paper); box-shadow: 0 12px 30px -12px rgba(34,29,25,.6); }
.btn-light { background: var(--paper); color: var(--ink); box-shadow: 0 12px 30px -14px rgba(0,0,0,.5); }
.btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.06); }
.btn-outline { border-color: var(--gold-soft); background: var(--paper); color: var(--ink); }
.btn-small { padding: 9px 16px; font-size: 11px; background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.shimmer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); animation: sweep 4.5s ease-in-out infinite;
}
.btn-gold.shimmer::after { background: linear-gradient(100deg, transparent, rgba(241,220,170,.5), transparent); }
@keyframes sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* ---------- gate ---------- */
.gate { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 32px 18px; }
.gate-card {
  width: 100%; max-width: 420px; text-align: center; padding: 48px 28px 34px;
  border-radius: var(--radius-lg); position: relative;
  animation: card-in 1.2s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.ring { position: absolute; top: 30px; left: 50%; width: 132px; height: 132px; margin-left: -66px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: url(#goldline); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2s var(--ease) .2s forwards; }
.ring circle + circle { stroke-width: .6; animation-delay: .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.gate .monogram { margin-top: 4px; margin-bottom: 40px; }
.gate-title { font-size: 58px; line-height: 1.05; font-weight: 500; }
.gate-title > em { font-size: .8em; }
.gate-copy { color: var(--muted); margin: 22px 0 24px; }
.gate-form { display: grid; gap: 12px; }
.gate-form input {
  text-align: center; padding: 15px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.7); outline: none; font-size: 16px; letter-spacing: 0.1em;
  transition: border-color .2s, box-shadow .3s;
}
.gate-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(169,132,78,.14); }
.gate-error { min-height: 1.4em; margin: 4px 0 0; color: #a0473a; font-size: 14px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.gate.leaving { animation: leave .7s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: scale(1.06); filter: blur(10px); } }

/* ---------- hero slideshow ---------- */
.hero {
  position: relative; height: 100svh; min-height: 520px; max-height: 900px; overflow: hidden;
  background: #221d19; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.slides, .slide { position: absolute; inset: 0; }
.slide { background-size: cover; background-position: center; opacity: 0; transition: opacity 1.8s ease; transform: scale(1.06); }
.slide.on { opacity: 1; animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1.16) translate(-1.5%, -1%); } }
.slide.fallback {
  background:
    radial-gradient(circle at 25% 20%, rgba(239,211,203,.75), transparent 50%),
    radial-gradient(circle at 80% 75%, rgba(220,200,164,.8), transparent 55%),
    radial-gradient(circle at 60% 35%, rgba(201,211,192,.6), transparent 45%),
    #6b5a4b;
  opacity: 1; animation: kenburns 14s ease-in-out infinite alternate;
}
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,15,10,.3) 0%, rgba(20,15,10,0) 28%, rgba(20,15,10,0) 42%, rgba(20,15,10,.78) 100%); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 92px; text-align: center; color: #fff; padding: 0 16px; }
.hero-title { font-size: clamp(64px, 19vw, 132px); line-height: .95; font-weight: 500; text-shadow: 0 4px 40px rgba(0,0,0,.25); }
.hero-title > em { color: var(--gold-hi); font-size: .62em; vertical-align: .12em; }
.hero-title .ch { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(6deg); filter: blur(8px); animation: ch-in 1s var(--ease) forwards; }
@keyframes ch-in { to { opacity: 1; transform: none; filter: none; } }
.hero-date { font-family: var(--serif); font-style: italic; font-size: 20px; color: #f3e7d3; margin: 10px 0 0; letter-spacing: .02em; }
.hero-empty { position: absolute; top: 34%; left: 0; right: 0; text-align: center; color: #fff6e6; font-family: var(--serif); font-style: italic; font-size: 22px; }
.dots { position: absolute; bottom: 60px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.4); transition: all .5s var(--ease); }
.dots span.on { background: #fff; width: 22px; }
.scroll-cue { position: absolute; bottom: 18px; left: 50%; width: 22px; height: 34px; margin-left: -11px; border: 1.5px solid rgba(255,255,255,.6); border-radius: 999px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 3px; background: #fff; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; padding: 22px 0; margin-top: 8px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 22px; width: max-content; align-items: center; animation: marquee 32s linear infinite; }
.marquee span { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--ink); white-space: nowrap; }
.marquee b { color: var(--gold); font-weight: 400; font-size: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- panels ---------- */
.panel { max-width: 720px; margin: 0 auto; padding: 22px 14px; text-align: center; }
.panel h2 { font-size: clamp(38px, 10vw, 52px); line-height: 1.02; font-weight: 500; }
.card { border-radius: var(--radius-lg); padding: 38px 22px 28px; position: relative; overflow: clip; }
.card-dark {
  background: radial-gradient(circle at 80% 0%, rgba(169,132,78,.4), transparent 50%), linear-gradient(160deg, #2c241e, #1c1714);
  color: #fff; box-shadow: 0 40px 70px -35px rgba(34,29,25,.7);
}
.card-dark .muted { color: rgba(255,255,255,.7); }
.card-dark h2 em { color: var(--gold-hi); }
.card-dark .eyebrow { color: var(--gold-hi); }

.field { display: block; text-align: left; margin: 26px 0 14px; }
.field span { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 6px; }
.field em { text-transform: none; letter-spacing: 0; font-style: italic; font-weight: 300; }
.field input {
  width: 100%; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.75); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .3s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(169,132,78,.14); }

/* the dropzone wears a slowly rotating gold border */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 36px 20px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from var(--angle), var(--gold-soft), #f6e6bd, var(--gold), var(--blush), var(--gold-soft)) border-box;
  animation: spin-border 6s linear infinite;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
@keyframes spin-border { to { --angle: 360deg; } }
.dropzone:hover, .dropzone.over { transform: translateY(-3px); box-shadow: 0 24px 40px -24px rgba(169,132,78,.6); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px;
  background: linear-gradient(145deg, #f8eedb, #efdcb8); color: var(--gold);
  box-shadow: 0 10px 24px -10px rgba(169,132,78,.7); animation: bob 3s ease-in-out infinite;
}
.dz-icon svg { width: 32px; height: 32px; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.dropzone strong { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.dz-sub { color: var(--muted); font-size: 13px; }

.upload-status {
  position: sticky; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 5; box-shadow: 0 18px 36px -20px rgba(0,0,0,.6);
  margin: 18px 0 0; padding: 16px 16px 14px; border-radius: var(--radius); text-align: left;
  background: linear-gradient(150deg, #2c241e, #1c1714); color: #fff; animation: rise .6s var(--ease) both;
}
.us-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.us-top strong { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.us-top strong b { color: var(--gold-hi); font-weight: 500; }
.us-top span { font-size: 12px; letter-spacing: .08em; color: rgba(255,255,255,.65); white-space: nowrap; }
.us-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); margin-top: 10px; overflow: hidden; }
.us-bar i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .4s var(--ease); background: var(--gold-grad); background-size: 200% 100%; animation: foil 1.6s linear infinite; }
.upload-status.complete .us-bar i { animation: none; }
.us-note { margin: 10px 0 0; font-size: 13px; color: rgba(255,255,255,.7); }
.queue li.done { opacity: .7; }
.queue li.active { border-color: var(--gold-soft); box-shadow: 0 10px 24px -16px rgba(169,132,78,.8); }
.queue { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; text-align: left; }
.queue li {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 8px; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 16px;
  animation: rise .6s var(--ease) both;
}
.queue .thumb { width: 52px; height: 52px; border-radius: 12px; background: var(--ivory) center/cover; }
.queue .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 7px; overflow: hidden; }
.queue .bar i {
  display: block; height: 100%; width: 0; border-radius: 4px; transition: width .3s;
  background: var(--gold-grad); background-size: 200% 100%; animation: foil 1.6s linear infinite;
}
.queue .state { font-size: 12px; color: var(--muted); min-width: 48px; text-align: right; padding-right: 4px; }
.queue li.done .state { color: var(--gold); font-weight: 500; }
.queue li.done .bar i { animation: none; }
.queue li.error .state { color: #a0473a; }
.queue li.error .retry { text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; color: #a0473a; font-size: 12px; }
.queue-summary { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--gold); margin: 18px 0 0; animation: rise .8s var(--ease) both; }

.decorate .card { padding-top: 150px; }
.sticker-cloud { position: absolute; top: 18px; left: 0; right: 0; height: 130px; pointer-events: none; }
.sc { position: absolute; height: 112px; width: auto; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); animation: float 6s ease-in-out infinite; }
.sc1 { left: 6%; top: 8px; --r: -8deg; }
.sc2 { left: 30%; top: 22px; height: 100px; --r: 6deg; animation-delay: -1.5s; }
.sc3 { right: 26%; top: 4px; --r: -4deg; animation-delay: -3s; }
.sc4 { right: 5%; top: 20px; height: 100px; --r: 9deg; animation-delay: -4.5s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-10px) rotate(calc(var(--r) * -1)); } }
.decorate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ---------- grid ---------- */
.album { padding-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: 6px; margin-top: 26px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
.grid > .tile:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
.tile {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; overflow: hidden;
  background: linear-gradient(110deg, #ece2d4 30%, #f6efe4 50%, #ece2d4 70%); background-size: 250% 100%;
  animation: foil 1.6s linear infinite; border-radius: 14px;
}
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity .7s var(--ease), transform 1.2s var(--ease); }
.tile img.loaded { opacity: 1; transform: none; }
.tile:hover img.loaded { transform: scale(1.05); }
.tile .badge {
  position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.tile .badge svg { width: 10px; height: 10px; margin-left: 2px; }
.picker-grid > .tile:nth-child(7n + 1) { grid-column: auto; grid-row: auto; }

.footer { text-align: center; padding: 40px 20px calc(120px + var(--safe-b)); color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 19px; }
.footer p { margin: 0; }

/* ---------- floating dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); z-index: 40;
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  transform: translate(-50%, 140%); transition: transform .7s var(--ease);
}
.dock.show { transform: translate(-50%, 0); }
.dock a {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 500; letter-spacing: .08em;
  transition: background .3s, color .3s;
}
.dock a.active { background: var(--ink); color: var(--paper); }
.dock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- celebration burst ---------- */
.burst { position: fixed; inset: 0; z-index: 90; pointer-events: none; width: 100vw; height: 100vh; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .petals { display: none; }
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(18,14,10,.96);
  display: flex; align-items: center; justify-content: center;
}
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 0 90px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 2; background: none; border: 0; color: #fff; font-size: 38px; line-height: 1; padding: 6px 12px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: none; border: 0; color: rgba(255,255,255,.75); font-size: 48px; padding: 20px 14px; cursor: pointer; }
.lb-prev { left: 0; } .lb-next { right: 0; }
.lb-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + var(--safe-b));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e9dcc6;
  font-family: var(--serif); font-style: italic; font-size: 17px;
}
.lb-actions { display: flex; gap: 8px; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 55; background: rgba(18,14,10,.5); display: flex; align-items: flex-end; }
.sheet-inner {
  width: 100%; max-height: 82svh; overflow: auto; background: var(--ivory);
  border-radius: 20px 20px 0 0; padding: 18px 14px calc(18px + var(--safe-b));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.sheet-head h3 { font-size: 26px; }
.sheet-close { background: none; border: 0; font-size: 32px; cursor: pointer; }
.picker-grid { margin-top: 12px; }

/* ---------- editor ---------- */
.editor {
  position: fixed; inset: 0; z-index: 60; background: #1d1915; color: #fff;
  display: flex; flex-direction: column;
}
.ed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
}
.ed-title { font-family: var(--serif); font-size: 22px; }
.ed-link { background: none; border: 0; color: #e9dcc6; font-size: 15px; letter-spacing: .06em; padding: 8px 6px; cursor: pointer; }
.ed-link.strong { color: #fff; font-weight: 500; }
.ed-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 12px; position: relative; }
.ed-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.ed-hint { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.55); margin: 0; pointer-events: none; }
.ed-tools { background: #26211c; padding: 10px 0 calc(12px + var(--safe-b)); }
.ed-tabs { display: flex; justify-content: center; gap: 26px; padding-bottom: 8px; }
.ed-tab { background: none; border: 0; color: rgba(255,255,255,.5); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; padding: 6px 0; cursor: pointer; border-bottom: 1px solid transparent; }
.ed-tab.active { color: #fff; border-bottom-color: var(--gold); }
.ed-tray { display: flex; gap: 10px; overflow-x: auto; padding: 4px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ed-tray::-webkit-scrollbar { display: none; }
.ed-item {
  flex: 0 0 auto; width: 74px; background: none; border: 0; padding: 0; cursor: pointer; color: rgba(255,255,255,.75);
  font-size: 11px; text-align: center;
}
.ed-item .sw { width: 74px; height: 74px; border-radius: 10px; background: #3a332c center/contain no-repeat; border: 2px solid transparent; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ed-item.active .sw { border-color: var(--gold); }
.ed-item img { width: 100%; height: 100%; object-fit: contain; }
.ed-selected { display: flex; justify-content: center; gap: 10px; padding: 10px 14px 0; }
.ed-selected button { min-width: 46px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: none; color: #fff; font-size: 18px; cursor: pointer; padding: 0 14px; }
.ed-selected .danger { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #f1b9ae; border-color: rgba(241,185,174,.4); }


.ed-done {
  position: absolute; inset: 0; z-index: 2; background: #1d1915;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.ed-done img { max-width: 78%; max-height: 52%; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.ed-done-title { font-family: var(--serif); font-style: italic; font-size: 24px; color: #f3e3c6; margin: 8px 0 0; text-align: center; }
.btn-light { background: var(--paper); color: var(--ink); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); text-align: center;
}
