/* Noël à Longèves — candy cane (sucre d'orge) art direction. Mobile first, big & tactile. */
:root {
  --sugar: #fffbf8;       /* page */
  --white: #ffffff;
  --rose: #ffd9df;        /* soft pink */
  --rose-2: #f7b9c3;
  --red: #d7263d;         /* peppermint red */
  --red-2: #a8182b;
  --mint: #17805f;        /* readable mint green */
  --mint-2: #0f6149;
  --mint-soft: #d4f1e6;
  --butter: #f6c453;
  --butter-soft: #fff1c9;
  --ink: #3b1a24;         /* dark raspberry, never plain black */
  --ink-soft: #6e4a55;
  --line: #f0d3d8;

  --display: 'Shrikhand', 'Georgia', serif;
  --sans: 'Nunito', system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --candy: repeating-linear-gradient(-45deg, var(--red) 0 12px, var(--white) 12px 24px);
  --candy-mint: repeating-linear-gradient(-45deg, var(--mint) 0 12px, var(--white) 12px 24px);
  --lift: 0 1px 0 var(--line), 0 10px 24px -12px rgba(168, 24, 43, .25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 112.5%; scroll-padding: 110px 0 120px; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--sugar);
  /* wide, barely-there pink stripes: wrapping paper seen from close */
  background-image: repeating-linear-gradient(-45deg, rgba(255, 217, 223, .45) 0 46px, transparent 46px 92px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.45;
}
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.screen { position: relative; z-index: 1; min-height: 100dvh; }

:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; border-radius: 8px; }
input:focus-visible, textarea:focus-visible { outline: none; }

/* ---------- Titles ---------- */
.title-h { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.05; color: var(--red); letter-spacing: .005em;
  text-shadow: 0 3px 0 var(--rose); overflow-wrap: anywhere; }
.title-h.big { font-size: clamp(2.6rem, 11vw, 3.6rem); }

/* ---------- Gate ---------- */
#gate { display: grid; place-items: center; padding: 40px 18px 48px; text-align: center; overflow: hidden; }
.gate-inner { width: min(460px, 100%); display: grid; justify-items: center; }
.gate-title {
  margin: 0; font-family: var(--display); font-weight: 400; color: var(--red); line-height: .9;
  font-size: clamp(5rem, 28vw, 8.5rem); text-shadow: 0 5px 0 var(--rose), 0 10px 0 var(--rose-2);
  animation: rise .7s var(--ease-out) backwards;
}
.gate-title span { display: block; margin-top: 10px; font-family: var(--sans); font-weight: 900; font-size: clamp(1.4rem, 6vw, 1.9rem); color: var(--mint); text-shadow: none; letter-spacing: .01em; }
.countdown { font-size: 1.1rem; font-weight: 700; margin: 14px 0 0; animation: rise .6s .15s var(--ease-out) backwards; }
.countdown strong { font-family: var(--display); font-weight: 400; font-size: 1.9em; color: var(--red); vertical-align: -3px; padding: 0 2px; }

/* The candy cane */
.gift { width: 108px; margin: 18px auto 8px; animation: rise .6s .25s var(--ease-out) backwards; }
@media (min-width: 640px) { .gift { width: 128px; } }
.cane { display: block; width: 100%; height: auto; overflow: visible; transform: rotate(-8deg); filter: drop-shadow(0 8px 10px rgba(168, 24, 43, .22)); }
.cane path { fill: none; stroke-linecap: round; }
.cane-base { stroke: var(--white); stroke-width: 26; }
.cane-stripes { stroke: var(--red); stroke-width: 26; stroke-dasharray: 13 13; stroke-linecap: butt !important; animation: roll 2.4s .3s var(--ease-out) backwards; }
.cane-shine { stroke: rgba(255, 255, 255, .55); stroke-width: 5; }
@keyframes roll { from { stroke-dashoffset: 156; } }
.gift.open .cane { animation: hop .9s var(--ease-out) forwards; }
@keyframes hop { 30% { transform: rotate(10deg) scale(1.12) translateY(-18px); } 100% { transform: rotate(60deg) scale(.4) translate(140px, -260px); opacity: 0; } }
.gift.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px) rotate(-4deg); } 40%, 80% { transform: translateX(8px) rotate(4deg); } }

