/* Birthday Gift Page (§49) — two registers in one stylesheet.
   The BUILDER speaks the app's language (tokens.css: Pretendard, near-sharp,
   photo-paper white). The GIFT itself speaks /special's: cream paper, Caveat
   handwriting, Playfair display, watercolor art. They meet nowhere — a buyer
   edits in the app, she only ever sees the keepsake.

   Motion discipline: transform / opacity / filter ONLY. The signature entrance is
   the **veil** (§42e-bis) — rise + unblur — staggered with a --d custom property.
   prefers-reduced-motion collapses everything at the bottom of the gift block. */

/* ================================================================== */
/* The gift experience                                                 */
/* ================================================================== */

.bd-gift {
  --bd-cream: #FFF9F5;
  --bd-ink: #4a2b33;
  --bd-ink-soft: #8a6570;
  --bd-berry: #79203f;
  --bd-pink: #e77fa3;
  --bd-pink-soft: #f5b8cd;
  --bd-hand: "Caveat", cursive;
  --bd-serif: "Playfair Display", Georgia, serif;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bd-cream);
  color: var(--bd-ink);
  overflow-x: hidden;
}

/* The backdrop is its own fixed layer (iOS Safari ignores background-attachment:
   fixed) — wash art + two barely-there glows that give the cream some air. */
.bd-wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("/birthday/assets/wash.webp") center / cover no-repeat, var(--bd-cream);
}
.bd-wash::before,
.bd-wash::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}
.bd-wash::before { top: -22vmax; right: -18vmax; background: radial-gradient(closest-side, rgba(245, 184, 205, 0.5), transparent); }
.bd-wash::after { bottom: -26vmax; left: -20vmax; background: radial-gradient(closest-side, rgba(250, 224, 197, 0.55), transparent); }

.bd-hearts {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.bd-page { position: relative; z-index: 2; }

/* --- the veil: the one entrance everything shares ---------------------- */
.bd-gift .bd-veil {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(7px);
  transition: opacity 0.9s ease var(--d, 0s), transform 0.9s ease var(--d, 0s), filter 0.9s ease var(--d, 0s);
}
.bd-gift .is-in .bd-veil,
.bd-gift .is-in.bd-veil {
  opacity: 1;
  transform: none;
  filter: none;
}

/* --- opener --------------------------------------------------------- */
.bd-opener {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 24px;
  background: var(--bd-cream);
  transition: opacity 1s ease 0.15s, filter 1s ease 0.15s;
}
.bd-opener.is-open { opacity: 0; filter: blur(8px); pointer-events: none; }
.bd-opener-glow {
  position: absolute;
  width: min(560px, 96vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(245, 184, 205, 0.45), rgba(245, 184, 205, 0) 70%);
  animation: bd-glow 5s ease-in-out infinite;
}
@keyframes bd-glow {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.12); opacity: 1; }
}
.bd-opener-art {
  position: relative;
  width: min(320px, 62vw);
  filter: drop-shadow(0 18px 40px rgba(121, 32, 63, 0.14));
  animation: bd-float 4.5s ease-in-out infinite;
}
.bd-opener.is-open .bd-opener-art { animation: bd-open-zoom 1s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes bd-open-zoom {
  25% { transform: scale(0.94) rotate(-2deg); opacity: 1; }
  to { transform: scale(1.7) translateY(-36px) rotate(2deg); opacity: 0; }
}
@keyframes bd-float {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-12px) rotate(1.2deg); }
}
.bd-opener-btn {
  appearance: none;
  position: relative;
  border: 1.5px solid rgba(121, 32, 63, 0.35);
  background: rgba(255, 255, 255, 0.65);
  color: var(--bd-berry);
  font-family: var(--bd-serif);
  font-size: clamp(17px, 2.6vw, 21px);
  padding: 15px 30px;
  border-radius: 999px;
  cursor: pointer;
  animation: bd-pulse 2.2s ease-in-out infinite;
  backdrop-filter: blur(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.bd-opener-btn:hover { background: #fff; }
@keyframes bd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 127, 163, 0.45); }
  55% { box-shadow: 0 0 0 16px rgba(231, 127, 163, 0); }
}
.bd-opener-heart { display: inline-block; animation: bd-beat 1.4s ease-in-out infinite; }
@keyframes bd-beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.25); }
  24% { transform: scale(1); }
}
.bd-opener-hint {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  margin: 0;
  font-family: var(--bd-hand);
  font-size: 19px;
  color: var(--bd-ink-soft);
}

