/* Velvet envelope invite — full-screen lace envelope; a paper card inside steps through 5 pages.
   Single committed look (velvet + paper), so no dark/light switch. */
:root {
  --velvet: #4a111b;
  --velvet-hi: #7a2a36;
  --velvet-deep: #24060b;
  --paper: #f5ede3;
  --paper-2: #ebdccb;
  --field: #fffaf3;
  --ink: #5a1824;
  --ink-soft: #8b6a63;
  --line: #dcc6b2;
  --gold: #c9a25e;
  --gold-hi: #f2dca3;
  --gold-deep: #8d6429;
  --danger: #b3261e;

  --f-display: "Aref Ruqaa", "Amiri", "Traditional Arabic", serif;
  --f-body: "Amiri", "Noto Naskh Arabic", "Times New Roman", serif;

  --ease: cubic-bezier(.65, 0, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--velvet-deep);
  color: var(--ink);
  font-family: var(--f-body);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* page background from an image (behind the envelope) */
.bg-image body { background-size: cover; background-position: center; background-repeat: no-repeat; }
.bg-image .to-guest { color: var(--ink); text-shadow: none; }

#bg, #sparkles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg { z-index: 0; }
/* honeypot field: invisible to people, filled only by bots */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#flora { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#sparkles { z-index: 6; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 8;
  display: flex; justify-content: space-between; align-items: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.icon-btn {
  pointer-events: auto;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(242, 220, 163, .35);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
#shareBtn { margin-inline-start: auto; }
.eq { display: flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.eq i { width: 3px; height: 100%; background: var(--ink); border-radius: 2px; transform-origin: bottom; transform: scaleY(.35); }
.icon-btn[aria-pressed="true"] .eq i { animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; }
.eq i:nth-child(3) { animation-delay: -.6s !important; }
.eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- stage + envelope ---------- */
.stage {
  position: fixed; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stage.is-open { padding: 0; gap: 0; }
/* envelope, seal and hint fade in together once the art is ready */
.stage.booting > #env, .stage.booting > #tapHint, .stage.booting > #toGuest { opacity: 0; }
/* the envelope (seal on it) glides up from below the screen and settles softly; the hint follows */
.stage:not(.booting) > #env { animation: env-rise 3.6s cubic-bezier(.45, .05, .25, 1) both; }
.stage:not(.booting) > #tapHint, .stage:not(.booting) > #toGuest { animation: reveal 1.2s ease 2.6s both; }
/* once the entrance has played (or the editor jumps to a page) it must not replay */
.stage.entered > #env, .stage.entered > #tapHint, .stage.entered > #toGuest { animation: none; }
@keyframes env-rise {
  from { opacity: 0; transform: translateY(42vh) rotate(-.8deg); }
  45% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }

.to-guest {
  margin: 0; color: var(--gold-hi); font-size: 18px; letter-spacing: .02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.to-guest b { font-family: var(--f-display); font-size: 1.25em; font-weight: 700; }

.lace {
  background-color: var(--velvet);
  background-image:
    var(--lace-img, none),
    radial-gradient(130% 90% at 50% 0%, rgba(255, 220, 215, .09), transparent 60%),
    linear-gradient(165deg, var(--velvet-hi), var(--velvet) 55%, var(--velvet-deep));
  background-size: var(--lace-size, 200px) var(--lace-size, 200px), auto, auto;
}

/* envelope texture from an image: same scale on every panel, no tiling seams on a phone screen */
.pat-image .lace {
  background-image: linear-gradient(165deg, rgba(255, 235, 230, .05), rgba(0, 0, 0, .14)), var(--lace-img);
  background-size: auto, min(100vw, 540px) auto;
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, center top;
}
.pat-image .pocket-sides, .pat-image .pocket-bottom { background-position: 0 0, center bottom; }
.pat-image .flap { background-image: linear-gradient(165deg, rgba(255, 235, 230, .08), rgba(0, 0, 0, .1)), var(--lace-img); }
/* sheer lace: the side panels show a lighter rose lining through the open net (a transparent texture) */
.pat-image.lace-sheer .pocket-sides {
  background-color: var(--lace-lining, #93525b);
  background-image: linear-gradient(rgba(0, 0, 0, .04), rgba(0, 0, 0, .1)), var(--lace-img);
}
/* warm light coming through the sheer sides */
.pat-image.lace-sheer .pocket-sides::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(30% 44% at 18% 50%, rgba(244, 206, 194, .4), transparent 100%), radial-gradient(30% 44% at 82% 50%, rgba(244, 206, 194, .4), transparent 100%);
}
.pat-image.lace-sheer .flap, .pat-image.lace-sheer .pocket-bottom, .pat-image.lace-sheer .env-back { background-color: var(--lace-ground, #561722); }
/* embroidered border around the closed envelope */
.pat-image.lace-sheer .env::after {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none;
  border: 7px solid rgba(26, 3, 9, .55);
  box-shadow: inset 0 0 0 1px rgba(150, 80, 90, .35), inset 0 0 0 4px rgba(26, 3, 9, .3);
  background: radial-gradient(circle, rgba(118, 48, 58, .95) 1.6px, transparent 2.1px) 0 0 / 6px 6px;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 2px; transition: opacity .5s;
}
.pat-image.lace-sheer .env.s-seal::after { opacity: 0; }

.env {
  position: relative; flex: none;
  width: 340px; height: 240px;
  perspective: 1400px;
  border-radius: 8px;
  cursor: pointer;
  transition: width 1s var(--ease), height 1s var(--ease), border-radius 1s var(--ease);
}
.env.s-full { border-radius: 0; cursor: default; }
.env-back { position: absolute; inset: 0; border-radius: inherit; z-index: 0; box-shadow: 0 34px 70px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .25); }

.flap-wrap {
  position: absolute; left: 0; right: 0; top: 0; height: var(--flap-depth, 56%);
  z-index: 4; transform-origin: 50% 0;
  transition: transform .8s var(--ease);
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, .45));
}
.flap { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background-position: 63px 41px, 0 0, 0 0; }
.trim { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; pointer-events: none; }
.no-seams .trim { display: none; }
.s-flap .flap-wrap { transform: rotateX(180deg); }
.s-rise .flap-wrap { z-index: 1; }

.card {
  position: absolute; left: 6%; right: 6%; top: 7%; bottom: 6%;
  z-index: 2; overflow: hidden; border-radius: 4px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .7), transparent 70%),
    var(--paper);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, .28);
  transition: top 1.05s var(--ease), bottom 1s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 9px; pointer-events: none;
  border: 1px solid var(--gold); opacity: .5; border-radius: 2px;
}
.s-rise .card { top: -40%; }
.s-full .card { top: 7%; bottom: 3%; }

.pocket-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; height: 100%;
  z-index: 3; pointer-events: none;
  transition: height 1s var(--ease);
  filter: drop-shadow(0 -5px 9px rgba(0, 0, 0, .42));
}
.pocket-sides { position: absolute; inset: 0; clip-path: polygon(0 0, 50% 53%, 100% 0, 100% 100%, 0 100%); }
.pb-wrap { position: absolute; inset: 0; filter: drop-shadow(0 -3px 5px rgba(0, 0, 0, .5)); }
.pocket-bottom { position: absolute; inset: 0; clip-path: polygon(0 100%, 50% 40%, 100% 100%); background-position: 117px 88px, 0 0, 0 0; }
.s-full .pocket-wrap { height: 44%; }

