:root {
  --bg: #f4f2ef;
  --surface: #ffffff;
  --fill: #f1eeea;          /* inputs, tonal buttons */
  --fill-strong: #e7e2dc;
  --ink: #1d1a17;
  --ink-2: #6d655e;
  --ink-3: #a59d95;
  --brand: #ff5a3c;
  --brand-2: #ff8a3c;
  --on-brand: #ffffff;
  --brand-tint: #ffece7;
  --ok: #1f9d63; --ok-tint: #e2f6ec;
  --no: #d64545; --no-tint: #fde8e8;
  --wait: #b7791f; --wait-tint: #fdf3dc;
  --wa: #22b35e;
  --shadow: 0 1px 2px rgba(29, 26, 23, .04), 0 8px 24px -12px rgba(29, 26, 23, .12);
  --shadow-up: 0 -8px 30px -12px rgba(29, 26, 23, .18);
  --r-lg: 24px; --r: 16px; --r-sm: 12px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110; --surface: #1d1b19; --fill: #262320; --fill-strong: #322e2a;
    --ink: #f5f1ec; --ink-2: #b2a99f; --ink-3: #7a726a;
    --brand: #ff6b4f; --brand-2: #ff9a55; --on-brand: #1a0f0b; --brand-tint: #3a211a;
    --ok: #4cd18b; --ok-tint: #173226; --no: #ff7b7b; --no-tint: #3a1d1d; --wait: #f0b955; --wait-tint: #382c14;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
    --shadow-up: 0 -10px 30px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* The hidden attribute always wins over display rules (sheets, toggles, menus). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; letter-spacing: -.02em; line-height: 1.12; font-weight: 800; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
small { font-size: .82rem; font-weight: 500; color: var(--ink-2); }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i.chev { width: 18px; height: 18px; color: var(--ink-3); margin-left: auto; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(32px + var(--safe-b)); }

/* ---------- Top bar & brand ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 17px; }
.appbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.appbar-title b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title > span:last-child { min-width: 0; }
.iconbtn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.iconbtn:active { transform: scale(.94); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px; font-weight: 700; font-size: .98rem; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); box-shadow: 0 10px 24px -10px var(--brand); }
.btn.tonal { background: var(--fill); }
.btn.tonal.wa, .action.wa { background: color-mix(in srgb, var(--wa) 14%, transparent); color: var(--wa); }
.btn.block { width: 100%; min-height: 56px; font-size: 1.05rem; }
.btn .i { width: 20px; height: 20px; }
.link { border: 0; background: none; padding: 6px 0; color: var(--brand-ink, var(--brand)); font-weight: 700; font-size: .9rem; cursor: pointer; }
.sticky-cta { position: sticky; bottom: calc(12px + var(--safe-b)); z-index: 5; margin-top: 20px; }
.dash .sticky-cta { bottom: calc(var(--tabbar-h) + 12px + var(--safe-b)); }

/* ---------- Grouped lists & fields ---------- */
.group-title { margin: 28px 4px 10px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.group + .group { margin-top: 12px; }
.group > * + * { box-shadow: inset 0 1px 0 var(--fill); }  /* hairline made of fill, not a border */
.field { display: block; padding: 12px 16px 14px; }
.field > span { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field > span small { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
input, select, textarea {
  width: 100%; border: 0; outline: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--ink);
  font: 500 16px/1.4 var(--font); padding: 13px 14px; appearance: none; -webkit-appearance: none;
  transition: box-shadow .15s ease, background .15s ease;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a59d95' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
textarea { resize: vertical; min-height: 52px; }
input:focus, select:focus, textarea:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--brand); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[readonly] { color: var(--ink-2); }
input[type=date], input[type=time] { min-height: 48px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; }
.pair .field + .field { box-shadow: inset 1px 0 0 var(--fill); }

.row, .info {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; min-height: 60px;
  border: 0; background: none; text-align: left; cursor: pointer;
}
.row:active, .info:active { background: var(--fill); }
.row > span, .info > span { flex: 1; min-width: 0; }
.row b, .info b { display: block; font-weight: 700; }
.row small, .info small { display: block; }
.row > .i:first-child, .info > .i:first-child { color: var(--brand-ink, var(--brand)); }
.row em { font-style: normal; font-weight: 800; font-size: 1.1rem; }
.row.danger, .row.danger .i { color: var(--no); }

.switch { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.switch > span { flex: 1; } .switch b { display: block; font-weight: 700; } .switch small { display: block; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { flex: none; width: 52px; height: 32px; border-radius: 99px; background: var(--fill-strong); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 2px var(--brand); }

/* Event type carousel */
.typepicker { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
.typepicker::after { content: ""; flex: 0 0 6px; }  /* right edge breathing room */
.typepicker::-webkit-scrollbar { display: none; }
.typepicker label { scroll-snap-align: start; flex: none; cursor: pointer; }
.typepicker input { position: absolute; opacity: 0; }
.typepicker span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 92px; height: 92px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); font-size: .75rem; font-weight: 700; text-align: center; padding: 6px; color: var(--ink-2); transition: transform .15s, background .15s; }
.typepicker b { font-size: 1.8rem; line-height: 1; }
.typepicker input:checked + span { background: var(--ink); color: var(--surface); transform: translateY(-2px); }
.typepicker input:focus-visible + span { box-shadow: 0 0 0 2px var(--brand); }

/* Segmented */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--fill); border-radius: 20px; margin-bottom: 12px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: grid; place-items: center; min-height: 52px; border-radius: 15px; font-weight: 700; cursor: pointer; color: var(--ink-2); transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented label:first-child input:checked + span { background: var(--brand); color: var(--on-brand); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 2px var(--brand); }

/* Banners & toast */
.banner { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--fill); font-weight: 600; }
.banner.ok { background: var(--ok-tint); color: var(--ok); }
.banner.no { background: var(--no-tint); color: var(--no); }
.fine { display: flex; gap: 8px; align-items: flex-start; margin: 16px 4px 0; font-size: .82rem; color: var(--ink-2); }
.fine .i { width: 16px; height: 16px; margin-top: 2px; }
.fine.center { justify-content: center; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px + var(--safe-b)); z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 99px; background: var(--ink); color: var(--surface); font-weight: 700; font-size: .9rem; transition: all .25s ease; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Home ---------- */
.home .hero { padding: 20px 4px 4px; }
.home .hero h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
.home .hero p { color: var(--ink-2); font-size: 1.05rem; margin: 12px 0 18px; }
.perks { display: flex; flex-wrap: wrap; gap: 8px; }
.perks span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-size: .82rem; font-weight: 700; }
.perks .i { width: 16px; height: 16px; color: var(--brand-ink, var(--brand)); }
.home .sheet { margin-top: 28px; }
.home .sheet h2 { font-size: 1.5rem; padding: 0 4px; }
.home .group-title:first-of-type { margin-top: 16px; }

/* ---------- Invite (guest) ---------- */
body.cover-bg { background: var(--bg); }
.invite { padding-top: 0; }
.cover {
  margin: 0 -16px; padding: calc(56px + env(safe-area-inset-top, 0px)) 24px 64px; text-align: center; color: #fff;
  background: radial-gradient(120% 90% at 20% 0%, var(--brand-2), transparent 60%), linear-gradient(160deg, var(--brand), var(--cover-end, #c2185b));
  border-radius: 0 0 36px 36px;
}
.cover-emoji { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 28px; background: rgba(255,255,255,.22); backdrop-filter: blur(6px); font-size: 2.6rem; margin-bottom: 16px; }
.cover .eyebrow { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.cover h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
.invite .sheet { position: relative; margin-top: -36px; }
.invite .sheet > .group:first-child, .invite .sheet > .banner:first-child { margin-top: 0; }
.note { margin: 12px 0 0; padding: 16px 18px; border-radius: var(--r-lg); background: var(--brand-tint); color: var(--ink); font-size: 1rem; line-height: 1.5; }
.hello { margin: 0 0 12px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.answer { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 12px; }
.answer b { display: block; } .answer small { display: block; }
.answer-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; }
.answer.ok .answer-icon { background: var(--ok-tint); color: var(--ok); }
.answer.no .answer-icon { background: var(--no-tint); color: var(--no); }
.change { margin-top: 12px; }
.change > summary { display: flex; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); font-weight: 700; cursor: pointer; list-style: none; }
.change > summary::-webkit-details-marker { display: none; }
.change[open] > summary .chev { transform: rotate(90deg); }
.madewith { text-align: center; margin: 32px 0 0; font-size: .8rem; color: var(--ink-3); }
.madewith .brand { font-size: .9rem; color: var(--ink-2); }
.madewith .logo { width: 22px; height: 22px; font-size: 12px; border-radius: 7px; }

/* ---------- Dashboard ---------- */
.dash { max-width: none; padding: 0; }
.dash-main { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--tabbar-h) + 32px + var(--safe-b)); }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; font-weight: 800; font-size: .85rem; color: hsl(var(--h, 20) 55% 35%); background: hsl(var(--h, 20) 80% 90%); }
@media (prefers-color-scheme: dark) { .avatar { color: hsl(var(--h, 20) 70% 80%); background: hsl(var(--h, 20) 35% 22%); } }
.avatar.emoji { background: var(--surface); box-shadow: var(--shadow); font-size: 1.3rem; border-radius: 14px; }

