
:root {
  --bg: #f7f3ed;
  --surface: #fffdf9;
  --ink: #1e1c19;
  --muted: #777169;
  --line: #ded7ce;
  --accent: #1f2b26;
  --accent-soft: #e7ece8;
  --ivory: #eee4d4;
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 3px solid rgba(42, 69, 57, .55); outline-offset: 3px; }
button:disabled, a[aria-disabled="true"] { cursor: not-allowed; }

.network-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px max(16px, env(safe-area-inset-left));
  background: #3d3327;
  color: #fff8ed;
  font-size: 13px;
  text-align: center;
}

.fatal-error-page, .not-found-page {
  min-height: 100svh;
  padding: max(36px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  text-align: center;
}
.fatal-error-card { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 36px; }
.fatal-error-card h1, .not-found-page h1 { font-family: "Playfair Display", serif; font-weight: 500; font-size: clamp(38px, 7vw, 58px); margin: 22px 0 10px; }
.fatal-error-card p, .not-found-page p { color: var(--muted); line-height: 1.65; }
.fatal-error-actions, .not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.fatal-error-card small { display: block; margin-top: 28px; color: var(--muted); }
.not-found-code { font-family: "Playfair Display", serif; font-size: clamp(82px, 18vw, 160px); line-height: .8; color: #c8bba8; }

.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #a44236; box-shadow: 0 0 0 3px rgba(164,66,54,.08); }
.field-error { color: #9c392e; font-size: 11px; line-height: 1.4; }
.required-mark { color: #9c392e; font-weight: 700; }
.editor-validation { margin: 18px 30px 0; padding: 16px 18px; border-radius: 14px; border: 1px solid #e0b4ad; background: #fff6f4; color: #6f2d25; }
.editor-validation strong { display: block; margin-bottom: 4px; }
.editor-validation p { margin: 0 0 8px; font-size: 13px; }
.editor-validation ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.55; }
.invite-phone-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px 0 22px;
  background: rgba(255,253,249,.82);
  border: 1px solid rgba(30,28,25,.08);
  border-radius: 22px;
  position: sticky;
  top: 12px;
  z-index: 50;
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(49,43,36,.06);
}
.brand {
  font-weight: 800;
  letter-spacing: .12em;
  font-size: 15px;
}
.brand span { font-weight: 500; }
.desktop-nav { display: flex; gap: 30px; font-size: 14px; }
.desktop-nav a:hover { opacity: .55; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  background: #fff;
}
.user-pill img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: inherit;
}
.icon-button:hover { background: rgba(0,0,0,.05); }

.primary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: default; transform: none; }
.ghost-button { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.ghost-button:hover { background: rgba(255,255,255,.55); }
.primary-button.big, .ghost-button.big { padding: 15px 22px; }
.compact { padding: 11px 16px; }
.full { width: 100%; }
.menu-button { display: none; border: 0; background: transparent; }
.mobile-menu { display: none; }

/* Stage 8: interface language switcher */
.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.language-switcher button {
  border: 0;
  background: transparent;
  color: #91897f;
  padding: 2px 3px;
  cursor: pointer;
}
.language-switcher button.active { color: var(--ink); }
.language-switcher > span { color: #c5beb5; }
.hero-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 670px;
  margin: 26px auto 0;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 18%, rgba(201,185,158,.36), transparent 34%),
    linear-gradient(135deg, #f8f1e7 0%, #ebe3d8 100%);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  padding: 60px 68px;
  position: relative;
}
.hero-shell:after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(80,65,45,.11);
  border-radius: 26px;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; max-width: 570px; }
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 700;
  color: #85796a;
  margin-bottom: 14px;
}
.hero-copy h1, .page-head h1, .section-heading h2, .closing-cta h2, .published-page h1 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  letter-spacing: -.035em;
}
.hero-copy h1 {
  font-size: clamp(48px, 5.2vw, 76px);
  line-height: .97;
  margin: 0 0 26px;
}
.hero-copy p {
  font-size: 18px;
  line-height: 1.65;
  color: #655f58;
  max-width: 540px;
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.free-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; color: #6f675e; }

.hero-visual { height: 560px; position: relative; display: grid; place-items: center; }
.phone {
  width: 282px;
  height: 570px;
  border: 9px solid #1e1d1b;
  border-radius: 48px;
  padding: 6px;
  background: #1e1d1b;
  box-shadow: 0 32px 70px rgba(47,40,32,.22);
  transform: rotate(2deg);
}
.phone-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: #f6eee2;
}
.mini-invite {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 40% 25%, rgba(255,255,255,.8), transparent 28%),
    linear-gradient(180deg,#f3eadc,#e7d9c4);
  position: relative;
  color: #352d25;
}
.mini-invite > span { letter-spacing: .26em; font-size: 9px; margin-bottom: 26px; }
.mini-invite h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 39px;
  text-align: center;
  font-weight: 500;
  line-height: 1.05;
}
.mini-invite h3 i { display: block; font-weight: 400; font-size: 22px; padding: 8px; }
.mini-line { width: 42px; height: 1px; background: #8b7b67; margin: 26px 0 18px; }
.mini-invite strong { font-size: 12px; letter-spacing: .15em; }
.mini-invite small { margin-top: 10px; color: #806f5b; }
.mini-arrow { position: absolute; bottom: 34px; animation: bounce 1.8s infinite; }
.mini-flower { position: absolute; opacity: .32; font-size: 30px; }
.mini-flower.one { top: 66px; left: 35px; }
.mini-flower.two { right: 30px; bottom: 90px; font-size: 18px; }

.floating-card {
  position: absolute;
  background: rgba(255,255,255,.87);
  border: 1px solid rgba(30,28,25,.08);
  box-shadow: 0 15px 35px rgba(49,43,36,.11);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 3;
}
.fc-one { right: 0; top: 115px; }
.fc-two { left: 15px; top: 255px; }
.fc-three { right: 20px; bottom: 72px; }

.categories-strip {
  width: min(1080px, calc(100% - 40px));
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #93897d;
  font-size: 13px;
  overflow-x: auto;
  padding: 16px 2px 4px;
}
.section {
  width: min(1080px, calc(100% - 40px));
  margin: 120px auto;
}
.section-heading { max-width: 650px; margin-bottom: 38px; }
.section-heading h2, .closing-cta h2 { font-size: clamp(36px, 4vw, 54px); line-height: 1.05; margin: 0; }
.row-heading { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-card {
  min-height: 245px;
  padding: 30px;
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid rgba(40,35,29,.06);
}
.step-card > span { font-family: "Playfair Display", serif; font-size: 28px; color: #b0a18d; }
.step-card h3 { margin: 58px 0 8px; font-size: 20px; }
.step-card p { color: var(--muted); line-height: 1.55; margin: 0; }

.template-card {
  background: var(--surface);
  border: 1px solid rgba(40,35,29,.07);
  border-radius: 28px;
  padding: 16px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 30px;
}
.template-preview {
  min-height: 500px;
  background: #efe5d6;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.preview-ivory { text-align: center; color: #493f35; }
.preview-ivory small { letter-spacing: .25em; }
.preview-ivory h3 { font-family: "Playfair Display", serif; font-size: 46px; font-weight: 500; margin: 34px 0 16px; }
.preview-ivory h3 em { display: block; font-size: 26px; }
.preview-ivory p { letter-spacing: .16em; }
.template-meta { padding: 38px 28px 28px 0; display: flex; flex-direction: column; justify-content: space-between; }
.tag { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: #eeece7; color: #746c62; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.template-meta h3 { font-family: "Playfair Display", serif; font-size: 36px; font-weight: 500; margin: 16px 0 12px; }
.template-meta p { color: var(--muted); line-height: 1.6; }
.template-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.closing-cta {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 60px;
  min-height: 470px;
  border-radius: 34px;
  background: #1f2b26;
  color: white;
  text-align: center;
  padding: 70px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.closing-cta > span { letter-spacing: .22em; font-size: 12px; opacity: .62; margin-bottom: 20px; }
.closing-cta h2 { max-width: 650px; margin-bottom: 28px; }
.closing-cta .primary-button { background: #f3ecdf; color: #1f2b26; }

.footer {
  width: min(1080px, calc(100% - 40px));
  margin: 70px auto 30px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  font-size: 13px;
  color: #7c756d;
}
.footer p { text-align: center; }
.footer > span { text-align: right; }

.page-shell { width: min(1080px, calc(100% - 40px)); margin: 90px auto 120px; min-height: 55vh; }
.page-head { max-width: 700px; margin-bottom: 36px; }
.page-head h1 { font-size: clamp(44px, 5vw, 68px); line-height: 1; margin: 0 0 18px; }
.page-head p { color: var(--muted); line-height: 1.6; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 24px; padding-bottom: 4px; }
.filter {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  padding: 10px 15px;
  border-radius: 999px;
}
.filter.active { background: var(--ink); color: white; border-color: var(--ink); }
.coming-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.coming-card { padding: 14px; background: rgba(255,255,255,.4); border: 1px dashed #cfc7bc; border-radius: 22px; }
.coming-art { height: 210px; display: grid; place-items: center; background: #ede8e1; border-radius: 15px; color: #9b9287; }
.coming-card > span { display: inline-block; margin-top: 16px; color: #9a8e7e; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.coming-card h3 { margin: 6px 0 10px; }


/* Stage 7: multi-template catalog */
.template-catalog-grid {
  display: grid;
  gap: 22px;
}
.template-catalog-grid .template-card:nth-child(even) .template-preview { order: 2; }
.template-catalog-grid .template-card:nth-child(even) .template-meta { padding: 38px 0 28px 28px; }
.preview-miras {
  width: 100%;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #4f4032;
  background:
    radial-gradient(circle at 50% 24%, rgba(255,255,255,.78), transparent 27%),
    linear-gradient(155deg, #f3eadc, #d9c6aa);
  position: relative;
}
.preview-miras:before,
.preview-miras:after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(153,115,62,.28);
  transform: rotate(45deg);
}
.preview-miras:before { left: -86px; top: 64px; }
.preview-miras:after { right: -86px; bottom: 64px; }
.preview-miras small { letter-spacing: .27em; font-size: 10px; }
.preview-miras h3 {
  font-family: "Playfair Display", serif;
  font-size: 64px;
  font-weight: 500;
  line-height: .95;
  margin: 38px 0 24px;
}
.preview-miras p { letter-spacing: .16em; font-size: 12px; }
.compact-empty { min-height: 220px; margin-top: 20px; }
.editor-page { min-height: 100vh; background: #ece8e2; }
.editor-topbar {
  min-height: 72px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid #ddd8d1;
}
.editor-topbar > div { display: flex; align-items: center; gap: 18px; }
.small-brand { font-size: 13px; }
.save-state { color: #8b847c; font-size: 12px; }
.editor-top-actions { display: flex; gap: 8px; }
.setup-banner {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 12px 16px;
  background: #fff5d7;
  border: 1px solid #ead79b;
  border-radius: 12px;
  font-size: 13px;
  color: #64552d;
}
.editor-tabs { display: none; }
.editor-layout {
  max-width: 1180px;
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 620px) 1fr;
  gap: 18px;
  align-items: start;
  padding: 0 0 80px;
}
.editor-panel {
  background: #fff;
  border-radius: 22px;
  border: 1px solid #ddd8d1;
  overflow: hidden;
}
.editor-intro { padding: 30px 30px 24px; border-bottom: 1px solid #eeeae5; }
.editor-intro h1 { font-family: "Playfair Display", serif; font-size: 40px; font-weight: 500; margin: 13px 0 6px; }
.editor-intro p { margin: 0; color: var(--muted); }
.field-group { padding: 26px 30px; border-bottom: 1px solid #eeeae5; }
.field-group:last-child { border-bottom: 0; }
.field-group h2 { margin: 0 0 18px; font-size: 16px; }
.field-stack { display: grid; gap: 14px; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12px; font-weight: 600; color: #6b645d; }
.field input, .field textarea, .field select,
.program-edit-row input {
  width: 100%;
  border: 1px solid #d9d3cb;
  background: #fcfbf9;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 13px;
  outline: 0;
}
.field input:focus, .field textarea:focus, .field select:focus,
.program-edit-row input:focus { border-color: #8f877c; box-shadow: 0 0 0 3px rgba(143,135,124,.1); }
.field textarea { resize: vertical; min-height: 130px; }
.upload-zone {
  width: 100%;
  min-height: 210px;
  border: 1px dashed #cfc7bc;
  border-radius: 16px;
  background: #faf8f5;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: #7d756c;
  overflow: hidden;
  padding: 0;
}
.upload-zone strong { color: #312e2a; }
.upload-zone span { font-size: 12px; }
.upload-zone img { width: 100%; height: 260px; object-fit: cover; }
.upload-row {
  border: 1px solid #d9d3cb;
  background: #fcfbf9;
  border-radius: 14px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.upload-row div { display: flex; align-items: center; gap: 10px; }
.program-edit-row { display: grid; grid-template-columns: 105px 1fr 34px; gap: 8px; align-items: center; }
.text-add { justify-self: start; border: 0; background: transparent; color: #3f5148; font-weight: 700; padding: 6px 0; }
.live-preview-wrap {
  position: sticky;
  top: 90px;
  display: grid;
  justify-items: center;
}
.preview-label { font-size: 11px; color: #817970; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px; }
.preview-phone {
  width: 390px;
  height: 720px;
  background: #171716;
  border: 8px solid #171716;
  border-radius: 44px;
  box-shadow: 0 22px 60px rgba(47,43,38,.17);
  overflow: hidden;
}
.preview-scroll { height: 100%; overflow-y: auto; border-radius: 34px; background: #f6efe5; scrollbar-width: none; }
.preview-scroll::-webkit-scrollbar { display: none; }


/* Stage 2: section manager */
.section-manager {
  padding: 26px 30px 30px;
  border-bottom: 1px solid #eeeae5;
  background: linear-gradient(180deg, #fff, #fcfaf7);
}
.section-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-manager-head h2 {
  margin: 12px 0 5px;
  font-size: 19px;
}
.section-manager-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 470px;
}
.section-manager-head > svg { color: #8d857b; margin-top: 4px; }
.section-manager-list { display: grid; gap: 8px; }
.section-control {
  border: 1px solid #e1dcd5;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}
.section-control.disabled { background: #f7f5f2; opacity: .72; }
.section-control-main {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.section-visibility {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef2ef;
  color: #334a3f;
}
.section-control.disabled .section-visibility { background: #ece8e3; color: #9b9389; }
.section-control-copy { min-width: 0; display: grid; gap: 3px; }
.section-control-copy strong { font-size: 13px; }
.section-control-copy span { font-size: 11px; color: #8c847b; }
.section-order-actions { display: flex; align-items: center; }
.section-order-actions .icon-button:disabled { opacity: .25; cursor: default; }
.section-settings {
  border-top: 1px solid #eeeae5;
  padding: 14px 14px 16px 58px;
  background: #fbfaf8;
}
.section-settings > p {
  margin: 0 0 12px;
  color: #817970;
  font-size: 12px;
  line-height: 1.45;
}
.section-settings-grid { display: grid; gap: 10px; }
.section-settings .field input {
  background: #fff;
}

@media (max-width: 560px) {
  .section-manager { padding: 22px 18px 24px; }
  .section-control-main { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 7px 7px; }
  .section-order-actions .icon-button { width: 30px; height: 30px; }
  .section-settings { padding: 13px 12px 15px; }
}

/* Stage 4: image optimization and hero framing */
.hero-media-editor { display: grid; gap: 14px; }
.hero-upload-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 430px;
  border: 1px dashed #cfc7bc;
  border-radius: 18px;
  background: #f4efe8;
  color: #746d65;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.hero-upload-preview:disabled { cursor: progress; opacity: .72; }
.hero-upload-preview > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s ease, object-position .2s ease;
  transform-origin: center;
}
.hero-empty-photo {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.hero-empty-photo strong { color: #302d29; }
.hero-empty-photo small { font-size: 12px; opacity: .7; }
.hero-change-photo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(28,27,25,.82);
  color: white;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.media-result-note {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef3ef;
  color: #526158;
  font-size: 11px;
}
.media-result-note strong {
  color: #274235;
  letter-spacing: .08em;
}
.media-result-note small { color: #778078; }
.hero-position-controls {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid #e1dcd5;
  border-radius: 15px;
  background: #fbfaf8;
}
.position-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.position-head > div { display: grid; gap: 3px; }
.position-head strong { font-size: 13px; }
.position-head span { font-size: 11px; color: #877f76; line-height: 1.45; }
.range-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; }
.range-field > span { font-size: 11px; color: #6f675f; }
.range-field input[type="range"] { width: 100%; accent-color: #35453d; }
.media-status {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f1eee9;
  color: #706960;
  font-size: 11px;
  line-height: 1.45;
}
.media-help-text {
  margin: 10px 0 0;
  color: #8c847a;
  font-size: 11px;
  line-height: 1.5;
}

/* Stage 5: music editor */
.music-editor { display: grid; gap: 12px; }
.music-empty {
  width: 100%;
  min-height: 150px;
  border: 1px dashed #cfc7bc;
  border-radius: 16px;
  background: #faf8f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #787068;
  padding: 22px;
}
.music-empty:disabled { cursor: progress; opacity: .72; }
.music-empty strong { color: #302d29; }
.music-empty > span:last-child { font-size: 11px; }
.music-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8ede9;
  color: #33483e;
  margin-bottom: 3px;
}
.music-card {
  border: 1px solid #ddd7cf;
  border-radius: 17px;
  background: #fbfaf8;
  padding: 16px;
  display: grid;
  gap: 15px;
}
.music-card-top {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.music-play-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: #2f4037;
  color: #fff;
}
.music-track-copy { min-width: 0; display: grid; gap: 4px; }
.music-track-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.music-track-copy span { color: #827a71; font-size: 11px; }
.music-progress-row {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 9px;
  align-items: center;
  font-size: 10px;
  color: #8b8379;
}
.music-progress-row input[type="range"],
.music-volume-row input[type="range"] {
  width: 100%;
  accent-color: #35453d;
}
.music-volume-row {
  display: grid;
  grid-template-columns: 20px 145px 1fr;
  gap: 9px;
  align-items: center;
  font-size: 11px;
  color: #665f57;
}
.music-loop-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 11px;
  line-height: 1.45;
  color: #6d655d;
}
.music-loop-row input { margin-top: 2px; accent-color: #35453d; }
.music-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-button {
  border: 1px solid #e3c9c6;
  border-radius: 999px;
  background: #fff8f7;
  color: #8c4740;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
}
.music-library {
  padding: 14px;
  border: 1px solid #e1dcd5;
  border-radius: 15px;
  background: #fff;
}
.music-library-head { display: grid; gap: 3px; margin-bottom: 10px; }
.music-library-head strong { font-size: 13px; }
.music-library-head span { color: #827a71; font-size: 11px; }
.music-library-list { display: grid; gap: 7px; }
.music-library-list button {
  border: 1px solid #e2ddd6;
  border-radius: 12px;
  background: #fbfaf8;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}

@media (max-width: 560px) {
  .music-volume-row { grid-template-columns: 20px 1fr; }
  .music-volume-row input[type="range"] { grid-column: 1 / -1; }
  .music-actions > * { flex: 1; }
}

/* Stage 7: event-specific models */
.event-model-summary {
  border: 1px solid #ded7ce;
  background: linear-gradient(135deg, #faf8f4, #f4efe7);
  border-radius: 14px;
  padding: 14px 15px;
  display: grid;
  gap: 4px;
}
.event-model-summary > span {
  color: #7d7469;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.event-model-summary strong { font-size: 17px; }
.event-model-summary small { color: #8a8178; font-size: 11px; }
.field-grid.one { grid-template-columns: 1fr; }
.invite-template-label { display: block; margin-top: 4px; color: #968b7f; font-size: 11px; }

/* Stage 8: invite language is independent from UI language */
.invite-language-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid #d9d3cb;
  border-radius: 14px;
  background: #fcfbf9;
}
.invite-language-card > div:first-child { display: grid; gap: 4px; }
.invite-language-card > div:first-child > span { font-size: 12px; font-weight: 700; color: #5f5952; }
.invite-language-card small { color: #918980; line-height: 1.35; }
.invite-language-options {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: #eeeae4;
  flex: 0 0 auto;
}
.invite-language-options button {
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  background: transparent;
  color: #827a71;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
}
.invite-language-options button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(45,40,34,.08);
}
.invite {
  background: #f4ecdf;
  min-height: 100vh;
  color: #342f2a;
  font-family: "Manrope", sans-serif;
}
.invite-embedded { min-height: auto; }
.invite-body { opacity: 0; transform: translateY(8px); transition: .7s ease; }
.invite-body.shown { opacity: 1; transform: none; }
.invite-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.82), transparent 27%),
    linear-gradient(160deg,#efe4d3,#d9c9b1);
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.gate-mark { position: absolute; top: 28px; font-size: 11px; letter-spacing: .22em; opacity: .55; }
.gate-card { text-align: center; }
.gate-card > span { letter-spacing: .25em; font-size: 10px; text-transform: uppercase; }
.gate-card h1 { font-family: "Playfair Display", serif; font-size: clamp(48px, 10vw, 80px); font-weight: 500; line-height: .95; margin: 28px 0 38px; }
.gate-card h1 em { display: block; font-size: .45em; margin: 10px; }
.gate-card button {
  border: 0;
  border-radius: 999px;
  background: #2e3a34;
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 auto 10px;
}
.gate-card small { opacity: .6; }
.invite-hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 22%, rgba(255,255,255,.9), transparent 28%),
    linear-gradient(180deg,#f2e8da,#dfceb7);
  background-size: cover;
  background-position: center;
}
.invite-hero:after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(73,63,52,.25);
}
.invite-hero-inner { position: relative; z-index: 2; padding: 34px; animation: rise .9s ease both; }
.invite-hero-inner > span, .invite-kicker { font-size: 9px; letter-spacing: .23em; font-weight: 700; }
.invite-hero-inner h1 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(48px, 14vw, 78px);
  line-height: .96;
  margin: 30px 0 0;
  text-shadow: 0 2px 20px rgba(0,0,0,.06);
}
.invite-hero-inner h1 em { display: block; font-size: .45em; margin: 9px; }
.hairline { width: 44px; height: 1px; background: currentColor; opacity: .62; margin: 28px auto 20px; }
.invite-hero-inner strong { display: block; letter-spacing: .16em; font-size: 12px; }
.invite-hero-inner small { display: block; margin-top: 10px; }
.bounce { margin-top: 45px; animation: bounce 1.7s infinite; }
.ornament { position: absolute; opacity: .28; z-index: 1; font-size: 42px; }
.ornament-a { top: 12%; left: 10%; }
.ornament-b { right: 11%; bottom: 13%; font-size: 24px; }

.invite-section {
  min-height: 66vh;
  padding: 80px max(28px, 8vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid rgba(78,65,50,.12);
}
.invite-section h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 500;
  line-height: 1.08;
  margin: 20px 0;
}
.invite-section p { max-width: 620px; line-height: 1.85; color: #6f655b; font-size: 14px; }
.intro-section { background: #f8f2e9; }
.date-section { background: #efe3d2; }
.date-section > svg, .venue-section > svg { margin-bottom: 20px; }
.timer-section { min-height: 54vh; background: #28342f; color: #f6efe3; }
.countdown { width: min(520px, 100%); display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 28px; }
.countdown div { padding: 16px 6px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; }
.countdown strong { display: block; font-family: "Playfair Display", serif; font-size: 31px; font-weight: 500; }
.countdown span { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; opacity: .7; }
.event-day-message { font-family: "Playfair Display", serif; font-size: 38px; margin-top: 24px; }
.hosts-section { min-height: 44vh; }
.venue-section { background: #f8f2e9; }
.map-button {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 999px;
  background: #2e3a34;
  color: white;
  font-size: 13px;
}
.program-section { background: #efe3d2; }
.program-list { width: min(560px, 100%); margin-top: 25px; }
.program-row { display: grid; grid-template-columns: 64px 1fr 1.8fr; align-items: center; gap: 14px; text-align: left; padding: 13px 0; }
.program-row strong { font-size: 13px; }
.program-row > span { height: 1px; background: rgba(60,50,40,.26); }
.program-row p { margin: 0; font-size: 13px; }
.dress-section { background: #f8f2e9; }
.swatches { display: flex; gap: 9px; margin-top: 20px; }
.swatches i { width: 34px; height: 34px; border-radius: 50%; background: #d9c6ad; }
.swatches i:nth-child(2) { background: #b9aa98; }
.swatches i:nth-child(3) { background: #7d8376; }
.swatches i:nth-child(4) { background: #4f6257; }
.swatches i:nth-child(5) { background: #28342f; }
.contact-section { min-height: 44vh; }
.final-section { min-height: 75vh; background: #2a352f; color: #f5eee2; }
.final-section h2 { max-width: 620px; }
.final-section p { color: #d8d0c3; }
.final-section small { margin-top: 60px; opacity: .5; letter-spacing: .12em; }
.final-symbol { font-size: 28px; opacity: .45; }
.audio-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(35,44,40,.9);
  color: white;
  display: grid;
  place-items: center;
  z-index: 90;
  box-shadow: 0 9px 25px rgba(0,0,0,.18);
}
.audio-fab.playing { animation: pulse 1.8s infinite; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(42,53,47,.22); } 50% { box-shadow: 0 0 0 10px rgba(42,53,47,0); } }

/* Stage 2: ordered invitation slots are layout-neutral. */
.invite-section-slot:empty { display: none; }

/* Stage 4: hero image uses non-destructive framing settings. */
.invite-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.invite-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  will-change: transform;
}
.invite-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(29,24,19,.08), rgba(29,24,19,.46));
}
.invite-hero.has-photo { color: #fffaf1; }
.invite-hero.has-photo:after { border-color: rgba(255,248,238,.45); z-index: 3; }
.invite-hero.has-photo .ornament { z-index: 2; }
.invite-hero.has-photo .invite-hero-inner { z-index: 4; }

/* Stage 5: shared invitation music control */
.audio-fab {
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.audio-fab:hover { transform: translateY(-1px); }
.audio-fab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* =========================================================
   Stage 6 — Wedding Ivory visual polish
   ========================================================= */
.invite {
  --ivory-paper: #f8f2e8;
  --ivory-warm: #eee2d1;
  --ivory-ink: #342f2a;
  --ivory-muted: #766b60;
  --ivory-green: #293730;
  --ivory-gold: #b49a75;
  overflow-x: clip;
}

.invite-body {
  background: var(--ivory-paper);
}

.invite-section-slot {
  position: relative;
  overflow: clip;
}

.section-content {
  width: min(680px, 100%);
  margin-inline: auto;
}

/* Scroll reveal: deliberately subtle, not presentation-like. */
.invite-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(2px);
  transition:
    opacity .78s cubic-bezier(.22,.61,.36,1) var(--reveal-delay, 0ms),
    transform .78s cubic-bezier(.22,.61,.36,1) var(--reveal-delay, 0ms),
    filter .78s ease var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.invite-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.invite-kicker {
  color: #8a7863;
  letter-spacing: .3em;
  line-height: 1.4;
}
.timer-section .invite-kicker,
.final-section .invite-kicker {
  color: inherit;
}

.invite-section {
  position: relative;
  min-height: 62vh;
  padding: clamp(74px, 10vw, 116px) max(28px, 8vw);
  border-bottom-color: rgba(78,65,50,.095);
}
.invite-section h2 {
  max-width: 680px;
  font-size: clamp(38px, 8.3vw, 58px);
  line-height: 1.02;
  letter-spacing: -.028em;
  text-wrap: balance;
}
.invite-section p {
  max-width: 620px;
  font-size: clamp(14px, 2.6vw, 16px);
  line-height: 1.9;
  color: var(--ivory-muted);
  text-wrap: pretty;
}
.ivory-paper-section {
  background:
    radial-gradient(circle at 12% 16%, rgba(255,255,255,.72), transparent 26%),
    radial-gradient(circle at 86% 82%, rgba(211,193,165,.16), transparent 28%),
    var(--ivory-paper);
}
.invitation-copy {
  white-space: pre-line;
  font-size: clamp(15px, 2.8vw, 17px) !important;
  line-height: 2 !important;
}

/* Gate */
.invite-gate {
  background:
    radial-gradient(circle at 24% 12%, rgba(255,255,255,.9), transparent 25%),
    radial-gradient(circle at 78% 86%, rgba(122,99,71,.10), transparent 30%),
    linear-gradient(155deg, #f5ede1 0%, #dfceb6 100%);
}
.invite-gate:before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(80,65,45,.2);
  pointer-events: none;
}
.gate-mark {
  top: 32px;
  letter-spacing: .29em;
  font-size: 9px;
}
.gate-card {
  width: min(640px, 100%);
  position: relative;
  z-index: 2;
  animation: ivoryGateIn .9s cubic-bezier(.22,.61,.36,1) both;
}
.gate-card > span {
  letter-spacing: .34em;
  color: #766858;
}
.gate-card h1 {
  max-width: 94%;
  margin: 30px auto 42px;
  font-size: clamp(50px, 11vw, 84px);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.gate-card h1 > span { display: block; }
.gate-card h1.names-medium { font-size: clamp(45px, 9.6vw, 72px); }
.gate-card h1.names-compact { font-size: clamp(38px, 8.2vw, 62px); line-height: 1; }
.gate-card button {
  min-width: 220px;
  justify-content: center;
  padding: 16px 22px;
  box-shadow: 0 12px 26px rgba(46,58,52,.16);
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.gate-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(46,58,52,.2);
}
.gate-card small { display: block; margin-top: 12px; letter-spacing: .08em; }
.gate-rule {
  position: absolute;
  top: 50%;
  width: min(18vw, 180px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(72,60,47,.22));
}
.gate-rule-left { left: 4vw; }
.gate-rule-right { right: 4vw; transform: scaleX(-1); }

/* Hero */
.invite-hero {
  min-height: max(680px, 100svh);
  isolation: isolate;
}
.invite-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 26%, rgba(54,44,34,.06));
  pointer-events: none;
}
.invite-hero-media img {
  transition: transform 1.4s cubic-bezier(.22,.61,.36,1);
}
.invite-body.shown .invite-hero-media img {
  animation: ivoryHeroBreath 14s ease-in-out infinite alternate;
}
.invite-hero-shade {
  background:
    linear-gradient(180deg, rgba(24,20,16,.05) 0%, rgba(24,20,16,.09) 42%, rgba(24,20,16,.52) 100%),
    radial-gradient(circle at 50% 45%, transparent 20%, rgba(24,20,16,.10) 100%);
}
.invite-hero:after {
  inset: 18px;
  border-color: rgba(73,63,52,.28);
}
.ivory-frame-corner {
  position: absolute;
  z-index: 4;
  width: 36px;
  height: 36px;
  pointer-events: none;
  opacity: .55;
}
.ivory-frame-corner-a {
  top: 18px;
  left: 18px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}
.ivory-frame-corner-b {
  right: 18px;
  bottom: 18px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.invite-hero-inner {
  width: min(760px, 94%);
  padding: 42px 26px;
}
.hero-enter {
  animation: ivoryHeroTextIn 1.05s cubic-bezier(.22,.61,.36,1) .12s both;
}
.invite-hero-inner > span {
  font-size: 9px;
  letter-spacing: .36em;
  text-transform: uppercase;
}
.invite-hero-inner h1 {
  max-width: 100%;
  margin: 32px auto 0;
  font-size: clamp(54px, 13vw, 88px);
  line-height: .9;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.invite-hero-inner h1 .person-name {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.invite-hero-inner h1.names-medium {
  font-size: clamp(48px, 11vw, 76px);
}
.invite-hero-inner h1.names-compact {
  font-size: clamp(39px, 9vw, 64px);
  line-height: .96;
}
.invite-hero-inner h1 em {
  margin: 10px 0 12px;
  font-size: .36em;
  opacity: .88;
}
.hairline {
  width: 54px;
  opacity: .56;
  margin-top: 34px;
}
.invite-hero-inner strong {
  font-size: 11px;
  letter-spacing: .24em;
  font-variant-numeric: tabular-nums;
}
.invite-hero-inner small {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: .06em;
}
.bounce {
  opacity: .78;
  margin-top: 52px;
}
.ornament { opacity: .24; }

/* Editorial date */
.date-section {
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.42), transparent 35%),
    var(--ivory-warm);
}
.date-card-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.section-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.25;
  margin-bottom: 24px;
  color: #796a59;
}
.editorial-date {
  margin-top: 28px;
  display: grid;
  justify-items: center;
  line-height: 1;
}
.editorial-date strong {
  font-family: "Playfair Display", serif;
  font-size: clamp(84px, 22vw, 132px);
  font-weight: 500;
  line-height: .72;
  letter-spacing: -.06em;
}
.editorial-date span {
  margin-top: 24px;
  font-family: "Playfair Display", serif;
  font-size: clamp(30px, 7vw, 46px);
  text-transform: lowercase;
}
.editorial-date small {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: .3em;
  color: #887968;
}
.event-time {
  margin-top: 34px !important;
  font-size: 13px !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Countdown */
.timer-section {
  min-height: 58vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.055), transparent 38%),
    #27352f;
}
.countdown {
  width: min(590px, 100%);
  gap: 10px;
  margin-top: 34px;
}
.countdown div {
  min-width: 0;
  padding: 22px 7px 18px;
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.025);
  border-radius: 2px;
}
.countdown strong {
  font-size: clamp(31px, 8vw, 47px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown span {
  margin-top: 10px;
  font-size: 7px;
  letter-spacing: .16em;
}
.event-day-message {
  max-width: 550px;
  line-height: 1.08;
  text-wrap: balance;
}

/* Hosts */
.hosts-section { min-height: 48vh; }
.hosts-flourish {
  margin: 32px 0 12px;
  color: var(--ivory-gold);
  opacity: .68;
}
.hosts-names {
  margin-top: 6px !important;
  font-size: clamp(38px, 9vw, 56px) !important;
}

/* Venue */
.venue-section {
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.1)),
    #f4ebde;
}
.venue-content { display: flex; flex-direction: column; align-items: center; }
.venue-section h2 { margin-bottom: 10px; }
.map-button {
  margin-top: 25px;
  padding: 14px 21px;
  background: var(--ivory-green);
  box-shadow: 0 10px 24px rgba(41,55,48,.12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.map-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(41,55,48,.17);
}

/* Program */
.program-section {
  background:
    radial-gradient(circle at 15% 18%, rgba(255,255,255,.42), transparent 26%),
    #eadcca;
}
.program-list {
  width: min(610px, 100%);
  margin-top: 38px;
}
.program-row {
  grid-template-columns: 72px 1fr minmax(130px, 1.75fr);
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid rgba(60,50,40,.085);
}
.program-row:last-child { border-bottom: 0; }
.program-row strong {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.program-row > span { opacity: .7; }
.program-row p {
  line-height: 1.45;
  color: #62584d;
}

/* Dress code */
.dress-section .swatches {
  gap: 11px;
  margin-top: 27px;
}
.swatches i {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255,255,255,.65);
  box-shadow: 0 2px 7px rgba(61,51,40,.09);
}

/* Contact */
.contact-section {
  min-height: 48vh;
  background: #eee2d2;
}
.contact-section h2 { margin-bottom: 7px; }

/* Finale */
.final-section {
  min-height: 82vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.055), transparent 30%),
    linear-gradient(180deg, #2d3a34 0%, #24302b 100%);
}
.final-content { display: flex; flex-direction: column; align-items: center; }
.final-symbol {
  color: #d7c3a2;
  font-size: 24px;
  opacity: .72;
}
.final-section h2 {
  margin-top: 28px;
  max-width: 650px;
}
.final-names {
  margin-top: 9px !important;
  font-family: "Playfair Display", serif;
  font-size: clamp(24px, 6vw, 38px) !important;
  line-height: 1.2 !important;
  color: #e2d7c6 !important;
  overflow-wrap: anywhere;
}
.final-names.names-medium { font-size: clamp(22px, 5.3vw, 33px) !important; }
.final-names.names-compact { font-size: clamp(19px, 4.7vw, 28px) !important; }
.final-names span { margin-inline: .25em; opacity: .7; font-style: italic; }
.final-section small {
  margin-top: 68px;
  font-size: 8px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

/* Preview refinement */
.invite-embedded .invite-section {
  min-height: 58vh;
}
.invite-embedded .invite-hero {
  min-height: 680px;
}

@keyframes ivoryHeroTextIn {
  from { opacity: 0; transform: translateY(22px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes ivoryGateIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ivoryHeroBreath {
  from { scale: 1; }
  to { scale: 1.025; }
}

@media (max-width: 560px) {
  .invite-section {
    min-height: 58vh;
    padding: 72px 24px;
  }
  .invite-section h2 {
    font-size: clamp(35px, 10.5vw, 48px);
  }
  .invite-hero {
    min-height: 100svh;
  }
  .invite-hero-inner {
    width: 100%;
    padding-inline: 25px;
  }
  .invite-hero-inner h1 {
    font-size: clamp(50px, 15vw, 72px);
  }
  .invite-hero-inner h1.names-medium {
    font-size: clamp(43px, 12.5vw, 61px);
  }
  .invite-hero-inner h1.names-compact {
    font-size: clamp(34px, 10.2vw, 49px);
  }
  .invite-hero-inner strong { letter-spacing: .18em; }
  .gate-rule { display: none; }
  .gate-card h1.names-default { font-size: clamp(48px, 15vw, 70px); }
  .gate-card h1.names-medium { font-size: clamp(40px, 12vw, 58px); }
  .gate-card h1.names-compact { font-size: clamp(33px, 10vw, 47px); }
  .countdown { gap: 5px; }
  .countdown div { padding: 18px 3px 15px; }
  .countdown strong { font-size: clamp(28px, 9vw, 39px); }
  .program-row {
    grid-template-columns: 62px 22px 1fr;
    gap: 10px;
  }
  .program-row strong { font-size: 16px; }
  .program-row p { font-size: 12px; }
  .editorial-date strong { font-size: clamp(82px, 29vw, 118px); }
}

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

/* Stage 7: event participants */
.invite-hero-inner h1 .person-name-wrap,
.gate-card h1 .gate-name-wrap {
  display: block;
}
.invite-hero-inner h1 .person-name-wrap > em,
.gate-card h1 .gate-name-wrap > em {
  display: block;
}
.published-page, .auth-page, .center-state {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
}
.success-circle {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: #dfe9e2; color: #2e4b3e; margin-bottom: 22px;
}
.published-page h1 { font-size: clamp(42px, 6vw, 66px); max-width: 720px; margin: 0 0 12px; }
.published-page > p { color: var(--muted); max-width: 540px; line-height: 1.6; }
.published-link {
  width: min(620px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 8px 8px 16px;
  margin: 24px 0;
}
.published-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.published-link button { width: 42px; height: 42px; border: 0; border-radius: 12px; display: grid; place-items: center; }
.published-actions { display: flex; gap: 10px; }
.center-link { margin-top: 20px; }

.auth-card {
  width: min(430px, 100%);
  background: white;
  padding: 36px;
  border-radius: 24px;
  border: 1px solid var(--line);
}
.google-mark {
  width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 20px;
  border: 1px solid var(--line); border-radius: 50%; font-weight: 800; font-size: 20px;
}
.auth-card h1 { font-family: "Playfair Display", serif; font-size: 40px; font-weight: 500; margin: 0 0 8px; }
.auth-card p { color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
.empty-state {
  min-height: 330px;
  border: 1px dashed #cbc3b8;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}
.empty-state h2 { font-family: "Playfair Display", serif; font-size: 34px; margin: 0 0 8px; }
.empty-state p { color: var(--muted); }
.invite-list { display: grid; gap: 12px; }
.invite-list-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 16px;
}
.invite-list-thumb { width: 92px; height: 92px; border-radius: 12px; background: #eee6da; overflow: hidden; display: grid; place-items: center; }
.invite-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.invite-list-card h3 { margin: 8px 0 3px; }
.invite-list-card p { margin: 0; color: var(--muted); font-size: 13px; }

.invite-management-card {
  grid-template-columns: 92px minmax(0, 1fr) auto;
}

.invite-list-info { min-width: 0; }

.invite-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.compact-action {
  padding: 9px 12px;
  font-size: 12px;
}

.status-published {
  background: #e6eee8;
  color: #3e5b49;
}

.status-draft {
  background: #f0ece6;
  color: #766d62;
}

.danger-button { color: #a34b43; }
.danger-button:hover { background: #f8e9e7; }
.danger-button:disabled,
.compact-action:disabled { opacity: .45; cursor: default; }

@media (max-width: 780px) {
  .invite-management-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .invite-management-card .invite-list-thumb {
    width: 74px;
    height: 74px;
  }

  .invite-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.cloud-sync-note {
  margin: -14px 0 24px;
  padding: 12px 14px;
  border: 1px solid #cbd8ce;
  border-radius: 14px;
  background: #eef5f0;
  color: #395044;
  font-size: 13px;
}

.cloud-sync-note.warning {
  border-color: #ead8a6;
  background: #fff7de;
  color: #6a592d;
}

/* Stage 10 — sharing */
.published-page-rich {
  justify-content: flex-start;
  min-height: 100vh;
  padding-top: 76px;
  padding-bottom: 90px;
}

.published-hero {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.published-hero > p {
  color: var(--muted);
  max-width: 570px;
  line-height: 1.65;
}

.published-link-static a {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f1eee8;
}

.published-primary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.published-share-layout {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: stretch;
}

.share-card {
  background: var(--surface);
  border: 1px solid rgba(40,35,29,.08);
  border-radius: 24px;
  padding: 24px;
  text-align: left;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 15px;
}

.share-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #ebe7df;
  color: #38463f;
}

.share-card-copy h2 {
  margin: 2px 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 500;
}

.share-card-copy > p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.share-option {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfaf7;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 650;
  font-size: 13px;
}

.share-option:hover { background: #f2efe9; }
.whatsapp-option { background: #eef7f0; border-color: #d6e8da; }
.telegram-option { background: #eff6fa; border-color: #d7e4eb; }

.share-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2f8f53;
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.qr-share-card { align-content: start; }
.qr-image {
  width: min(230px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 16px;
  margin: 10px auto 16px;
  border: 1px solid #e6e1d9;
}
.qr-placeholder {
  width: min(230px, 100%);
  aspect-ratio: 1;
  border-radius: 16px;
  margin: 10px auto 16px;
  background: #f0ece5;
}

.preview-info-card {
  width: min(920px, 100%);
  margin-top: 16px;
  background: #1f2b26;
  color: white;
  border-radius: 24px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 26px;
  text-align: left;
}

.preview-info-card .eyebrow { color: #b8c3bc; }
.preview-info-card h2 {
  margin: 5px 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 31px;
  font-weight: 500;
}
.preview-info-card p { margin: 0; color: #cfd6d1; line-height: 1.6; font-size: 14px; }
.preview-info-card img,
.preview-info-placeholder {
  width: 210px;
  height: 118px;
  border-radius: 16px;
  object-fit: cover;
}
.preview-info-placeholder {
  display: grid;
  place-items: center;
  background: #e9dfcf;
  color: #4e453b;
  text-align: center;
  letter-spacing: .16em;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .published-page-rich { padding-top: 48px; }
  .published-share-layout { grid-template-columns: 1fr; }
  .preview-info-card { grid-template-columns: 1fr; }
  .preview-info-card img,
  .preview-info-placeholder { width: 100%; height: 180px; }
}

@media (max-width: 470px) {
  .share-card { grid-template-columns: 1fr; padding: 19px; }
  .share-grid { grid-template-columns: 1fr; }
  .published-primary-actions { width: 100%; }
  .published-primary-actions > * { width: 100%; }
}

/* Stage 11 — account dashboard */
.account-shell { min-height: 70vh; }
.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.account-stats-grid > div {
  background: var(--surface);
  border: 1px solid rgba(40,35,29,.08);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 4px;
}
.account-stats-grid strong { font-family: "Playfair Display", serif; font-size: 36px; font-weight: 500; }
.account-stats-grid span { color: var(--muted); font-size: 12px; }
.account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.account-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.account-filters button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12px;
}
.account-filters button.active { background: var(--ink); color: white; border-color: var(--ink); }
.account-search {
  width: min(310px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: #8b837a;
}
.account-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
@media (max-width: 700px) {
  .account-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .account-stats-grid > div { padding: 15px 12px; }
  .account-stats-grid strong { font-size: 30px; }
  .account-toolbar { align-items: stretch; flex-direction: column; }
  .account-search { width: 100%; }
}
/* Gallery editor */
.gallery-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.gallery-editor-item, .gallery-add {
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  overflow: hidden;
  position: relative;
}
.gallery-editor-item { background: #eee9e2; }
.gallery-editor-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-actions {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.gallery-item-actions button {
  min-width: 0;
  height: 27px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(27,25,23,.76);
  color: white;
  backdrop-filter: blur(7px);
}
.gallery-item-actions button:disabled { opacity: .28; cursor: default; }
.gallery-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: #3b3732;
  font-size: 10px;
  font-weight: 800;
}
.gallery-add {
  border: 1px dashed #c8c0b6;
  background: #faf8f5;
  color: #746c63;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.gallery-add:disabled { opacity: .55; cursor: progress; }
.gallery-add span { font-size: 11px; font-weight: 700; }
.gallery-add small { font-size: 10px; opacity: .65; }

/* Invitation gallery */
.gallery-section { background: #f8f2e9; min-height: auto; padding-top: 88px; padding-bottom: 88px; }
.invite-gallery {
  width: min(680px, 100%);
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}
.gallery-photo {
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #ded4c7;
}
.gallery-photo img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  transition: transform .7s ease;
}
.gallery-photo:hover img { transform: scale(1.025); }
.gallery-photo-0, .gallery-photo-4 { grid-row: span 2; }
.gallery-photo-0 img, .gallery-photo-4 img { min-height: 470px; }
.gallery-photo-2 { transform: translateY(-18px); }

@media (max-width: 560px) {
  .gallery-editor-grid { grid-template-columns: repeat(3, 1fr); }
  .invite-gallery { gap: 7px; }
  .gallery-photo img { min-height: 180px; }
  .gallery-photo-0 img, .gallery-photo-4 img { min-height: 367px; }
}

/* Stage 6 — editorial Wedding Ivory gallery */
.gallery-section {
  background:
    radial-gradient(circle at 92% 8%, rgba(211,193,165,.18), transparent 27%),
    #f8f2e9;
  padding-top: clamp(84px, 11vw, 126px);
  padding-bottom: clamp(90px, 12vw, 138px);
}
.gallery-content { width: min(760px, 100%); }
.invite-gallery {
  width: 100%;
  margin-top: 42px;
  gap: 12px;
  grid-auto-flow: dense;
}
.gallery-photo {
  position: relative;
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(73,60,45,.08);
  background: #ddd1c2;
}
.gallery-photo:after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255,255,255,.34);
  pointer-events: none;
  opacity: .75;
}
.gallery-photo img {
  min-height: 250px;
  transition: transform 1.05s cubic-bezier(.22,.61,.36,1), filter .6s ease;
}
.gallery-photo:hover img { transform: scale(1.035); }
.gallery-photo-0,
.gallery-photo-5 { grid-row: span 2; }
.gallery-photo-0 img,
.gallery-photo-5 img { min-height: 512px; }
.gallery-photo-1 img,
.gallery-photo-4 img { aspect-ratio: 4 / 3; }
.gallery-photo-2 { transform: translateY(28px); }
.gallery-photo-3 { transform: translateY(-12px); }

/* 1–2 photos should still feel intentional rather than like an unfinished grid. */
.gallery-count-1 { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; }
.gallery-count-1 .gallery-photo-0 { grid-row: auto; }
.gallery-count-1 .gallery-photo-0 img { min-height: 580px; }
.gallery-count-2 { max-width: 680px; margin-inline: auto; }
.gallery-count-2 .gallery-photo { grid-row: auto; transform: none; }
.gallery-count-2 .gallery-photo img { min-height: 390px; }

@media (max-width: 560px) {
  .invite-gallery { gap: 7px; margin-top: 34px; }
  .gallery-photo:after { inset: 5px; }
  .gallery-photo img { min-height: 188px; }
  .gallery-photo-0 img,
  .gallery-photo-5 img { min-height: 383px; }
  .gallery-photo-2 { transform: translateY(18px); }
  .gallery-photo-3 { transform: translateY(-8px); }
  .gallery-count-1 .gallery-photo-0 img { min-height: 470px; }
  .gallery-count-2 .gallery-photo img { min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-photo:hover img { transform: none; }
}

/* Reset legacy Stage 4 span now that Stage 6 uses photo 5 as the second tall tile. */
.invite-gallery .gallery-photo-4 { grid-row: auto; }
.invite-gallery .gallery-photo-4 img { min-height: 250px; }
@media (max-width: 560px) {
  .invite-gallery .gallery-photo-4 img { min-height: 188px; }
}
/* Stage 11 — admin */
.site-announcement {
  width: 100%;
  padding: 10px 18px;
  background: #1f2b26;
  color: #f6efe4;
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
}
.site-status-card {
  margin: -12px 0 24px;
  padding: 15px 18px;
  border: 1px solid #ead8a6;
  border-radius: 16px;
  background: #fff7de;
  color: #69582e;
  display: grid;
  gap: 3px;
  font-size: 13px;
}
.disabled-link { opacity: .55; pointer-events: none; }
.admin-page {
  width: min(1180px, calc(100% - 32px));
  margin: 54px auto 110px;
}
.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.admin-header h1 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 500;
  line-height: 1;
}
.admin-header p { color: var(--muted); margin: 0; }
.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 98px;
  padding: 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid rgba(40,35,29,.08);
  display: grid;
  gap: 5px;
}
.admin-sidebar button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: #625c55;
}
.admin-sidebar button.active { background: #25322c; color: white; }
.admin-content {
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(40,35,29,.08);
  border-radius: 24px;
  padding: 28px;
}
.admin-message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef5f0;
  border: 1px solid #ceddd2;
  color: #385044;
  font-size: 13px;
}
.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.admin-section-head > div > span { color: #938a7e; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.admin-section-head h2 { margin: 6px 0 5px; font-size: 29px; }
.admin-section-head p { margin: 0; color: var(--muted); max-width: 680px; line-height: 1.55; }
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.admin-stat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 5px;
  background: #fbfaf7;
}
.admin-stat-card strong { font-family: "Playfair Display", serif; font-size: 35px; font-weight: 500; }
.admin-stat-card span { color: var(--muted); font-size: 12px; }
.admin-overview-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.admin-info-card { border-radius: 16px; background: #ede9e2; padding: 20px; display: grid; gap: 8px; }
.admin-info-card svg { color: #657269; }
.admin-info-card strong { font-size: 20px; }
.admin-info-card span { color: var(--muted); font-size: 12px; }
.admin-list { display: grid; gap: 9px; }
.admin-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 120px 145px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fcfbf9;
}
.admin-row-main { min-width: 0; display: grid; justify-items: start; gap: 5px; }
.admin-row-main strong { font-size: 14px; }
.admin-row-main small { color: var(--muted); }
.admin-order { display: grid; gap: 4px; }
.admin-order span { color: var(--muted); font-size: 10px; }
.admin-order input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: white; }
.admin-switch { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #625c55; }
.admin-switch input { width: 17px; height: 17px; accent-color: #25322c; }
.admin-switch.standalone { padding: 12px 0; }
.admin-settings-card, .admin-music-form {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: #fbfaf7;
}
.admin-music-form { margin-bottom: 16px; }
.admin-music-form input[type="file"] { padding: 12px; border: 1px dashed #c9c1b6; border-radius: 12px; background: white; }
.music-admin-row { grid-template-columns: minmax(0,1fr) 150px 40px; }
.music-admin-row audio { width: min(420px, 100%); height: 34px; margin-top: 4px; }
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; grid-template-columns: repeat(5, minmax(0,1fr)); overflow-x: auto; }
  .admin-sidebar button { justify-content: center; }
  .admin-sidebar button span { display: none; }
  .admin-stats-grid { grid-template-columns: repeat(2,1fr); }
  .admin-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .admin-page { width: calc(100% - 20px); margin-top: 38px; }
  .admin-header { align-items: stretch; flex-direction: column; }
  .admin-content { padding: 18px; border-radius: 20px; }
  .admin-section-head { flex-direction: column; }
  .admin-section-head .primary-button { width: 100%; }
  .admin-row, .music-admin-row { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .desktop-nav, .desktop-only { display: none !important; }
  .menu-button { display: grid; place-items: center; }
  .mobile-menu {
    display: flex;
    position: fixed;
    inset: 0;
    background: #f7f3ed;
    z-index: 100;
    padding: max(90px, calc(env(safe-area-inset-top) + 68px)) max(26px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left));
    flex-direction: column;
    gap: 22px;
    font-size: 24px;
  }
  .menu-close { position: absolute; right: max(24px, env(safe-area-inset-right)); top: max(24px, env(safe-area-inset-top)); border: 0; background: transparent; }
  .mobile-menu .primary-button, .mobile-menu .ghost-button { font-size: 15px; margin-top: 8px; }
  .hero-shell { grid-template-columns: 1fr; padding: 54px 30px 36px; }
  .hero-copy { max-width: none; }
  .hero-visual { height: 500px; margin-top: 34px; }
  .phone { height: 500px; width: 250px; }
  .fc-one { right: 2%; top: 80px; }
  .fc-two { left: 2%; }
  .fc-three { right: 6%; bottom: 38px; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 190px; }
  .step-card h3 { margin-top: 35px; }
  .template-card { grid-template-columns: 1fr; }
  .template-meta { padding: 15px 10px 10px; }
  .coming-grid { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .footer p, .footer > span { text-align: center; }
  .editor-layout { grid-template-columns: 1fr; margin-top: 0; padding: 0; }
  .editor-panel { border-radius: 0; border: 0; }
  .live-preview-wrap { position: static; min-height: calc(100vh - 124px); background: #ddd8d1; padding: 20px 0 50px; }
  .preview-phone { width: min(390px, calc(100% - 24px)); height: 760px; }
  .editor-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-bottom: 1px solid #ddd8d1;
  }
  .editor-tabs button {
    border: 0;
    background: transparent;
    padding: 13px;
    color: #857e76;
  }
  .editor-tabs button.active { color: var(--ink); border-bottom: 2px solid var(--ink); font-weight: 700; }
  .mobile-hidden { display: none; }
  .mobile-hidden-preview { display: none; }
  .setup-banner { border-radius: 0; margin: 0; border-left: 0; border-right: 0; }
}

@media (max-width: 560px) {
  .site-header { width: calc(100% - 20px); margin-top: 10px; min-height: 62px; border-radius: 18px; padding: 0 14px; }
  .hero-shell { width: calc(100% - 20px); margin-top: 14px; border-radius: 26px; padding: 44px 22px 30px; }
  .hero-shell:after { inset: 10px; border-radius: 19px; }
  .hero-copy h1 { font-size: 49px; }
  .hero-copy p { font-size: 16px; }
  .hero-buttons { display: grid; }
  .hero-buttons > * { width: 100%; }
  .hero-visual { height: 450px; }
  .phone { width: 220px; height: 450px; border-width: 7px; border-radius: 40px; }
  .phone-screen { border-radius: 30px; }
  .mini-invite h3 { font-size: 34px; }
  .floating-card { padding: 10px 12px; font-size: 11px; }
  .section { margin: 85px auto; }
  .section-heading h2 { font-size: 40px; }
  .row-heading { align-items: start; flex-direction: column; }
  .template-preview { min-height: 430px; }
  .preview-ivory h3 { font-size: 39px; }
  .template-meta h3 { font-size: 31px; }
  .closing-cta { width: calc(100% - 20px); border-radius: 26px; }
  .closing-cta h2 { font-size: 40px; }
  .page-shell { width: calc(100% - 28px); margin-top: 60px; }
  .page-head h1 { font-size: 46px; }
  .editor-topbar { padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); min-height: calc(66px + env(safe-area-inset-top)); }
  .editor-topbar .ghost-button { display: none; }
  .editor-topbar .primary-button { padding: 10px 13px; font-size: 12px; }
  .editor-topbar > div { gap: 9px; }
  .save-state { display: none; }
  .field-group, .editor-intro { padding-left: 18px; padding-right: 18px; }
  .editor-validation { margin-left: 18px; margin-right: 18px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .program-edit-row { grid-template-columns: 88px 1fr 34px; }
  .preview-phone { height: calc(100svh - 160px); min-height: 600px; border-width: 5px; border-radius: 33px; }
  .preview-scroll { border-radius: 28px; }
  .invite-list-card { grid-template-columns: 68px 1fr; }
  .invite-list-thumb { width: 68px; height: 68px; }
  .invite-list-card > .ghost-button { grid-column: 1/-1; }
  .published-actions { width: 100%; flex-direction: column; }
}

@media (max-width: 900px) {
  .template-catalog-grid .template-card:nth-child(even) .template-preview { order: initial; }
  .template-catalog-grid .template-card:nth-child(even) .template-meta { padding: 15px 10px 10px; }
}

@media (max-width: 560px) {
  .preview-miras { min-height: 430px; }
  .preview-miras h3 { font-size: 52px; }
}

@media (max-width: 560px) {
  .compact-language-switcher { display: none; }
  .mobile-menu .language-switcher { align-self: flex-start; font-size: 12px; }
  .invite-language-card { align-items: flex-start; flex-direction: column; }
}
.miras-invite {
  --miras-cream: #f6efe5;
  --miras-paper: #fbf7f0;
  --miras-gold: #a88955;
  --miras-dark: #302c26;
  --miras-wine: #6d3d3d;
  background: var(--miras-cream);
  color: var(--miras-dark);
}

.miras-gate {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.9), transparent 27%),
    linear-gradient(155deg, #f5ecde 0%, #ded0b9 100%);
}
.miras-gate:before,
.miras-gate:after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(148,116,65,.28);
  transform: rotate(45deg);
}
.miras-gate:before { left: -95px; top: 80px; }
.miras-gate:after { right: -95px; bottom: 80px; }
.miras-gate-ornament { position: absolute; top: 24%; color: var(--miras-gold); opacity: .55; font-size: 22px; }
.miras-gate-card { position: relative; z-index: 2; }
.miras-gate-card h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(58px, 13vw, 92px);
  font-weight: 500;
  line-height: .98;
  margin: 24px 0 12px;
  color: #443a2e;
}
.miras-gate-card h1.miras-name-medium { font-size: clamp(50px, 11vw, 78px); }
.miras-gate-card h1.miras-name-compact { font-size: clamp(42px, 9vw, 66px); }
.miras-gate-card p { color: #89765e; margin: 0 0 32px; font-size: 13px; letter-spacing: .06em; }

.miras-hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, rgba(255,255,255,.88), transparent 28%),
    linear-gradient(180deg, #f7efe2 0%, #dfd0ba 100%);
}
.miras-hero:after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(151,116,62,.34);
  border-radius: 48% 48% 10px 10px / 10% 10% 10px 10px;
  z-index: 4;
  pointer-events: none;
}
.miras-hero-media { position: absolute; inset: 0; overflow: hidden; }
.miras-hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s ease; }
.miras-hero.has-photo .miras-hero-media img { filter: saturate(.86) contrast(.96); }
.miras-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31,22,18,.09), rgba(35,24,19,.58));
  z-index: 1;
}
.miras-hero:not(.has-photo) .miras-hero-overlay { opacity: 0; }
.miras-hero-inner { position: relative; z-index: 3; padding: 42px 34px; }
.miras-hero.has-photo .miras-hero-inner { color: #fff9ef; text-shadow: 0 2px 18px rgba(0,0,0,.18); }
.miras-hero-inner > span { font-size: 10px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; }
.miras-line { width: 34px; height: 1px; background: currentColor; opacity: .55; margin: 22px auto; }
.miras-hero-inner h1 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(68px, 17vw, 110px);
  line-height: .94;
  margin: 0;
}
.miras-hero-inner h1.miras-name-medium { font-size: clamp(56px, 14vw, 92px); }
.miras-hero-inner h1.miras-name-compact { font-size: clamp(46px, 11vw, 74px); }
.miras-hero-inner p { margin: 18px 0 30px; font-family: "Playfair Display", serif; font-style: italic; font-size: 16px; }
.miras-hero-inner strong { display: block; font-size: 12px; letter-spacing: .2em; }
.miras-hero-inner small { display: block; margin-top: 10px; }
.miras-ornament { position: absolute; z-index: 2; color: var(--miras-gold); opacity: .5; }
.miras-ornament-top { top: 9%; font-size: 22px; }
.miras-ornament-side { right: 9%; bottom: 12%; font-size: 38px; }

.miras-section { background: var(--miras-paper); }
.miras-section .invite-kicker { color: #987849; }
.miras-section h2 { color: #40372d; }
.miras-centered-copy { max-width: 650px; }
.miras-mini-mark { margin-bottom: 22px; color: var(--miras-gold); opacity: .65; }
.miras-intro-section { background: #faf5ed; }
.miras-intro-section .invitation-copy { font-size: 15px; max-width: 600px; color: #776958; }

.miras-date-section { background: #e7dac5; }
.miras-date-card { width: min(570px, 100%); }
.miras-section-icon { margin-bottom: 20px; color: #8b6c40; }
.miras-date-grid { margin: 28px auto 6px; display: grid; justify-items: center; }
.miras-date-grid strong { font-family: "Playfair Display", serif; font-size: clamp(86px, 22vw, 132px); font-weight: 500; line-height: .75; }
.miras-date-grid span { margin-top: 24px; text-transform: uppercase; letter-spacing: .2em; font-size: 12px; }
.miras-date-grid small { margin-top: 8px; font-size: 13px; }

.miras-timer-section { background: #563a35; color: #fff8ec; }
.miras-timer-section .invite-kicker { color: #d8bd91; }
.miras-timer-section .countdown div { border-color: rgba(255,248,236,.22); background: rgba(255,255,255,.035); }
.miras-hosts-section { min-height: 48vh; background: #faf5ed; }
.miras-host-divider { width: 110px; height: 1px; background: rgba(154,119,66,.35); margin: 28px auto 12px; position: relative; }
.miras-host-divider span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #faf5ed; color: #a48759; padding: 0 12px; }
.miras-hosts-section h2 { font-size: clamp(36px, 9vw, 56px); }

.miras-venue-section { background: #efe5d7; }
.miras-map-button {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 19px;
  border-radius: 999px;
  background: #6b4a3f;
  color: #fff9f0;
  font-size: 13px;
}
.miras-program-section { background: #faf5ed; }
.miras-program-list { width: min(560px, 100%); margin: 30px auto 0; }
.miras-program-row { display: grid; grid-template-columns: 70px 30px 1fr; align-items: center; gap: 13px; padding: 15px 0; border-bottom: 1px solid rgba(138,105,61,.16); text-align: left; }
.miras-program-row strong { font-family: "Playfair Display", serif; font-size: 18px; font-weight: 500; }
.miras-program-row > span { color: #ad8b58; font-size: 9px; text-align: center; }
.miras-program-row p { margin: 0; color: #716557; }

.miras-gallery-section { background: #e9ddcd; padding-top: 90px; padding-bottom: 90px; }
.miras-gallery { width: min(680px, 100%); display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 32px; }
.miras-photo { margin: 0; overflow: hidden; border-radius: 90px 90px 12px 12px; min-height: 270px; background: #d8cab6; }
.miras-photo:nth-child(even) { border-radius: 12px 12px 90px 90px; }
.miras-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 270px; transition: transform .7s ease; }
.miras-photo:hover img { transform: scale(1.025); }
.miras-gallery-1 { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
.miras-gallery-1 .miras-photo { min-height: 480px; }
.miras-gallery-2 .miras-photo { min-height: 360px; }

.miras-dress-section { background: #faf5ed; }
.miras-swatches { display: flex; gap: 9px; margin-top: 22px; }
.miras-swatches i { width: 34px; height: 34px; border-radius: 50%; background: #eee0cb; border: 1px solid rgba(82,61,42,.12); }
.miras-swatches i:nth-child(2) { background: #d8c2a0; }
.miras-swatches i:nth-child(3) { background: #a88b63; }
.miras-swatches i:nth-child(4) { background: #8b5e53; }
.miras-swatches i:nth-child(5) { background: #503631; }
.miras-contact-section { background: #efe5d7; min-height: 48vh; }
.miras-final-section { min-height: 78vh; background: #4e3732; color: #fff7eb; }
.miras-final-section h2 { color: #fff7eb; max-width: 620px; }
.miras-final-section p { color: #e7d7c4; }
.miras-final-mark { font-size: 28px; color: #d2b482; margin-bottom: 10px; }
.miras-final-name { font-family: "Playfair Display", serif; font-size: clamp(52px, 13vw, 82px) !important; line-height: 1; margin-top: 28px !important; color: #fff7eb !important; }
.miras-final-name.miras-name-medium { font-size: clamp(46px, 11vw, 70px) !important; }
.miras-final-name.miras-name-compact { font-size: clamp(38px, 9vw, 58px) !important; }
.miras-final-section small { margin-top: 60px; opacity: .5; letter-spacing: .12em; }

@media (max-width: 560px) {
  .miras-hero:after { inset: 12px; border-radius: 46% 46% 8px 8px / 9% 9% 8px 8px; }
  .miras-hero-inner { padding: 38px 22px; }
  .miras-program-row { grid-template-columns: 58px 20px 1fr; gap: 9px; }
  .miras-gallery { gap: 8px; }
  .miras-photo, .miras-photo img { min-height: 220px; }
  .miras-gallery-2 .miras-photo { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .miras-hero-media img, .miras-photo img { transition: none !important; }
}

/* =========================================================
   Stage 12 — Public invitation responsive + motion refresh
   Shared by current and future event templates.
   ========================================================= */
html.invite-gate-locked,
body.invite-gate-locked {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}
body.invite-gate-locked { touch-action: none; }

.invite.is-gated {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
.invite.is-gated .invite-body {
  width: 100%;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: none;
}
.invite-gate {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  transition: opacity .56s cubic-bezier(.22,.61,.36,1),
              transform .56s cubic-bezier(.22,.61,.36,1),
              filter .56s ease;
}
.invite-gate.gate-opening {
  opacity: 0;
  transform: scale(1.018);
  filter: blur(4px);
  pointer-events: none;
}
.invite-gate.gate-opening .gate-card {
  transform: translateY(-18px) scale(.985);
  opacity: 0;
  transition: transform .52s cubic-bezier(.22,.61,.36,1), opacity .42s ease;
}
.invite-gate.gate-opening:before,
.invite-gate.gate-opening:after,
.invite-gate.gate-opening .gate-rule,
.invite-gate.gate-opening .miras-gate-ornament,
.invite-gate.gate-opening .gate-mark {
  opacity: 0;
  transition: opacity .3s ease;
}

/* The document itself now appears only after the gate has finished closing. */
.invite-body {
  transition: opacity .72s cubic-bezier(.22,.61,.36,1), transform .72s cubic-bezier(.22,.61,.36,1);
}
.invite-body.shown { animation: inviteBodyEnter .72s cubic-bezier(.22,.61,.36,1) both; }
@keyframes inviteBodyEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Shared reading rhythm */
.invite-section {
  min-height: auto;
  padding: clamp(72px, 8vw, 104px) max(28px, 7vw);
}
.invite-section .section-content { width: min(720px, 100%); }
.invite-kicker {
  font-size: 10px;
  letter-spacing: .27em;
}
.invite-section h2 {
  font-size: clamp(38px, 6.2vw, 56px);
  line-height: 1.04;
  margin: 18px 0;
}
.invite-section p {
  font-size: clamp(15px, 1.8vw, 16px);
  line-height: 1.75;
}
.invitation-copy {
  font-size: clamp(16px, 2vw, 17px) !important;
  line-height: 1.8 !important;
}
.intro-section,
.hosts-section,
.venue-section,
.contact-section,
.dress-section,
.miras-intro-section,
.miras-hosts-section,
.miras-venue-section,
.miras-contact-section,
.miras-dress-section {
  min-height: clamp(390px, 48svh, 520px);
}
.date-section,
.miras-date-section { min-height: clamp(570px, 67svh, 720px); }
.timer-section,
.miras-timer-section { min-height: clamp(410px, 50svh, 520px); }
.final-section,
.miras-final-section { min-height: clamp(610px, 72svh, 760px); }

/* Readability of dates/countdown on real phones. */
.countdown { width: min(620px, 100%); gap: 8px; }
.countdown div { padding: 21px 6px 18px; }
.countdown strong { font-size: clamp(32px, 6vw, 46px); }
.countdown span {
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .12em;
}
.event-time { font-size: 14px !important; }
.invite-phone-link {
  display: inline-block;
  padding: 4px 0;
  font-size: clamp(16px, 2vw, 18px);
}

/* More expressive reveal while keeping it elegant. */
.invite-reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(.992);
  filter: blur(5px);
  transition:
    opacity .92s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0ms),
    transform .92s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0ms),
    filter .82s ease var(--reveal-delay, 0ms);
}
.invite-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0,0,0) scale(1);
  filter: blur(0);
}
.program-row.invite-reveal,
.miras-program-row.invite-reveal {
  transform: translate3d(-24px, 0, 0);
  filter: blur(2px);
}
.program-row.invite-reveal.is-visible,
.miras-program-row.invite-reveal.is-visible { transform: none; filter: none; }
.gallery-photo.invite-reveal,
.miras-photo.invite-reveal {
  transform: none;
  filter: none;
  clip-path: inset(6% 0 6% 0 round 2px);
  transition:
    opacity .9s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0ms),
    clip-path 1.05s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0ms);
}
.gallery-photo.invite-reveal.is-visible,
.miras-photo.invite-reveal.is-visible { clip-path: inset(0 0 0 0 round 2px); }
.gallery-photo.invite-reveal img,
.miras-photo.invite-reveal img {
  transform: scale(1.045);
  transition: transform 1.25s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0ms), filter .6s ease;
}
.gallery-photo.invite-reveal.is-visible img,
.miras-photo.invite-reveal.is-visible img { transform: scale(1); }

/* Hero: put contrast where the names actually live rather than only at the bottom. */
.invite-hero-shade {
  background:
    radial-gradient(ellipse at 50% 52%, rgba(17,15,13,.26) 0%, rgba(17,15,13,.12) 32%, transparent 64%),
    linear-gradient(180deg, rgba(24,20,16,.09) 0%, rgba(24,20,16,.10) 37%, rgba(24,20,16,.48) 100%);
}
.miras-hero-overlay {
  background:
    radial-gradient(ellipse at 50% 52%, rgba(30,21,17,.22), transparent 58%),
    linear-gradient(180deg, rgba(31,22,18,.10), rgba(35,24,19,.55));
}
.invite-hero-inner,
.miras-hero-inner { max-width: 820px; }

/* Floating audio control: less intrusive, still easy to reach. */
.audio-fab {
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  background: rgba(35,44,40,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: .88;
}
.audio-fab:hover,
.audio-fab:focus-visible { opacity: 1; }

/* Large screens: the invitation becomes a deliberate editorial canvas instead of
   stretching endlessly over a monitor. */
@media (min-width: 900px) {
  .invite:not(.invite-embedded) {
    background: #d8d2ca;
  }
  .invite:not(.invite-embedded) .invite-body {
    width: min(1120px, 100%);
    margin-inline: auto;
    box-shadow: 0 0 70px rgba(47,40,33,.12);
  }
  .invite:not(.invite-embedded) .invite-hero,
  .invite:not(.invite-embedded) .miras-hero {
    min-height: clamp(720px, 92svh, 900px);
  }
  .invite:not(.invite-embedded) .section-content {
    width: min(760px, 100%);
  }
  .invite:not(.invite-embedded) .gallery-content,
  .invite:not(.invite-embedded) .miras-gallery-section .section-content {
    width: min(900px, 100%);
  }
  .invite:not(.invite-embedded) .invite-gallery,
  .invite:not(.invite-embedded) .miras-gallery { max-width: 900px; }
  .invite-gate .gate-card { max-width: 720px; }
}

/* Phones: content is intentionally denser and text is never microscopic. */
@media (max-width: 560px) {
  .invite-gate {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(18px, env(safe-area-inset-left));
  }
  .invite-gate:before { inset: 12px; }
  .gate-mark { top: max(22px, calc(env(safe-area-inset-top) + 12px)); }
  .gate-card { transform: translateY(-1.5vh); }
  .gate-card h1 { margin-top: 25px; margin-bottom: 34px; }
  .gate-card button {
    min-height: 54px;
    min-width: min(270px, 82vw);
    font-size: 16px;
  }
  .gate-card small { font-size: 11px; }

  .invite-section {
    min-height: auto;
    padding: 76px 23px;
  }
  .intro-section,
  .hosts-section,
  .venue-section,
  .contact-section,
  .dress-section,
  .miras-intro-section,
  .miras-hosts-section,
  .miras-venue-section,
  .miras-contact-section,
  .miras-dress-section { min-height: auto; }
  .date-section,
  .miras-date-section {
    min-height: 600px;
    padding-top: 86px;
    padding-bottom: 86px;
  }
  .timer-section,
  .miras-timer-section {
    min-height: 430px;
    padding-top: 78px;
    padding-bottom: 78px;
  }
  .final-section,
  .miras-final-section {
    min-height: 650px;
    padding-top: 90px;
    padding-bottom: 72px;
  }
  .invite-kicker {
    font-size: 10px;
    letter-spacing: .24em;
  }
  .invite-section h2 {
    font-size: clamp(34px, 9.4vw, 44px);
    line-height: 1.05;
    margin: 17px 0;
  }
  .invite-section p {
    font-size: 15.5px;
    line-height: 1.72;
  }
  .invitation-copy {
    font-size: 16px !important;
    line-height: 1.78 !important;
  }
  .section-icon,
  .miras-section-icon { margin-bottom: 20px; }
  .editorial-date { margin-top: 25px; }
  .editorial-date strong { font-size: clamp(88px, 27vw, 116px); }
  .editorial-date span { font-size: clamp(31px, 8.7vw, 42px); margin-top: 22px; }
  .event-time { margin-top: 30px !important; font-size: 13px !important; }

  .countdown {
    width: calc(100vw - 46px);
    max-width: 520px;
    gap: 5px;
    margin-top: 29px;
  }
  .countdown div { padding: 19px 2px 16px; }
  .countdown strong { font-size: clamp(29px, 8.8vw, 38px); }
  .countdown span { font-size: 8px; letter-spacing: .08em; }

  .hosts-flourish { margin-top: 27px; }
  .hosts-names { font-size: clamp(35px, 9.6vw, 47px) !important; }
  .map-button,
  .miras-map-button {
    min-height: 52px;
    padding-inline: 22px;
    font-size: 14px;
  }

  .gallery-section,
  .miras-gallery-section {
    padding-top: 78px;
    padding-bottom: 84px;
  }
  .invite-gallery,
  .miras-gallery { margin-top: 31px; }
  .gallery-photo-2,
  .gallery-photo-3 { transform: none; }

  .audio-fab {
    width: 44px;
    height: 44px;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .countdown span { font-size: 7.5px; letter-spacing: .045em; }
  .countdown strong { font-size: 28px; }
  .gate-card button { min-width: min(250px, 84vw); }
}

@media (prefers-reduced-motion: reduce) {
  .invite-gate.gate-opening { opacity: 0; transform: none; filter: none; }
  .gallery-photo.invite-reveal,
  .miras-photo.invite-reveal { clip-path: none !important; }
  .gallery-photo.invite-reveal img,
  .miras-photo.invite-reveal img { transform: none !important; }
}
.invite-gate.gate-opening .gate-card { animation: none !important; }

/* =========================================================
   Stage 8 — second visual pass from real iPhone + desktop QA
   Tighter rhythm, stronger desktop scale, staggered scroll motion.
   Shared rules intentionally improve every current/future invite template.
   ========================================================= */

/* Stagger the actual content inside a revealed block so scrolling feels alive
   without turning the invitation into a slide presentation. */
.invite-reveal:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > * {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
}
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > * {
  animation: terrainviteChildIn .72s cubic-bezier(.16,1,.3,1) both;
}
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *:nth-child(1) { animation-delay: calc(var(--reveal-delay, 0ms) + 40ms); }
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *:nth-child(2) { animation-delay: calc(var(--reveal-delay, 0ms) + 125ms); }
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *:nth-child(3) { animation-delay: calc(var(--reveal-delay, 0ms) + 215ms); }
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *:nth-child(4) { animation-delay: calc(var(--reveal-delay, 0ms) + 305ms); }
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *:nth-child(5) { animation-delay: calc(var(--reveal-delay, 0ms) + 395ms); }
.invite-reveal.is-visible:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *:nth-child(n+6) { animation-delay: calc(var(--reveal-delay, 0ms) + 465ms); }

@keyframes terrainviteChildIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Countdown cells join one after another. */
.invite-reveal .countdown > div { opacity: 0; transform: translateY(10px) scale(.97); }
.invite-reveal.is-visible .countdown > div { animation: terrainviteCountIn .62s cubic-bezier(.16,1,.3,1) both; }
.invite-reveal.is-visible .countdown > div:nth-child(1) { animation-delay: 220ms; }
.invite-reveal.is-visible .countdown > div:nth-child(2) { animation-delay: 285ms; }
.invite-reveal.is-visible .countdown > div:nth-child(3) { animation-delay: 350ms; }
.invite-reveal.is-visible .countdown > div:nth-child(4) { animation-delay: 415ms; }
@keyframes terrainviteCountIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* Desktop is an editorial invitation, not a mobile page enlarged to a monitor. */
@media (min-width: 900px) {
  .invite:not(.invite-embedded) {
    background:
      radial-gradient(circle at 20% 12%, rgba(255,255,255,.28), transparent 27%),
      radial-gradient(circle at 83% 78%, rgba(91,72,50,.08), transparent 28%),
      #d8d2ca;
  }

  .invite:not(.invite-embedded) .invite-body {
    width: min(1120px, 100%);
    box-shadow: 0 0 78px rgba(47,40,33,.14);
  }

  .invite:not(.invite-embedded) .invite-section {
    padding: 72px 76px;
  }

  .invite:not(.invite-embedded) .intro-section,
  .invite:not(.invite-embedded) .hosts-section,
  .invite:not(.invite-embedded) .contact-section,
  .invite:not(.invite-embedded) .dress-section,
  .invite:not(.invite-embedded) .miras-intro-section,
  .invite:not(.invite-embedded) .miras-hosts-section,
  .invite:not(.invite-embedded) .miras-contact-section,
  .invite:not(.invite-embedded) .miras-dress-section {
    min-height: 350px;
  }

  .invite:not(.invite-embedded) .venue-section,
  .invite:not(.invite-embedded) .miras-venue-section { min-height: 390px; }

  .invite:not(.invite-embedded) .date-section,
  .invite:not(.invite-embedded) .miras-date-section { min-height: 520px; }

  .invite:not(.invite-embedded) .timer-section,
  .invite:not(.invite-embedded) .miras-timer-section { min-height: 360px; }

  .invite:not(.invite-embedded) .final-section,
  .invite:not(.invite-embedded) .miras-final-section { min-height: 540px; }

  .invite:not(.invite-embedded) .invite-kicker {
    font-size: 11px;
    letter-spacing: .29em;
  }

  .invite:not(.invite-embedded) .invite-section h2 {
    font-size: clamp(46px, 4.2vw, 64px);
    max-width: 760px;
  }

  .invite:not(.invite-embedded) .invite-section p {
    font-size: 16px;
    line-height: 1.78;
  }

  .invite:not(.invite-embedded) .invitation-copy {
    font-size: 17px !important;
    max-width: 680px;
  }

  .invite:not(.invite-embedded) .editorial-date strong,
  .invite:not(.invite-embedded) .miras-date-grid strong { font-size: 126px; }

  .invite:not(.invite-embedded) .editorial-date span { font-size: 44px; }

  .invite:not(.invite-embedded) .countdown {
    width: min(660px, 100%);
    gap: 10px;
  }
  .invite:not(.invite-embedded) .countdown div { padding: 25px 8px 21px; }
  .invite:not(.invite-embedded) .countdown strong { font-size: 49px; }
  .invite:not(.invite-embedded) .countdown span { font-size: 9px; letter-spacing: .14em; }

  .invite:not(.invite-embedded) .map-button,
  .invite:not(.invite-embedded) .miras-map-button {
    min-height: 50px;
    padding-inline: 24px;
    font-size: 14px;
  }

  .invite:not(.invite-embedded) .invite-phone-link { font-size: 18px; }

  /* Keep the music control visually attached to the invitation canvas. */
  .invite:not(.invite-embedded) .audio-fab {
    right: max(18px, calc((100vw - 1120px) / 2 + 18px));
    bottom: 18px;
  }
}

/* Real-phone pass: less dead air, while preserving the ceremonial feeling. */
@media (max-width: 560px) {
  .invite-section { padding: 62px 22px; }

  .intro-section,
  .hosts-section,
  .contact-section,
  .dress-section,
  .miras-intro-section,
  .miras-hosts-section,
  .miras-contact-section,
  .miras-dress-section { min-height: auto; }

  .venue-section,
  .miras-venue-section {
    min-height: auto;
    padding-top: 66px;
    padding-bottom: 68px;
  }

  .date-section,
  .miras-date-section {
    min-height: 520px;
    padding-top: 68px;
    padding-bottom: 68px;
  }

  .timer-section,
  .miras-timer-section {
    min-height: 370px;
    padding-top: 62px;
    padding-bottom: 62px;
  }

  .final-section,
  .miras-final-section {
    min-height: 560px;
    padding-top: 76px;
    padding-bottom: 62px;
  }

  .gallery-section,
  .miras-gallery-section {
    padding-top: 66px;
    padding-bottom: 72px;
  }

  .invite-section h2 {
    font-size: clamp(34px, 9vw, 42px);
    line-height: 1.04;
  }

  .intro-section .section-content,
  .miras-intro-section .section-content { max-width: 350px; }

  .editorial-date strong { font-size: clamp(88px, 26vw, 108px); }
  .editorial-date span { font-size: clamp(30px, 8.4vw, 39px); }
  .editorial-date small { margin-top: 12px; }
  .event-time { margin-top: 28px !important; }

  .countdown { margin-top: 27px; }
  .countdown div { padding-top: 18px; padding-bottom: 15px; }
  .countdown strong { font-size: clamp(29px, 8.5vw, 37px); }
  .countdown span { font-size: 8.2px; }

  .hosts-flourish { margin-top: 24px; }
  .hosts-names { margin-bottom: 0 !important; }

  .contact-section h2 { margin-top: 15px; }
  .final-section small { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .invite-reveal:not(.program-row):not(.miras-program-row):not(.gallery-photo):not(.miras-photo) > *,
  .invite-reveal .countdown > div {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
