/* ═══════════════════════════════════════════════════════════════════════
   wedding-garden-party-card-sunlight-and-sage — styles.css
   "Sunlight & Sage" — a fresh, whimsical garden-party wedding invitation.

   Palette (the suite's fresh greens, leaning sage & cream):
     card paper  #FFFEF8 · backdrop cream #FDFBF1 · sage #7FA36B / #4E7A45
     leaf #8AAE77 · butter #F2C14E · coral #F08A6B · ink #39423A

   Layout: one 100dvh shell — masthead / tabs / active panel / foot.
   Only the active panel scrolls (html.js gates this; without JS the page
   reads as a normal scrolling document with every panel in order).
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* palette */
  --paper: #FFFEF8;
  --cream: #FDFBF1;
  --cream-deep: #F3F1E3;
  --sage: #7FA36B;
  --sage-deep: #4E7A45;
  --leaf: #8AAE77;
  --butter: #F2C14E;
  --butter-deep: #E0A93B;
  --coral: #F08A6B;
  --coral-deep: #E2704E;
  --mint: #EEF4E6;
  --ink: #39423A;
  --muted: #7C8576;
  --line: rgba(57, 66, 58, 0.16);

  /* type */
  --font-script: "Caveat", "Segoe Print", cursive;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-ui: "Quicksand", "Helvetica Neue", Arial, sans-serif;

  /* shape */
  --radius: 16px;
  --shadow-soft: 0 14px 40px rgba(78, 102, 69, 0.14);
  --shadow-card: 0 26px 70px rgba(78, 102, 69, 0.22);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { height: 100%; }