.tab { display: none; animation: in .22s ease; }
.tab.active { display: block; }
@keyframes in { from { transform: translateY(8px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  box-shadow: var(--shadow-up);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .7rem; font-weight: 700; color: var(--ink-3); }
.tabbar a .i { width: 24px; height: 24px; padding: 0; transition: transform .15s; }
.tabbar a.active { color: var(--brand-ink, var(--brand)); }
.tabbar a.active .i { transform: translateY(-1px); stroke-width: 2.3; }
.rail-brand { display: none; }

.hero-card { margin-top: 8px; padding: 22px; border-radius: var(--r-lg); color: #fff; background: radial-gradient(120% 120% at 100% 0%, var(--brand-2), transparent 55%), linear-gradient(150deg, var(--brand), #c2185b); box-shadow: 0 18px 40px -20px var(--brand); }
.hero-card p { margin: 0; font-weight: 700; opacity: .9; }
.hero-card .big { display: block; font-size: 3.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 2px 0 14px; }
.hero-card small { color: rgba(255,255,255,.85); }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: #fff; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.stat span { font-size: .8rem; font-weight: 700; }
.stat.ok span { color: var(--ok); } .stat.no span { color: var(--no); } .stat.wait span { color: var(--wait); }
.stat:active { transform: scale(.97); }

.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 4px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); font-size: .75rem; font-weight: 700; cursor: pointer; text-align: center; }
.action .i { width: 26px; height: 26px; }
.action:active { transform: scale(.96); }
.linkbox { display: flex; align-items: center; gap: 14px; padding: 12px; margin-top: 12px; }
.linkbox img { border-radius: 12px; background: #fff; flex: none; }
.linkbox span { min-width: 0; } .linkbox small { display: block; }
.linkbox b { display: block; word-break: break-all; font-size: .9rem; }

.searchbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0 0 0 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-3); }
.searchbar input { background: transparent; padding-left: 4px; min-height: 50px; }
.searchbar input:focus { box-shadow: none; background: transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 9px 14px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-size: .86rem; font-weight: 700; white-space: nowrap; }
.chip i { font-style: normal; color: var(--ink-3); font-weight: 700; }
.chip .i { width: 15px; height: 15px; }
.chip.on { background: var(--ink); color: var(--surface); }
.chip.on i { color: inherit; opacity: .65; }
.listhead { display: flex; align-items: center; gap: 16px; margin: 20px 4px 8px; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.listhead span { flex: 1; }

.guests { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.guest { display: flex; align-items: flex-start; }
.guest + .guest { box-shadow: inset 0 1px 0 var(--fill); }
.pick { padding: 12px 0 12px 14px; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick .avatar { transition: transform .15s; }
.pick input:checked + .avatar { background: var(--brand); color: var(--on-brand); font-size: 0; }
.pick input:checked + .avatar::after { content: ""; width: 16px; height: 9px; border: solid currentColor; border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.pick input:focus-visible + .avatar { box-shadow: 0 0 0 2px var(--brand); }
.guest details { flex: 1; min-width: 0; }
.guest summary { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 16px 10px 12px; cursor: pointer; list-style: none; }
.guest summary::-webkit-details-marker { display: none; }
.who { flex: 1; min-width: 0; }
.who b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { flex: none; padding: 5px 11px; border-radius: 99px; font-size: .75rem; font-weight: 800; }
.pill.ok { background: var(--ok-tint); color: var(--ok); } .pill.no { background: var(--no-tint); color: var(--no); } .pill.wait { background: var(--wait-tint); color: var(--wait); }
.guest-more { padding: 0 16px 16px 12px; }
.guest-more p { margin: 0 0 10px; font-size: .92rem; } .guest-more p small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--ink-3); }
.mini-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-actions .btn { min-height: 40px; padding: 0 14px; font-size: .86rem; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); color: var(--ink-2); }
.empty .i { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 6px; }
.empty b { color: var(--ink); font-size: 1.05rem; }
.empty .btn { margin-top: 12px; }

/* Selection bottom sheet */
.selbar {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 10px + var(--safe-b)); z-index: 40; width: min(100% - 20px, 620px);
  transform: translateX(-50%); padding: 14px 14px 12px; border-radius: 26px; background: var(--surface); box-shadow: 0 20px 50px -12px rgba(0,0,0,.35);
  animation: up .22s ease;
}
@keyframes up { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.selbar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.selbar-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sel-act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border: 0; border-radius: 14px; background: var(--fill); font-size: .72rem; font-weight: 700; cursor: pointer; }
.sel-act:active { transform: scale(.95); }
.sel-act.danger { color: var(--no); background: var(--no-tint); }
.tagform { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 10px; }
.tagform .btn { min-height: 46px; padding: 0 14px; }

/* ---------- Larger screens ---------- */
@media (min-width: 900px) {
  .home { max-width: 1080px; display: grid; grid-template-columns: 1fr 480px; gap: 56px; padding-bottom: 64px; }
  .home .appbar { grid-column: 1 / -1; }
  .home .hero { position: sticky; top: 120px; align-self: start; padding-top: 40px; }
  .home .hero h1 { font-size: 3.6rem; }
  .home .sheet { margin-top: 0; }

  .dash { display: grid; grid-template-columns: 240px 1fr; }
  .tabbar { position: sticky; top: 0; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 14px; box-shadow: none; background: transparent; backdrop-filter: none; }
  .rail-brand { display: block; padding: 6px 12px 24px; }
  .tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: .95rem; color: var(--ink-2); }
  .tabbar a.active { background: var(--surface); box-shadow: var(--shadow); }
  .dash-main { margin: 0; padding-bottom: 48px; width: 100%; max-width: 720px; }
  .dash .sticky-cta { bottom: 16px; }
  .selbar { bottom: 20px; left: calc(50% + 120px); }
  .toast { bottom: 32px; }
}
.linkbox > * + * { box-shadow: none; }
.row em small { display: block; font-size: .65rem; font-weight: 700; color: var(--ink-3); text-align: center; text-transform: uppercase; }

/* ---------- Photo picker ---------- */
.photo-picker { display: grid; gap: 10px; }
.pp-frame {
  position: relative; overflow: hidden; border-radius: var(--r-lg); aspect-ratio: 4 / 3;
  background:
    radial-gradient(60% 70% at 15% 10%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%),
    radial-gradient(60% 70% at 90% 100%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.pp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.has-photo .pp-img { opacity: 1; }
.pp-shade {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 18px 18px;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent 55%), linear-gradient(to bottom, rgba(0,0,0,.25), transparent 30%);
  color: #fff; opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.has-photo .pp-shade { opacity: 1; }
.pp-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: .72rem; font-weight: 700; }
.pp-badge .i { width: 15px; height: 15px; }
.pp-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.pp-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px; text-align: center; cursor: pointer; }
.has-photo .pp-empty { display: none; }
.pp-cam { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 10px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 26px -10px var(--brand); transition: transform .15s ease; }
.pp-cam .i { width: 30px; height: 30px; }
.pp-empty b { font-size: 1.05rem; }
.pp-formats { margin-top: 8px; padding: 4px 10px; border-radius: 99px; background: var(--fill); font-size: .7rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.pp-empty:hover .pp-cam, .photo-picker.drag .pp-cam { transform: scale(1.06); }
.photo-picker.drag .pp-frame { transform: scale(1.01); box-shadow: 0 0 0 3px var(--brand), var(--shadow); }
.pp-frame:active { transform: scale(.99); }
.photo-picker input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pp-empty:has(input:focus-visible) .pp-cam { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand); }
.pp-busy { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 700; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(4px); }
.photo-picker.busy .pp-busy { display: flex; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--fill-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pp-actions { display: none; grid-template-columns: 1fr 1fr; gap: 10px; }
.has-photo .pp-actions { display: grid; }
.pp-actions .btn { position: relative; min-height: 46px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.pp-actions .btn.danger { color: var(--no); }
.pp-actions .btn:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--brand); }