/* --- the lock (breaking the seal) -------------------------------------- */
.bd-lock {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(400px, 88vw);
  opacity: 0;
  transform: translateY(22px);
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.6s ease 0.35s, transform 0.6s ease 0.35s, filter 0.6s ease 0.35s;
}
/* the seal-breaking swap: button melts away, the secret rises in its place */
.bd-opener.is-unsealing .bd-opener-btn { opacity: 0; transform: translateY(-10px) scale(0.94); pointer-events: none; animation: none; }
.bd-opener.is-unsealing .bd-lock { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.bd-opener.is-unsealing .bd-opener-art { animation-duration: 7s; }
.bd-lock { top: calc(50% + min(160px, 31vw) + 10px); }
.bd-lock.is-shaking { animation: bd-shake 0.45s ease; }
@keyframes bd-shake {
  20% { transform: translateX(-9px); }
  45% { transform: translateX(7px); }
  70% { transform: translateX(-4px); }
  90% { transform: translateX(2px); }
}
.bd-lock.is-open { opacity: 0; transform: translateY(-8px); filter: blur(4px); pointer-events: none; transition-delay: 0s; }
.bd-lock-title {
  font-family: var(--bd-hand);
  font-size: clamp(20px, 3vw, 24px);
  color: var(--bd-ink);
  margin: 0;
  text-align: center;
}
.bd-lock-hint {
  font-family: var(--bd-hand);
  font-size: 18px;
  color: var(--bd-ink-soft);
  margin: -4px 0 0;
  text-align: center;
}
.bd-lock-row { display: flex; gap: 8px; width: 100%; }
.bd-lock-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(121, 32, 63, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  padding: 12px 18px;
  font-family: var(--bd-hand);
  font-size: 20px;
  color: var(--bd-ink);
  text-align: center;
  backdrop-filter: blur(4px);
}
.bd-lock-input:focus { outline: none; border-color: var(--bd-pink); }
.bd-lock-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #ec6a96, #d65b86);
  color: #fff;
  font-family: var(--bd-serif);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(214, 91, 134, 0.3);
  transition: transform 0.12s ease;
}
.bd-lock-btn:active { transform: scale(0.94); }
.bd-lock-msg {
  min-height: 22px;
  font-family: var(--bd-hand);
  font-size: 18px;
  color: var(--bd-berry);
  margin: 0;
}

/* --- hero ------------------------------------------------------------ */
.bd-hero {
  min-height: 92vh;
  min-height: 92dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12vh 22px 8vh;
  gap: 8px;
}
.bd-hero-artwrap { position: relative; }
.bd-hero-art {
  width: min(430px, 78vw);
  margin-bottom: 6px;
  mix-blend-mode: multiply; /* the watercolor's cream ground melts into the wash */
  animation: bd-breathe 7s ease-in-out infinite;
}
@keyframes bd-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}
.bd-twinkle {
  position: absolute;
  color: var(--bd-pink-soft);
  font-size: 18px;
  animation: bd-twinkle 3.2s ease-in-out infinite;
}
.bd-twinkle-a { top: 12%; left: 4%; }
.bd-twinkle-b { top: 30%; right: 2%; font-size: 13px; animation-delay: 1.4s; }
@keyframes bd-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  50% { opacity: 0.9; transform: scale(1) rotate(8deg); }
}
.bd-headline {
  font-family: var(--bd-serif);
  font-weight: 600;
  font-size: clamp(34px, 7.2vw, 62px);
  line-height: 1.12;
  color: var(--bd-berry);
  margin: 0;
  min-height: 1.2em;
}
.bd-caret {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  margin-left: 3px;
  background: var(--bd-pink);
  vertical-align: -0.1em;
  animation: bd-caret 0.85s steps(1) infinite;
}
@keyframes bd-caret { 50% { opacity: 0; } }
.bd-hero-sub {
  font-family: var(--bd-hand);
  font-size: clamp(21px, 3.4vw, 27px);
  color: var(--bd-ink-soft);
  margin: 6px 0 0;
}
.bd-scroll-cue {
  margin-top: 7vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--bd-hand);
  font-size: 18px;
  color: var(--bd-ink-soft);
  opacity: 0.85;
}
.bd-cue-arrow { animation: bd-cue 1.8s ease-in-out infinite; }
@keyframes bd-cue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}
/* hero children stagger once the envelope opens */
.bd-hero.is-in .bd-hero-artwrap { --d: 0.1s; }
.bd-hero.is-in .bd-hero-sub { --d: 1.7s; }
.bd-hero.is-in .bd-scroll-cue { --d: 2.5s; }