.gate-form { width: 100%; display: grid; gap: 12px; text-align: left; margin-top: 8px; padding: 22px 20px 18px; background: var(--white); border-radius: 24px; box-shadow: var(--lift); position: relative; overflow: hidden;
  animation: rise .6s .35s var(--ease-out) backwards; }
.gate-form::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--candy); }
.gate-form label { font-weight: 900; font-size: 1.15rem; }
.error { color: var(--red-2); font-size: 1rem; font-weight: 800; margin: 0; }
.error:not(:empty) { background: var(--rose); padding: 8px 12px; border-radius: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

/* ---------- Inputs & buttons ---------- */
input, textarea {
  font: inherit; font-size: 1.1rem; color: var(--ink); width: 100%; min-width: 0; min-height: 56px;
  background: var(--sugar); border: 2px solid var(--rose-2); border-radius: 16px;
  padding: 12px 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 0; }
input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--rose); background: var(--white); }
input::placeholder, textarea::placeholder { color: #9a7b84; }

/* Pill buttons that press down like a sweet */
.btn {
  font: inherit; font-size: 1.05rem; font-weight: 800; cursor: pointer; border: 0; border-radius: 999px;
  min-height: 52px; padding: 10px 20px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--white); color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--rose-2), 0 4px 0 var(--rose-2);
  transition: transform .15s var(--ease-spring), box-shadow .15s;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--rose-2), 0 1px 0 var(--rose-2); }
.btn-xl { min-height: 60px; font-size: 1.2rem; width: 100%; }
.btn-red { background: var(--red); color: var(--white); box-shadow: 0 4px 0 var(--red-2); }
.btn-red:active { box-shadow: 0 1px 0 var(--red-2); }
.btn-green { background: var(--mint); color: var(--white); box-shadow: 0 4px 0 var(--mint-2); }
.btn-green:active { box-shadow: 0 1px 0 var(--mint-2); }
.btn-gold { background: var(--butter); color: var(--ink); box-shadow: 0 4px 0 #c99a2e; }
.btn-small { min-height: 40px; padding: 4px 14px; font-size: .9rem; }
.danger { color: var(--red-2); }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } }

/* ---------- Macarons (avatars) ---------- */
.macaron { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; line-height: 1; flex: none;
  box-shadow: inset 0 -3px 0 rgba(59, 26, 36, .08), 0 0 0 2px var(--white), 0 3px 8px -3px rgba(59, 26, 36, .35); }
.macaron > span { font-size: .9em; transform: translateY(.02em); }
.m-pink { background: var(--rose); }
.m-mint { background: var(--mint-soft); }
.m-butter { background: var(--butter-soft); }
.m-sky { background: #dcebff; }
.m-lilac { background: #eadff8; }
.emo { font-size: 1.5rem; }
.emo.sm { font-size: 1.1rem; }

.emoji-pick { display: grid; gap: 4px; text-align: left; min-width: 0; }
.av-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 62px); gap: 8px; overflow-x: auto; padding: 6px 4px 10px; scroll-snap-type: x proximity; }
@media (min-width: 640px) { .av-grid { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(8, 62px); overflow: visible; } }
.av-btn { width: 62px; height: 62px; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 50%; cursor: pointer; scroll-snap-align: start; transition: transform .2s var(--ease-spring); }
.av-btn .av { font-size: 1.9rem; }
.av-btn[aria-pressed="true"] { transform: scale(1.08); }
.av-btn[aria-pressed="true"] .macaron { box-shadow: 0 0 0 3px var(--white), 0 0 0 7px var(--red), 0 4px 10px -2px rgba(168, 24, 43, .4); }