.seal {
  position: absolute; left: 50%; top: var(--seal-y, 56%); z-index: 5;
  width: var(--seal-size, 84px); height: var(--seal-size, 84px); padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .45)) drop-shadow(0 12px 16px rgba(0, 0, 0, .55));
  transition: transform .45s var(--ease), opacity .4s;
  animation: seal-breathe 2.6s ease-in-out infinite;
}
.seal-flat .seal { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.seal svg { width: 100%; height: 100%; stroke: none; display: block; }
.seal .seal-img { position: absolute; left: -4%; top: -4%; width: 108%; height: 108%; object-fit: contain; pointer-events: none; user-select: none; }
.seal .seal-canvas { position: absolute; left: -6%; top: -6%; width: 112%; height: 112%; pointer-events: none; }
.seal:hover { animation-play-state: paused; transform: translate(-50%, -50%) scale(1.06); }
.seal:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 6px; border-radius: 50%; }
.s-seal .seal { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-12deg); pointer-events: none; animation: none; }
@keyframes seal-breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.045); } }

/* ---------- pills / hints ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(201, 162, 94, .5); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  padding: 8px 20px; font-size: 16px; cursor: pointer;
  box-shadow: 0 0 0 5px rgba(245, 237, 227, .16), 0 10px 24px rgba(0, 0, 0, .4);
  transition: opacity .5s, transform .5s var(--ease);
}
.pill i { font-style: normal; color: var(--gold); }
.pill svg { width: 16px; height: 16px; }
.pill:focus-visible, .btn:focus-visible, .mic:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.stage.is-opening #tapHint { opacity: 0; transform: translateY(14px); pointer-events: none; }
.float-hint {
  position: fixed; left: 50%; z-index: 5;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4.5vh);
  transform: translateX(-50%);
  animation: hint-in .6s var(--ease) both;
}
.float-hint svg { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- pages ---------- */
.pages { position: absolute; inset: 0 0 auto; height: 100%; transition: height 1s var(--ease); }
.s-full .pages { height: 60%; }
.page {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(6px, 1.4vh, 12px);
  padding: clamp(18px, 3.2vh, 30px) 9% clamp(8px, 1.6vh, 16px);
  text-align: center;
  overflow-y: auto; scrollbar-width: none;
  opacity: 0; visibility: hidden; transform: translateY(34px);
  transition: opacity .55s, transform .75s var(--ease), visibility 0s linear .75s;
}
.page::-webkit-scrollbar { display: none; }
.page.active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s .15s, transform .8s .1s var(--ease), visibility 0s; }
.page.out-up { transform: translateY(-34px); }
.page.from-top { transform: translateY(-34px); transition: none; }
.page > * { margin: 0; flex: none; }