/* --- shared section chrome ------------------------------------------- */
.bd-section {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 9vh 22px;
}
.bd-eyebrow {
  font-family: var(--bd-hand);
  font-size: clamp(22px, 3.6vw, 28px);
  color: var(--bd-pink);
  text-align: center;
  margin: 0 0 26px;
}
.bd-eyebrow::after {
  content: "♥";
  display: block;
  font-size: 12px;
  color: var(--bd-pink-soft);
  margin-top: 2px;
}
.bd-corner-florals {
  position: absolute;
  bottom: -10px;
  left: -60px;
  width: 210px;
  opacity: 0.55;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.bd-corner-florals--right { left: auto; right: -60px; transform: scaleX(-1); }

/* --- letter ----------------------------------------------------------- */
.bd-letter-paper {
  position: relative;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(121, 32, 63, 0.10);
  border-radius: 6px;
  box-shadow: 0 14px 44px rgba(121, 32, 63, 0.08);
  padding: clamp(26px, 5vw, 46px);
  transform: rotate(-0.4deg);
}
.bd-gift .is-in .bd-letter-paper { transform: rotate(-0.4deg); } /* keep the paper's lean after the veil clears */
.bd-seal {
  position: absolute;
  top: -16px;
  right: 26px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #a03a5e, var(--bd-berry) 70%);
  color: rgba(255, 249, 245, 0.85);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(121, 32, 63, 0.3), inset 0 0 0 3px rgba(255, 249, 245, 0.18);
  transform: rotate(-8deg);
}
.bd-letter-p {
  font-family: var(--bd-hand);
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 500;
  line-height: 1.55;
  margin: 0 0 1.1em;
  color: var(--bd-ink);
}
.bd-letter-p:last-child { margin-bottom: 0; }

/* --- counter ------------------------------------------------------------ */
.bd-count-row {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 3vw, 26px);
}
.bd-count-cell { text-align: center; min-width: 64px; }
.bd-count-num {
  font-family: var(--bd-serif);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 56px);
  color: var(--bd-berry);
  font-variant-numeric: tabular-nums;
}
.bd-count-num.is-tick { animation: bd-tick 0.5s ease; }
@keyframes bd-tick {
  0% { transform: translateY(-4px); opacity: 0.4; }
  100% { transform: none; opacity: 1; }
}
.bd-count-label {
  font-family: var(--bd-hand);
  font-size: 18px;
  color: var(--bd-ink-soft);
}
.bd-count-sub {
  text-align: center;
  font-family: var(--bd-hand);
  font-size: clamp(19px, 2.8vw, 23px);
  color: var(--bd-ink-soft);
  margin: 22px 0 0;
}