/* ---------- Who ---------- */
#who { display: grid; place-items: center; padding: 40px 16px 60px; }
.who-inner { width: min(680px, 100%); text-align: center; display: grid; gap: 12px; }
.lead { font-size: 1.05rem; margin: 0; }
.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 14px 0 22px; }
.person-btn { font: inherit; color: var(--ink); cursor: pointer; border: 0; padding: 0; background: none; animation: rise .5s var(--ease-out) backwards; }
.person-btn .paper { display: grid; gap: 8px; justify-items: center; padding: 20px 10px 16px; }
.person-btn .emo { font-size: 2.6rem; }
.person-btn .nm { font-weight: 900; font-size: 1.3rem; line-height: 1.1; overflow-wrap: anywhere; }
.person-btn:active .scrap { transform: scale(.96); }
.card-form { display: grid; gap: 14px; padding: 24px 20px 22px; background: var(--white); border-radius: 24px; box-shadow: var(--lift); text-align: left; }
.form-h { font-family: var(--display); font-weight: 400; font-size: 1.7rem; color: var(--red); margin: 0; line-height: 1.1; }
.field { display: grid; gap: 6px; font-weight: 800; }
.help { font-size: .95rem; color: var(--ink-soft); margin: -6px 0 0; }
.envie { border: 0; padding: 0; margin: 0; min-width: 0; }
.envie legend { font-size: 1rem; font-weight: 800; margin-bottom: 4px; padding: 0; }

/* ---------- Paper = sugar-white cards ---------- */
.scrap { position: relative; height: 100%; transition: transform .2s var(--ease-spring); }
.paper { background: var(--white); border-radius: 22px; box-shadow: var(--lift); }
.p-candy { background: var(--red); color: var(--white); }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: var(--white);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: var(--candy); }
.brand { font-family: var(--display); font-size: 1.7rem; color: var(--red); line-height: 1; white-space: nowrap; }
.brand span { font-family: var(--sans); font-weight: 900; font-size: .95rem; color: var(--mint); }
.days { margin-left: auto; font-size: .8rem; font-weight: 800; color: var(--ink-soft); text-align: right; line-height: 1; display: grid; justify-items: end; gap: 2px; }
.days strong { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--mint); }
.me-chip {
  font: inherit; font-weight: 800; color: var(--ink); background: var(--sugar); border: 0; border-radius: 999px;
  min-height: 48px; padding: 4px 14px 4px 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: inset 0 0 0 2px var(--rose);
}
.me-chip .emo { font-size: 1.3rem; }
@media (max-width: 400px) { .brand span { display: none; } .me-chip > span:last-child { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

.board { position: relative; z-index: 1; padding: 22px 14px 190px; max-width: 1180px; margin: 0 auto; }
.board.calm * { animation: none !important; }
.board.calm .fresh { animation: pop .45s var(--ease-spring) both !important; }

.list-head { position: relative; display: grid; gap: 4px; margin: 10px 0 12px; padding-right: 76px; min-height: 64px; }
.list-head .meta { font-size: 1rem; font-weight: 800; color: var(--mint); }
.head-stk { position: absolute; right: 4px; top: -4px; font-size: 3.4rem; line-height: 1; transform: rotate(10deg); filter: drop-shadow(0 6px 6px rgba(168, 24, 43, .2)); }
.deco-emo { display: inline-block; }

.notice { display: block; margin: 4px 0 22px; padding: 12px 16px; font-size: 1rem; max-width: 720px; background: var(--butter-soft); border-radius: 16px; }

.back { font: inherit; font-weight: 800; font-size: 1rem; background: none; border: 0; color: var(--mint); cursor: pointer; min-height: 44px; padding: 0 4px; margin: 0 0 4px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 8px; margin: -6px 0 18px; align-items: center; }
.toolbar .seg { flex: 1; min-width: 0; }
.toolbar-2 { display: flex; gap: 8px; flex: none; }
.wide-only { display: none; }
@media (min-width: 640px) { .wide-only { display: inline; } .toolbar .seg { flex: 0 1 380px; } }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 2px var(--rose); }
.seg button { white-space: nowrap; font: inherit; font-size: .92rem; font-weight: 800; min-height: 44px; padding: 4px 6px; border: 0; border-radius: 999px; background: none; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--red); color: var(--white); }
.chip { font: inherit; font-size: .95rem; font-weight: 800; min-height: 52px; padding: 6px 14px; cursor: pointer; background: var(--white); color: var(--ink); border: 0; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--rose); }
.chip[aria-pressed="true"] { background: var(--mint); color: var(--white); box-shadow: none; }

