/* Palette pulled from Allison's avatar: pink onesie, sunshine accents, denim, peach backdrop. */
:root {
  --pink: #F05A9D;      --pink-d: #CF3F7F;   --pink-l: #FFE3EF;
  --sun: #FFC933;       --sun-d: #E5A800;    --sun-l: #FFF4CC;
  --denim: #5B8ED6;     --denim-d: #3F71B9;  --denim-l: #E3EEFB;
  --lav: #8C7BD8;       --lav-d: #6E5DBD;    --lav-l: #EEEAFB;
  --mint: #34C98B;      --mint-d: #22A56F;   --mint-l: #DEF7EC;
  /* Deeper versions wherever text sits on the color, so it reads at 4.5:1 or better (WCAG AA).
     The bright ones above stay for bars, avatar and decoration. */
  --pink-ui: #E41571;   --pink-ui-d: #B30F57;
  --denim-ui: #3876CD;  --denim-ui-d: #285A9F;
  --lav-ui: #7965D2;    --lav-ui-d: #5B47B0;
  --mint-ui: #23865D;   --mint-ui-d: #186445;
  --pink-text: #BB2B6A; --sun-text: #946C00; --mint-text: #1E7A54; --denim-text: #2D5EA8;
  --peach: #FFF1EA;
  --ink: #3B3355;       --muted: #72698B;    --line: #ECE5F1;
  --bg: #FFFFFF;
  --radius: 16px;
  --display: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 700 16px/1.5 var(--body);
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
p { margin: 0; }
a { color: var(--denim-d); }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--denim); outline-offset: 2px; border-radius: 10px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- chrome ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wordmark {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.01em;
  color: var(--pink); text-decoration: none; line-height: 1;
}
.brand-text { white-space: nowrap; } /* the name always stays on one line */
.brand-mark { display: none; width: 40px; height: 40px; flex: none; }

/* phones: a slim top bar with the name on the left, then the language button and a wish list / Contribute switch */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; background: var(--bg); border-bottom: 2px solid var(--line);
}
.topbar .wordmark { font-size: clamp(1.2rem, 6vw, 1.6rem); }
.topbar .brand-text { overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.topbar-lang {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 14px; cursor: pointer;
  background: var(--bg); border: 2px solid var(--line); border-bottom-width: 4px;
  font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--denim-ui);
}
.topbar-lang:active { border-bottom-width: 2px; transform: translateY(2px); }
.view-switch { display: flex; gap: 2px; padding: 3px; border-radius: 14px; background: #F6F2F9; border: 2px solid var(--line); }
.view-switch a {
  display: grid; place-items: center; width: 42px; height: 36px; border-radius: 10px; text-decoration: none;
  font-size: 1.35rem; line-height: 1; opacity: .5; filter: grayscale(.5); transition: background .2s, opacity .2s, filter .2s;
}
.view-switch a.active { opacity: 1; filter: none; background: var(--bg); box-shadow: 0 0 0 2px #BFD6F3, 0 2px 0 2px #BFD6F3; }
/* the smallest phones: tighter buttons so "Deseos de Allison" still fits */
@media (max-width: 350px) {
  .topbar { gap: 6px; padding-left: 12px; padding-right: 8px; }
  .topbar-actions { gap: 5px; }
  .topbar-lang { min-width: 38px; padding: 0 5px; }
  .view-switch a { width: 34px; }
}

.sidebar {
  display: none; flex-direction: column; gap: 24px; padding: 24px 16px; overflow-y: auto;
  background: var(--bg); border-right: 2px solid var(--line);
}
.sidebar .wordmark { font-size: 1.7rem; padding: 4px 10px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  border: 2px solid transparent; text-decoration: none; color: var(--muted);
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
}
.nav a:hover { background: var(--peach); }
.nav a.active { color: var(--denim-text); background: var(--denim-l); border-color: #BFD6F3; }
.nav-ic { width: 34px; flex: none; text-align: center; font-size: 1.6rem; line-height: 1; }
.nav-text { display: grid; gap: 2px; flex: 1; min-width: 0; line-height: 1.25; }
.nav-sub { font-family: var(--body); font-weight: 700; font-size: .8rem; color: var(--muted); }

.sidebar-foot { margin-top: auto; display: grid; gap: 6px; }
.lang-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 14px; cursor: pointer;
  background: none; border: 2px solid var(--line); border-bottom-width: 4px; color: var(--muted); text-align: left;
}
.lang-toggle:active { border-bottom-width: 2px; transform: translateY(2px); }
.lang-pill {
  display: inline-grid; place-items: center; min-width: 34px; height: 26px; border-radius: 8px;
  background: var(--denim-ui); color: #fff; font-family: var(--display); font-size: .85rem;
}
.lang-label { white-space: nowrap; }
.collapse-btn { display: none; }

.main { width: 100%; min-width: 0; max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; outline: none; }

@media (min-width: 760px) {
  body { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100vh; }
  .topbar { display: none; }
  .sidebar {
    display: flex; position: sticky; top: 0; height: 100vh; width: 272px; z-index: 10;
    transition: width .25s ease; overflow-x: clip;
  }
  .collapse-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 14px; cursor: pointer;
    background: none; border: 2px solid transparent; color: var(--muted); font-family: var(--display); font-weight: 600;
  }
  .collapse-btn:hover { background: var(--peach); }
  .collapse-ic { width: 34px; flex: none; text-align: center; font-size: 1.3rem; line-height: 1; }
  .main { max-width: 1400px; padding: 32px 32px 64px; }

  /* collapsed: icons only; the hidden labels stay readable by screen readers and show as tooltips */
  .sb-collapsed .sidebar { width: 84px; padding-inline: 12px; }
  .sb-collapsed .sidebar .wordmark { justify-content: center; padding: 0; }
  .sb-collapsed .brand-mark { display: block; }
  .sb-collapsed .sidebar .brand-text, .sb-collapsed .nav-text, .sb-collapsed .lang-label, .sb-collapsed .collapse-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .sb-collapsed .nav a, .sb-collapsed .lang-toggle, .sb-collapsed .collapse-btn { justify-content: center; padding-inline: 0; }
}

/* ---------- building blocks ---------- */
.card { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--bg); }