/* --- gallery -------------------------------------------------------------- */
.bd-gallery { max-width: 1000px; }
.bd-gal-wrap { position: relative; }
.bd-gal-track {
  display: flex;
  gap: clamp(14px, 2.5vw, 26px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 26px 8px 34px;
  scrollbar-width: none;
}
.bd-gal-track::-webkit-scrollbar { display: none; }
.bd-polaroid {
  scroll-snap-align: center;
  flex: 0 0 auto;
  width: min(270px, 68vw);
  background: #fff;
  padding: 12px 12px 16px;
  margin: 0;
  border-radius: 3px;
  box-shadow: 0 12px 34px rgba(121, 32, 63, 0.13);
  position: relative;
  transition: transform 0.5s cubic-bezier(0.3, 0.9, 0.4, 1), box-shadow 0.5s ease;
}
/* the veil handles the entrance; after it clears, the tilt + focus states own transform */
.bd-gift .is-in .bd-polaroid { transform: rotate(var(--tilt, 0deg)); }
.bd-gift .is-in .bd-polaroid.is-center {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
  box-shadow: 0 20px 46px rgba(121, 32, 63, 0.18);
}
.bd-polaroid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #f6eee9;
}
.bd-polaroid figcaption {
  font-family: var(--bd-hand);
  font-size: 19px;
  text-align: center;
  color: var(--bd-ink);
  padding-top: 10px;
}
.bd-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 86px;
  height: 26px;
  transform: translateX(-50%) rotate(var(--tapetilt, -3deg));
  background: rgba(245, 184, 205, 0.6);
  box-shadow: 0 1px 4px rgba(121, 32, 63, 0.10);
}
.bd-gal-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(121, 32, 63, 0.18);
  background: rgba(255, 255, 255, 0.9);
  color: var(--bd-berry);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.bd-gal-btn:hover { transform: translateY(-50%) scale(1.08); }
.bd-gal-prev { left: -6px; }
.bd-gal-next { right: -6px; }
@media (hover: none) { .bd-gal-btn { display: none; } }

/* --- reasons ------------------------------------------------------------------ */
.bd-reason-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bd-reason {
  display: flex;
  align-items: baseline;
  gap: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(121, 32, 63, 0.08);
  border-radius: 6px;
  padding: 15px 18px;
  opacity: 0;
  transform: translateX(-18px) rotate(var(--lean, 0deg));
  filter: blur(5px);
}
.bd-gift .is-in .bd-reason {
  animation: bd-reason-in 0.75s cubic-bezier(0.3, 0.9, 0.4, 1) forwards;
  animation-delay: calc(var(--i) * 0.32s);
}
@keyframes bd-reason-in {
  60% { filter: none; }
  to { opacity: 1; transform: rotate(0deg); filter: none; }
}
.bd-reason-n {
  font-family: var(--bd-serif);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--bd-pink);
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(3px);
}
.bd-gift .is-in .bd-reason .bd-reason-n {
  animation: bd-chip-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  animation-delay: calc(var(--i) * 0.32s + 0.35s);
}
@keyframes bd-chip-pop {
  from { transform: translateY(3px) scale(0.3); }
  to { transform: translateY(3px) scale(1); }
}
.bd-reason-text {
  font-family: var(--bd-hand);
  font-size: clamp(20px, 2.8vw, 24px);
  line-height: 1.4;
}