/* ---------- Compact rows ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .rows { max-width: 820px; } }
.rows .card-wrap.unfolded { margin: 8px 0; }
.row-wrap { animation: rise .4s var(--ease-out) backwards; }
.row { display: flex; align-items: center; gap: 8px; min-height: 76px; padding: 0 12px 0 0; border-radius: 18px; }
.row-wrap.by-other .row { background: #fbf3f4; box-shadow: none; }
.row-wrap.by-other .row-title { color: var(--ink-soft); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 4px; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 12px 4px 12px 16px; cursor: pointer; min-height: 76px; border-radius: 18px; }
.row-title { font-weight: 800; font-size: 1.08rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { font-size: .95rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.row-sub .hearts { font-size: 1rem; letter-spacing: 1px; }
.row-price { font-weight: 900; color: var(--mint); font-size: 1.05rem; }
.row-type { font-weight: 700; }
.quick { flex: none; width: 56px; min-height: 52px; padding: 0; font-size: 1.5rem; }
.fold { display: block; margin: 10px auto 0; font: inherit; font-weight: 800; font-size: 1rem; background: none; border: 0; color: var(--ink-soft); cursor: pointer; min-height: 44px; padding: 0 16px; }

/* Status pills (réservé / acheté / emballé) */
.mini-stamp, .stamp { font-weight: 900; font-size: .8rem; line-height: 1.15; text-align: center; padding: 6px 10px; border-radius: 999px; }
.mini-stamp { flex: none; max-width: 110px; }
.mini-stamp.reserved, .stamp.reserved { background: var(--butter-soft); color: #7a5200; }
.mini-stamp.bought, .stamp.bought { background: var(--mint-soft); color: var(--mint-2); }
.mini-stamp.wrapped, .stamp.wrapped { background: var(--candy); color: var(--red-2); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.mini-stamp.fresh, .stamp.fresh { animation: pop .45s var(--ease-spring) both; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } }
.stamp { position: absolute; right: 14px; top: -12px; z-index: 2; font-size: .9rem; padding: 6px 14px; box-shadow: 0 3px 8px -2px rgba(59, 26, 36, .25); }

/* ---------- Cards ---------- */
.items { display: grid; grid-template-columns: 1fr; gap: 22px; }
.card-wrap { animation: rise .45s var(--ease-out) backwards; }
.card { position: relative; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.card-wrap.by-other .paper { background: #fbf3f4; }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: .88rem; font-weight: 800; padding: 3px 12px; border-radius: 999px; background: var(--sugar); box-shadow: inset 0 0 0 2px var(--rose); }
.secret-tag { background: var(--ink); color: var(--white); box-shadow: none; }
.price { margin-left: auto; font-family: var(--display); font-size: 1.7rem; line-height: 1; color: var(--mint); }
.card h3 { margin: 0; font-size: 1.35rem; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.card .notes { margin: 0; font-size: 1rem; color: var(--ink-soft); line-height: 1.4; }
.card .by { font-size: .95rem; font-weight: 700; color: var(--ink-soft); margin: 0; }
.hearts { font-size: 1.4rem; letter-spacing: 3px; line-height: 1; }
.hearts .on { color: var(--red); }
.hearts .off { color: var(--rose-2); }
.taken-ribbon { margin: 0; align-self: flex-start; font-weight: 800; font-size: .95rem; color: var(--white); background: var(--ink-soft); padding: 4px 12px; border-radius: 999px; }
.share-line { margin: 0; font-size: .95rem; font-weight: 700; color: var(--mint); }
.card-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 auto; }
.card-actions .main-act { flex: 1 1 100%; }
.card-actions .link-ico { flex: 0 0 auto; }
.btn.share-toggle.on { background: var(--mint); color: var(--white); box-shadow: 0 4px 0 var(--mint-2); }

/* Wrapped gift in the hotte: a candy ribbon across the card */
.card-wrap.wrapped .paper { position: relative; overflow: hidden; }
.card-wrap.wrapped .card::before { content: ''; position: absolute; top: 0; bottom: 0; left: 18px; width: 14px; background: var(--candy); opacity: .9; }
.card-wrap.wrapped .card { padding-left: 46px; }

/* Progress: réservé → acheté → emballé */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--sugar); box-shadow: inset 0 0 0 2px var(--rose); list-style: none; margin: 0; }
.steps li { display: contents; }
.steps button { width: 100%; font: inherit; font-size: .95rem; font-weight: 800; min-height: 50px; padding: 4px; border: 0; border-radius: 999px; cursor: pointer; background: none; color: var(--ink); transition: background .2s; }
.steps button.done { background: var(--mint); color: var(--white); }
.steps button.current { box-shadow: 0 3px 0 var(--mint-2); }
.steps button:disabled { cursor: default; opacity: .85; }

.empty { text-align: center; padding: 46px 20px; font-size: 1.2rem; font-weight: 800; line-height: 1.3; color: var(--ink-soft); max-width: 460px; margin: 0 auto; }
.empty .deco-emo { display: block; font-size: 4.5rem; margin: 0 auto 12px; line-height: 1; }

.fab { position: fixed; left: 14px; right: 14px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 12; min-height: 58px; font-size: 1.1rem; }

/* ---------- Hotte ---------- */
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 8px; }
.total-card { display: grid; padding: 14px 8px; text-align: center; gap: 2px; }
.total-card .k { font-size: .9rem; font-weight: 800; }
.total-card .v { font-family: var(--display); font-size: 1.8rem; line-height: 1.1; }
.owner-head { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.9rem; font-weight: 400; margin: 30px 0 16px; color: var(--ink); }
.owner-head em { font-style: normal; color: var(--red); }
.notices { display: grid; gap: 10px; margin: 0 0 18px; }
.notice-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: var(--white); border-radius: 18px; box-shadow: inset 0 0 0 2px var(--butter); padding: 12px 14px; font-weight: 700; }