.names {
  font-family: var(--f-display); font-weight: 700;
  font-size: calc(min(19vw, 10.5vh, 96px) * var(--names-scale, 1)); line-height: 1.02;
  display: flex; flex-direction: column; align-items: center;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.names .amp { font-family: var(--f-body); font-weight: 700; font-size: .4em; color: var(--gold-deep); line-height: 1; margin-block: .02em .08em; }

/* names lockup artwork (SVG is painted with the ink colour unless recolor is off) */
.names-art { width: var(--names-w, 92%); max-width: 460px; display: flex; justify-content: center; }
.names-art svg, .names-art img { display: block; width: 100%; height: auto; max-height: 30vh; }
.names-art.recolor svg { color: var(--ink); }
.names-art.recolor svg * { fill: currentColor; }
body.no-anim *, body.no-anim *::before, body.no-anim *::after { transition: none !important; animation: none !important; }

/* closing page: the names lockup alone, a little larger, drifting in */
.finale-art { width: min(100%, 420px); }
.finale-art svg, .finale-art img { max-height: 44vh; }
.page.active .finale-art { animation: finale-in 1.4s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes finale-in { from { opacity: 0; transform: scale(.92); filter: blur(3px); } }
/* RSVP page with a page after it: mic block moves up, the scroll hint sits under it */
.stage.stacked .voice { bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5vh + 50px); }
.stage.stacked .float-hint { bottom: calc(env(safe-area-inset-bottom, 0px) + 1.2vh); padding: 5px 14px; font-size: 14px; }
.stage.stacked .rec-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5vh + 142px); }

.sep { display: flex; align-items: center; gap: 8px; width: min(64%, 220px); }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to left, transparent, var(--gold)); }
.sep::after { background: linear-gradient(to right, transparent, var(--gold)); }
.sep i { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

.date-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; max-width: 300px; }
.d-side { font-size: calc(clamp(14px, 4vw, 17px) * var(--body-scale, 1)); color: var(--ink-soft); }
.d-mid { display: flex; flex-direction: column; align-items: center; padding: 2px 18px; border-inline: 1px solid var(--gold); }
.d-mid b { font-size: clamp(34px, 10vw, 46px); line-height: 1; font-weight: 700; color: var(--ink); }
.d-mid small { font-size: 13px; color: var(--ink-soft); }

.eyebrow { font-size: calc(clamp(14px, 3.8vw, 16px) * var(--body-scale, 1)); color: var(--ink-soft); }
.title { font-family: var(--f-display); font-weight: 700; font-size: calc(min(9vw, 5vh, 42px) * var(--title-scale, 1)); line-height: 1.25; color: var(--ink); text-wrap: balance; }
.title.small { font-size: calc(min(7.4vw, 30px) * var(--title-scale, 1)); }
.sub { font-size: calc(clamp(14px, 3.8vw, 16px) * var(--body-scale, 1)); color: var(--ink-soft); line-height: 1.6; text-wrap: balance; }

.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, 2.4vw, 12px); width: 100%; max-width: 320px; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cell b {
  width: 100%; max-width: 66px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-size: clamp(20px, 6vw, 26px); font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 4px var(--field), inset 0 0 0 5px rgba(201, 162, 94, .55), 0 3px 8px rgba(90, 24, 36, .08);
}
.cell small { font-size: 13px; color: var(--ink-soft); }
.date-line { font-size: calc(15px * var(--body-scale, 1)); color: var(--ink-soft); }