/* --- closing ---------------------------------------------------------------------- */
.bd-closing {
  text-align: center;
  padding-bottom: 16vh;
}
.bd-closing-art {
  width: min(230px, 52vw);
  mix-blend-mode: multiply;
  animation: bd-float 6s ease-in-out infinite;
}
.bd-closing-msg {
  font-family: var(--bd-hand);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.45;
  margin: 18px auto 30px;
  max-width: 560px;
}
.bd-love-btn {
  appearance: none;
  border: 0;
  background: linear-gradient(120deg, #ec6a96, #d65b86);
  color: #fff;
  font-family: var(--bd-serif);
  font-weight: 600;
  font-size: clamp(18px, 2.8vw, 22px);
  padding: 16px 38px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(214, 91, 134, 0.35);
  animation: bd-heartbeat 2.6s ease-in-out infinite;
}
@keyframes bd-heartbeat {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 30px rgba(214, 91, 134, 0.35); }
  10% { transform: scale(1.045); }
  20% { transform: scale(1); }
  28% { transform: scale(1.03); box-shadow: 0 14px 36px rgba(214, 91, 134, 0.45); }
  40% { transform: scale(1); }
}
.bd-love-btn.is-pop { animation: bd-love-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bd-love-pop {
  30% { transform: scale(0.9); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.bd-signature {
  font-family: var(--bd-hand);
  font-size: 24px;
  color: var(--bd-ink-soft);
  margin: 26px 0 0;
  min-height: 1.3em;
}

/* --- music pill --------------------------------------------------------------------- */
.bd-music {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(121, 32, 63, 0.2);
  background: rgba(255, 255, 255, 0.88);
  color: var(--bd-berry);
  font-family: var(--bd-hand);
  font-size: 17px;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 22px rgba(121, 32, 63, 0.12);
  transition: transform 0.15s ease;
}
.bd-music:active { transform: scale(0.95); }
.bd-music-icon { font-size: 15px; }
.bd-music.is-playing .bd-music-icon { animation: bd-spin-note 1.6s ease-in-out infinite; }
@keyframes bd-spin-note {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
}

/* --- preview chrome ------------------------------------------------------------------- */
.bd-preview-bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(23, 24, 28, 0.82);
  color: #fff;
  font: 600 13px var(--font-display, sans-serif);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  backdrop-filter: blur(5px);
}
.bd-preview-close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: 600 13px var(--font-display, sans-serif);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.bd-preview-close:hover { background: rgba(255, 255, 255, 0.3); }

@media (prefers-reduced-motion: reduce) {
  .bd-gift *, .bd-gift *::before, .bd-gift *::after { animation: none !important; }
  .bd-gift .bd-veil { transition: none; opacity: 1; transform: none; filter: none; }
  .bd-gift .is-in .bd-reason { animation: none !important; opacity: 1; transform: none; filter: none; }
  .bd-gift .is-in .bd-reason .bd-reason-n { animation: none !important; }
  .bd-opener { transition: opacity 0.2s ease; }
  .bd-lock { transition: none; }
}

/* ================================================================== */
/* The builder                                                         */
/* ================================================================== */

.bdb {
  min-height: 100vh;
  background: var(--paper);
}
.bdb-shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 var(--s2) var(--s5);
}
.bdb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) 0;
}
.bdb-top-right { display: flex; align-items: center; gap: 14px; }
.bdb-back {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}
.bdb-back:hover { color: var(--ink); }
/* the quiet autosave chip — flashes "saved ♥" so nobody hunts for a save button */
.bdb-saved {
  font-size: 12px;
  font-weight: 700;
  color: #1f9d63;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.bdb-saved.is-on { opacity: 1; }
.bdb-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--s4);
  align-items: center;
  padding: var(--s3) 0 var(--s4);
}
@media (max-width: 760px) { .bdb-hero { grid-template-columns: 1fr; } }
.bdb-hero h1 {
  font-size: clamp(26px, 4.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.12;
}
.bdb-hero p { color: var(--ink-soft); font-size: 15px; line-height: 1.55; margin: 0; }
.bdb-hero-art {
  width: 100%;
  max-width: 330px;
  justify-self: center;
  border-radius: var(--r-card);
}
.bdb-badges { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.bdb-badge {
  font-size: 12px;
  font-weight: 700;
  color: #a94a6b;
  background: var(--pink-tint);
  padding: 5px 11px;
  border-radius: 999px;
}

.bdb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  align-items: start;
}
@media (max-width: 860px) { .bdb-grid { grid-template-columns: 1fr; } }

.bdb-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s3);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.bdb-card:focus-within { box-shadow: var(--shadow-soft); }
.bdb-card h2 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bdb-card h2 .bdb-step {
  font-size: 11px;
  font-weight: 800;
  color: #a94a6b;
  background: var(--pink-tint);
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bdb-card .bdb-hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.5; }

.bdb-field { margin-bottom: 14px; }
.bdb-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.bdb-field input[type="text"],
.bdb-field input[type="date"],
.bdb-field input[type="url"],
.bdb-field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--paper);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.bdb-field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.bdb-field input:focus, .bdb-field textarea:focus { outline: none; border-color: var(--pink); }
.bdb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .bdb-row2 { grid-template-columns: 1fr; } }