/* ---------- Family ---------- */
.fam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 8px; }
.fam-btn { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; animation: rise .4s var(--ease-out) backwards; }
.fam-card { display: grid; gap: 6px; justify-items: start; padding: 18px 14px 16px; min-height: 100%; }
.fam-av { font-size: 2.4rem; }
.fam-name { font-weight: 900; font-size: 1.35rem; line-height: 1.1; overflow-wrap: anywhere; }
.fam-sub { font-size: .92rem; font-weight: 700; color: var(--ink-soft); }
.fam-plan { font-size: .9rem; font-weight: 800; color: var(--mint); }
.gauge { width: 100%; height: 14px; border-radius: 999px; background: var(--sugar); box-shadow: inset 0 0 0 2px var(--rose); overflow: hidden; }
.gauge-fill { display: block; height: 100%; background: var(--candy); border-radius: 999px; }
@media (hover: hover) { .fam-btn:hover .scrap, .person-btn:hover .scrap { transform: translateY(-3px); } }
@media (min-width: 640px) { .fam-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .fam-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--white); box-shadow: 0 -1px 0 var(--line), 0 -10px 24px -14px rgba(168, 24, 43, .3);
}
.nav-btn { position: relative; font: inherit; color: var(--ink); background: none; border: 0; border-radius: 18px; min-height: 62px; display: grid; justify-items: center; align-content: center; gap: 2px; cursor: pointer; padding: 4px; }
.nav-ico { font-size: 1.5rem; line-height: 1; }
.nav-lbl { font-size: .9rem; font-weight: 800; }
.nav-btn[aria-current="page"] { background: var(--rose); }
.nav-btn[aria-current="page"] .nav-lbl { color: var(--red-2); }
.nav-count { position: absolute; top: 4px; right: calc(50% - 34px); min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--mint); color: var(--white); font-size: .85rem; font-weight: 900; display: grid; place-items: center; }
.nav-count.bump { animation: bump .42s var(--ease-spring); }
@keyframes bump { 50% { transform: scale(1.4); } }