body {
  height: 100%;
  background:
    radial-gradient(120% 90% at 50% 0%, #FFFEF8 0%, var(--cream) 55%, var(--cream-deep) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* faint paper grain so the card feels like real stock */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ── the shell ───────────────────────────────────────────────────────────
   Default (no JS): normal document flow. With JS: a 100dvh grid where
   only the active panel scrolls. */
.app { min-height: 100%; }

html.js .app {
  height: 100dvh;
  display: grid;
  /* masthead / tabs / active panel / foot / powered-by strip */
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.tabs { display: none; }
html.js .tabs { display: flex; }

.panel { padding: 0 0 8px; }
html.js .panel {
  display: none;
  position: absolute;
  inset: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
html.js .panel.is-active { display: block; }
html.js .panel > * { scroll-margin-top: 18px; }

html.js .panels {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* ── masthead ─────────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 3vw, 28px);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(253, 251, 241, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(57, 66, 58, 0.08);
}

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

.masthead__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #FFFEF8, var(--mint));
  box-shadow: inset 0 0 0 1px rgba(127, 163, 107, 0.45), 0 4px 12px rgba(127, 163, 107, 0.3);
}

.masthead__text { min-width: 0; line-height: 1.25; }
.masthead__top {
  display: block;
  font: 600 9.5px var(--font-ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage);
}
.masthead__name {
  display: block;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 22px;
  color: var(--sage-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masthead__name i { font-style: normal; color: var(--butter-deep); padding: 0 2px; }

.masthead__actions { display: flex; gap: 8px; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 254, 248, 0.85);
  color: var(--ink);
  font: 600 13px var(--font-ui);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}
.chip-btn:hover { border-color: var(--sage); color: var(--sage-deep); }
.chip-btn:active { transform: translateY(1px); }
.chip-btn.is-done { border-color: var(--sage-deep); color: var(--sage-deep); }

/* ── tabs ──────────────────────────────────────────────────────────────── */
.tabs {
  gap: 4px;
  padding: 6px clamp(10px, 2.5vw, 24px) 8px;
  background: rgba(253, 251, 241, 0.78);
  border-bottom: 1px solid rgba(57, 66, 58, 0.08);
  /* Grid-item min-size suppression: without this the bar refuses to shrink
     below its content width and pushes the ‹ › arrows off-screen. The inner
     .tabs-scroll does the actual sideways scrolling. */
  overflow-x: hidden;
}
/* Inner scroll strip holds only the tab labels — the ‹ › arrows sit outside
   it, pinned at the bar's edges even when the labels overflow sideways. */
.tabs-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font: 600 12px var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.tab:hover { color: var(--coral-deep); }
.tab[aria-selected="true"] {
  color: #FFFEF8;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  box-shadow: 0 6px 16px rgba(78, 122, 69, 0.4);
}

/* ── mobile ‹ › arrows ───────────────────────────────────────────────── */
/* Circular icon buttons flanking the labeled tabs: one tap pages to the
   previous/next panel like a carousel. Disabled at the ends by main.js;
   hidden on wide screens where every tab fits at once. */
.tabs .tab-arrow {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(57, 66, 58, 0.08);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, opacity 0.2s;
}
.tabs .tab-arrow:hover:not(:disabled) { color: var(--coral-deep); background: rgba(57, 66, 58, 0.14); }
.tabs .tab-arrow:active:not(:disabled) { transform: scale(0.94); }
.tabs .tab-arrow:disabled { opacity: 0.32; cursor: default; }
.tabs .tab-arrow:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 2px; }
@media (max-width: 640px) {
  html.js .tabs .tab-arrow { display: inline-flex; }
}

/* ── hero: the invitation card on a sage-lit backdrop ─────────────────── */
.hero-panel {
  position: relative;
  background:
    radial-gradient(110% 85% at 50% 26%, rgba(255, 254, 248, 0.96) 0%, rgba(255, 254, 248, 0.5) 52%, transparent 82%),
    linear-gradient(180deg, #E9EFDE 0%, #F3F1E3 100%);
}

.daisies {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}
.daisies--a { top: 16%; left: 8%; width: clamp(18px, 3vw, 30px); height: auto; transform: rotate(12deg); }
.daisies--b { top: 30%; right: 10%; width: clamp(20px, 3.4vw, 34px); height: auto; transform: rotate(-16deg); }
.daisies--c { bottom: 22%; left: 12%; width: clamp(16px, 2.6vw, 26px); height: auto; transform: rotate(-8deg); }
.daisies--d { bottom: 34%; right: 8%; width: clamp(18px, 3vw, 30px); height: auto; transform: rotate(20deg); }

/* the invitation sheet itself */
.card {
  position: relative;
  z-index: 2;
  margin: clamp(22px, 5vh, 44px) auto;
  width: min(480px, calc(100% - 28px));
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(127, 163, 107, 0.45);
  overflow: hidden;
}

/* scalloped sage band across the top of the card */
.card__scallop {
  display: block;
  width: 100%;
  height: auto;
}

/* pressed-flower corner sprays (pure decoration) */
.card__corner {
  position: absolute;
  width: clamp(76px, 20vw, 104px);
  height: auto;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
}
.card__corner svg { display: block; width: 100%; height: auto; }
.card__corner--tl { top: 10px; left: 10px; }
.card__corner--tr { top: 10px; right: 10px; }
.card__corner--bl { bottom: 10px; left: 10px; }
.card__corner--br { bottom: 10px; right: 10px; }

.card__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(16px, 3.4vw, 28px) clamp(18px, 5vw, 40px) clamp(22px, 4.4vw, 34px);
}

.card__greeting {
  margin: 0 0 16px;
  font: 600 13.5px var(--font-ui);
  letter-spacing: 0.03em;
  color: var(--sage-deep);
  background: rgba(238, 244, 230, 0.85);
  border: 1px dashed rgba(127, 163, 107, 0.6);
  border-radius: 999px;
  padding: 7px 16px;
}
.card__greeting b { font-weight: 700; }

.card__medallion { margin: 4px 0 14px; }

.card__hosts {
  margin: 0;
  font: 600 11px var(--font-ui);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
}

.card__request {
  margin: 12px 0 0;
  font: italic 500 clamp(16px, 3.4vw, 19px) var(--font-serif);
  color: var(--ink);
  line-height: 1.5;
  text-wrap: balance;
}

.card__names {
  margin: 14px 0 0;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(50px, 11vw, 74px);
  line-height: 1.02;
  color: var(--sage-deep);
  text-wrap: balance;
}
.card__amp {
  font-style: normal;
  color: var(--butter-deep);
  padding: 0 0.12em;
  font-size: 0.82em;
  vertical-align: 0.06em;
}

.card__ornament { margin: 10px 0 6px; width: min(160px, 60vw); height: auto; }

.card__date {
  margin: 8px 0 0;
  font: 500 clamp(15.5px, 3vw, 17.5px) var(--font-serif);
  color: var(--ink);
  line-height: 1.55;
  text-wrap: balance;
}
.card__date em { font-weight: 500; color: var(--sage-deep); }

.card__place {
  margin: 16px 0 0;
  font: 400 15.5px var(--font-serif);
  color: var(--ink);
  line-height: 1.55;
  text-wrap: balance;
}
.card__place strong { font-weight: 600; color: var(--coral-deep); }
.card__place span { display: block; margin-top: 4px; font-style: italic; color: var(--muted); }

.card__dress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
}
.card__dress p {
  margin: 0;
  font: 600 11px var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.card__dash {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 163, 107, 0.7), transparent);
}

.card__reply {
  margin: 18px 0 0;
  font: italic 500 14.5px var(--font-serif);
  color: var(--muted);
  line-height: 1.55;
}

/* optional couple cover — a large framed portrait under the scalloped
   band, like the photo cover of the invitation: a cream mat with a sage
   ring and a soft shadow. Clicking it opens the photo viewer. */
.card__cover {
  position: relative;
  width: 100%;
  margin: 0;
  padding: clamp(10px, 2vw, 14px) clamp(10px, 2vw, 14px) clamp(14px, 2.6vw, 18px);
  background: var(--paper);
  border-bottom: 1px solid rgba(127, 163, 107, 0.45);
}
.card__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid var(--sage);
  box-shadow:
    0 0 0 3px var(--paper),
    0 12px 26px rgba(78, 102, 69, 0.24);
}

