/* Shh Santa: stationery look. Ivory paper, evergreen ink, a garnet wax seal, fine gold lines.
   Built to be easy to read: 17px text, strong contrast, big tap targets. */

:root {
  --paper: #F7F2E9;
  --paper-2: #EFE6D6;
  --card: #FFFDF8;
  --ink: #1E2A24;
  --ink-2: #3D4842;
  --muted: #5C635C;
  --line: #E3D6BF;
  --line-2: #D4C3A4;
  --green: #1F4A3A;
  --green-2: #163829;
  --green-soft: #E2EBE3;
  --garnet: #8C1C2B;
  --garnet-2: #6B1220;
  --garnet-soft: #F6E4E1;
  --gold: #B48A42;
  --gold-text: #7E5C1D;
  --gold-soft: #F4E9D3;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 18px;
  --shadow: 0 1px 0 #fff inset, 0 12px 32px rgba(60, 40, 15, .07);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .6;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .16  0 0 0 .08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#app { position: relative; z-index: 1; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-underline-offset: 3px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(31, 74, 58, .35); outline-offset: 2px; border-radius: 8px; }

.page { max-width: 560px; margin: 0 auto; padding: calc(8px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom)); }
.page.has-tabs { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* type */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: 42px; line-height: 1.06; }
h1 em, h2 em { font-style: italic; color: var(--green); }
h2 { font-size: 27px; line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.2; }
p { margin: 8px 0; }
.lead { font-size: 18.5px; line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 15.5px; }
.fine { font-size: 14.5px; color: var(--muted); }
.center { text-align: center; }
.kicker { display: inline-block; font: 600 12.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); }
.rule { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold); font-size: 13px; }
.rule::before, .rule::after { content: ''; height: 1px; width: 56px; background: linear-gradient(90deg, transparent, #D2B27A, transparent); }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 400 23px var(--serif); letter-spacing: -.01em; }
.brand i { font-style: italic; }
.brand svg { width: 32px; height: 32px; flex: none; }
.topbar .right { display: flex; align-items: center; gap: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: 14px; border: none;
  font: 600 17px var(--sans); letter-spacing: .005em; text-decoration: none; text-align: center;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--green); color: #FBF6EC; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 10px 24px rgba(31, 74, 58, .22); }
.btn.primary:hover { background: var(--green-2); }
.btn.garnet { background: var(--garnet); color: #FBF6EC; box-shadow: 0 10px 22px rgba(140, 28, 43, .2); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px #BFAA85; }
.btn.danger { background: var(--card); color: var(--garnet-2); box-shadow: inset 0 0 0 1.5px #E3B9B4; }
.btn.small { min-height: 46px; padding: 0 16px; font-size: 15.5px; border-radius: 12px; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 60px; font-size: 18px; padding: 0 28px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-row .btn { flex: 1 1 auto; }
.link { background: none; border: none; padding: 0; color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 6px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sub-h { font: 600 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.note { background: var(--gold-soft); border: 1px solid #EAD8B2; border-radius: 14px; padding: 14px 16px; margin: 14px 0; font-weight: 500; }
.note.red { background: var(--garnet-soft); border-color: #EBC7C2; }
.note-text { white-space: pre-wrap; background: var(--paper); border-radius: 12px; padding: 12px 14px; margin: 10px 0 0; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* forms */
.field { display: block; margin: 16px 0 0; }
.field > span { display: block; font: 600 16px var(--sans); margin-bottom: 7px; color: var(--ink); }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.hint { display: block; font-size: 14.5px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=number], input[type=date], input:not([type]), textarea, select {
  width: 100%; min-height: 54px; padding: 13px 15px; border-radius: 13px; border: 1.5px solid var(--line-2);
  background: #FFFEFA; font-size: 18px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #8A8C82; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31, 74, 58, .14); }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.input-row { display: flex; gap: 10px; align-items: stretch; }
.input-row input { flex: 1; min-width: 0; }
.money { display: grid; grid-template-columns: 118px 1fr; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.optional { font: 500 13px var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin-left: 8px; vertical-align: middle; letter-spacing: 0; }
.error { background: var(--garnet-soft); color: var(--garnet-2); border: 1px solid #EBC7C2; border-radius: 13px; padding: 13px 15px; font-weight: 600; margin: 10px 0; }
.sticky { position: sticky; bottom: 0; z-index: 5; padding: 16px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 70%, rgba(247, 242, 233, 0)); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: #FFFEFA; font: 500 15.5px var(--sans); color: var(--ink); line-height: 1.2;
}
button.chip { min-height: 46px; }
button.chip:hover { border-color: #BFAA85; }
.chip.on { background: var(--green); border-color: var(--green); color: #FBF6EC; }
.chip.on svg { color: #FBF6EC; }
.chip svg { width: 16px; height: 16px; }
.chip.soft { background: rgba(255, 253, 248, .8); border-color: var(--line); font-size: 14.5px; min-height: 36px; padding: 6px 12px; }
.chip.add { border-style: dashed; color: var(--ink-2); }
.chip.apart { background: var(--garnet-soft); border-color: #E7C2BD; color: var(--garnet-2); }
.chip .x { background: none; border: none; padding: 0 0 0 4px; font-size: 20px; line-height: 1; color: inherit; opacity: .7; min-width: 28px; min-height: 28px; }
.count-line { font-size: 15px; color: var(--muted); font-weight: 500; margin-top: 12px; }
.select-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid #EAD8B2; padding: 12px 14px; border-radius: 14px; margin-top: 12px; font-weight: 600; }

/* monograms */
.mono { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font: italic 500 19px var(--serif); color: var(--green-2); background: #E2EBE3; letter-spacing: -.02em; }
.mono.sm { width: 30px; height: 30px; font-size: 14px; }
.mono.lg { width: 64px; height: 64px; font-size: 27px; }
.tint-0 { background: #DFE9E0; } .tint-1 { background: #F2DEDA; } .tint-2 { background: #EEE4CD; }
.tint-3 { background: #DDE3EA; } .tint-4 { background: #EADDE8; } .tint-5 { background: #E3E9D5; }

/* name tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.tile {
  display: flex; align-items: center; gap: 12px; text-align: left; min-height: 72px; padding: 12px; border-radius: 16px;
  background: #FFFEFA; border: 1.5px solid var(--line); transition: border-color .15s, transform .1s;
}
.tile:hover { border-color: var(--gold); }
.tile:active { transform: scale(.98); }
.tile .nm { display: flex; flex-direction: column; min-width: 0; font: 600 17px var(--sans); line-height: 1.2; overflow-wrap: anywhere; }
.tile .nm small { font: 400 14px var(--sans); color: var(--muted); margin-top: 3px; }
.tile.joined { background: transparent; border-style: dashed; }
.tile.joined .nm small { color: var(--green); }
.tile.mine { border-color: var(--green); background: var(--green-soft); }

/* invitation header */
.invite { text-align: center; padding: 18px 0 6px; }
.invite h1 { font-size: 36px; margin: 10px 0 6px; overflow-wrap: anywhere; }
.invite .by { color: var(--muted); font-size: 16px; }
.invite .chips { justify-content: center; margin-top: 14px; }

/* ---------- the envelope ---------- */
.stage { position: relative; width: 330px; height: 330px; margin: 0 auto; transition: margin-top .6s ease .35s; }
.stage[data-state=closed] { margin-top: -86px; }
.stage svg { position: absolute; left: 0; top: 0; width: 330px; height: 330px; overflow: visible; }
.stage .env-open { opacity: 0; transform-origin: 50% 39.4%; transform: scaleY(0); transition: transform .45s ease .32s, opacity .01s linear .32s; }
.stage .env-flap { transform-origin: 50% 39.4%; transition: transform .38s ease-in; }
.stage .letter-clip { position: absolute; left: 0; top: -40px; width: 330px; height: 340px; overflow: hidden; z-index: 2; pointer-events: none; }
.stage .letter {
  position: absolute; left: 47px; top: 148px; width: 236px; height: 188px; z-index: 2;
  background: var(--card); border-radius: 6px; box-shadow: 0 18px 34px rgba(60, 40, 15, .16);
  padding: 16px 14px; text-align: center; transform: translateY(0) rotate(0);
  transition: transform .8s cubic-bezier(.2, .9, .25, 1.05) .62s;
}
.stage .letter::before { content: ''; position: absolute; inset: 8px; border: 1px solid #E3CFA3; border-radius: 3px; pointer-events: none; }
.stage .letter::after { content: ''; position: absolute; inset: 12px; border: 1px solid #F0E3C6; border-radius: 2px; pointer-events: none; }
.stage .letter .kicker { margin-top: 16px; font-size: 10.5px; letter-spacing: .13em; white-space: nowrap; }
.stage .letter .who { font: italic 400 50px/1.02 var(--serif); color: var(--green); margin: 10px 4px 8px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stage .letter .who.long { font-size: 38px; }
.stage .letter .who.longer { font-size: 30px; }
.stage .pocket { z-index: 3; pointer-events: none; }
.stage .flap-layer { z-index: 4; pointer-events: none; }
.seal-btn {
  position: absolute; left: 125px; top: 152px; width: 80px; height: 80px; z-index: 5; padding: 0; border: none; background: none;
  border-radius: 50%; -webkit-tap-highlight-color: transparent; transition: transform .2s;
}
.seal-btn svg { position: static; width: 80px; height: 80px; overflow: visible; }
.seal-btn .half { transition: transform .5s cubic-bezier(.3, .7, .3, 1), opacity .5s ease .15s; transform-box: fill-box; transform-origin: center; }
.seal-btn:not(:disabled) { animation: sealPulse 2.4s ease-in-out infinite; }
.seal-btn:hover { transform: scale(1.04); }
.stage .cracked { position: absolute; left: 218px; top: 216px; width: 46px; height: 46px; z-index: 4; opacity: 0; transform: rotate(18deg) scale(.8); transition: opacity .3s ease .7s, transform .4s ease .7s; pointer-events: none; }
.stage .cracked svg { position: static; width: 46px; height: 46px; }
.stage .sparkle { position: absolute; z-index: 6; color: var(--gold); font-size: 14px; pointer-events: none; animation: sparkle 1.4s ease-out forwards; }

/* closed: letter tucked inside, flap down */
.stage[data-state=closed] .letter { transform: translateY(80px); }
/* opening + open */
.stage[data-state=open] .env-flap, .stage[data-state=opening] .env-flap { transform: scaleY(0); }
.stage[data-state=open] .env-open, .stage[data-state=opening] .env-open { opacity: 1; transform: scaleY(1); }
.stage[data-state=open] .letter, .stage[data-state=opening] .letter { transform: translateY(-88px) rotate(-1.2deg); }
.stage[data-state=open] .cracked, .stage[data-state=opening] .cracked { opacity: 1; transform: rotate(18deg) scale(1); }
.stage[data-state=opening] .seal-btn, .stage[data-state=open] .seal-btn { pointer-events: none; animation: none; }
.stage[data-state=opening] .seal-btn .half.l, .stage[data-state=open] .seal-btn .half.l { transform: translate(-26px, 20px) rotate(-38deg); opacity: 0; }
.stage[data-state=opening] .seal-btn .half.r, .stage[data-state=open] .seal-btn .half.r { transform: translate(26px, 22px) rotate(42deg); opacity: 0; }
.stage[data-state=open] .seal-btn { visibility: hidden; transition: visibility 0s .7s; }
.stage.no-anim *, .stage.no-anim { transition: none !important; animation: none !important; }
.stage-cap { text-align: center; margin: 2px 0 0; font: 600 18px var(--sans); color: var(--garnet-2); }
.stage-cap.calm { color: var(--muted); font-weight: 500; font-size: 15.5px; }

@keyframes sealPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes sparkle { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1) rotate(90deg); } }

/* ---------- the little papercut Santa ---------- */
.scene { position: relative; width: 330px; height: 92px; margin: -6px auto 0; overflow: hidden; }
.scene .ground { position: absolute; left: 10px; right: 10px; bottom: 9px; height: 1px; background: linear-gradient(90deg, transparent, #CBB48B 15%, #CBB48B 85%, transparent); }
.scene .walker { position: absolute; bottom: 8px; left: -90px; width: 66px; height: 84px; }
.scene .walker svg { width: 66px; height: 84px; display: block; overflow: visible; }
.scene .walker .bob { transform-box: fill-box; transform-origin: 50% 100%; }
.scene .walker .arm-shh, .scene .walker .arm-free { opacity: 0; }
.scene .shh { position: absolute; bottom: 74px; left: 186px; font: italic 500 20px var(--serif); color: var(--ink); opacity: 0; }
.scene.play .walker { animation: walk 5.2s cubic-bezier(.45, .05, .4, 1) forwards; }
.scene.play .walker .bob { animation: bob .3s ease-in-out 0s 6 alternate, bob .3s ease-in-out 3.45s 6 alternate; }
.scene.play .walker .arm-carry { animation: armCarry 5.2s steps(1, end) forwards; }
.scene.play .walker .arm-shh { animation: armShh 5.2s steps(1, end) forwards; }
.scene.play .walker .arm-free { animation: armFree 5.2s steps(1, end) forwards; }
.scene.play .shh { animation: shh 5.2s ease forwards; }
.scene { transition: height .45s ease, margin .45s ease; }
.scene.done { height: 0; margin-top: 0; }
.scene.done .walker { left: 400px; }
@keyframes walk { 0% { left: -90px; } 34% { left: 128px; } 66% { left: 128px; } 100% { left: 400px; } }
@keyframes bob { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-4px) rotate(2deg); } }
@keyframes armCarry { 0% { opacity: 1; } 38% { opacity: 0; } }
@keyframes armShh { 0% { opacity: 0; } 42% { opacity: 1; } 64% { opacity: 0; } }
@keyframes armFree { 0% { opacity: 0; } 38% { opacity: 1; } 42% { opacity: 0; } 64% { opacity: 1; } }
@keyframes shh { 0%, 40% { opacity: 0; transform: translateY(6px); } 46%, 62% { opacity: 1; transform: none; } 70%, 100% { opacity: 0; } }
.stage.delivering { animation: arrive 5.2s ease forwards; }
@keyframes arrive { 0%, 36% { opacity: 0; transform: translateY(18px) scale(.6); } 48% { opacity: 1; transform: translateY(-4px) scale(1.02); } 56%, 100% { opacity: 1; transform: none; } }

/* ---------- person page ---------- */
.me-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 14px 5px 6px; font: 600 15.5px var(--sans); min-height: 46px; }
.page-title { font: 500 15.5px var(--sans); color: var(--muted); text-align: center; margin: 0; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 6px; }
.seal-note { text-align: center; font-size: 14.5px; color: var(--muted); margin: 6px 0 0; }
.reveal-cap { text-align: center; color: var(--ink-2); margin: 4px 0 0; }
.wishes { margin-top: 10px; }
.wish { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.wish:first-child { border-top: 0; }
.wish-main { display: flex; align-items: center; gap: 13px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.wish img, .wish-ico { width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; background: var(--paper-2); display: grid; place-items: center; color: var(--green); }
.wish-ico svg { width: 24px; height: 24px; }
.wish-text { display: flex; flex-direction: column; min-width: 0; }
.wish-text .t { font: 600 16.5px var(--sans); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.wish-text .s { font-size: 14.5px; color: var(--muted); }
a.wish-main .s::after { content: ' ↗'; }
.wish .x { flex: none; min-width: 46px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted); font-size: 22px; line-height: 1; }
.wish.loading { opacity: .6; }
.kv { margin: 14px 0 0; }
.kv b { display: block; font: 600 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kv div { white-space: pre-wrap; margin-top: 3px; }
.ideas { margin: 8px 0 14px; }
.idea { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.idea:first-child { border-top: 0; }
.idea .t { font: 600 16.5px var(--sans); }
.idea .p { font-size: 14.5px; color: var(--muted); }
.dates { display: grid; gap: 10px; margin: 10px 0 14px; }
.date-row { display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.date-row svg { width: 24px; height: 24px; color: var(--green); flex: none; }
.date-row .when { font: 600 17px var(--sans); }
.date-row .lbl { font-size: 14.5px; color: var(--muted); }
.sleeps { display: inline-flex; align-items: center; gap: 8px; font: italic 400 21px var(--serif); color: var(--green); margin: 2px 0 10px; }
.sleeps svg { width: 20px; height: 20px; }
.rules-list { list-style: none; padding: 0; margin: 8px 0 0; }
.rules-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.rules-list li svg { width: 18px; height: 18px; color: var(--gold); flex: none; margin-top: 4px; }

/* messages */
.thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble { max-width: 84%; padding: 11px 15px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16.5px; }
.bubble .who { display: block; font: 600 13px var(--sans); opacity: .8; margin-bottom: 2px; }
.bubble small { display: block; font-size: 12.5px; opacity: .7; margin-top: 4px; }
.bubble.me { align-self: flex-end; background: var(--green); color: #FBF6EC; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--paper-2); border-bottom-left-radius: 6px; }
.compose { display: flex; gap: 10px; align-items: flex-end; }
.compose textarea { flex: 1; min-height: 56px; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; background: rgba(250, 246, 238, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar .inner { display: flex; width: 100%; max-width: 560px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 11px; min-height: 64px; background: none; border: none; font: 600 13.5px var(--sans); color: var(--muted); position: relative; }
.tab svg { width: 25px; height: 25px; }
.tab[aria-current='page'] { color: var(--garnet); }
.badge { position: absolute; top: 6px; left: calc(50% + 9px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--garnet); color: #fff; font: 700 12.5px var(--sans); display: grid; place-items: center; }

/* organizer */
.org-pill { font: 600 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--green-2); background: var(--green-soft); padding: 7px 12px; border-radius: 999px; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--paper); border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 13px 15px; margin-top: 12px; font: 600 16.5px var(--sans); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font: 400 28px var(--serif); line-height: 1.1; }
.stat span { font: 600 12px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.prow { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.prow .who { flex: 1; min-width: 0; }
.prow .nm { font: 600 17px var(--sans); overflow-wrap: anywhere; }
.status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 500 13.5px var(--sans); padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.pill svg { width: 14px; height: 14px; }
.pill.ok { background: var(--green-soft); color: var(--green-2); }
.pill.warn { background: var(--garnet-soft); color: var(--garnet-2); }
.pill.gold { background: var(--gold-soft); color: #6E5016; }
.manage { flex: none; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); font: 600 15px var(--sans); color: var(--ink-2); }
.remind-list { display: grid; gap: 10px; margin-top: 12px; }
.remind { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; min-height: 64px; padding: 12px 15px; border-radius: 15px; background: var(--paper); border: 1.5px solid var(--line); font: 600 16.5px var(--sans); }
.remind:hover { border-color: var(--line-2); }
.remind svg { width: 24px; height: 24px; color: var(--green); flex: none; }
.remind small { display: block; font: 400 14.5px var(--sans); color: var(--muted); }
.pairs { display: grid; gap: 8px; margin-top: 12px; }
.pair { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 12px; padding: 10px 12px; font-weight: 500; }
.log { margin: 8px 0 0; padding: 0; list-style: none; }
.log li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.log li small { display: block; color: var(--muted); }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.switch { position: relative; width: 58px; height: 34px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #D8CBB4; transition: background .2s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(24px); }
.collapse summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.collapse summary::after { content: ''; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; }
.collapse[open] summary::after { transform: rotate(-135deg); }
.celebrate { text-align: center; background: var(--gold-soft); border-color: #EAD8B2; position: relative; overflow: hidden; }

/* sheets */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(30, 22, 12, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet-back.closing { animation: fade .18s ease reverse forwards; }
.sheet { position: relative; background: var(--card); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .26s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .15); }
.sheet h2 { font-size: 27px; }
.sheet .big-mono { display: flex; justify-content: center; margin-bottom: 10px; }
.sheet .word { font: italic 400 34px var(--serif); text-align: center; color: var(--green); background: var(--gold-soft); border: 1px solid #EAD8B2; border-radius: 16px; padding: 16px; margin: 14px 0; }
.sheet-actions { display: grid; gap: 10px; margin-top: 18px; }
.menu { display: grid; gap: 4px; margin-top: 12px; }
.menu button, .menu a { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px; border-radius: 14px; background: none; border: none; text-align: left; font: 600 16.5px var(--sans); text-decoration: none; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--paper); }
.menu svg { width: 24px; height: 24px; color: var(--green); flex: none; }
.menu small { display: block; font: 400 14.5px var(--sans); color: var(--muted); }
.menu .danger, .menu .danger svg { color: var(--garnet-2); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .sheet-back { align-items: center; } .sheet { border-radius: 26px; } }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100% - 32px); background: var(--ink); color: #FBF6EC; font: 600 16px var(--sans); padding: 13px 20px; border-radius: 999px; text-align: center; transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* sealing overlay (after "Draw names") */
.seal-overlay { position: fixed; inset: 0; z-index: 70; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; animation: fade .2s; padding: 20px; }
.seal-overlay.finish { animation: fade .5s ease reverse forwards; }
.mini-envs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; max-width: 330px; }
.mini-env { width: 72px; height: 50px; position: relative; opacity: 0; animation: dealIn .4s ease forwards; }
.mini-env svg { width: 72px; height: 50px; }
.mini-env .mini-seal { position: absolute; left: 26px; top: 12px; width: 20px; height: 20px; opacity: 0; animation: stamp .35s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.seal-overlay .label { font: italic 400 28px var(--serif); color: var(--ink); text-align: center; }
@keyframes dealIn { from { opacity: 0; transform: translateY(14px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: 0; transform: scale(2.6); } to { opacity: 1; transform: scale(1); } }

/* ---------- home ---------- */
.hero { padding: 18px 0 4px; }
.hero h1 { font-size: 44px; margin: 12px 0 14px; }
.hero .lead { margin: 0 0 22px; }
.hero .fine { margin-top: 12px; }
.demo { margin: 22px 0 4px; padding: 20px 14px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); text-align: center; }
.demo .kicker { margin-bottom: 4px; }
.demo .stage-cap { margin-top: 0; }
.demo .after { margin: 8px 18px 6px; }
.section { margin-top: 34px; }
.section > h2 { margin-bottom: 6px; }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.steps .num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #FBF6EC; font: italic 400 21px var(--serif); }
.steps b { display: block; font: 400 21px var(--serif); margin-bottom: 2px; }
.steps p { margin: 0; color: var(--ink-2); }
.steps .eg { margin-top: 12px; }
.msg-eg { display: inline-flex; flex-direction: column; max-width: 260px; background: #E9E9EB; border-radius: 18px; padding: 10px 14px; font-size: 15.5px; color: #1d1d1f; text-align: left; }
.msg-eg .card-eg { margin-top: 8px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #ddd; }
.msg-eg .card-eg img { display: block; width: 100%; height: auto; }
.msg-eg .card-eg div { padding: 8px 10px; font: 600 14px var(--sans); }
.msg-eg .card-eg small { display: block; font: 400 12.5px var(--sans); color: #6e6e73; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.feature svg { width: 24px; height: 24px; color: var(--green); }
.feature b { display: block; font: 600 16px var(--sans); margin-top: 6px; }
.feature span { font-size: 14.5px; color: var(--muted); }
.promise { display: grid; gap: 10px; margin-top: 14px; }
.promise div { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.promise svg { width: 24px; height: 24px; color: var(--green); flex: none; margin-top: 1px; }
.faq { margin-top: 12px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 17px 2px; font: 600 17.5px var(--sans); }
.faq summary::after { content: '+'; font: 300 28px var(--sans); color: var(--green); line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 2px 18px; color: var(--ink-2); }
.cta-end { text-align: center; margin: 34px 0 8px; padding: 26px 18px; background: var(--green); color: #FBF6EC; border-radius: 22px; }
.cta-end h2 { color: #FBF6EC; }
.cta-end h2 em { color: #F1DDB0; }
.cta-end .btn { background: #FBF6EC; color: var(--green-2); margin-top: 16px; }
.group-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font: 600 17px var(--sans); }
.group-row:first-of-type { border-top: 0; }
.code-form { display: flex; gap: 10px; margin-top: 10px; }
.code-form input { flex: 1; min-width: 0; }

/* footer */
.foot { text-align: center; margin: 34px 0 8px; font-size: 14.5px; color: var(--muted); }
.foot a { color: var(--muted); }

/* loading */
.loading { display: grid; place-items: center; min-height: 60vh; }
.loading svg { width: 64px; height: 64px; animation: sealPulse 1.2s ease-in-out infinite; }

.prose h2 { margin-top: 22px; font-size: 23px; }
.prose p, .prose li { color: var(--ink-2); }

/* printable gift tags */
#print-area { display: none; }
@media print {
  @page { margin: 12mm; }
  body.printing > *:not(#print-area):not(svg) { display: none !important; }
  body.printing::before { display: none; }
  body.printing #print-area { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8mm; }
  .print-tag { border: 1px dashed #999; border-radius: 6mm; padding: 6mm; height: 58mm; display: flex; flex-direction: column; justify-content: center; text-align: center; break-inside: avoid; }
  .print-tag .to { font: italic 400 30pt var(--serif); color: #1F4A3A; }
  .print-tag .from { font: 500 12pt var(--sans); color: #333; margin-top: 3mm; }
  .print-tag svg { width: 12mm; height: 12mm; margin: 0 auto 2mm; }
}

@media (max-width: 370px) {
  h1, .hero h1 { font-size: 36px; }
  .two, .features { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(3, 1fr); }
}

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