.btn {
  --c: var(--pink-ui); --cd: var(--pink-ui-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--c); color: #fff; box-shadow: 0 4px 0 var(--cd);
  font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: .02em; text-decoration: none;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--cd); }
.btn:disabled { --c: #E5E0EA; --cd: #CFC8D8; color: #A69DB8; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--bg); color: var(--muted); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn-wide { width: 100%; }
.btn-venmo { --c: #0070D2; --cd: #00519A; }
.btn-paypal { --c: #0070BA; --cd: #004F86; }
.btn-zelle { --c: #6D1ED4; --cd: #4F129E; }

/* progress bar: thick, rounded, with the glossy highlight stripe */
.bar { position: relative; height: 16px; border-radius: 99px; background: #EFEAF3; overflow: hidden; }
.bar-lg { height: 20px; }
.bar > span {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--sun);
  transition: width .9s cubic-bezier(.34, 1.4, .64, 1);
}
.bar > span::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, .45);
}
.bar-lg > span::after { top: 5px; height: 5px; }
.bar-blue > span { background: var(--denim); }
.bar.is-full > span { background: var(--mint); }

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; gap: 8px; margin: 4px 0 20px; }
.hero-figure { position: relative; width: 150px; flex: none; }
.hero-avatar { position: relative; }

/* "coming soon" night sky drifting behind her */
.sky { position: absolute; left: -32%; top: -18%; width: 164%; height: auto; overflow: visible; pointer-events: none; }
.sky-cloud { animation: drift 9s ease-in-out infinite alternate; }
.sky-cloud.c2 { animation-duration: 11s; animation-delay: -4s; }
.sky-cloud.c3 { animation-duration: 13s; animation-delay: -7s; }
.sky-star, .sky-moon { transform-box: fill-box; transform-origin: center; }
.sky-star { animation: star-twinkle 2.6s ease-in-out infinite; }
.sky-star.s2 { animation-delay: -.8s; }
.sky-star.s3 { animation-delay: -1.5s; }
.sky-star.s4 { animation-delay: -2.1s; }
.sky-star.s5 { animation-delay: -.4s; }
.sky-moon { animation: moon-rock 6s ease-in-out infinite; }
@keyframes drift { from { transform: translateX(-8px); } to { transform: translateX(10px); } }
@keyframes star-twinkle { 0%, 100% { transform: scale(.55) rotate(0); opacity: .45; } 50% { transform: scale(1.1) rotate(20deg); opacity: 1; } }
@keyframes moon-rock { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

.countdown {
  display: flex; align-items: center; gap: 12px; width: fit-content; margin-bottom: 12px; padding: 8px 16px 8px 8px;
  border-radius: 14px; background: var(--pink-l);
}
.countdown-num {
  display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 8px; border-radius: 12px;
  background: var(--pink-ui); color: #fff; box-shadow: 0 3px 0 var(--pink-ui-d);
  font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1;
}
.countdown-text { display: grid; line-height: 1.25; text-align: left; }
.countdown-text strong { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--pink-text); }
.countdown-text small { font-size: .85rem; color: var(--ink); }
.announce { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.announce-photo { width: 104px; height: 104px; flex: none; object-fit: cover; border-radius: 20px; border: 3px solid var(--pink-l); }
.announce-title { font-size: 1.4rem; color: var(--pink-text); }
.announce-meta { font-size: .95rem; color: var(--muted); }
.bubble {
  position: relative; flex: 1; border: 2px solid var(--line); border-radius: 18px; padding: 16px 18px;
  font-size: 1.05rem; background: var(--bg);
}
.bubble::before, .bubble::after {
  content: ''; position: absolute; top: 50%; left: -12px; width: 0; height: 0;
  border: 11px solid transparent; border-right-color: var(--line); border-left: 0; transform: translateY(-50%);
}
.bubble::after { left: -8px; border-right-color: var(--bg); border-width: 9px; }
.bubble h1 { font-size: 1.35rem; margin-bottom: 6px; }
@media (max-width: 480px) {
  .hero { flex-direction: column; text-align: center; }
  .hero-figure { width: 170px; }
  .countdown { margin-inline: auto; }
  .announce { flex-direction: column; }
  .bubble::before, .bubble::after { top: -12px; left: 50%; transform: translateX(-50%); border: 11px solid transparent; border-bottom-color: var(--line); border-top: 0; }
  .bubble::after { top: -8px; border-width: 9px; border-bottom-color: var(--bg); border-top: 0; }
}

.overall { margin-bottom: 20px; }
.overall-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.overall-pct { font-family: var(--display); font-weight: 600; color: var(--sun-text); }

/* ---------- categories as "units" ---------- */
.unit { margin-bottom: 32px; scroll-margin-top: 88px; }
.unit-head {
  --c: var(--pink-ui); --cd: var(--pink-ui-d);
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--c); box-shadow: 0 4px 0 var(--cd); color: #fff; margin-bottom: 14px;
}
.unit-head[data-color="yellow"] { --c: var(--sun); --cd: var(--sun-d); color: #5A4200; }
.unit-head[data-color="blue"] { --c: var(--denim-ui); --cd: var(--denim-ui-d); }
.unit-head[data-color="purple"] { --c: var(--lav-ui); --cd: var(--lav-ui-d); }
.unit-head[data-color="green"] { --c: var(--mint-ui); --cd: var(--mint-ui-d); }
.unit-icon { font-size: 2rem; line-height: 1; }
.unit-head h2 { font-size: 1.3rem; }
.unit-head p { font-size: .9rem; }
.unit-ring { margin-left: auto; flex: none; }

.tip {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--peach); margin-bottom: 14px; font-size: .95rem;
}
.tip-face { width: 52px; flex: none; margin-top: -4px; }
.tip strong { display: block; font-family: var(--display); font-weight: 600; color: var(--pink-text); }

.items { display: grid; gap: 12px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center;
  border: 2px solid var(--line); border-bottom-width: 4px; border-radius: var(--radius); padding: 14px 16px;
}
.item h3 { font-family: var(--body); font-weight: 800; font-size: 1.05rem; }
.item .note { color: var(--muted); font-size: .9rem; }
.item-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.item-img { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
.item-icon { margin-right: 6px; }
.price { font-size: .85rem; font-weight: 800; color: var(--sun-text); }
.wanted {
  display: inline-flex; margin-bottom: 4px; padding: 2px 8px; border-radius: 99px;
  background: var(--pink-l); color: var(--pink-text); font-family: var(--display); font-weight: 600; font-size: .78rem;
}
.item.is-featured:not(.is-done) { border-color: #F5B3CF; }
.item-progress { grid-column: 1 / -1; display: grid; gap: 6px; }
.item-progress .label { font-size: .85rem; color: var(--muted); }
.item-links { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.shop {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; font-size: .85rem;
  border: 2px solid var(--line); text-decoration: none; color: var(--ink);
}
.shop:hover { background: var(--peach); }
/* taken: no button, just a Done stamp */
.item.is-done { background: #F6FCF9; border-color: #CDEFDF; }
.item.is-done h3, .item.is-done .note { color: var(--muted); }
.done-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 14px 6px 8px;
  border-radius: 14px; background: var(--mint-l); font-family: var(--display); font-weight: 600; color: var(--mint-text);
}
.done-badge i {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint);
  color: #fff; font-style: normal; box-shadow: 0 3px 0 var(--mint-d);
}
.item.just-updated { animation: pop .5s ease; }
/* covered since the last look: the Done stamp lands, the card shakes */
.item.just-done { animation: done-shake .45s .55s ease both; }
.item.just-done .done-badge { animation: stamp .5s .3s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes stamp {
  0% { transform: scale(2.4) rotate(-14deg); opacity: 0; }
  55% { transform: scale(.92) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes done-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-4px) rotate(-.6deg); }
  45% { transform: translateX(4px) rotate(.6deg); }
  70% { transform: translateX(-2px); }
}
.ring-fill { transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }

/* categories pop in as they scroll into view (app.js adds js-reveal only when motion is welcome) */
.js-reveal .unit-head, .js-reveal .tip, .js-reveal .item { transition: opacity .45s ease, transform .55s cubic-bezier(.2, 1.3, .4, 1); }
.js-reveal .item { transition-delay: calc(var(--i, 0) * 50ms + 120ms); }
.js-reveal .unit:not(.is-in) .unit-head, .js-reveal .unit:not(.is-in) .tip, .js-reveal .unit:not(.is-in) .item {
  opacity: 0; transform: translateY(18px) scale(.97);
}
@media (max-width: 420px) {
  .item { grid-template-columns: 1fr; }
  .item .btn { width: 100%; }
}
.empty { text-align: center; padding: 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }

/* ---------- fund ---------- */
.fund-hero { text-align: center; display: grid; justify-items: center; gap: 10px; margin-bottom: 20px; }
.fund-figure { display: flex; align-items: flex-end; justify-content: center; margin-top: 8px; }
.fund-avatar { width: 170px; }
.piggy { position: relative; width: 92px; margin: 0 0 4px -18px; }
.piggy-svg { display: block; width: 100%; height: auto; transform-origin: 50% 100%; }
.coin {
  position: absolute; left: calc(47.5% - 9px); top: 0; width: 18px; height: 18px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 35%, #FFE18A, #FFC933 55%, #E5A800); box-shadow: inset 0 0 0 2px #E5A800;
}
.coins-go .coin { animation: coin-drop .9s cubic-bezier(.45, 0, .7, 1) both; }
.coins-go .coin:nth-child(2) { animation-delay: .35s; }
.coins-go .coin:nth-child(3) { animation-delay: .7s; }
.coins-go .coin:nth-child(4) { animation-delay: 1.05s; }
.coins-go .piggy-svg { animation: piggy-bounce .35s .72s ease-out 4; }
@keyframes coin-drop {
  0% { transform: translateY(-70px) rotateY(0); opacity: 0; }
  15% { opacity: 1; }
  80% { transform: translateY(18px) rotateY(540deg); opacity: 1; }
  100% { transform: translateY(26px) rotateY(720deg) scale(.6); opacity: 0; }
}
@keyframes piggy-bounce { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.06, .93); } 70% { transform: scale(.98, 1.03); } }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 6px 12px 6px 8px; border-radius: 12px;
  border: 2px solid var(--line); border-bottom-width: 4px; color: var(--muted); text-decoration: none;
  font-family: var(--display); font-weight: 600;
}
.back-link:hover { background: var(--peach); }
.back-link:active { border-bottom-width: 2px; transform: translateY(2px); }
.lead { font-size: 1.1rem; max-width: 46ch; }
.section-title { margin-bottom: 12px; }
.pay-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.pay-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.pay-card .qr { width: 96px; height: 96px; border-radius: 10px; border: 2px solid var(--line); padding: 4px; }
.pay-card .qr-note { grid-column: 1; }
.zelle-to { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zelle-to code { font: 800 1rem var(--body); background: var(--lav-l); padding: 6px 10px; border-radius: 10px; }
.qr-fig { display: grid; justify-items: center; gap: 4px; margin: 0; }
.qr-fig figcaption { font-size: .75rem; font-weight: 800; color: var(--muted); text-align: center; }
/* on a phone the guest can't scan their own screen, so the QR codes and their hints are left out */
@media (max-width: 420px) { .pay-card .qr, .pay-card .qr-fig, .pay-card .scan-hint { display: none; } .pay-card { grid-template-columns: 1fr; } }

/* ---------- where to send the gift (gift pop-up + thank-you screen) ---------- */
.ship {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--peach); text-align: left;
}
.ship-ic { font-size: 1.6rem; line-height: 1; align-self: start; }
.ship-body { display: grid; gap: 2px; min-width: 0; }
.ship-body strong { font-family: var(--display); font-weight: 600; color: var(--pink-text); }
.ship-addr { white-space: pre-line; overflow-wrap: anywhere; }
.ship-copy { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
#celebrateShip { width: 100%; margin-bottom: 12px; }
#celebrateShip:empty { display: none; }
.celebrate .ship p { font-size: 1rem; max-width: none; }

/* reserving is not buying: the buy links, in the pop-up and on the thank-you screen */
.shop-block { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--sun-l); text-align: left; }
.shop-block .shop { background: var(--bg); }
#celebrateShop { width: 100%; }
#celebrateShop:empty { display: none; }
.celebrate .shop-block p { font-size: .95rem; max-width: none; }