/* ── content column for tab panels ────────────────────────────────────── */
.panel-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 28px) clamp(36px, 6vw, 64px);
}

/* ── section head ─────────────────────────────────────────────────────── */
.section-head { text-align: center; margin-bottom: 30px; }
.section-head .kicker {
  margin: 0 0 8px;
  font: 700 11.5px var(--font-ui);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--sage);
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 54px);
  line-height: 1.05;
  color: var(--sage-deep);
  text-wrap: balance;
}
.section-head .lede {
  margin: 12px auto 0;
  max-width: 46em;
  font-size: 16.5px;
  color: var(--muted);
  line-height: 1.6;
}
.section-head .lede strong { color: var(--coral-deep); font-weight: 700; }

/* ── countdown tiles (self-driven; never .count-*) ────────────────────── */
.countdown-tiles { text-align: center; margin-bottom: 34px; }
.countdown-tiles__label {
  margin: 0 0 12px;
  font: 700 11px var(--font-ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.tiles {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 14px);
}
.tile {
  min-width: clamp(58px, 14vw, 76px);
  padding: 12px 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(127, 163, 107, 0.4);
  background: linear-gradient(180deg, var(--paper), #F4F2E4);
  box-shadow: 0 8px 22px rgba(78, 102, 69, 0.12);
}
.tile-num {
  display: block;
  font: 700 clamp(22px, 4.6vw, 30px) var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--sage-deep);
}
.tile-cap {
  display: block;
  font: 600 9.5px var(--font-ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.countdown-tiles__here {
  margin: 14px 0 0;
  font: 700 17px var(--font-script);
  color: var(--coral-deep);
}

/* ── block titles / timeline ──────────────────────────────────────────── */
.block-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font: 700 12px var(--font-ui);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--sage);
}
.block-title::before,
.block-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 163, 107, 0.5), transparent);
}