/* ---------- Dialogs: bottom sheet on phones ---------- */
dialog { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 94dvh; background: var(--white); color: var(--ink); border-radius: 26px 26px 0 0; overflow-x: hidden; }
dialog::before { content: ''; display: block; height: 10px; background: var(--candy); }
dialog[open] { animation: sheet .4s var(--ease-out); }
dialog::backdrop { background: rgba(59, 26, 36, .45); }
@keyframes sheet { from { transform: translateY(100%); } }
dialog.closing { animation: sheet-out .22s cubic-bezier(.4, 0, 1, 1) forwards !important; }
@keyframes sheet-out { to { transform: translateY(100%); } }
.item-form { padding: 20px 18px max(22px, env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.item-form h3 { font-family: var(--display); font-weight: 400; font-size: 2rem; margin: 0; color: var(--red); line-height: 1.05; }
.item-form label { display: grid; gap: 6px; font-size: 1rem; font-weight: 800; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.x-btn { flex: none; width: 48px; height: 48px; font-size: 1.3rem; border: 0; border-radius: 50%; background: var(--sugar); box-shadow: inset 0 0 0 2px var(--rose); cursor: pointer; color: var(--ink); }
.privacy-banner { margin: 0; padding: 12px 14px; font-weight: 800; font-size: 1rem; background: var(--butter-soft); border-radius: 14px; }
.two { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.stars { display: flex; gap: 2px; }
.stars button { font-size: 2.3rem; width: 56px; height: 56px; background: none; border: 0; cursor: pointer; color: var(--rose-2); transition: transform .2s var(--ease-spring), color .2s; padding: 0; border-radius: 50%; }
.stars button.on { color: var(--red); }
.stars button:active { transform: scale(1.3); }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.form-actions .btn-xl { grid-column: 1 / -1; }
.pin-input { font-size: 2rem; letter-spacing: .6em; text-align: center; font-weight: 900; }
.switch { display: flex !important; align-items: center; gap: 12px; font-weight: 700 !important; }
.switch input { width: 28px; height: 28px; min-height: 0; accent-color: var(--mint); }

/* ---------- Toast & confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(164px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: max-content; max-width: min(92vw, 480px);
  background: var(--ink); color: var(--white); font-weight: 700; font-size: 1.02rem; padding: 12px 18px; border-radius: 18px;
  transition: opacity .3s, transform .4s var(--ease-spring); pointer-events: none;
}
.toast > span { flex: 1 1 auto; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action { pointer-events: auto; }
.toast-btn { font: inherit; font-weight: 900; background: var(--butter); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; white-space: nowrap; }

.burst { position: fixed; pointer-events: none; z-index: 70; width: 24px; height: 24px; margin: -12px 0 0 -12px; animation: burst 1.2s var(--ease-out) forwards; }
.burst svg { width: 100%; height: 100%; display: block; }
@keyframes burst { 0% { transform: scale(.3); } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); opacity: 0; } }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 640px) {
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .items { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .board { padding-left: 28px; padding-right: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .brand { font-size: 2rem; }
  .fab { left: auto; right: 28px; bottom: 112px; width: auto; padding: 10px 28px; }
  .list-head { padding-right: 120px; }
  .head-stk { font-size: 4.4rem; right: 16px; }
  .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(520px, 100% - 32px); bottom: 14px; border-radius: 26px; padding: 8px; box-shadow: 0 0 0 1px var(--line), 0 14px 30px -12px rgba(168, 24, 43, .35); }
  dialog { margin: auto; width: min(580px, calc(100% - 32px)); border-radius: 26px; box-shadow: 0 30px 60px -20px rgba(59, 26, 36, .45); }
  dialog[open] { animation: pop-in .4s var(--ease-spring); }
  @keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(14px); } }
  @keyframes sheet-out { to { opacity: 0; transform: scale(.94) translateY(10px); } }
  .form-actions { grid-template-columns: auto auto 1fr; }
  .form-actions .btn-xl { grid-column: auto; order: 3; justify-self: end; width: auto; }
  .totals { max-width: 640px; }
}
@media (min-width: 1100px) { .items { grid-template-columns: repeat(3, 1fr); } }

/* Animations off (profile switch) or reduced motion */
.still #snow { display: none; }
.still .cane-stripes, .still .gate-title, .still .gift { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Small phones: keep the three steps and the countdown tidy */
.countdown { text-wrap: balance; }
@media (max-width: 420px) { .steps button { font-size: .85rem; padding: 4px 2px; } }