/* ---------- wide screens: use the width instead of one long column ---------- */
@media (min-width: 760px) {
  .hero-figure { width: 180px; }

  .unit { margin-bottom: 40px; scroll-margin-top: 24px; }
  .items { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  /* Cards: title grows so links, progress and the button line up along the bottom of each row. */
  .item { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .item > :first-child { flex: 1; }
  .item-links { order: 1; }
  .item-progress { order: 2; }
  .item > .btn, .item > .done-badge { order: 3; }
  .item > .done-badge { justify-content: center; min-height: 46px; }

  .pay-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .pay-grid .empty { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .fund-view { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .fund-view .back-link { grid-column: 1 / -1; justify-self: start; }
  .fund-hero {
    position: sticky; top: 32px; margin: 0; padding: 32px 24px;
    border: 2px solid var(--line); border-radius: var(--radius);
  }
}
@media (min-width: 1100px) {
  .list-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 28px; align-items: center; margin-bottom: 28px; }
  .list-top .hero { margin: 0; }
  .list-top .overall { margin: 0; padding: 20px 22px; border: 2px solid var(--line); border-radius: var(--radius); }
}

/* ---------- claim sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(59, 51, 85, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
.sheet {
  width: 100%; max-width: 520px; background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px;
  animation: slide-up .28s cubic-bezier(.2, .9, .3, 1.2); max-height: 92vh; overflow-y: auto;
}
@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; }
}
.sheet-head { display: flex; gap: 12px; align-items: center; }
.sheet-avatar { width: 64px; flex: none; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--display); font-weight: 600; }
.field input, .field textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #FBF9FC;
  font-weight: 700; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--denim); background: #fff; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper input { width: 72px; text-align: center; font-family: var(--display); font-size: 1.2rem; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.step {
  width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px;
  background: var(--bg); font-size: 1.4rem; cursor: pointer; color: var(--denim-d);
}
.step:active { border-bottom-width: 2px; transform: translateY(2px); }
.form-error { color: #D1335B; min-height: 0; }
.form-error:empty { display: none; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ---------- celebration ---------- */
.celebrate {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; place-items: safe center;
  animation: fade .2s ease; padding: 24px; overflow-y: auto;
}
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate-inner { position: relative; display: grid; justify-items: center; gap: 12px; text-align: center; width: min(420px, 100%); }
.celebrate-avatar { width: 220px; }
@media (max-height: 760px) { .celebrate-avatar { width: 150px; } }
.celebrate h2 { font-size: 2rem; color: var(--pink); }
.celebrate p { font-size: 1.1rem; max-width: 34ch; }
.xp-chip {
  font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: #5A4200; background: var(--sun);
  box-shadow: 0 4px 0 var(--sun-d); border-radius: 14px; padding: 8px 16px; margin: 6px 0 12px;
  animation: pop .5s .35s both cubic-bezier(.3, 1.6, .5, 1);
}
.xp-chip:empty { display: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- Allison avatar ---------- */
.allison { display: block; width: 100%; height: auto; overflow: visible; }
.allison-wrap { --av-delay: 0s; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.allison g, .allison .av-curl, .allison .av-shadow, .allison .av-brow-l, .allison .av-brow-r { transform-box: view-box; }
.allison .av-heart, .allison .av-sparkles path { transform-box: fill-box; transform-origin: center; }
.allison .av-bob { transform-origin: 100px 216px; }
.allison .av-shadow { transform-origin: 100px 220px; }
.allison .av-head, .allison .av-turn { transform-origin: 100px 150px; }
.allison .av-arm-wave { transform-origin: 140px 154px; }
.allison .av-eyes-open { transform-origin: 100px 101px; }

/* always-on life: breathing, a swaying hair curl, rosy cheeks, looking around */
.allison .av-body { transform-origin: 100px 215px; animation: breathe 3.4s var(--av-delay) ease-in-out infinite; }
.allison .av-breath { animation: breathe-rise 3.4s var(--av-delay) ease-in-out infinite; }
.allison .av-curl { transform-origin: 100px 35px; animation: curl 2.6s var(--av-delay) ease-in-out infinite alternate; }
.allison .av-cheek { animation: blush 3.4s var(--av-delay) ease-in-out infinite; }
.allison .av-glance { animation: glance 9s var(--av-delay) ease-in-out infinite; }
/* avatar.js sets --lx/--ly/--turn while the mouse moves */
.allison .av-look { transform: translate(var(--lx, 0px), var(--ly, 0px)); transition: transform .2s ease-out; }
.allison .av-turn { transform: rotate(var(--turn, 0deg)); transition: transform .45s ease-out; }
.is-tracking .av-glance { animation: none; }

/* default: every alternate face part hidden */
.allison .av-eye-wink, .allison .av-eyes-happy, .allison .av-eyes-sleep, .allison .av-mouth-open,
.allison .av-mouth-sleep, .allison .av-zzz, .allison .av-sparkles, .allison .av-hearts { display: none; }

.mood-wave .av-arm-wave { animation: wave-burst 4.2s var(--av-delay) ease-in-out infinite; }
.mood-wave .av-head { animation: tilt 4.8s var(--av-delay) ease-in-out infinite; }
.mood-wave .av-eyes-open { animation: blink 6s var(--av-delay) infinite; }

.mood-wink .av-eye-r { display: none; }
.mood-wink .av-eye-wink { display: inline; }
.mood-wink .av-arm-wave { animation: arm-sway 3.4s var(--av-delay) ease-in-out infinite; }
.mood-wink .av-head { animation: tilt 5.6s var(--av-delay) ease-in-out infinite; }

.mood-cheer .av-eyes-open, .mood-cheer .av-mouth-smile { display: none; }
.mood-cheer .av-eyes-happy, .mood-cheer .av-mouth-open, .mood-cheer .av-sparkles { display: inline; }
.mood-cheer .allison { animation: hop .7s cubic-bezier(.3, 0, .5, 1) 3, bounce 1.4s 2.1s ease-in-out infinite; }
.mood-cheer .av-arm-wave { animation: wave .5s ease-in-out infinite; }
.mood-cheer .av-head { animation: tilt 1.4s ease-in-out infinite; }
.mood-cheer .av-sparkles path { animation: sparkle .8s ease-in-out infinite alternate; }
.mood-cheer .av-sparkles path:nth-child(2) { animation-delay: .27s; }
.mood-cheer .av-sparkles path:nth-child(3) { animation-delay: .54s; }

.mood-sleep .av-eyes-open, .mood-sleep .av-mouth-smile, .mood-sleep .av-arm-wave { display: none; }
.mood-sleep .av-eyes-sleep, .mood-sleep .av-mouth-sleep, .mood-sleep .av-zzz { display: inline; }
.mood-sleep .av-head { transform: rotate(-6deg); }
.mood-sleep .av-turn { transform: none; }
.mood-sleep .av-body, .mood-sleep .av-breath { animation-duration: 5s; }
.mood-sleep .av-zzz { animation: zzz 2.4s ease-in-out infinite; }

/* graduation cap: worn on the fund page, dropped on when the fund button is tapped */
.allison .av-cap { display: none; transform-origin: 100px 30px; }
.allison .av-tassel { transform-origin: 144px 31px; }
.has-cap .av-cap { display: inline; }
.has-cap .av-curl { display: none; }
.has-cap .av-tassel { animation: tassel 1.8s var(--av-delay) ease-in-out infinite alternate; }
.cap-drop .av-cap { animation: cap-drop .8s cubic-bezier(.5, 0, .5, 1) both; }
.cap-drop .av-bob { animation: cap-land .8s ease-out; }
.cap-toss .av-cap { animation: cap-toss .85s cubic-bezier(.25, .6, .4, 1) both; }

/* reacting to buttons: an excited gasp that points at the gift, or a little pout */
.allison .av-mouth-gasp, .allison .av-mouth-pout { display: none; }
.allison .av-brow-l { transform-origin: 78px 78px; transition: transform .25s ease; }
.allison .av-brow-r { transform-origin: 122px 78px; transition: transform .25s ease; }
.allison-wrap.react-excited .av-mouth-smile, .allison-wrap.react-excited .av-mouth-sleep,
.allison-wrap.react-excited .av-eye-wink, .allison-wrap.react-pout .av-mouth-smile { display: none; }
.allison-wrap.react-excited .av-mouth-gasp, .allison-wrap.react-excited .av-eye-r, .allison-wrap.react-pout .av-mouth-pout { display: inline; }
.allison-wrap.react-excited .av-brow-l, .allison-wrap.react-excited .av-brow-r { transform: translateY(-4px); }
.allison-wrap.react-excited .av-arm-wave { animation: none; transform: rotate(var(--point, 70deg)); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.allison-wrap.react-excited .av-bob { animation: boing .5s cubic-bezier(.3, 0, .5, 1); }
.allison-wrap.react-excited .av-cheek { animation: none; opacity: .85; }
.allison-wrap.react-pout .av-brow-l { transform: rotate(-16deg) translateY(1px); }
.allison-wrap.react-pout .av-brow-r { transform: rotate(16deg) translateY(1px); }
.allison-wrap.react-pout .av-head { animation: none; transform: rotate(-5deg); transition: transform .3s ease; }
.allison-wrap.react-pout .av-arm-wave { animation: none; transform: rotate(35deg); transition: transform .3s ease; }
.allison-wrap.react-pout .av-look { transform: translate(0, -2.5px); }

/* a little hop on hover, a giggle with hearts on tap (these come last so they win over moods) */
@media (hover: hover) {
  .allison-wrap:hover .av-bob { animation: boing .6s cubic-bezier(.3, 0, .5, 1); }
}
.allison-wrap.is-giggle .av-eyes-open, .allison-wrap.is-giggle .av-eye-wink, .allison-wrap.is-giggle .av-eyes-sleep,
.allison-wrap.is-giggle .av-mouth-smile, .allison-wrap.is-giggle .av-mouth-sleep, .allison-wrap.is-giggle .av-zzz { display: none; }
.allison-wrap.is-giggle .av-eyes-happy, .allison-wrap.is-giggle .av-mouth-open, .allison-wrap.is-giggle .av-hearts { display: inline; }
.allison-wrap.is-giggle .av-bob { animation: giggle-hop .9s cubic-bezier(.3, 0, .5, 1); }
.allison-wrap.is-giggle .av-shadow { animation: shadow-hop .9s cubic-bezier(.3, 0, .5, 1); }
.allison-wrap.is-giggle .av-head { animation: giggle-shake .9s ease-in-out; }
.allison-wrap.is-giggle .av-cheek { animation: none; opacity: .9; }
.allison-wrap.is-giggle .av-heart { animation: heart-float 1.1s ease-out both; }
.allison-wrap.is-giggle .av-hearts g:nth-child(2) .av-heart { animation-delay: .12s; }
.allison-wrap.is-giggle .av-hearts g:nth-child(3) .av-heart { animation-delay: .24s; }

@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.028); } }
@keyframes breathe-rise { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.2px); } }
@keyframes curl { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes blush { 0%, 100% { opacity: .5; } 50% { opacity: .75; } }
@keyframes glance {
  0%, 30%, 50%, 54%, 76%, 100% { transform: translate(0, 0); }
  34%, 46% { transform: translate(-3px, .5px); }
  58%, 72% { transform: translate(3px, -1px); }
}
@keyframes blink {
  0%, 42%, 46%, 90%, 93%, 96%, 100% { transform: scaleY(1); }
  44%, 91.5%, 94.5% { transform: scaleY(.1); }
}
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-16deg); } 75% { transform: rotate(10deg); } }
@keyframes wave-burst {
  0%, 44%, 100% { transform: rotate(0); }
  6%, 22% { transform: rotate(-18deg); }
  14%, 30% { transform: rotate(10deg); }
  38% { transform: rotate(-6deg); }
}
@keyframes arm-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(2deg); } }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-18px) scale(1.02, .98); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes boing {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-8px) scale(.97, 1.03); }
  60% { transform: translateY(0) scale(1.03, .97); }
}
@keyframes giggle-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  15% { transform: translateY(0) scale(1.06, .92); }
  40% { transform: translateY(-16px) scale(.96, 1.05); }
  65% { transform: translateY(0) scale(1.05, .95); }
  80% { transform: translateY(-4px) scale(1); }
}
@keyframes giggle-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-7deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(2deg); }
}
@keyframes shadow-hop { 40% { transform: scale(.7); } }
@keyframes heart-float {
  0% { transform: translateY(6px) scale(.3); opacity: 0; }
  25% { transform: translateY(0) scale(1.1); opacity: 1; }
  100% { transform: translateY(-28px) scale(.9); opacity: 0; }
}
@keyframes sparkle { from { transform: scale(.55) rotate(0); opacity: .4; } to { transform: scale(1.1) rotate(45deg); opacity: 1; } }
@keyframes tassel { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes cap-drop {
  0% { transform: translateY(-80px) rotate(-20deg); opacity: 0; }
  15% { opacity: 1; }
  55% { transform: translateY(4px) rotate(5deg); }
  75% { transform: translateY(-3px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0); }
}
@keyframes cap-toss {
  0% { transform: none; opacity: 1; }
  15% { transform: translateY(4px); }
  100% { transform: translate(40px, -170px) rotate(-420deg); opacity: 0; }
}
@keyframes cap-land { 0%, 50%, 100% { transform: scale(1); } 62% { transform: scale(1.05, .94); } 80% { transform: scale(.98, 1.02); } }
@keyframes zzz { 0% { transform: translateY(4px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }

/* ---------- sliding between the list and the fund ---------- */
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out .25s ease both; }
::view-transition-new(root) { animation: vt-in .32s cubic-bezier(.2, .9, .3, 1) both; }
html[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-back; }
html[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-48px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(48px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(48px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-48px); } }

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