.timeline { list-style: none; margin: 0 0 34px; padding: 0; }
.timeline-item {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 13px 4px 13px 0;
  border-bottom: 1px dashed rgba(127, 163, 107, 0.45);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item__time {
  flex: none;
  width: 82px;
  font: 700 15.5px var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--coral-deep);
}
.timeline-item__text { font-size: 16.5px; color: var(--ink); }

/* ── venues ────────────────────────────────────────────────────────────── */
.event-list { display: grid; gap: 14px; margin-bottom: 30px; }
.event-item {
  position: relative;
  padding: 20px 20px 18px;
  border-radius: var(--radius);
  /* no flat solid border — a soft hairline plus a pressed sprig do the
     framing, so the card reads as stationery rather than a flat AI box */
  border: 1px solid rgba(127, 163, 107, 0.22);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
/* inset dashed sage rule = a second, inner frame. Together with the
   outer hairline it gives a double-line stamped edge (like the card
   front's medallion), not a single generic border. */
.event-item::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(127, 163, 107, 0.4);
  border-radius: 12px;
  pointer-events: none;
}
/* a single pressed sprig pinned top-right — replaces the old multi-colour
   gradient stripe (which read as generic/AI). One motif, hand-placed. */
.event-item::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 11px;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 21c0-5 3-8 8-9' stroke='%237FA36B' stroke-width='1.4' stroke-linecap='round'/%3E%3Cpath d='M12 21c0-3 2-5 5-6' stroke='%238AAE77' stroke-width='1.2' stroke-linecap='round'/%3E%3Cellipse cx='15' cy='14' rx='2.4' ry='4' transform='rotate(-35 15 14)' fill='%238AAE77'/%3E%3Cellipse cx='18' cy='11' rx='2' ry='3.4' transform='rotate(20 18 11)' fill='%237FA36B'/%3E%3Cellipse cx='9' cy='17' rx='2' ry='3.4' transform='rotate(35 9 17)' fill='%238AAE77'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0.9;
  pointer-events: none;
}
.event-item__chip {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--sage-deep);
  font: 700 10.5px var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.event-item__title { margin: 10px 0 4px; font: 700 22px var(--font-ui); color: var(--sage-deep); }
.event-item__when { margin: 0; font: 600 13px var(--font-ui); color: var(--coral-deep); }
.event-item__addr { margin: 6px 0 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.event-item__actions { margin-top: 12px; }

/* ── notes ─────────────────────────────────────────────────────────────── */
.notes {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px dashed rgba(127, 163, 107, 0.65);
  background: rgba(238, 244, 230, 0.55);
}
.note { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.55; }
.note strong { color: var(--sage-deep); font-weight: 700; }

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 14px var(--font-ui);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--butter-deep); outline-offset: 2px; }
.btn--primary {
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: #FFFEF8;
  box-shadow: 0 12px 28px rgba(78, 122, 69, 0.38);
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--sage); color: var(--sage-deep); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* loading node (driven by the platform script) */
.loading { display: none; text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 0; }