/* photos */
.bdb-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .bdb-photos { grid-template-columns: repeat(2, 1fr); } }
.bdb-photo {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  overflow: hidden;
  background: var(--paper);
  animation: bdb-photo-in 0.35s ease;
}
@keyframes bdb-photo-in {
  from { opacity: 0; transform: scale(0.94); }
}
.bdb-photo img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.bdb-photo input {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 7px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--paper-raised);
}
.bdb-photo input:focus { outline: none; }
.bdb-photo-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 24, 28, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.bdb-photo-add {
  aspect-ratio: 1 / 1.28;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-ctrl);
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.bdb-photo-add:hover { border-color: var(--pink); color: var(--ink); }
.bdb-photo-add:disabled { opacity: 0.6; cursor: default; }
.bdb-photo-add span:first-child { font-size: 22px; }

/* reasons */
.bdb-reasons { display: flex; flex-direction: column; gap: 8px; }
.bdb-reason-row { display: flex; gap: 8px; align-items: center; }
.bdb-reason-row .bdb-reason-n {
  font-size: 12px;
  font-weight: 800;
  color: #a94a6b;
  min-width: 20px;
  text-align: right;
}
.bdb-reason-row input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--paper);
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}
.bdb-reason-row input:focus { outline: none; border-color: var(--pink); }
.bdb-reason-row button {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}
.bdb-add-btn {
  align-self: flex-start;
  border: 1.5px dashed var(--line);
  background: none;
  border-radius: var(--r-ctrl);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  margin-top: 4px;
}
.bdb-add-btn:hover { border-color: var(--pink); color: var(--ink); }

/* sticky action bar */
.bdb-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 14px 0 max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--paper) 38%);
  margin-top: var(--s3);
}
.bdb-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 26px;
  cursor: pointer;
  transition: filter 0.15s;
  position: relative;
}
.bdb-btn:disabled { opacity: 0.55; cursor: default; }
.bdb-btn-preview { background: var(--ink); color: #fff; }
.bdb-btn-preview:hover:not(:disabled) { filter: brightness(1.2); }
.bdb-btn-share { background: linear-gradient(120deg, #ec6a96, #d65b86); color: #fff; }
.bdb-btn-share:hover:not(:disabled) { filter: brightness(1.06); }
/* busy state: a small spinning heart-dot next to the label */
.bdb-btn.is-busy { pointer-events: none; opacity: 0.85; }
.bdb-btn.is-busy::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  vertical-align: -2px;
  animation: bdb-spin 0.7s linear infinite;
}
@keyframes bdb-spin { to { transform: rotate(360deg); } }

/* the fullscreen preview overlay hosts a .bd-gift */
.bdb-preview-host {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: #FFF9F5;
}

/* toast */
.bdb-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  animation: bdb-toast 0.25s ease;
}
@keyframes bdb-toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ================================================================== */
/* Share / publish panel                                               */
/* ================================================================== */

.bds-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 24, 28, 0.5);
  backdrop-filter: blur(3px);
  animation: bds-fade 0.2s ease;
}
@keyframes bds-fade { from { opacity: 0; } }
.bds-card {
  width: min(520px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(23, 24, 28, 0.28);
  padding: 26px 24px;
  position: relative;
  text-align: center;
  animation: bds-rise 0.3s cubic-bezier(0.3, 1.1, 0.4, 1);
}
@keyframes bds-rise { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.bds-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #f1f2f5;
  color: #4a4d57;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.bds-title { font-size: 21px; font-weight: 800; margin: 0 0 6px; }
.bds-sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.5; }
.bds-qr {
  width: min(320px, 74vw);
  height: auto;
  margin: 0 auto 14px;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.bds-link-row { display: flex; gap: 8px; margin-bottom: 14px; }
.bds-link-row input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-ctrl);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--paper);
}
.bds-btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
}
.bds-btn:hover { filter: brightness(1.2); }
.bds-btn-soft { background: #f1f2f5; color: var(--ink); }
.bds-btn-soft:hover { filter: none; background: #e7e8ec; }
.bds-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.bds-style-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.bds-style-toggle button {
  appearance: none;
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 7px 14px;
  cursor: pointer;
}
.bds-style-toggle button.is-on { background: var(--pink-tint); color: #a94a6b; }
.bds-note { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.5; }