/* ---------- Places search ---------- */
.places { position: relative; }
[data-places] .places > .i { position: absolute; left: 12px; top: 14px; width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
[data-places] .places input { padding-left: 40px; }
.suggest { list-style: none; margin: 8px 0 0; padding: 6px; border-radius: var(--r); background: var(--surface); box-shadow: 0 16px 40px -12px rgba(0,0,0,.28); }
.suggest li { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.suggest li .i { width: 18px; height: 18px; color: var(--brand-ink, var(--brand)); margin-top: 2px; }
.suggest li small { display: block; font-weight: 500; }
.suggest li[aria-selected=true], .suggest li:hover { background: var(--fill); }
.suggest .muted { color: var(--ink-2); cursor: default; font-weight: 500; }
.suggest .powered { justify-content: flex-end; padding: 4px 8px; font-size: .7rem; color: var(--ink-3); cursor: default; font-weight: 600; }
.suggest .powered:hover { background: none; }
.coords > summary { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.coords > summary::-webkit-details-marker { display: none; }
.coords > summary > .i:first-child { color: var(--brand-ink, var(--brand)); }
.coords > summary span { flex: 1; min-width: 0; } .coords > summary b { display: block; font-weight: 700; } .coords > summary small { display: block; }
.coords[open] > summary .chev { transform: rotate(90deg); }
.coords .fine { margin: 0 16px 14px; }
.picked { color: var(--ok) !important; font-weight: 700 !important; }

/* ---------- Invite: photo cover, map/Uber, gifts ---------- */
.cover.with-photo { position: relative; padding: 0; min-height: 0; overflow: hidden; text-align: left; }
.cover-photo { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 72vh; object-fit: cover; }
.cover.with-photo .cover-text { position: absolute; inset: auto 0 0 0; padding: 120px 24px 64px; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.35) 55%, transparent); }
.cover.with-photo h1 { text-shadow: 0 2px 16px rgba(0,0,0,.3); }
.info.place { cursor: default; } .info.place:active { background: none; }
.go { display: flex; gap: 8px; padding: 4px 16px 16px; }
.group > .go { box-shadow: none; }
.go .btn { flex: 1; min-height: 46px; padding: 0 12px; font-size: .92rem; }
.btn.uber { background: #000; color: #fff; }
@media (prefers-color-scheme: dark) { .btn.uber { background: #fff; color: #000; } }
.gift-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--brand-tint); color: var(--brand-ink, var(--brand)); }
.gift-ico .i { width: 20px; height: 20px; }
.gifts .row > .gift-ico + span { flex: 1; }
.seelink { display: inline-flex; align-items: center; gap: 2px; color: var(--brand-ink, var(--brand)); font-weight: 700; font-size: .85rem; flex: none; }
.seelink .i { width: 16px; height: 16px; }
.gifts form { margin: 0; }
.iconbtn.flat { box-shadow: none; background: transparent; color: var(--ink-3); width: 40px; height: 40px; }
.iconbtn.flat:hover { color: var(--no); background: var(--no-tint); }
.group-title small { font-size: inherit; color: var(--ink-3); margin-left: 4px; }
.tab > .empty { margin-top: 0; }
.row > .gift-ico, .info > .gift-ico { flex: none; }

/* ---------- No text selection / zoom (fields and .copyable stay selectable) ---------- */
html { touch-action: manipulation; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .copyable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }
body.locked { overflow: hidden; }

/* ---------- Small shared bits ---------- */
.spacer { flex: 1; }
.muted { color: var(--ink-2); margin: 6px 0 0; }
.mt { margin-top: 20px; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 0; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font: 700 .88rem var(--font); color: var(--ink); cursor: pointer; }
.userchip.ghost { padding: 10px 16px; }
.appbar form { margin: 0; }
.btn.sm-pill { min-height: 36px; padding: 0 14px; font-size: .85rem; background: var(--ink); color: var(--surface); flex: none; }
.btn.wa-solid { background: var(--wa); color: #fff; box-shadow: 0 10px 24px -12px var(--wa); }
.btn.tonal.block { margin-top: 10px; }
.group.pad { padding: 22px; }
.group.pad h2 { font-size: 1.4rem; }
.group.pad .btn.primary { margin-top: 18px; }
.iconbtn.back .i { transform: rotate(180deg); }
.actions-grid.three { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.progress.dark { background: var(--fill); margin-top: 8px; }
.progress.dark i { background: var(--wa); transition: width .3s ease; }

/* ---------- Auth pages ---------- */
.auth-main { padding: 12px 4px 40px; }
.auth-main h1 { font-size: 2rem; margin-top: 12px; }
.auth-main .banner { margin-top: 16px; }
.auth-main form { margin-top: 16px; }
.pw { position: relative; }
.pw input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer; }
.pw-toggle.on { color: var(--brand-ink, var(--brand)); }
.center-link { display: block; text-align: center; margin: 18px 0 0; }
.switch-auth { text-align: center; color: var(--ink-2); margin-top: 22px; font-weight: 600; }
.auth .answer { margin-top: 16px; }
.auth-cta { margin-top: 28px; }

/* ---------- My invites ---------- */
.hello-user { display: flex; align-items: center; gap: 14px; margin: 18px 4px 0; }
.hello-user small { display: block; }
.hello-user h1 { font-size: 1.8rem; }
.event-list { display: grid; gap: 12px; }
.event-card { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.event-card:active { transform: scale(.99); }
.event-card img, .event-emoji { flex: none; width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.event-emoji { display: grid; place-items: center; font-size: 1.9rem; background: var(--brand-tint); }
.event-info { flex: 1; min-width: 0; }
.event-info b { display: block; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-info small { display: block; }
.event-info em { display: block; font-style: normal; font-size: .8rem; font-weight: 700; color: var(--ok); margin-top: 2px; }
.mine .sticky-cta { margin-top: 28px; }

/* ---------- Dashboard: claim banner and WhatsApp entry points ---------- */
.banner.claim { margin-top: 8px; background: var(--wait-tint); color: var(--ink); font-size: .88rem; flex-wrap: wrap; }
.banner.claim .i { color: var(--wait); }
.banner.claim span { flex: 1; min-width: 160px; }
.wa-hero { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-radius: var(--r-lg); cursor: pointer; text-align: left; color: #fff; font: inherit;
  background: linear-gradient(135deg, #25d366, #128c4a); box-shadow: 0 14px 30px -16px #128c4a; }
.wa-hero + .wa-hero { margin-top: 10px; }
.wa-hero span:not(.wa-hero-icon) { flex: 1; min-width: 0; }
.wa-hero b { display: block; font-size: 1.05rem; }
.wa-hero small { display: block; color: rgba(255,255,255,.85); }
.wa-hero .chev { color: rgba(255,255,255,.8); }
.wa-hero-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; background: rgba(255,255,255,.2); }
.wa-hero-icon .i { width: 24px; height: 24px; }
.wa-hero.alt { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.wa-hero.alt small { color: var(--ink-2); }
.wa-hero.alt .chev { color: var(--ink-3); }
.wa-hero.alt .wa-hero-icon { background: color-mix(in srgb, var(--wa) 14%, transparent); color: var(--wa); }
.wa-hero.compact { margin-top: 12px; padding: 12px 14px; }
.wa-hero:active { transform: scale(.99); }

/* ---------- Bottom sheet ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .2s ease; }
.modal-panel { position: relative; width: min(100%, 560px); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 18px calc(22px + var(--safe-b)); border-radius: 28px 28px 0 0; background: var(--bg);
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.modal.open .modal-backdrop { opacity: 1; }
.modal.open .modal-panel { transform: none; }
.grabber { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--fill-strong); margin: 0 auto 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-size: 1.35rem; }
.modal-actions { display: grid; gap: 10px; margin-top: 14px; }
.modal-actions .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions .two .btn:only-child, .modal-actions .two .btn[hidden] + .btn { grid-column: 1 / -1; }
.msg-field { padding: 0; margin-top: 14px; }
.msg-field textarea { background: var(--surface); box-shadow: var(--shadow); min-height: 150px; line-height: 1.5; }
@media (min-width: 900px) { .modal { align-items: center; } .modal-panel { border-radius: 28px; max-height: 88vh; } }

/* WhatsApp-like preview */
.wa-chat { margin-top: 12px; padding: 16px 14px; border-radius: 20px; background: #efe7dd; }
@media (prefers-color-scheme: dark) { .wa-chat { background: #0b141a; } }
.wa-bubble { margin-left: auto; max-width: 88%; padding: 4px; border-radius: 12px 4px 12px 12px; background: #d9fdd3; color: #111b21; box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: .9rem; line-height: 1.4; }
@media (prefers-color-scheme: dark) { .wa-bubble { background: #005c4b; color: #e9edef; } }
.wa-card { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; background: rgba(0,0,0,.06); }
.wa-card img, .wa-card-emoji { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; }
.wa-card-emoji { display: grid; place-items: center; font-size: 1.6rem; background: rgba(255,255,255,.6); }
.wa-card span { min-width: 0; } .wa-card b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-card small { display: block; font-size: .72rem; color: inherit; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-text { padding: 6px 6px 4px; word-break: break-word; }
.wa-link { color: #027eb5; text-decoration: underline; }
@media (prefers-color-scheme: dark) { .wa-link { color: #53bdeb; } }

/* Sending queue */
.queue-progress { margin: 14px 2px 0; font-weight: 700; font-size: .9rem; }
.queue { list-style: none; margin: 14px 0 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.queue li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.queue li + li { box-shadow: inset 0 1px 0 var(--fill); }
.queue .who { flex: 1; min-width: 0; }
.queue .btn { background: var(--wa); color: #fff; }
.queue .btn .i { width: 17px; height: 17px; }
.queue .when-done { display: none; }
.queue li.sent .btn { background: var(--ok-tint); color: var(--ok); }
.queue li.sent .when-todo { display: none; }
.queue li.sent .when-done { display: inline-flex; align-items: center; gap: 4px; }
.queue .when-todo { display: inline-flex; align-items: center; gap: 6px; }
.group.pad > * + * { box-shadow: none; }

/* ---------- Theme decorations (icons of the event type) ---------- */
.cover { position: relative; overflow: hidden; }
.cover-emoji, .cover-text { position: relative; z-index: 1; }
.deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.deco span { position: absolute; font-size: calc(30px * var(--s, 1)); transform: translate(-50%, -50%) rotate(var(--r, 0deg)); opacity: .55;
  filter: saturate(1.1); animation: float 7s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes float { from { translate: 0 0; } to { translate: 0 -8px; } }
.deco.page { position: fixed; z-index: 0; }
.deco.page span { opacity: .07; font-size: calc(46px * var(--s, 1)); }
.invite .cover, .invite .sheet { position: relative; z-index: 1; }
.deco.mini span { font-size: calc(16px * var(--s, 1)); opacity: .5; animation: none; }

/* ---------- Color theme picker ---------- */
.theme-picker { display: grid; gap: 12px; }
.theme-preview { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--shadow); padding-bottom: 14px; color: var(--ink); transition: background .2s; }
.tp-cover { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 26px; color: #fff; text-align: center;
  background: radial-gradient(120% 90% at 20% 0%, var(--brand-2), transparent 60%), linear-gradient(160deg, var(--brand), var(--cover-end, #c2185b)); border-radius: 0 0 22px 22px; }
.tp-cover b { font-size: 1.15rem; letter-spacing: -.01em; }
.tp-emoji { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.22); font-size: 1.4rem; }
.tp-body { position: relative; margin: -12px 14px 0; padding: 14px; border-radius: 16px; background: var(--surface); display: grid; gap: 8px; }
.tp-line { height: 9px; border-radius: 99px; background: var(--fill, #eee); }
.tp-line.short { width: 60%; }
.tp-btn { justify-self: stretch; text-align: center; padding: 9px; border-radius: 99px; font-weight: 800; font-size: .85rem; color: var(--on-brand); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.palettes { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 6px; scroll-padding-inline: 16px; scrollbar-width: none; }
.palettes::-webkit-scrollbar { display: none; }
.pal { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.pal input { position: absolute; opacity: 0; }
.pal .sw { width: 52px; height: 52px; border-radius: 50%; box-shadow: var(--shadow);
  background: conic-gradient(var(--a) 0 50%, var(--b) 50% 75%, var(--c) 75% 100%); transition: transform .15s; }
.pal small { font-size: .72rem; font-weight: 700; }
.pal input:checked + .sw { transform: scale(1.06); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.pal input:focus-visible + .sw { box-shadow: 0 0 0 3px var(--brand); }
.color-inputs .color-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
.color-row span { flex: 1; font-weight: 700; font-size: .92rem; }
.color-row input[type=color] { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; overflow: hidden; background: none; cursor: pointer; box-shadow: var(--shadow); }
.color-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-row input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.color-row em { font-style: normal; font-family: ui-monospace, monospace; font-size: .85rem; color: var(--ink-2); width: 70px; text-align: right; }

/* ---------- Cover video ---------- */
video.cover-photo { background: #000; }
.cover-fs { position: absolute; z-index: 2; right: 14px; top: calc(14px + env(safe-area-inset-top, 0px)); display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border: 0; border-radius: 99px; background: rgba(0,0,0,.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font: 700 .82rem var(--font); cursor: pointer; }
.cover-fs .i { width: 18px; height: 18px; }
.video-picker { display: grid; gap: 10px; }
.vp-frame { position: relative; overflow: hidden; border-radius: var(--r-lg); aspect-ratio: 16 / 10; background: var(--surface); box-shadow: var(--shadow); }
.vp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.has-video .vp-video { display: block; }
.vp-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px; text-align: center; cursor: pointer; }
.has-video .vp-empty { display: none; }
.video-picker input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.vp-progress { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); font-weight: 700; }
.vp-progress .progress { width: 70%; }
.uploading .vp-progress { display: flex; }
.vp-actions { display: none; }
.has-video .vp-actions { display: grid; }

/* ---------- QR pop-up ---------- */
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; padding: 22px; border-radius: var(--r-lg); background: #fff; color: #1d1a17; box-shadow: var(--shadow); text-align: center; }
.qr-card img { width: min(260px, 70vw); height: auto; }
.qr-card b { font-size: 1.05rem; margin-top: 6px; }
.qr-card small { color: #6d655e; }
.qr-thumb { padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.modal-actions .two .btn.primary { width: auto; padding: 0 16px; min-height: 48px; font-size: .98rem; }

/* ---------- Profile ---------- */
.avatar.photo { object-fit: cover; padding: 0; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.8rem; }
.appbar-name { font-weight: 800; font-size: 1.1rem; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 16px 4px 4px; }
.avatar-edit h1 { font-size: 1.4rem; }
.avatar-pick { position: relative; cursor: pointer; flex: none; }
.avatar-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-cam { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0 0 3px var(--bg); }
.avatar-cam .i { width: 17px; height: 17px; }
.center-form { margin: 4px 0 0 116px; }
.profile form .btn.tonal.block { margin-top: 12px; background: var(--surface); box-shadow: var(--shadow); }
.logout { margin-top: 28px; }
/* Invite without date/place: keep the first section clear of the cover's overlap. */
.invite .sheet > .group-title:first-child, .invite .sheet > form.rsvp:first-child > .group-title:first-child { margin-top: 52px; }

/* ---------- Theme editor v2: annotated preview ---------- */
.deco span { opacity: var(--deco, .55); }
.deco.page span { opacity: calc(var(--deco, .6) * .12); }
.deco.mini span { opacity: var(--deco, .5); }
.theme-preview { padding: 0 14px 16px; display: grid; gap: 10px; }
.theme-preview .tp-cover { margin: 0 -14px; padding: 26px 16px 30px; gap: 4px; }
.tp-eyebrow { color: rgba(255,255,255,.85); font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tp-card { position: relative; margin-top: -22px; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 18px -10px rgba(0,0,0,.3); }
.tp-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: .8rem; }
.tp-row + .tp-row { box-shadow: inset 0 1px 0 var(--fill); }
.tp-row b { display: block; font-weight: 700; }
.tp-row small { display: block; font-size: .7rem; color: var(--ink-2); }
.tp-ico { color: var(--brand-ink, var(--brand)); display: grid; } .tp-ico .i { width: 18px; height: 18px; }
.tp-note { padding: 9px 12px; border-radius: 12px; background: var(--brand-tint); color: var(--ink); font-size: .78rem; }
.theme-preview .tp-note { color: var(--ink); }
.tp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); font-size: .74rem; font-weight: 700; }
.tp-seg span { text-align: center; padding: 8px 4px; border-radius: 10px; color: var(--ink-2); }
.tp-seg .on { background: var(--brand); color: var(--on-brand); }
.theme-preview .tp-btn { padding: 11px; }
.tp-badge { position: absolute; z-index: 3; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font: 800 .68rem var(--font); font-style: normal;
  color: #fff; background: #1d1a17; box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.tp-badge.inline { position: static; margin-left: auto; flex: none; }
.tp-badge.static { position: static; flex: none; }
.theme-preview[data-focus="main"] [data-area~="main"], .theme-preview[data-focus="second"] [data-area~="second"],
.theme-preview[data-focus="card"] .tp-card { outline: 3px dashed #ff2d55; outline-offset: 3px; }
.theme-preview[data-focus="bg"] { outline: 3px dashed #ff2d55; outline-offset: -3px; }
.theme-preview[data-focus="text"] .tp-row b, .theme-preview[data-focus="text"] .tp-row small { background: rgba(255,45,85,.18); border-radius: 4px; }
.theme-preview[data-focus="second"] .tp-cover { background: radial-gradient(140% 110% at 20% 0%, var(--brand-2), transparent 70%), linear-gradient(160deg, var(--brand), var(--cover-end)); }

.color-inputs .color-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.color-row > span { flex: 1; min-width: 0; }
.color-row > span b { display: block; font-weight: 700; font-size: .92rem; }
.color-row > span small { display: block; font-size: .74rem; }
.color-row em { width: auto; font-size: .76rem; }
.auto-contrast { min-height: 54px; }
.group-title.sub { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.icon-opts { padding: 12px; display: grid; gap: 12px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); }
.seg3 input { position: absolute; opacity: 0; }
.seg3 span { display: grid; place-items: center; min-height: 40px; border-radius: 11px; font-weight: 700; font-size: .84rem; color: var(--ink-2); cursor: pointer; text-align: center; }
.seg3 input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg3 input:focus-visible + span { box-shadow: 0 0 0 2px var(--brand); }
.custom-icons { display: grid; gap: 10px; }
.custom-icons input { font-size: 1.3rem; letter-spacing: .1em; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-grid button { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--fill); font-size: 1.25rem; cursor: pointer; }
.emoji-grid button:active { transform: scale(.9); }
.custom-icons .link { justify-self: start; }
.row.static { cursor: default; } .row.static:active { background: none; }
.row.static small { font-size: .75rem; }

/* ---------- PDF pop-up preview (looks like a sheet of paper) ---------- */
.pdf-page { margin-top: 12px; padding: 18px 16px; border-radius: 10px; background: #fff; color: #111; box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,.04);
  font-family: Helvetica, Arial, sans-serif; display: grid; gap: 3px; }
.pdf-h { font-size: 1.05rem; }
.pdf-sub { color: #666; font-size: .72rem; }
.pdf-table { margin-top: 10px; font-size: .72rem; }
.pdf-tr { display: grid; grid-template-columns: 1fr 64px 48px; gap: 6px; padding: 5px 0; border-bottom: 1px solid #eee; }
.pdf-tr.head { font-weight: 700; border-bottom: 1px solid #999; }
.pdf-tr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-more { color: #888; font-size: .72rem; margin-top: 6px; }

/* ---------- Gift hints ---------- */
.fine.first { margin-top: -2px; margin-bottom: 12px; }
.mt-12 { margin-top: 12px; }
.sizes-grid { display: grid; grid-template-columns: 1fr 1fr; }
.sizes-grid .field:nth-child(odd) { box-shadow: inset -1px 0 0 var(--fill); }
.likes-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.like input { position: absolute; opacity: 0; }
.like span { display: inline-block; padding: 8px 12px; border-radius: 99px; background: var(--fill); font-size: .84rem; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.like input:checked + span { background: var(--brand); color: var(--on-brand); }
.like input:focus-visible + span { box-shadow: 0 0 0 2px var(--brand); }
.hints { padding: 14px; display: grid; gap: 12px; }
.hints > * + * { box-shadow: none; }
.hints-head { display: flex; align-items: center; gap: 12px; }
.hints-head b { display: block; } .hints-head small { display: block; }
.size-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.size-chip { display: grid; padding: 10px 12px; border-radius: 14px; background: var(--fill); box-shadow: inset 3px 0 0 var(--brand-ink, var(--brand)); }
.size-chip small { font-size: .72rem; font-weight: 700; color: var(--ink-2); }
.size-chip b { font-size: 1.25rem; font-weight: 800; color: var(--brand-ink, var(--brand)); }
.hint-label { margin: 0; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.like-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.like-chips span { padding: 7px 12px; border-radius: 99px; background: var(--fill); font-size: .86rem; font-weight: 700; }
.hint-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: .9rem; }

/* ---------- Invite pop-ups: date, map, Uber ---------- */
button.info { font: inherit; color: inherit; }
.date-card { display: flex; align-items: center; gap: 18px; margin-top: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.cal-page { flex: none; width: 96px; border-radius: 18px; overflow: hidden; text-align: center; background: var(--surface); box-shadow: 0 8px 24px -12px rgba(0,0,0,.35), 0 0 0 1px var(--fill); }
.cal-month { display: block; padding: 6px 0; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--on-brand); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.cal-day { display: block; font-size: 2.6rem; font-weight: 800; line-height: 1.1; padding-top: 4px; color: var(--ink); }
.cal-year { display: block; padding-bottom: 8px; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.date-text { display: grid; gap: 2px; min-width: 0; }
.date-text b { font-size: 1.15rem; text-transform: capitalize; }
.date-text span { color: var(--ink-2); font-weight: 600; }
.date-time { display: inline-flex; align-items: center; gap: 6px; } .date-time .i { width: 16px; height: 16px; }
.countdown { justify-self: start; margin-top: 6px; padding: 4px 10px; border-radius: 99px; font-style: normal; font-size: .8rem; font-weight: 800; color: var(--brand-ink, var(--brand)); background: var(--brand-tint); }
.map-frame { position: relative; margin-top: 12px; height: 240px; border-radius: var(--r-lg); overflow: hidden; background: var(--fill); box-shadow: var(--shadow); }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: var(--ink-2); pointer-events: none; }
.map-frame.loaded .map-loading { display: none; }
.addr-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 8px 12px 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.addr-card > span:nth-child(2) { flex: 1; min-width: 0; }
.addr-card b { display: block; } .addr-card small { display: block; }

/* Uber route animation: the car drives along the path from "Você" to the event.
   Path, car and pins share the same 320x170 coordinate box. */
.route { position: relative; margin-top: 12px; height: 190px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(0deg, rgba(0,0,0,.04) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px) 0 0 / 24px 24px, #eef1f4; }
@media (prefers-color-scheme: dark) { .route { background-color: #1c2128; } }
.route-inner { position: relative; width: 320px; height: 170px; margin: 10px auto 0; }
.route-svg { position: absolute; inset: 0; overflow: visible; }
.route-road { fill: none; stroke: #c9cfd6; stroke-width: 16; stroke-linecap: round; }
.route-dash { fill: none; stroke: #111; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 12; animation: dash 1.2s linear infinite; }
@media (prefers-color-scheme: dark) { .route-road { stroke: #3a414b; } .route-dash { stroke: #fff; } }
@keyframes dash { to { stroke-dashoffset: -44; } }
.route-car { position: absolute; left: 0; top: 0; font-size: 26px; line-height: 1;
  offset-path: path("M40 130 C 90 130, 90 60, 150 70 S 230 120, 280 40"); offset-rotate: auto; offset-anchor: center;
  animation: drive 4.5s cubic-bezier(.45,.05,.55,.95) infinite; }
@keyframes drive { 0% { offset-distance: 0%; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
.route-pin { position: absolute; display: grid; place-items: center; }
.route-pin.start { left: 18px; top: 122px; width: 44px; gap: 4px; }
.route-pin.start i { width: 16px; height: 16px; border-radius: 50%; background: #111; box-shadow: 0 0 0 5px rgba(17,17,17,.15); }
.route-pin.start b { font-size: .7rem; color: #111; }
@media (prefers-color-scheme: dark) { .route-pin.start i { background: #fff; } .route-pin.start b { color: #fff; } }
.route-pin.end { left: 258px; top: 2px; width: 44px; height: 44px; border-radius: 14px; background: var(--brand); box-shadow: 0 8px 18px -8px var(--brand); font-size: 22px;
  animation: bounce 1.8s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .route-car { animation: none; offset-distance: 60%; } }
.route-car i { display: block; font-style: normal; transform: scaleX(-1); }

/* ---------- Uber: first-time tip and "came back" state ---------- */
.uber-tip { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.uber-tip p { margin: 0 0 10px; font-size: .92rem; }
.uber-tip ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.uber-tip li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-2); }
.uber-tip li b { color: var(--ink); }
.uber-tip li i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: var(--ink);
  font: 800 .8rem var(--font); font-style: normal; animation: tipstep 6s ease-in-out infinite; }
.uber-tip li:nth-child(2) i { animation-delay: 2s; }
.uber-tip li:nth-child(3) i { animation-delay: 4s; }
@keyframes tipstep { 0%, 28% { background: #000; color: #fff; transform: scale(1.14); } 36%, 100% { background: var(--fill); color: var(--ink); transform: none; } }
@media (prefers-color-scheme: dark) { @keyframes tipstep { 0%, 28% { background: #fff; color: #000; transform: scale(1.14); } 36%, 100% { background: var(--fill); color: var(--ink); transform: none; } } }
.uber-back { display: none; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--ok-tint); }
.uber-back b { display: block; color: var(--ok); } .uber-back small { display: block; color: var(--ink-2); }
.ub-ico { font-size: 1.6rem; animation: wave 1.2s ease-in-out infinite; transform-origin: 70% 80%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(16deg); } 30% { transform: rotate(-8deg); } }
.when-again { display: none; }
.returned .uber-back { display: flex; animation: in .3s ease; }
.returned .uber-tip, .returned .when-first { display: none; }
.returned .when-again { display: inline; }
.returned [data-uber-go] { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; box-shadow: 0 0 0 0 rgba(0,0,0,.35); } 50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(0,0,0,0); } }

/* ---------- RSVP in steps ---------- */
.rsvp-cta { margin-top: 16px; }
.rsvp-cta .btn { min-height: 60px; font-size: 1.1rem; }
.steps .step { animation: in .25s ease; }
.step-dots { display: flex; justify-content: center; gap: 6px; margin: 2px 0 14px; }
.step-dots i { width: 28px; height: 5px; border-radius: 99px; background: var(--fill-strong); transition: background .2s; }
.step-dots i.on { background: var(--brand); }
.step-q { margin: 2px 0 16px; text-align: center; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.step-sub { margin: -10px 0 14px; text-align: center; color: var(--ink-2); font-size: .92rem; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: grid; justify-items: center; gap: 2px; padding: 24px 10px 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow);
  outline: 2px solid transparent; cursor: pointer; transition: outline-color .15s, background .15s, transform .12s; }
.choice span:active { transform: scale(.97); }
.choice em { font-style: normal; font-size: 2.6rem; line-height: 1.1; margin-bottom: 6px; }
.choice b { font-size: 1.12rem; } .choice small { color: var(--ink-2); font-size: .82rem; }
.choice-yes input:checked + span { outline-color: var(--brand); background: var(--brand-tint); }
.choice-no input:checked + span { outline-color: var(--ink-3); background: var(--fill); }
.choice input:checked + span em { animation: hop .45s ease; }
.choice input:focus-visible + span { outline-color: var(--brand); }
@keyframes hop { 40% { transform: translateY(-8px) scale(1.12); } }
.note-sugs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.note-sug { border: 0; padding: 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink);
  font: 600 .88rem/1.35 var(--font); text-align: left; cursor: pointer; }
.note-sug.chosen { background: var(--brand-tint); color: var(--ink); outline: 2px solid var(--brand); }
.note-sug:active { transform: scale(.98); }
.step-back { display: flex; align-items: center; gap: 4px; margin: 14px auto 0; padding: 8px 12px; border: 0; background: none; color: var(--ink-2); font: 700 .92rem var(--font); cursor: pointer; }
.step-back .i { width: 18px; height: 18px; transform: rotate(180deg); }
.answer-note { margin-top: 4px; font-style: italic; color: var(--ink-2); }

/* ---------- Opening animation: sealed envelope in the invite's own colors ---------- */
body.intro-on { overflow: hidden; }
body.intro-on .invite > :not(.intro):not(.modal):not(.player) { opacity: 0; }
.intro { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; overflow: hidden; padding: 24px 20px; text-align: center; color: var(--ink);
  background: radial-gradient(90% 60% at 50% 38%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 70%), radial-gradient(120% 80% at 10% 0%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 60%), var(--bg);
  cursor: pointer; -webkit-user-select: none; user-select: none; }
.intro small { color: inherit; }
.intro-rain { position: absolute; inset: 0; pointer-events: none; }
.intro-rain span { position: absolute; left: var(--x); top: 100%; font-size: calc(26px * var(--s, 1)); opacity: calc(var(--deco, .6) * .55); animation: rain var(--t, 7s) linear var(--d, 0s) infinite; }
@keyframes rain { from { transform: translateY(0) rotate(-10deg); } to { transform: translateY(calc(-100vh - 80px)) rotate(25deg); } }

.intro-stage { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.intro-kicker { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--on-bg, var(--ink)); animation: rise .7s ease both .15s; }
.envelope { position: relative; width: 280px; height: 180px; perspective: 900px; cursor: pointer; outline: none;
  animation: envIn .9s cubic-bezier(.2,.9,.3,1.25) both .25s, bob 3.2s ease-in-out 1.3s infinite; }
@keyframes envIn { from { opacity: 0; transform: translateY(40px) scale(.7) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.env-back { position: absolute; inset: 0; border-radius: 16px; background: var(--brand); background: color-mix(in srgb, var(--brand) 78%, #000);
  box-shadow: 0 30px 50px -24px color-mix(in srgb, var(--brand) 70%, #000); }
.env-letter { position: absolute; z-index: 2; left: 16px; right: 16px; top: 12px; height: 156px; padding: 18px 20px; border-radius: 10px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 9px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.env-letter span { font-size: 30px; line-height: 1; }
.env-letter i { display: block; width: 78%; height: 7px; border-radius: 9px; background: var(--fill); }
.env-letter i.short { width: 46%; }
.env-front { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; fill: var(--brand); filter: drop-shadow(0 -2px 3px rgba(0,0,0,.08)); }
.env-flap { position: absolute; z-index: 4; left: 0; top: 0; width: 280px; height: 112px; fill: var(--brand); fill: color-mix(in srgb, var(--brand) 86%, #fff);
  transform-origin: 50% 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.14)); }
.env-seal { position: absolute; z-index: 5; left: 50%; top: 104px; display: grid; place-items: center; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: var(--brand-2); box-shadow: 0 0 0 4px var(--surface), 0 8px 16px -6px rgba(0,0,0,.4); font-size: 26px; animation: seal 2.4s ease-in-out 1.4s infinite; }
@keyframes seal { 0%, 70%, 100% { transform: none; } 80% { transform: scale(1.12) rotate(-8deg); } 90% { transform: scale(1.05) rotate(6deg); } }
.intro-open { padding: 16px 34px; border: 0; border-radius: 99px; background: var(--brand); color: var(--on-brand); font: 800 1.08rem var(--font); cursor: pointer;
  box-shadow: 0 14px 30px -12px var(--brand); animation: rise .7s ease both .8s, breathe 1.8s ease-in-out 1.6s infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Opening: seal pops, flap folds back, letter slides out, the envelope zooms away into the card. */
.intro.open { cursor: default; }
.intro.open .intro-kicker, .intro.open .intro-open { animation: fadeOut .3s ease forwards; pointer-events: none; }
.intro.open .envelope { animation: envAway .8s cubic-bezier(.55,0,.75,.2) 1.55s forwards; }
.intro.open .env-seal { animation: sealOff .4s cubic-bezier(.5,-0.6,.7,1) forwards; }
.intro.open .env-flap { animation: flapOpen .65s ease-in-out .3s forwards; }
.intro.open .env-letter { animation: letterUp .75s cubic-bezier(.2,.8,.2,1) .85s forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes sealOff { 40% { transform: scale(1.2); } to { transform: scale(0) rotate(40deg); opacity: 0; } }
@keyframes flapOpen { 0% { transform: rotateX(0); z-index: 4; } 49% { z-index: 4; } 50% { z-index: 1; } 100% { transform: rotateX(180deg); z-index: 1; } }
@keyframes letterUp { to { transform: translateY(-92px); } }
@keyframes envAway { 0% { transform: none; opacity: 1; } 100% { transform: translateY(-40px) scale(2.4); opacity: 0; } }

.intro-card { grid-area: 1 / 1; position: relative; z-index: 2; width: min(100%, 360px); padding: 30px 22px 28px; border-radius: 30px; background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.45); opacity: 0; pointer-events: none; }
.intro.open .intro-card { animation: cardIn .8s cubic-bezier(.2,.9,.3,1.15) 1.8s forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(-50px) scale(.55) rotate(-3deg); } to { opacity: 1; transform: none; } }
.ic-hi { margin: 0 0 4px; font-weight: 700; color: var(--ink-2); }
.ic-title { margin: 0; font-size: clamp(1.9rem, 8.6vw, 2.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; color: var(--brand-ink, var(--brand)); }
.ic-title .w { display: inline-block; white-space: nowrap; }
.ic-title i, .intro-card [style*="--at"], .ic-hi { opacity: 0; }
.ic-title i { display: inline-block; font-style: normal; }
.intro.open .ic-hi { animation: rise .5s ease 2.2s forwards; }
.intro.open .ic-title i { animation: letter .55s cubic-bezier(.2,.9,.3,1.4) forwards; animation-delay: calc(2.3s + var(--i) * .04s); }
@keyframes letter { from { opacity: 0; transform: translateY(.7em) rotate(10deg) scale(.5); } to { opacity: 1; transform: none; } }
.intro.open .intro-card [style*="--at"] { animation: rise .6s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(2.3s + var(--at)); }
.ic-for { margin: 18px 0 0; font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.ic-name { margin: 4px 0 0; font-size: clamp(1.45rem, 6.6vw, 1.9rem); font-weight: 800; line-height: 1.15; }
.intro-card .ic-date { display: inline-flex; align-items: center; gap: 14px; margin-top: 18px; padding: 10px 20px 10px 16px; border-radius: 22px; background: var(--brand-tint); }
.intro.open .intro-card .ic-date { animation-name: zoom; animation-timing-function: cubic-bezier(.2,.9,.3,1.5); }
@keyframes zoom { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.ic-date b { font-size: 3.6rem; line-height: .9; font-weight: 800; letter-spacing: -.04em; color: var(--brand-ink, var(--brand)); }
.ic-date span { text-align: left; }
.ic-date em { display: block; font-style: normal; font-size: 1.4rem; font-weight: 800; letter-spacing: .12em; }
.ic-date small { display: block; font-size: .85rem; color: var(--ink-2); }
.ic-date small::first-letter { text-transform: uppercase; }
.ic-time { margin: 12px 0 0; font-size: 1.1rem; font-weight: 700; }
.intro-skip { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); font-size: .8rem; color: var(--on-bg, var(--ink)); opacity: 0; }
.intro.open .intro-skip { animation: rise .4s ease 3.4s forwards; }

/* Skip: jump to the finished card. */
.intro.skip .envelope { animation: none; opacity: 0; }
.intro.skip .intro-card, .intro.skip .intro-card * { animation-delay: -10s !important; }

/* Leaving: the card flies up into the cover while the page builds itself. */
.intro.bye { pointer-events: none; background: transparent; transition: background .6s ease; animation: introFade .8s ease forwards; }
.intro.bye .intro-card { animation: cardOut .75s cubic-bezier(.5,0,.3,1) forwards !important; }
.intro.bye .intro-card * { animation-delay: -10s !important; }
.intro.bye .intro-rain, .intro.bye .intro-skip, .intro.bye .intro-stage { opacity: 0; transition: opacity .3s; }
@keyframes introFade { 0%, 40% { background-color: var(--bg); } 100% { background-color: transparent; opacity: 0; } }
@keyframes cardOut { to { opacity: 0; transform: translateY(-34vh) scale(.6); } }

.assemble .invite .cover { animation: coverIn .9s cubic-bezier(.2,.8,.2,1) both .1s; }
@keyframes coverIn { from { opacity: 0; transform: scale(1.08); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.assemble .invite .sheet > * { animation: piece .7s cubic-bezier(.2,.8,.2,1.1) both; animation-delay: calc(.35s + var(--k, 0) * .1s); }
@keyframes piece { from { opacity: 0; transform: translateY(36px) scale(.96); } to { opacity: 1; transform: none; } }
.assemble .invite .sheet > .rsvp-cta { animation: ctaIn .7s cubic-bezier(.2,.9,.3,1.2) both .9s; }
@keyframes ctaIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
.assemble .deco.page span { animation: pop .6s ease both calc(.4s + var(--d, 0s) / 3); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.3); } }

@media (prefers-reduced-motion: reduce) {
  .intro *, .assemble * { animation: none !important; }
}

/* ---------- Cover video: always playing, sound and pause inline ---------- */
.cover-fs { display: none; }
.with-video .cover-text { z-index: 2; pointer-events: none; }
.v-tap { position: absolute; inset: 0; z-index: 1; border: 0; background: none; cursor: pointer; }
.v-ctrls { position: absolute; z-index: 3; right: 14px; top: calc(14px + env(safe-area-inset-top, 0px)); display: flex; gap: 8px; }
.v-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 99px; color: #fff; cursor: pointer;
  background: rgba(0,0,0,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font: 700 .82rem var(--font); }
.v-btn.round { width: 40px; padding: 0; justify-content: center; }
.v-btn .i { width: 19px; height: 19px; }
.v-btn .is-sound, .sound-on .v-btn .is-muted { display: none; }
.sound-on .v-btn .is-sound { display: block; }
.v-state, .pl-state { position: absolute; z-index: 2; left: 50%; top: 50%; display: grid; place-items: center; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; opacity: 0; pointer-events: none; }
.v-state .i, .pl-state .i { width: 34px; height: 34px; }
.v-state .is-play, .pl-state .is-play { display: none; margin-left: 4px; }
.paused > .v-state .is-play, .v-state.paused .is-play, .pl-state.paused .is-play { display: block; }
.v-state.paused .is-pause, .pl-state.paused .is-pause { display: none; }
.v-state.flash, .pl-state.flash { animation: blink .7s ease forwards; }
.v-state.paused, .pl-state.paused { opacity: 1; animation: none; }
@keyframes blink { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }

/* ---------- Full-screen player ---------- */
.player { position: fixed; inset: 0; z-index: 500; background: #000; color: #fff; opacity: 0; transition: opacity .2s ease; }
.player.open { opacity: 1; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pl-tap { position: absolute; inset: 0; z-index: 1; border: 0; background: none; cursor: pointer; }
.pl-close { position: absolute; z-index: 3; right: 14px; top: calc(14px + env(safe-area-inset-top, 0px)); display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; cursor: pointer; }
.pl-close .i { width: 22px; height: 22px; }
.pl-bar { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 40px 18px calc(18px + var(--safe-b)); background: linear-gradient(to top, rgba(0,0,0,.75), transparent); }
.pl-close, .pl-bar { transition: opacity .25s ease; }
.player.idle .pl-close, .player.idle .pl-bar { opacity: 0; pointer-events: none; }
.player.idle { cursor: none; }
.pl-time { display: flex; align-items: center; gap: 12px; font: 600 .78rem var(--font); font-variant-numeric: tabular-nums; }
.pl-time span { min-width: 34px; opacity: .9; } .pl-time span:last-child { text-align: right; }
.pl-time input { flex: 1; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; --p: 0%; }
.pl-time input::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.3) var(--p)); }
.pl-time input::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.3) var(--p)); }
.pl-time input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.pl-time input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.pl-btns { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 18px; margin-top: 8px; }
.pl-btns button { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; }
.pl-btns button:active { transform: scale(.92); }
.pl-btns [data-pl-mute] { justify-self: start; }
.pl-btns small { position: absolute; font: 800 .55rem var(--font); top: 50%; left: 50%; transform: translate(-50%, -38%); }
.pl-btns .i { width: 26px; height: 26px; }
.pl-btns .pl-main { width: 64px; height: 64px; background: #fff; color: #000; }
.pl-main .i { width: 28px; height: 28px; }
.pl-main .is-play { display: none; margin-left: 3px; }
.player.paused .pl-main .is-play { display: block; } .player.paused .pl-main .is-pause { display: none; }
[data-pl-mute] .is-muted, .player.muted [data-pl-mute] .is-sound { display: none; }
.player.muted [data-pl-mute] .is-muted { display: block; }

/* ---------- Toast above pop-ups; above the fixed RSVP button on invites ---------- */
.toast { z-index: 700; }
body.cover-bg .toast { bottom: calc(104px + var(--safe-b)); }

/* ---------- "Responder convite" stays at the bottom ---------- */
.rsvp-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0; padding: 22px 16px calc(14px + var(--safe-b));
  background: linear-gradient(to bottom, transparent, var(--bg) 45%); pointer-events: none; }
.rsvp-cta > div { max-width: 560px; margin: 0 auto; pointer-events: auto; }
.rsvp-cta .btn.tonal { background: var(--surface); box-shadow: var(--shadow); }
.invite .sheet { padding-bottom: 96px; }

/* ---------- RSVP flow bits ---------- */
form[data-status="nao"] .if-sim, form:not([data-status="nao"]) .if-nao { display: none; }
.if-nao { display: inline-flex; align-items: center; gap: 8px; }
.step-sub.mt { margin-top: 16px; }
.step-sending { display: grid; justify-items: center; gap: 12px; padding: 36px 0 24px; color: var(--ink-2); }

/* ---------- Copy button follows the invite colors ---------- */
.iconbtn.copy-btn { position: relative; flex: none; background: var(--brand-tint); color: var(--brand-ink, var(--brand)); box-shadow: none; transition: background .2s, color .2s, transform .15s; }
.copy-btn .i { width: 20px; height: 20px; transition: transform .25s cubic-bezier(.2,.9,.3,1.5), opacity .2s; }
.copy-btn .c2 { position: absolute; opacity: 0; transform: scale(.3); }
.copy-btn.copied { background: var(--brand); color: var(--on-brand); }
.copy-btn.copied .c1 { opacity: 0; transform: scale(.3); }
.copy-btn.copied .c2 { opacity: 1; transform: none; stroke-width: 2.6; }

/* ---------- Calendar and map choices ---------- */
.link-alt { display: block; text-align: center; padding: 8px; font-weight: 700; font-size: .9rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.open-with { margin: 4px 0 -2px; text-align: center; font-size: .82rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.btn.map-app { width: 100%; min-height: 56px; background: var(--surface); box-shadow: var(--shadow); }
.btn.map-app .i { color: var(--brand-ink, var(--brand)); }

/* ---------- Colors suggested by the photo ---------- */
.photo-pals { padding: 14px 16px 6px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.photo-pals .palettes { margin: 0 -16px; }
.pp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pp-head > span { flex: 1; } .pp-head b { display: block; } .pp-head small { display: block; color: var(--ink-2); font-size: .82rem; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .86rem; }
.photo-pals.pulse { animation: palPulse 1.2s ease; }
@keyframes palPulse { 0% { box-shadow: 0 0 0 0 var(--brand); } 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 25%, transparent); } 100% { box-shadow: var(--shadow); } }
.group-title.sub { margin-top: 14px; }

/* ---------- Guest entry ticket ---------- */
.ticket-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 20px 20px; text-align: center;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
/* the notches of a paper ticket */
.ticket-card::before, .ticket-card::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--bg); }
.ticket-card::before { left: -11px; } .ticket-card::after { right: -11px; }
.ticket-qr { padding: 12px; margin-bottom: 8px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 3px var(--brand-tint); }
.ticket-qr img { display: block; width: min(220px, 60vw); height: auto; image-rendering: pixelated; }
.ticket-card > b { font-size: 1.2rem; }
.ticket-card > small { max-width: 300px; color: var(--ink-2); line-height: 1.4; }
.ticket-code { margin-top: 6px; padding: 6px 14px; border-radius: 10px; background: var(--fill); font: 800 1.05rem ui-monospace, Menlo, monospace; letter-spacing: .14em; }
.ticket-tip { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .78rem; color: var(--ink-3); }
.ticket-tip .i { width: 14px; height: 14px; }
.ticket-card.done { padding: 26px 20px; background: var(--ok-tint); }
.ticket-card.done::before, .ticket-card.done::after { display: none; }
.ticket-card.done > b { color: var(--ok); }
.ticket-check { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%; background: var(--ok); color: #fff; }
.ticket-check .i { width: 34px; height: 34px; stroke-width: 3; }
.ticket-card.just { animation: ticketIn .7s cubic-bezier(.2,.9,.3,1.4); }
.ticket-card.just .ticket-check { animation: hop .6s ease .3s; }
@keyframes ticketIn { from { transform: scale(.85); opacity: 0; } }

/* ---------- Simple centered pages ---------- */
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.big-empty { max-width: 420px; gap: 10px; padding: 36px 24px; }
.big-empty h1 { font-size: 1.5rem; color: var(--ink); }
.big-empty p { margin: 0 0 8px; }
.big-emoji { font-size: 3rem; }

/* ---------- Owner panel: door ---------- */
.door-stats { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.door-stats > b { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; color: var(--ok); }
.door-stats > b small { font-size: 1rem; color: var(--ink-3); font-weight: 700; }
.door-stats span b { display: block; } .door-stats span small { display: block; color: var(--ink-2); font-size: .82rem; }
.door-link { display: grid; gap: 8px; padding: 14px 18px 12px; }
.door-link > small { color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.door-link > b { font-size: .92rem; word-break: break-all; }
.door-link .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.door-manage { display: flex; justify-content: space-between; }
.door-manage .link { border: 0; background: none; padding: 6px 0; font: 700 .86rem var(--font); color: var(--ink-2); cursor: pointer; }
.door-manage .link.danger { color: var(--no); }

/* ---------- Door scanner (dark, full screen) ---------- */
body.scan-body { background: #0d0c0b; color: #fff; }
.scan-app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: env(safe-area-inset-top, 0px) 0 calc(16px + var(--safe-b)); }
.scan-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.scan-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 1.2rem; flex: none; }
.scan-icon .i { transform: rotate(180deg); }
.scan-title { flex: 1; min-width: 0; } .scan-title b { display: block; font-size: 1.1rem; }
.scan-title small { display: block; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-count { text-align: right; font-weight: 700; color: rgba(255,255,255,.7); }
.scan-count b { font-size: 1.5rem; color: #4cd18b; } .scan-count small { display: block; font-size: .72rem; }
.scan-view { position: relative; margin: 4px 16px 0; aspect-ratio: 3 / 4; max-height: 62dvh; border-radius: 28px; overflow: hidden; background: #1c1a18; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.live .scan-view video { opacity: 1; }
.scan-frame { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; transition: opacity .3s; }
.live .scan-frame { opacity: 1; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.scan-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.scan-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.scan-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.scan-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 10%; height: 3px; border-radius: 3px; background: #4cd18b; box-shadow: 0 0 14px #4cd18b; animation: scanLine 2s ease-in-out infinite alternate; }
@keyframes scanLine { to { top: 88%; } }
.scan-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.scan-start small { color: rgba(255,255,255,.65); max-width: 260px; }
.scan-start .btn { margin-top: 10px; padding: 0 24px; min-height: 52px; }
.scan-start-ico { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: rgba(255,255,255,.08); }
.scan-start-ico .i { width: 38px; height: 38px; }
.scan-start b { font-size: 1.3rem; }
.scan-err { color: #ff9b9b !important; }
.scan-result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px; text-align: center; animation: srIn .25s ease; }
@keyframes srIn { from { opacity: 0; transform: scale(1.06); } }
.scan-result.ok { background: #138a52; } .scan-result.no { background: #c0392b; } .scan-result.warn { background: #b7791f; }
.sr-icon { display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 8px; border-radius: 50%; background: rgba(255,255,255,.2); font-size: 3rem; font-weight: 800; }
.sr-title { margin: 0; font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.sr-name { margin: 6px 0 0; font-size: clamp(1.8rem, 8vw, 2.4rem); font-weight: 800; line-height: 1.1; }
.sr-extra { margin: 6px 0 0; font-size: 1rem; opacity: .92; max-width: 320px; }
.sr-next { margin-top: 18px; background: rgba(255,255,255,.95); color: #111; padding: 0 26px; min-height: 50px; }
.scan-manual { display: flex; gap: 8px; margin: 14px 16px 0; }
.scan-manual input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border: 0; border-radius: 16px; background: rgba(255,255,255,.1); color: #fff;
  font: 700 1rem ui-monospace, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
.scan-manual input::placeholder { font-family: var(--font); letter-spacing: 0; text-transform: none; font-weight: 500; color: rgba(255,255,255,.5); }
.scan-manual .btn { min-height: 50px; padding: 0 18px; background: rgba(255,255,255,.14); color: #fff; }
.scan-recent { margin: 6px 16px 0; }
.scan-recent .group-title { color: rgba(255,255,255,.55); }
.scan-recent ul { list-style: none; margin: 0; padding: 0; border-radius: 18px; background: rgba(255,255,255,.06); overflow: hidden; }
.scan-recent li { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.scan-recent li + li { box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.scan-recent li b { flex: 1; } .scan-recent li small { color: #4cd18b; font-weight: 800; }
.scan-recent li em { font-style: normal; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums; }
.scan-recent li.none { color: rgba(255,255,255,.5); justify-content: center; }

/* ---------- Invite: text and icons that sit on the page background follow its contrast ---------- */
body.themed :is(.group-title, .group-title small, .fine, .madewith, .madewith .brand, .step-sub, .open-with, .link-alt, .step-back, .step-sending, .intro-skip) { color: var(--on-bg-2, var(--ink-2)); }
body.themed :is(.modal-head h2, .step-q, .hello-on-bg) { color: var(--on-bg, var(--ink)); }
body.themed .modal-head .iconbtn.flat { color: var(--on-bg-2, var(--ink-3)); }
body.themed .note { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* Success cards keep their own light-green look, so their text uses fixed dark greens (readable with any theme). */
.ticket-card.done, .uber-back { background: #e2f6ec; }
.ticket-card.done > b, .uber-back b { color: #136b42; }
.ticket-card.done small, .uber-back small { color: #34584a; }
.ticket-card.done .ticket-check { background: #1f9d63; }