/* ── RSVP deadline countdown (platform-driven .count-*) ────────────────── */
.rsvp-countdown {
  margin: -6px 0 22px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px dashed rgba(226, 170, 52, 0.7);
  background: rgba(242, 193, 78, 0.16);
  text-align: center;
  font-size: 13.5px;
}
.rsvp-countdown__label { margin: 0 0 4px; font: 700 10.5px var(--font-ui); letter-spacing: 0.26em; text-transform: uppercase; color: var(--butter-deep); }
.rsvp-countdown__nums { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.rsvp-countdown__nums span { color: var(--coral-deep); font-size: 17px; }

/* ── forms (RSVP + injected guestbook) ─────────────────────────────────── */
.rsvp-form { display: grid; gap: 16px; }

.form-group { display: grid; gap: 6px; }
.form-group label {
  font: 700 12px var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.form-group label small {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: 500 15px var(--font-ui);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group textarea { resize: vertical; min-height: 76px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: #A9B2A0; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(127, 163, 107, 0.22);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-hint { margin: -8px 0 0; font-size: 13px; font-style: italic; color: var(--muted); }

.error { min-height: 16px; font: 600 12.5px var(--font-ui); color: #C03F2E; }
.error:empty { display: none; }

.rsvp-extras {
  display: grid;
  gap: 16px;
  padding: 16px 16px 2px;
  border-radius: 14px;
  border: 1px dashed rgba(127, 163, 107, 0.6);
  background: rgba(238, 244, 230, 0.5);
  transition: opacity 0.3s, filter 0.3s;
}

/* decline state: dim party-size + meal fields (visual only — fields stay
   enabled and submission is never intercepted; the platform owns the form) */
form.is-declining .rsvp-extras { opacity: 0.45; filter: grayscale(0.5); }

.declined-note {
  display: none;
  margin: -4px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(242, 193, 78, 0.2);
  color: var(--butter-deep);
  font: 700 19px var(--font-script);
  text-align: center;
}
form.is-declining .declined-note { display: block; }

/* ── guestbook (Style A: platform injects form + list into .guestbook-body) ── */
.guestbook-section #guestbookForm .form-group { margin-bottom: 14px; }
.guestbook-section #guestbookForm input.form-control,
.guestbook-section #guestbookForm textarea.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: 500 15px var(--font-ui);
}
.guestbook-section #guestbookForm input.form-control:focus,
.guestbook-section #guestbookForm textarea.form-control:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(127, 163, 107, 0.22);
}
.guestbook-section #guestbookForm button[type="submit"] {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px auto 0;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%) !important;
  color: #FFFEF8 !important;
  font: 600 14px var(--font-ui);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(78, 122, 69, 0.38);
}
.guestbook-section #guestbookForm button[type="submit"]:hover { filter: brightness(1.06); }

/* injected message list — neutralise the engine's inline scroll box */
.guestbook-section #comments-container {
  margin-top: 28px !important;
  border-top: 1px solid var(--line) !important;
  max-height: none !important;
  overflow: visible !important;
}
.guestbook-section .guestbook-entry {
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(127, 163, 107, 0.35);
  background: var(--paper);
  box-shadow: 0 4px 16px rgba(78, 102, 69, 0.08);
  word-break: break-word;
}
.guestbook-section .guestbook-entry h5 { margin: 0 0 4px; font: 700 15px var(--font-ui); color: var(--sage-deep); }
.guestbook-section .guestbook-entry p { margin: 0 0 4px; font-size: 15px; line-height: 1.55; color: var(--ink); }
.guestbook-section .guestbook-entry small { color: var(--muted); font-size: 12px; }

.guestbook-section .more-guestbook-wrap { text-align: center; margin-top: 18px; }
.guestbook-section #load-more {
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 600 14px var(--font-ui);
  cursor: pointer;
}
.guestbook-section #load-more:hover { border-color: var(--sage); color: var(--sage-deep); }

/* ── free page (OPTIONAL host-filled panel) ─────────────────────────────
   The free page is a host-filled extra panel (#panel-free): a title and
   repeatable blocks — each a title, free text and an OPTIONAL photo. The
   platform hides the whole section when it is empty or switched off; the
   tab disappears with it because the tabs are generated from the panels
   that exist. Leave the image empty in the editor (or delete the
   .free-block__media figure) and the block still works without it. */