.story { font-size: calc(clamp(15px, 4.1vw, 17px) * var(--body-scale, 1)); line-height: 1.85; color: var(--ink); max-width: 34ch; text-wrap: pretty; }
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 330px; }
.fam { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.fam h4 { margin: 0; font-family: var(--f-display); font-size: clamp(17px, 5vw, 21px); font-weight: 700; color: var(--ink); }
.fam p {
  margin: 0; width: 100%; white-space: pre-line;
  font-size: 14px; line-height: 1.6; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 7px 6px;
}

.map {
  width: 100%; max-width: 340px; aspect-ratio: 16 / 9; max-height: 22vh;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-2);
  box-shadow: 0 4px 12px rgba(90, 24, 36, .1);
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.venue { font-family: var(--f-display); font-size: calc(min(7.4vw, 30px) * var(--title-scale, 1)); font-weight: 700; color: var(--ink); }
.city { font-size: calc(15px * var(--body-scale, 1)); color: var(--ink-soft); margin-top: -6px !important; }

/* ---------- buttons & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 24px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-size: 17px; font-weight: 700;
  color: var(--paper);
  background: linear-gradient(180deg, var(--velvet-hi), var(--velvet));
  box-shadow: 0 6px 16px rgba(74, 17, 27, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { width: 18px; height: 18px; }
.btn.small { min-height: 40px; padding: 7px 18px; font-size: 15px; }
.btn.ghost { background: var(--field); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }

.rsvp { display: flex; flex-direction: column; gap: 9px; width: 100%; max-width: 330px; }
.field {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: var(--field); padding: 9px 14px; font-size: 16px; color: var(--ink);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: var(--ink-soft); opacity: .7; }
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 94, .22); }
textarea.field { resize: none; line-height: 1.6; min-height: 72px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: grid; place-items: center; min-height: 42px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--field);
  font-size: 15px; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.choice input:checked + label { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.form-err { margin: 0; font-size: 14px; color: var(--danger); }
.rsvp-done { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done-mark { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--gold-hi); }
.done-mark svg { width: 28px; height: 28px; stroke-width: 2.2; }

/* ---------- voice ---------- */
.voice {
  position: fixed; left: 50%; z-index: 5;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 3vh);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--paper); text-align: center;
  animation: hint-in .6s var(--ease) both;
}
.voice p { margin: 0; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.voice-title { font-family: var(--f-display); font-size: 21px; font-weight: 700; }
.voice-sub { font-size: 14px; color: var(--paper-2); margin-bottom: 8px !important; }
.mic {
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--velvet-deep);
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 0 0 6px rgba(242, 220, 163, .16), 0 10px 24px rgba(0, 0, 0, .45);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .2s;
}
.mic svg { width: 26px; height: 26px; stroke-width: 2; }
.mic.is-rec { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(179, 38, 30, .25), 0 10px 24px rgba(0, 0, 0, .45); animation: rec-ring 1.2s ease-out infinite; }
@keyframes rec-ring { 0% { box-shadow: 0 0 0 0 rgba(242, 220, 163, .45), 0 10px 24px rgba(0, 0, 0, .45); } 100% { box-shadow: 0 0 0 22px rgba(242, 220, 163, 0), 0 10px 24px rgba(0, 0, 0, .45); } }

.rec-bar {
  position: fixed; left: 50%; z-index: 7;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 3vh + 92px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 9px 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  white-space: nowrap;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2ch; }
.rec-cancel { color: var(--ink-soft); font-size: 14px; transform: translateX(var(--dx, 0)); opacity: var(--fade, 1); }

/* ---------- player ---------- */
.player { display: flex; align-items: center; gap: 10px; width: 100%; direction: ltr; }
.player .pp {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
}
.player .pp svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.player .track { position: relative; flex: 1; height: 6px; border-radius: 6px; background: var(--line); cursor: pointer; }
.player .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--gold-deep); }
.player .t { flex: none; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 4ch; }

/* ---------- sheet & toast ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 9;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(24, 4, 8, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade .25s both;
}
.sheet-panel {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center;
  background: var(--paper); border-radius: 24px 24px 0 0;
  padding-block: 22px calc(env(safe-area-inset-bottom, 0px) + 22px);
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .4);
  animation: sheet-up .35s var(--ease) both;
}
.sheet-panel .title { margin: 0; }
.sheet-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; z-index: 10;
  top: calc(env(safe-area-inset-top, 0px) + 66px);
  transform: translateX(-50%);
  max-width: min(92vw, 380px); width: max-content;
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: 10px 16px; font-size: 15px; text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
  animation: fade .25s both;
}

@media (max-height: 700px) {
  .page { gap: 6px; padding-top: 16px; }
  .map { max-height: 17vh; }
  textarea.field { min-height: 54px; }
  .rsvp { gap: 7px; }
  .field, .choice label { min-height: 40px; padding-block: 7px; }
}

@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 24px; padding-block: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
