:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #1f2a24;
  --muted: #6b746e;
  --line: #e7e0d4;
  --green: #1f5e43;
  --green-2: #2c7a57;
  --red: #b5333b;
  --red-soft: #fbe9ea;
  --gold: #c8962e;
  --gold-soft: #fbf3df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 4px 16px rgba(31, 42, 36, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Nunito Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; font-family: inherit; font-weight: 700; }
a { color: var(--green); }
a:hover { color: var(--green-2); }
code { background: #f1ece2; padding: 1px 5px; border-radius: 5px; }

/* Layout */
.container { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .layout.editable .items-col { order: -1; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row input, .row select { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
section { margin-bottom: 1.5rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem 1rem; background: var(--green); color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.brand { color: #fff; text-decoration: none; font-family: Fraunces, serif; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.brand:hover { color: #fff; }
.topbar nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav > a { color: #e9f3ee; text-decoration: none; padding: .4rem .6rem; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.topbar nav > a:hover { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 560px) { .brand span { display: none; } .topbar { padding: .5rem .6rem; gap: .4rem; } .topbar nav { flex-wrap: nowrap; gap: 0; } .topbar nav > a { padding: .3rem .35rem; font-size: .82rem; white-space: nowrap; } .usermenu { margin-left: .15rem; } }
.pill { background: var(--gold); color: #fff; border-radius: 99px; padding: 0 .45rem; font-size: .75rem; }
.usermenu { position: relative; margin-left: .3rem; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu {
  position: absolute; right: 0; top: 2.6rem; background: #fff; color: var(--ink); border-radius: 12px;
  box-shadow: var(--shadow); padding: .75rem; min-width: 190px; display: grid; gap: .5rem; border: 1px solid var(--line);
}

/* Cards & bits */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.narrow { max-width: 520px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lead { font-size: 1.15rem; }
.pre { white-space: pre-wrap; margin: .2rem 0 .7rem; }
.warn-text { color: var(--red); }
.note { background: var(--gold-soft); border: 1px solid #efdfb4; padding: .6rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.tag { display: inline-block; background: #eef3ef; color: var(--green); border-radius: 99px; padding: .05rem .55rem; font-size: .75rem; font-weight: 700; }
.tag.ok { background: #e3f3ea; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .25rem 0 .8rem; list-style: none; }
.chip { background: #f3eee4; border-radius: 99px; padding: .15rem .65rem; font-size: .85rem; }
.chips.mini { margin: .3rem 0 0; }
.chips.mini .chip { font-size: .72rem; padding: .05rem .5rem; }
.plain { list-style: none; padding: 0; margin: .25rem 0 .75rem; }
.plain li { padding: .2rem 0; }
.field-label { font-weight: 700; font-size: .85rem; margin: .6rem 0 .3rem; color: #3d4741; }

.avatar {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #d5545b); color: #fff; font-weight: 700; flex: none;
  font-family: Fraunces, serif;
}
.avatar.sm { width: 32px; height: 32px; font-size: .9rem; background: var(--gold); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .7rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .6rem .7rem; font: inherit; font-weight: 400;
  border: 1px solid #d9d1c3; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #a8d4bd; border-color: var(--green-2); }
.row input, .row select { margin-top: 0; }
.check-label { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.check-label input { width: auto; margin: 0; }
fieldset { border: 1px dashed var(--line); border-radius: 10px; padding: .75rem; margin: 0 0 1rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .2rem .75rem; margin-bottom: .6rem; }
.checks .check-label { margin: 0; font-weight: 400; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 140px; margin: 0; }
form.inline { display: inline; }
.sm-input { padding: .3rem .5rem; max-width: 140px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid #d6cdbd; background: #fff; color: var(--ink); font: inherit;
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f7f3ea; color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #9c2a31; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: .3rem .7rem; font-size: .88rem; }
.btn.big { padding: .8rem 1.5rem; font-size: 1.1rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.linkbtn.danger, .danger { color: var(--red); }

.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.flash.success { background: #e3f3ea; color: #17462f; }
.flash.error { background: var(--red-soft); color: #7d1d23; }

/* Auth */
main.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(circle at 20% 10%, #2c7a57 0, transparent 40%), radial-gradient(circle at 90% 90%, #b5333b 0, transparent 35%), var(--green); }
.auth-card { background: #fff; border-radius: 18px; padding: 2rem 1.6rem; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.auth-card form { text-align: left; margin-top: 1rem; }
.auth-emoji { font-size: 2.6rem; }
main.auth .flash { max-width: 400px; width: 100%; margin: 0 auto 1rem; }

/* Home */
.hero { margin: .5rem 0 1.25rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.person-card { display: flex; gap: .75rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s; }
.person-card:hover { transform: translateY(-2px); color: var(--ink); }
.person-card.me { border-color: #cfe3d7; background: #f6fbf8; }
.pc-body { display: grid; min-width: 0; }
.pc-name { font-weight: 700; }
.santa-card { background: linear-gradient(135deg, #fff, #fff6f6); border-color: #f1d4d6; }
.event-list { padding-left: 1.1rem; }
.today-banner { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.2rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--red), #d5545b); color: #fff; text-decoration: none; box-shadow: var(--shadow); font-size: 1.1rem; }
.today-banner:hover { color: #fff; filter: brightness(1.05); }
.tb-icon { font-size: 2rem; }
.tb-detail { display: block; font-size: .95rem; opacity: .9; }
.coming-list { list-style: none; padding: 0; margin: 0 0 .6rem; }
.coming-list.card { padding: .3rem 1rem; }
.coming-list li { display: flex; gap: .7rem; align-items: center; padding: .55rem .4rem; border-top: 1px solid var(--line); }
.coming-list li:first-child { border-top: 0; }
.coming-list li.soon { background: var(--gold-soft); border-radius: 10px; border-top-color: transparent; }
.coming-list li.soon + li { border-top-color: transparent; }
.cl-icon { font-size: 1.3rem; width: 1.6rem; text-align: center; }
.cl-date { display: block; }
.cl-when { font-weight: 700; font-size: .88rem; white-space: nowrap; color: var(--green); }
.soon .cl-when { color: var(--red); }
.date-line { margin: .2rem 0 .5rem; }
.show-age { font-weight: 400; margin: -.4rem 0 .8rem; }

/* Help tips + checklist */
.tip-bubble { position: absolute; z-index: 60; background: var(--ink); color: #fff; border-radius: 14px; padding: .85rem 1rem .7rem;
  box-shadow: 0 12px 34px rgba(0,0,0,.28); animation: pop .25s ease; font-size: .95rem; line-height: 1.45; }
.tip-arrow { position: absolute; top: -7px; width: 14px; height: 14px; background: var(--ink); transform: translateX(-50%) rotate(45deg); }
.tip-bubble.above .tip-arrow { top: auto; bottom: -7px; }
.tip-actions { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }
.tip-actions .tip-count { margin-left: auto; color: #b9c4bd; }
.tip-bubble .tip-skip { color: #b9c4bd; }
.tip-bubble .btn.primary { background: var(--gold); border-color: var(--gold); }
.tip-target { outline: 3px solid var(--gold) !important; outline-offset: 4px; border-radius: 10px; position: relative; z-index: 2; }
.checklist-card { border-color: #e7d6ad; background: linear-gradient(#fffdf6, #fff); }
.checklist-head { display: flex; justify-content: space-between; align-items: center; }
.checklist-head h2 { margin: 0; }
.progress { height: 8px; border-radius: 99px; background: #f1ead9; overflow: hidden; margin: .6rem 0 .4rem; }
.progress span { display: block; height: 100%; background: var(--green-2); border-radius: 99px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.checklist li { display: flex; gap: .6rem; align-items: center; padding: .3rem 0; }
.checklist .tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfc5b3; font-size: .8rem; font-weight: 900; color: #fff; flex: none; }
.checklist li.done .tick { background: var(--green-2); border-color: var(--green-2); }
.checklist li.done span:last-child { color: var(--muted); text-decoration: line-through; }
.checklist li.skipped .tick { background: #b9b0a0; border-color: #b9b0a0; font-size: 1rem; }
.checklist li.skipped > span:nth-child(2) { color: var(--muted); }
.checklist .skip-form { margin-left: auto; }
.checklist .skip-form .linkbtn { color: var(--muted); font-weight: 400; }
.checklist a { font-weight: 700; }

/* Family activities */
.act-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.act-head .lead { margin: .2rem 0; }
.act-head h1 { font-size: clamp(1.35rem, 4.6vw, 1.9rem); }
@media (max-width: 560px) { .act-head .lead { font-size: 1rem; } }
.tree-wrap { position: relative; padding: .5rem; background: linear-gradient(#fffaf0, #fdf3e1); }
.tree { width: 100%; max-height: 72vh; display: block; }
.leaf { cursor: pointer; outline: none; }
.leaf-inner { transform-box: fill-box; transform-origin: 50% 0%; animation: sway 4s ease-in-out infinite; animation-delay: var(--sway-delay, 0s); transition: transform .15s; }
.leaf:hover .leaf-inner, .leaf:focus-visible .leaf-inner, .leaf.active .leaf-inner { transform: scale(1.35); animation-play-state: paused; }
.leaf.active use { stroke: #fff; stroke-width: 3; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .leaf-inner { animation: none; } }
.leaf-card { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); width: min(92%, 420px); display: flex; gap: .8rem; align-items: flex-start;
  background: #fff; border-radius: 14px; padding: .9rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.15); border: 1px solid var(--line); animation: pop .25s ease; }
.leaf-card-emoji { font-size: 2rem; line-height: 1; }
.leaf-card-text { font-family: Fraunces, Georgia, serif; font-size: 1.15rem; }
#leaf-card-close { margin-left: auto; text-decoration: none; font-size: 1.4rem; line-height: 1; }
.tree-hint { text-align: center; margin: .3rem 0 .2rem; display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.leaf-card-nav { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; }
.leaf-card-nav form { margin-left: auto; }
.emoji-pick, .color-pick { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.emoji-opt input, .color-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.emoji-opt span { display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .4rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1.3rem; cursor: pointer; background: #fff; }
.emoji-opt span.emoji-none { font-size: .8rem; }
.emoji-opt input:checked + span { border-color: var(--green); box-shadow: inset 0 0 0 2px var(--green); background: #e8f4ee; }
.color-opt span { display: inline-block; width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.color-opt input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.emoji-opt input:focus-visible + span, .color-opt input:focus-visible + span { outline: 2px solid #a8d4bd; }
.leaf-list { list-style: none; padding: 0; margin: 0; }
.leaf-list li { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.leaf-list li:first-child { border-top: 0; }
.leaf-dot { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50% 0 50% 0; flex: none; font-size: 1rem; }
.act-banner { display: flex; gap: .9rem; align-items: center; padding: .9rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, #d9772b, #b5333b); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.act-banner:hover { color: #fff; filter: brightness(1.05); }
.act-banner-icon { font-size: 2rem; }
.act-card { display: flex; gap: 1rem; align-items: center; text-decoration: none; color: var(--ink); margin: 0; }
.act-card:hover { color: var(--ink); border-color: #e7c9a8; }
.act-card.closed { opacity: .85; }
.act-icon { font-size: 2.2rem; }
.open-tag { color: var(--green); }

/* Raffle */
.tree.drawing .leaf { opacity: .35; transition: opacity .15s; }
.tree .leaf.lit, .tree .leaf.winner { opacity: 1 !important; }
.leaf.lit .leaf-inner { transform: scale(1.8); animation-play-state: paused; }
.leaf.lit use { stroke: #fff; stroke-width: 4; filter: drop-shadow(0 0 6px #ffd76a); }
.leaf.winner .leaf-inner { transform: scale(1.7); animation-play-state: paused; }
.leaf.winner use { stroke: #ffd76a; stroke-width: 5; filter: drop-shadow(0 0 10px #ffcf40); }
.draw-stage { position: absolute; top: .8rem; left: 50%; transform: translateX(-50%); }
.draw-title { background: var(--ink); color: #fff; border-radius: 99px; padding: .45rem 1.1rem; font-weight: 700; box-shadow: var(--shadow); animation: pulse 1s ease-in-out infinite; white-space: nowrap; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.winner-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 420px); text-align: center;
  background: #fff; border-radius: 18px; padding: 1.3rem 1.2rem 1rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); border: 2px solid #f0d58a; animation: pop .35s ease; z-index: 5; }
.winner-trophy { font-size: 3rem; line-height: 1; }
.winner-name { font-family: Fraunces, Georgia, serif; font-size: 2rem; font-weight: 700; margin: .1rem 0 .3rem; color: var(--red); }
.winner-leaf { font-size: 1.05rem; margin-bottom: .4rem; }
.winner-actions { justify-content: center; margin-top: .6rem; }
.raffle-panel { border-color: #f0d58a; background: linear-gradient(#fffcf2, #fff); }
.raffle-panel h2 { margin-bottom: .3rem; }
.winner-banner { display: flex; gap: .8rem; align-items: center; padding: .9rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, #f6d36b, #e6a92e); color: #3a2a05; text-decoration: none; box-shadow: var(--shadow); font-size: 1.05rem; }
.winner-banner:hover { color: #3a2a05; filter: brightness(1.04); }
@media (prefers-reduced-motion: reduce) { .draw-title { animation: none; } }

/* Shipping address */
.ship-box { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.ship-box > summary { list-style: none; }
.ship-box > summary::-webkit-details-marker { display: none; }
.ship-addr { margin-top: .7rem; padding: .6rem .7rem; border-radius: 10px; background: #fcfaf6; border: 1px solid var(--line); }
.addr-text { margin: .2rem 0 .5rem; }

/* Login links */
#login-link { font-size: .8rem; }
.link-send { margin: .8rem 0; }
.btn.big { padding: .8rem 1.2rem; font-size: 1.05rem; }

/* Admin: last seen */
.seen-cell { white-space: nowrap; }
.seen-now { color: var(--green); font-weight: 700; }
.seen-now::before { content: "● "; }

/* Admin: dates */
.dates-cell { min-width: 170px; }
.admin-dates[open] { margin-top: .4rem; padding: .6rem; border: 1px dashed var(--line); border-radius: 10px; background: #fcfaf6; min-width: 220px; }
.admin-dates label { margin-bottom: .45rem; }

/* Event form */
.invite-box legend { font-weight: 700; padding: 0 .3rem; }
.invite-list { margin-top: .4rem; }
.form-hint { margin: -.4rem 0 .8rem; }
.your-time { color: var(--green); font-weight: 600; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cal-option { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.cal-option h2 { font-size: 1.05rem; }
#cal-link { font-size: .8rem; }
.android-steps { padding-left: 1.2rem; margin: .2rem 0 .4rem; display: grid; gap: .45rem; }
.android-card.is-android { border-color: #cfe3d7; background: #f6fbf8; }
.cal-choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.cal-choose fieldset { margin: 0; }
.cal-choose legend { font-weight: 700; padding: 0 .3rem; }
.cal-choose .check-label { font-weight: 400; margin: .35rem 0; align-items: flex-start; }
.cal-choose .check-label input { margin-top: .25rem; }

/* Add to calendar (single date) */
.addcal { position: relative; display: inline-block; margin-top: .4rem; }
.addcal > summary { list-style: none; }
.addcal > summary::-webkit-details-marker { display: none; }
.addcal-menu { position: absolute; z-index: 20; right: 0; top: calc(100% + .3rem); min-width: 260px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: .35rem; display: grid; }
.event-card .addcal-menu, .event-hero .addcal-menu { left: 0; right: auto; }
.addcal-menu a { padding: .5rem .65rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.addcal-menu a:hover { background: #f4efe5; color: var(--ink); }
.addcal-menu a.best { font-weight: 700; background: #e8f4ee; }
.addcal-menu a.best::after { content: "  ← this device"; font-weight: 400; color: var(--muted); font-size: .8rem; }
.addcal-note { padding: .35rem .65rem .2rem; }
.coming-list .addcal { margin: 0; }
.coming-list .addcal > summary { padding: .2rem .45rem; }
.event-card h2 a { color: var(--ink); text-decoration: none; }
.event-card h2 a:hover { text-decoration: underline; }
a.count { text-decoration: none; }
a.count:hover { color: #fff; filter: brightness(1.1); }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.chat-list { padding: .6rem; position: sticky; top: 4.2rem; max-height: calc(100vh - 6rem); overflow: auto; }
.chat-link { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 9px; text-decoration: none; color: var(--ink); }
.chat-link:hover { background: #f4efe5; color: var(--ink); }
.chat-link.active { background: #e8f4ee; font-weight: 700; }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { padding: 1rem 1.1rem .4rem; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 1.4rem; margin: 0 0 .2rem; }
.messages { height: min(60vh, 560px); overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; background: #fcfaf6; }
.msg { display: flex; gap: .5rem; align-items: flex-end; max-width: 85%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: .45rem .75rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.msg.mine .bubble { background: #e8f4ee; border-color: #cfe3d7; border-radius: 14px 14px 4px 14px; }
.msg-meta { display: flex; gap: .5rem; align-items: baseline; font-size: .78rem; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-del { text-decoration: none; font-size: 1rem; line-height: 1; opacity: .5; }
.msg-del:hover { opacity: 1; }
.chat-form { display: flex; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { margin: 0; resize: none; }
.chat-cta { display: flex; gap: .6rem; align-items: center; text-decoration: none; color: var(--ink); padding: .7rem 1rem; }
.chat-cta:hover { color: var(--ink); border-color: #cfe3d7; }
.chat-cta .pill { margin-left: auto; }
.chat-banner { background: #e8f1fb; border-color: #c9dcf0; }
@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { position: static; display: flex; gap: .3rem; overflow-x: auto; white-space: nowrap; max-height: none; }
  .chat-list .field-label { display: none; }
  .chat-link { flex: none; border: 1px solid var(--line); }
  .messages { height: calc(100vh - 21rem); min-height: 240px; }
  .chat-head { padding: .7rem .9rem .3rem; }
  .chat-head h1 { font-size: 1.15rem; }
  .chat-form { padding: .6rem .7rem; }
  .msg { max-width: 92%; }
}

/* What's new */
.news-card { border-color: #cfe3d7; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: flex; gap: .7rem; align-items: flex-start; padding: .5rem 0; border-top: 1px solid var(--line); }
.news-list li:first-child { border-top: 0; }
.news-list .avatar.sm { background: linear-gradient(135deg, var(--red), #d5545b); }
.new-tag { background: #e8f1fb; color: #24527a; }

/* Received, group gifts, secret ideas, questions */
.btn.got-it { border-color: #cfe3d7; color: var(--green); }
.group-box { margin: .6rem 0 .2rem; padding: .7rem .8rem; border-radius: 10px; background: #eef6f1; border: 1px solid #cfe3d7; display: grid; gap: .4rem; }
.group-people { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.group-people li { background: #fff; border-radius: 99px; padding: .05rem .55rem; font-size: .8rem; border: 1px solid #d7e7dd; }
.group-start { display: inline-block; }
.group-start[open] { flex-basis: 100%; padding: .7rem; border: 1px dashed #cfe3d7; border-radius: 10px; }
.group-start summary { list-style: none; }
.group-start summary::-webkit-details-marker { display: none; }
.group-start[open] summary { margin-bottom: .5rem; }
.wide-input { max-width: 260px; }
.group-line { margin-top: .25rem; }
.check.readonly { display: inline-grid; place-items: center; cursor: default; border-style: dashed; color: var(--green); }
.ideas { margin-top: 1.6rem; padding-top: 1rem; border-top: 2px dashed var(--line); }
.item.secret { background: #fffdf6; border-color: #efe3c2; }
.secret-tag { background: #f6ecd2; color: #7a5a12; }
.questions { margin-top: 1.4rem; }
.q { padding: .6rem 0; border-top: 1px solid var(--line); display: grid; gap: .3rem; }
.q:first-of-type { border-top: 0; }
.q.unanswered .q-text { font-weight: 700; }
.q-answer { color: var(--green); }
.ask-form { margin-top: .6rem; }
.question-banner { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: var(--gold-soft); border: 1px solid #efdfb4; color: var(--ink); text-decoration: none; }
.question-banner:hover { color: var(--ink); border-color: var(--gold); }
details.received summary { cursor: pointer; }
.received-list li { display: flex; gap: .6rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--line); }
.event-list li { margin: .25rem 0; }

/* Person */
.person-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.person-head h1 { margin: 0; }
.profile textarea { font-size: .92rem; }
.add-card > summary { list-style: none; width: 100%; }
.add-card > summary::-webkit-details-marker { display: none; }
.add-card[open] > summary { margin-bottom: 1rem; }
.item-form { display: block; }
.preview-box { display: flex; gap: .75rem; align-items: center; margin: -.2rem 0 .8rem; }
.preview-box img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.prio-picker { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prio-opt { margin: 0; }
.prio-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prio-opt span { display: inline-block; padding: .4rem .8rem; border: 1px solid #d6cdbd; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: .9rem; background: #fff; }
.prio-opt input:checked + span { border-color: var(--green); background: #e8f4ee; box-shadow: inset 0 0 0 1px var(--green); }
.prio-opt input:focus-visible + span { outline: 2px solid #a8d4bd; }

.sortbar { margin: 0 0 .6rem; color: var(--muted); }
.sortbar a { margin-left: .5rem; text-decoration: none; color: var(--muted); }
.sortbar a.active { color: var(--green); font-weight: 700; text-decoration: underline; }

.item { display: flex; gap: 1rem; padding: .9rem; }
.item.claimed { opacity: .72; background: #fbfaf7; }
.thumb { position: relative; width: 96px; height: 96px; flex: none; border-radius: 10px; background: #f6f1e7; display: grid; place-items: center; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb .ph { font-size: 2rem; }
@media (max-width: 480px) { .thumb { width: 70px; height: 70px; } }
.item-body { flex: 1; min-width: 0; }
.item-body h3 { margin: .25rem 0 .1rem; overflow-wrap: anywhere; }
.item-body h3 a { color: var(--ink); text-decoration-color: #c9c1b2; }
.item-top { display: flex; gap: .4rem; flex-wrap: wrap; }
.prio { font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 99px; }
.prio.p3 { background: var(--red-soft); color: var(--red); }
.prio.p2 { background: var(--gold-soft); color: #8a6417; }
.prio.p1 { background: #eef1f0; color: #56605a; }
.price { color: var(--ink); }
.notes { font-size: .92rem; color: #3d4741; }
.item-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.item-actions form { margin: 0; }
.item-actions details.edit { flex-basis: 100%; order: 10; }
.item-actions details.edit[open] { padding: .75rem; border: 1px dashed var(--line); border-radius: 10px; margin-top: .25rem; }
.item-actions details.edit summary { list-style: none; display: inline; }
.item-actions details.edit summary::-webkit-details-marker { display: none; }
.item-actions details.edit[open] summary { display: block; margin-bottom: .6rem; }
.status { font-weight: 700; font-size: .9rem; }
.status.mine { color: var(--green); }
.status.taken { color: var(--muted); }

/* Shopping */
.shop-list { list-style: none; padding: 0; margin: 0; }
.shop-list li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--line); }
.shop-list li:first-child { border-top: 0; }
.shop-list li.done .grow > a, .shop-list li.done .grow { text-decoration: line-through; color: var(--muted); }
.check { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--green); background: #fff; color: #fff; font-weight: 900; cursor: pointer; padding: 0; }
.done .check { background: var(--green); }

/* Kids */
.kid-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .5rem; }
.kid-head h2 { margin: 0; }

/* Events */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.event-card { display: flex; gap: 1rem; align-items: center; text-decoration: none; color: var(--ink); margin: 0; }
.event-card:hover { color: var(--ink); border-color: #cfe3d7; }
.count { display: grid; place-items: center; min-width: 74px; padding: .5rem; border-radius: 12px; background: var(--green); color: #fff;
  font-family: Fraunces, serif; font-size: 1.8rem; font-weight: 700; line-height: 1; }
.count small { font-family: "Nunito Sans", sans-serif; font-size: .7rem; font-weight: 600; opacity: .85; margin-top: .25rem; }
.count.big { min-width: 110px; font-size: 2.6rem; padding: .8rem; background: var(--red); }
.event-hero { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.event-hero h1 { margin-bottom: .1rem; }
.event-hero p { margin: .2rem 0; }
.col-actions { display: grid; gap: .4rem; justify-items: end; }
.reveal { margin: .6rem 0 1rem; }
.reveal-answer { font-size: 1.3rem; font-family: Fraunces, serif; padding: 1rem; background: #fff6f6; border-radius: 12px; border: 1px dashed #e5b7ba; animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.draw-form { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--line); }

/* Admin */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.admin-table form { margin: 0; flex-wrap: nowrap; }
.admin-table td.right form { margin-left: .6rem; }
@media (max-width: 640px) { .admin-table thead { display: none; } .admin-table tr { display: grid; padding: .4rem 0; border-bottom: 1px solid var(--line); } .admin-table td { border: 0; padding: .2rem 0; } .admin-table td.right { text-align: left; } }

/* Raffle countdown + prize */
.raffle-opts { border: 1px dashed #e3cf9b; border-radius: 12px; padding: .75rem .9rem; margin: .25rem 0 1rem; }
.raffle-opts[hidden] { display: none; }
.raffle-prize { margin: .2rem 0 .6rem; }
.countdown { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem; background: #fff8e6;
  border: 1px solid #f0d58a; border-radius: 12px; padding: .65rem .9rem; margin: .4rem 0 .8rem; }
.countdown .cd-label { font-weight: 600; }
.countdown .cd-time { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #9a3412; }
.countdown.cd-zero .cd-time { animation: cdpulse 1s ease-in-out infinite; }
@keyframes cdpulse { 50% { opacity: .45; } }
.raffle-banner { display: flex; gap: .7rem; align-items: center; text-decoration: none; color: inherit;
  background: linear-gradient(135deg, #fff4d6, #fde7c8); border: 1px solid #f0c987; border-radius: 14px;
  padding: .75rem 1rem; margin-bottom: .8rem; font-size: 1.05rem; }
.raffle-banner > span { font-size: 1rem; }
.raffle-banner [data-cd-time] { font-weight: 700; font-variant-numeric: tabular-nums; color: #9a3412; }
.winner-prize { font-weight: 700; color: #9a3412; margin: .3rem 0; }

.act-banner .act-extra { display: block; margin-top: .45rem; padding-top: .45rem; border-top: 1px dashed rgba(255, 255, 255, .55); font-size: .95rem; }
.act-banner .act-extra [data-cd-time] { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.act-banner .act-when { display: block; opacity: .9; }
.act-banner .your-time { color: #fff; font-weight: 700; }