.free-blocks {
  display: grid;
  gap: 16px;
}
.free-block {
  padding: clamp(18px, 3.4vw, 26px) clamp(18px, 4vw, 30px);
  border-radius: var(--radius);
  border: 1px solid rgba(127, 163, 107, 0.22);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.free-block__title {
  margin: 0 0 8px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(24px, 4.6vw, 30px);
  line-height: 1.15;
  color: var(--sage-deep);
  overflow-wrap: anywhere;
}
.free-block__content {
  margin: 0;
  font: 400 16px var(--font-serif);
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.free-block__media {
  margin: 16px auto 0;
  max-width: 560px;
}
/* the engine strips the <img> when the host leaves the photo empty — an
   empty figure would otherwise leave a stray frame behind */
.free-block__media:empty { display: none; }
.free-block__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 5px;
  background: var(--paper);
  border: 1px solid rgba(127, 163, 107, 0.4);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(78, 102, 69, 0.12);
}
.free-block__cap {
  margin: 8px 2px 0;
  font: 600 17px var(--font-script);
  color: var(--sage-deep);
}

/* thank-you / closed states injected by the platform scripts */
.thank-you-message { text-align: center; padding: 26px 12px; }
.thank-you-message h3 {
  margin: 0 0 8px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 38px;
  color: var(--sage-deep);
}
.thank-you-message p { margin: 4px 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ── optional media: flyer/banner ──────────────────────────────────────
   A wide framed image slot for hosts who already have a designed flyer or
   poster for the wedding — display it so guests can confirm they're in the
   right place. Clicking it opens the same full-screen viewer as the photos. */
.banner-flyer {
  margin: 0 auto 34px;
  max-width: 660px;
  text-align: center;
}
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  padding: 6px;
  background: var(--paper);
  border: 1px solid rgba(127, 163, 107, 0.45);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.banner-flyer figcaption {
  margin-top: 9px;
  font: 600 16px var(--font-script);
  color: var(--muted);
}

/* ── optional media: "Garden moments" gallery ────────────────────────── */
.story-gallery {
  margin-bottom: 34px;
  text-align: center;
}
.gallery-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 18px;
  font: 700 12px var(--font-ui);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--sage);
}
.gallery-label::before,
.gallery-label::after {
  content: "";
  flex: 1;
  max-width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 163, 107, 0.5), transparent);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.gallery-item { margin: 0; }
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 5px;
  background: var(--paper);
  border: 1px solid rgba(127, 163, 107, 0.4);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(78, 102, 69, 0.12);
}
.gallery-item figcaption {
  margin-top: 8px;
  font: 600 17px var(--font-script);
  color: var(--sage-deep);
}

/* ── optional media: film feature (video URL embed) ─────────────────────
   A poster + play button that lazy-loads an <iframe> from the URL in
   data-video-url (YouTube / Vimeo / any embeddable URL). Nothing loads
   until the guest taps play — fast, and consent-friendly. */
.film-card {
  margin-bottom: 34px;
  text-align: center;
}
.film-frame {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: var(--mint); /* mat behind the poster / while loading */
  border: 1px solid rgba(127, 163, 107, 0.45);
  box-shadow: var(--shadow-soft);
}
.film-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.film-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(56px, 12vmin, 72px);
  height: clamp(56px, 12vmin, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFEF8;
  background: radial-gradient(circle at 32% 28%, var(--sage) 0%, var(--sage-deep) 100%);
  border: 1px solid rgba(255, 254, 248, 0.7);
  box-shadow: 0 12px 28px rgba(78, 102, 69, 0.45);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform 0.25s ease;
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play { transform: translate(-50%, -50%) scale(1.08); }
.film-open:focus-visible { outline: 2px solid var(--butter-deep); outline-offset: 3px; }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(57, 66, 58, 0.6);
  color: #FFFEF8;
  font: 700 10px var(--font-ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  font-style: italic;
  text-align: center;
  background: var(--mint);
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font: 700 11.5px var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 193, 78, 0.6);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.film-external:hover { color: var(--butter-deep); border-color: var(--butter-deep); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px rgba(78, 102, 69, 0.45), 0 0 0 0 rgba(242, 193, 78, 0.35); }
  50% { box-shadow: 0 12px 28px rgba(78, 102, 69, 0.45), 0 0 0 14px rgba(242, 193, 78, 0); }
}

/* ── photo viewer (lightbox with zoom) ──────────────────────────────────
   Click any photo to open it full-screen; zoom with the +/− buttons,
   double-tap, or the keyboard; pan by dragging or scrolling while zoomed;
   "Open original" opens the source image in a new tab. Built at runtime
   by main.js from whatever [data-lightbox] slots exist — removing those
   blocks removes the viewer entirely (no orphaned UI, no platform contract). */
html.js .card__cover, html.js .gallery-item img, html.js .banner-flyer img, html.js .free-block__media img { cursor: zoom-in; }

/* small "view full size" magnifier badge on hover / keyboard focus — shows
   the photo is clickable. Purely visual; without JS it never appears. */
html.js .card__cover, html.js .gallery-item, html.js .banner-flyer, html.js .free-block__media { position: relative; }
html.js .card__cover::after,
html.js .gallery-item::after,
html.js .banner-flyer::after,
html.js .free-block__media::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 254, 248, 0.94)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E7A45' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E")
    center / 15px no-repeat;
  border: 1px solid rgba(127, 163, 107, 0.6);
  box-shadow: 0 4px 12px rgba(78, 102, 69, 0.25);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
html.js .card__cover:hover::after,
html.js .card__cover:focus-within::after,
html.js .gallery-item:hover::after,
html.js .gallery-item:focus-within::after,
html.js .banner-flyer:hover::after,
html.js .banner-flyer:focus-within::after,
html.js .free-block__media:hover::after,
html.js .free-block__media:focus-within::after {
  opacity: 1;
  transform: none;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(14px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  background: rgba(57, 66, 58, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.photo-viewer.is-open { display: flex; }
.photo-viewer figure {
  margin: 0;
  width: 100%;
  max-width: min(94vw, 980px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.pv-stage {
  position: relative;
  width: 100%;
  height: min(68dvh, 70vh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
}
.pv-stage.is-zoomed { display: block; cursor: grab; }
.pv-stage.is-zoomed.is-dragging { cursor: grabbing; }
.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border: 6px solid var(--paper);
  border-radius: 10px;
  background: var(--mint); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  user-select: none;
  -webkit-user-drag: none;
}
.photo-viewer .pv-unavailable {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  background: var(--mint);
  border: 6px solid var(--paper);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}
.photo-viewer figcaption {
  font: 600 21px var(--font-script);
  color: #F7F3E3;
}
.pv-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.pv-zoom {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(247, 243, 227, 0.5);
  background: rgba(255, 254, 248, 0.94);
  color: var(--sage-deep);
  font: 700 19px var(--font-ui);
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s, background-color 0.2s;
}
.pv-zoom:hover { background: #fff; transform: scale(1.06); }
.pv-zoom:disabled { opacity: 0.45; cursor: default; transform: none; }
.pv-zoom-num {
  min-width: 54px;
  font: 700 11.5px var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: #F7F3E3;
}
.pv-original {
  margin-left: 8px;
  font: 700 11px var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F7F3E3;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 243, 227, 0.5);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.pv-original:hover { color: var(--butter); border-color: var(--butter); }

.pv-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(247, 243, 227, 0.5);
  background: rgba(255, 254, 248, 0.94);
  color: var(--sage-deep);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s, background-color 0.2s;
}
.pv-btn:hover { transform: scale(1.06); background: #fff; }
.pv-close { top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
.pv-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
.pv-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.06); }
.photo-viewer :focus-visible { outline: 2px solid var(--butter-deep); outline-offset: 2px; }

/* ── foot ─────────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(14px, 3vw, 28px);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: rgba(253, 251, 241, 0.92);
  color: var(--muted);
  border-top: 1px solid rgba(57, 66, 58, 0.08);
  font-size: 12.5px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.foot::-webkit-scrollbar { display: none; }
.foot__dot { opacity: 0.5; }
/* brand footer placeholder (replace the text, or let the platform inject) */
.foot .footer-brand {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--sage-deep);
}
.foot .footer-brand i { font-style: normal; color: var(--butter-deep); }

/* ── powered-by brand strip (full-width footer line) ────────────────────
   A slim "Powered by Kundangi" line at the very foot of the app. The
   engine swaps the literal brand token for the platform name at render;
   the cockpit's Free Powered By field can override the whole line.
   Full-width in both the JS shell (the extra auto row of the .app grid)
   and the no-JS stacked document (its natural place at the end). */
.powered-by {
  width: 100%;
  text-align: center;
  font: 700 9.5px var(--font-ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
html:not(.js) .powered-by {
  padding: 14px 16px 22px;
  border-top: 1px solid rgba(57, 66, 58, 0.08);
}
html.js .powered-by {
  padding: 7px 14px;
  border-top: 1px solid rgba(57, 66, 58, 0.08);
  background: rgba(253, 251, 241, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.powered-by .link-footer { color: var(--sage-deep); font-weight: 700; }

/* ── focus visibility (global) ────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--butter-deep);
  outline-offset: 2px;
}

/* ── reveal-on-scroll (JS adds .is-visible; reduced-motion skips it) ────
   Gated behind html.js: without JavaScript the stacked document must stay
   fully readable — never invisible content. */
html.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ── small screens: reclaim vertical space ────────────────────────────── */
@media (max-height: 640px) {
  .masthead { padding-top: 6px; padding-bottom: 6px; }
  .masthead__top { display: none; }
  .foot { display: none; }
}
@media (max-width: 520px) {
  .chip-btn { padding: 8px 10px; }
  .chip-btn__label { display: none; }
  /* roomier touch targets for the text tabs */
  .tab { padding: 12px 14px; font-size: 13px; }
  .form-row { grid-template-columns: 1fr; }
  .card__dress p { white-space: normal; }
  .gallery-grid { grid-template-columns: 1fr; }
  /* viewer: prev/next drop below the photo so they never cover it */
  .photo-viewer { padding: 10px; flex-direction: column; gap: 10px; }
  .photo-viewer figure { max-width: 100%; }
  .pv-stage { height: min(58dvh, 60vh); }
  .photo-viewer img { border-width: 4px; }
  .pv-prev, .pv-next { position: static; transform: none; width: 40px; height: 40px; }
  .pv-prev:hover, .pv-next:hover { transform: scale(1.06); }
  .photo-viewer .pv-close { top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); }
}

/* ── reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
html.no-motion *, html.no-motion *::before, html.no-motion *::after {
  animation: none !important;
  transition: none !important;
}
html.no-motion [data-reveal] { opacity: 1; transform: none; }

/* ── print: flatten to readable pages ─────────────────────────────────── */
@media print {
  html.js .app { height: auto; display: block; overflow: visible; }
  html.js .panel { display: block !important; overflow: visible !important; position: static; }
  .masthead__actions, .tabs, .foot, .no-print, .powered-by { display: none !important; }
  body { background: #fff; }
  .panel-inner { max-width: none; padding: 12px; }
  .hero-panel { background: #fff; }
  .card { margin: 0 auto; box-shadow: none; page-break-inside: avoid; }
  .daisies { display: none; }
  .countdown-tiles, .timeline-item, .event-item, .notes, .banner-flyer, .story-gallery, .film-card { page-break-inside: avoid; }
  /* the viewer never prints; a playing film iframe prints its poster instead */
  .photo-viewer { display: none !important; }
  .film-frame iframe { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
