@import url('/assets/fonts.css?v=festive-1');

/* Veillée: warm paper, deep green, red lacquer and a little woven ribbon. */
:root {
  color-scheme: light;
  --pine: #214737;
  --deep: #173a2b;
  --ink: #302d25;
  --muted: #6d6b5f;
  --cream: #f7f2e8;
  --panel: #fffdf8;
  --line: #e1d8c8;
  --red: #ad3028;
  --sage: #e5e9de;
  --gold: #a88038;
  --ochre: #e0b256;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
  --tartan: repeating-linear-gradient(0deg, transparent 0 9px, #d3a14799 9px 10px, transparent 10px 18px, #1c3c2fa6 18px 25px, transparent 25px 32px), repeating-linear-gradient(90deg, #9c3029 0 12px, #243e2ad9 12px 20px, #a83b2d 20px 28px, #d3a147aa 28px 29px, #9c3029 29px 36px);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; touch-action: manipulation; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
svg { flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
[hidden] { display: none !important; }
::selection { background: #e6c985; color: var(--deep); }
:where(button, a, input, textarea, select):focus-visible { outline: 3px solid #c29543; outline-offset: 4px; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 14px; background: var(--panel); color: var(--deep); }
.skip-link:focus { top: 20px; }

/* The thin tartan is a ribbon, not a texture behind reading content. */
.site-header { position: relative; max-width: 1600px; min-height: 96px; margin: 0 auto; padding: 25px clamp(24px, 4vw, 68px) 20px; display: flex; align-items: center; justify-content: space-between; gap: 28px; background: var(--cream); }
.site-header::before { content: ''; position: absolute; inset: 0 0 auto; height: 7px; background-image: var(--tartan); }
.brand { display: inline-flex; align-items: center; gap: 11px; font: 700 31px/1 var(--serif); letter-spacing: -.8px; white-space: nowrap; }
.brand-icon { position: relative; display: block; flex: 0 0 auto; width: 31px; height: 33px; border-radius: 50%; background: radial-gradient(circle at 37% 32%, #dc5545 0%, #bd392f 35%, #a12821 75%); box-shadow: inset -3px -2px 6px #71181125; }
.brand-icon::before { content: ''; position: absolute; width: 10px; height: 12px; top: 9px; left: 9px; border-radius: 50%; background: #edbe65; box-shadow: 0 0 9px #f2c76a45; }
.brand-icon .icon { display: none; }
.brand-caption { display: block; margin-top: 8px; color: var(--muted); font: 9px/1.2 var(--sans); letter-spacing: 1.2px; }
.main-nav { display: flex; align-items: center; gap: 7px; }
.nav-item { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 0; border-radius: 28px; background: transparent; color: #665a4c; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.nav-item .icon { width: 16px; height: 16px; }
.nav-item.active { color: #fffaf0; background: var(--deep); }
.nav-count { font-size: 10px; opacity: .75; }
.header-actions, .sidebar-bottom { display: flex; align-items: center; gap: 13px; }
.event-switch { max-width: 200px; }
.select-wrap { display: flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 24px; background: #fffcf6; }
.select-wrap > .icon { color: var(--gold); width: 14px; height: 14px; }
.select-wrap > .icon:last-child { width: 11px; }
.select-wrap select { appearance: none; min-width: 0; width: 100%; padding: 10px 0; border: 0; color: #4b453b; background: transparent; font-size: 13px; cursor: pointer; }
select option { background: var(--panel); color: var(--ink); }
.profile-button { display: flex; align-items: center; gap: 9px; background: transparent; border: 0; padding: 3px; min-height: 44px; }
.profile-button strong { font-size: 14px; font-weight: 500; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; background: #f1dfb4; color: #785826; width: 36px; height: 36px; border-radius: 50%; font-size: 11px; font-weight: 600; object-fit: cover; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.color-1 { background: #b74334; color: #fff7e9; }
.avatar.color-2 { background: #e7bd62; color: #46351c; }
.avatar.color-3 { background: #ede6d5; color: #a3382a; }
.avatar.color-4 { background: #e2baaa; color: #663b31; }
.avatar.color-5 { background: #bbc8ac; color: #38503b; }
.app-main { max-width: 1600px; margin: 0 auto; }
.topbar { min-height: 40px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 5px clamp(24px, 4vw, 68px) 8px; background: var(--cream); }
.breadcrumb { display: none; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.countdown { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.countdown .icon { width: 14px; height: 14px; color: var(--gold); }
.topbar .btn { min-height: 36px; padding-block: 5px; border-color: transparent; font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 12px 22px; border: 1px solid transparent; border-radius: 27px; font-size: 14px; font-weight: 600; line-height: 1.5; text-align: center; transition: background .15s, border-color .15s, transform .15s; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary, .btn.danger { background: var(--red); color: #fffaf2; }
.btn.secondary { background: transparent; color: var(--pine); border-color: #c8c5ae; }
.btn.ghost { background: transparent; color: var(--pine); }
.btn.small { min-height: 38px; padding: 8px 16px; font-size: 13px; }
.btn.full { width: 100%; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; padding: 10px; border-radius: 50%; background: transparent; color: var(--pine); }
.text-link { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; color: var(--pine); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.text-link .icon { width: 16px; height: 16px; }
.eyebrow { display: block; color: var(--gold); font-size: 10px; font-weight: 600; line-height: 1.6; letter-spacing: 1.5px; }
.subtle { color: var(--muted); line-height: 1.8; }

/* The full-height illustration keeps the star and the presents in the frame. */
.welcome-banner, .login-story { --hero-height: 700px; position: relative; isolation: isolate; overflow: hidden; min-height: var(--hero-height); height: auto; background: #13281d; color: #fff7e8; }
.hero-art { position: absolute; z-index: -2; inset: 0 0 auto auto; width: auto; max-width: none; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: right center; }
.welcome-banner::before, .login-story::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #142d20 0%, #142d20f5 20%, #142d20b3 34%, transparent 55%); pointer-events: none; }
.welcome-banner::after { content: ''; position: absolute; z-index: 2; left: -2%; right: -2%; bottom: -17px; height: 34px; border-radius: 50% 50% 0 0; background: var(--cream); pointer-events: none; }
.hero-snow { position: absolute; z-index: 0; inset: 0; pointer-events: none; overflow: hidden; }
.hero-snow canvas { display: block; width: 100%; height: 100%; }
.village-3d { display: none; }
.welcome-copy { position: relative; z-index: 1; width: 57%; max-width: 760px; padding: 48px 24px 35px clamp(32px, 4.5vw, 76px); }
.welcome-copy .eyebrow { overflow-wrap: anywhere; color: #e7be64; font-size: 12px; font-weight: 700; letter-spacing: .1px; }
.welcome-copy h1 { margin: 20px 0 23px; color: #fff8e9; font: 700 clamp(52px, 4.85vw, 74px)/.99 var(--serif); letter-spacing: -2.4px; text-wrap: balance; }
.welcome-copy h1 em { font-style: normal; }
.welcome-copy p { display: -webkit-box; max-width: 480px; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: #d8e1d4; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 29px; }
.hero-actions .btn { min-height: 49px; padding-inline: 22px; font-size: 14px; }
.hero-actions .btn.secondary { color: #fff9ed; border-color: #e8ebd7bd; background: #173d2c33; }
.countdown-tag { position: relative; z-index: 1; margin: 28px 0 0 7px; display: flex; align-items: center; gap: 14px; width: 220px; min-height: 76px; padding: 11px 20px 11px 31px; background: #fcf3df; color: var(--ink); clip-path: polygon(10% 0,100% 0,100% 100%,10% 100%,0 50%); transform: rotate(-4deg); }
.countdown-tag::before { content: ''; position: absolute; left: 13px; width: 8px; height: 8px; background: var(--deep); border-radius: 50%; }
.countdown-tag strong { font: 700 49px/.95 var(--sans); letter-spacing: -2px; color: var(--red); }
.countdown-tag > span { font-size: 12px; font-weight: 700; line-height: 1.4; max-width: 89px; }
.family-tree { position: absolute; z-index: 2; top: 0; left: calc(100% - var(--hero-height) * .345); width: calc(var(--hero-height) * .78); height: 100%; transform: translateX(-50%); }
.family-ornaments { position: absolute; inset: 0; }
.family-ornament { position: absolute; left: var(--ornament-x, 50%); top: var(--ornament-y, 50%); display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 70px; min-height: 77px; border: 0; padding: 0; background: transparent; transform: translate(-50%, -50%); }
.ornament-ball { position: relative; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border: 1px solid #ef9d5b52; border-radius: 50%; background: radial-gradient(circle at 33% 25%, #df6552, #b72f26 55%, #7f211e); box-shadow: inset -5px -4px 11px #5d100f40, 0 5px 12px #0c180e70; color: #fff2dc; font: 700 17px/1 var(--serif); transition: box-shadow .18s, transform .18s; }
.ornament-ball::before { content: ''; position: absolute; top: -6px; left: calc(50% - 7px); width: 14px; height: 7px; border-radius: 3px 3px 1px 1px; background: linear-gradient(90deg,#aa792b,#ebc76c,#ad7f36); }
.ornament-ball img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.family-ornament:nth-child(3n + 2) .ornament-ball { color: #3e2e16; background: radial-gradient(circle at 33% 25%,#f6db91,#d3a344 62%,#a97927); border-color: #e7c26d; }
.family-ornament:nth-child(3n) .ornament-ball { color: #a8372a; background: radial-gradient(circle at 33% 25%,#fffef4,#ece6d2 62%,#c0b7a1); border-color: #fff6dc; }
.ornament-label { display: inline-flex; align-items: center; gap: 4px; max-width: 125px; border-radius: 14px; padding: 3px 9px; background: #faf3e3; color: #40382d; font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 5px #0c180e20; }
.ornament-label small { color: var(--red); font-size: 10px; flex-shrink: 0; }
.family-ornament.is-me .ornament-ball { outline: 2px solid #f5e2a6; outline-offset: 4px; }
.family-ornament.is-active .ornament-label { color: #fff8e8; background: var(--red); }
.family-ornament.is-active .ornament-label small { color: #fff0cd; }
.ornament-more .ornament-ball { background: #f6ead2; color: var(--pine); }
.scene-toggle { position: absolute; z-index: 4; right: 23px; bottom: 24px; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 7px 11px; border: 1px solid #e0d7b947; border-radius: 20px; background: #153224c9; color: #e5e7d8; font-size: 10px; }
.scene-toggle .icon { width: 12px; height: 12px; }
.scene-play-icon, .scene-toggle[data-paused="true"] .scene-pause-icon { display: none; }
.scene-toggle[data-paused="true"] .scene-play-icon { display: block; }
.hero-stamp, .hero-family { display: none; }

/* Wish lists live on paper, with softly sculpted illustrations for the demo. */
.main-content { padding-bottom: 0; }
.list-section { position: relative; max-width: 1432px; margin: 0 auto; padding: 46px clamp(24px, 4vw, 64px) 56px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.section-heading h2 { overflow-wrap: anywhere; color: #332c23; font: 700 36px/1.17 var(--serif); letter-spacing: -1px; }
.section-eyebrow { margin-bottom: 9px; font-size: 12px; letter-spacing: 1.2px; }
.section-heading .subtle { margin-top: 10px; font-size: 14px; }
.section-heading > .btn { flex-shrink: 0; }
.members-filter { display: flex; align-items: center; gap: 9px; overflow-x: auto; padding: 26px 1px 20px; scrollbar-width: thin; scrollbar-color: #c6c5af transparent; }
.member-filter { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 5px 13px 5px 6px; border: 1px solid #dcd1bd; border-radius: 25px; background: transparent; color: #716454; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s; }
.member-filter .avatar { width: 25px; height: 25px; font-size: 8px; }
.member-filter .icon { width: 15px; height: 15px; }
.member-filter.active { background: var(--deep); color: #fff9ee; border-color: var(--deep); }
.member-filter .count { margin-left: 2px; font-size: 10px; opacity: .65; }
.gift-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 16px 0 23px; border-top: 1px solid #dfd6c68c; }
.members-filter:not([hidden]) + .gift-toolbar { margin-top: 0; }
.result-line { display: flex; align-items: center; gap: 20px; }
.result-line > span { font-size: 13px; color: var(--muted); }
.toolbar-controls { display: flex; align-items: center; gap: 23px; }
.search-box { display: flex; align-items: center; gap: 8px; }
.search-box .icon { width: 16px; height: 16px; color: #7e866c; }
.search-box input { width: 160px; padding: 8px 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-box input::placeholder { color: var(--muted); }
.toolbar-controls select { max-width: 200px; padding: 8px 0; border: 0; background: transparent; color: #756956; font-size: 13px; }
.gifts-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 22px; align-items: stretch; }
.gift-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding-top: 8px; border: 1px solid #e8decc; border-radius: 13px; background: var(--panel); box-shadow: 0 3px 8px #51412c03; }
.gift-card::before { content: ''; position: absolute; z-index: 1; inset: 0 0 auto; height: 8px; background-image: var(--tartan); }
.gift-visual { position: relative; margin: 9px 10px 0; aspect-ratio: 1.22; overflow: hidden; border-radius: 7px; background: #e9e3d7; }
.gift-visual > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gift-visual.no-image { display: grid; place-items: center; background: #ebe8db; }
.gift-visual.no-image > .icon { width: 58px; height: 58px; color: #9b8c6b; stroke-width: 1; }
.priority { position: absolute; display: flex; align-items: center; gap: 4px; left: 9px; top: 9px; padding: 4px 7px; border-radius: 13px; background: #fff9eceb; color: #795f32; font-size: 12px; }
.priority .icon { width: 11px; height: 11px; }
.priority.p3 { background: #a7312bee; color: #fff9e9; }
.gift-owner { display: flex; align-items: center; gap: 6px; padding: 14px 15px 0; color: #70614e; font-size: 14px; }
.gift-owner .avatar { width: 22px; height: 22px; font-size: 8px; }
.gift-owner strong { color: #69523f; font-weight: 500; }
.owner-you { margin-left: auto; color: #927437; font-size: 11px; }
.gift-body { display: flex; flex: 1; flex-direction: column; padding: 12px 15px 15px; }
.gift-title { overflow-wrap: anywhere; color: #393126; font: 600 17px/1.4 var(--sans); letter-spacing: -.2px; }
.title-button { border: 0; padding: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
.gift-description { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 43px; margin: 8px 0 12px; color: #766e5e; font-size: 13px; line-height: 1.65; }
.gift-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.gift-price { color: #393025; font-size: 17px; font-weight: 700; }
.gift-price small { font-size: 12px; font-weight: 400; }
.shop-link { overflow: hidden; max-width: 120px; color: #736653; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.gift-funding { min-height: 32px; margin-top: 13px; }
.funding-copy { display: flex; justify-content: space-between; gap: 5px; color: #75664f; font-size: 12px; }
.funding-copy strong { color: var(--red); font-weight: 600; }
.progress { height: 5px; overflow: hidden; margin-top: 7px; border-radius: 3px; background: #eee4d1; }
.progress span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--red); transition: width .2s; }
.funding-empty { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: #39704d; font-size: 13px; }
.funding-empty .icon { width: 13px; height: 13px; }
.gift-actions { display: flex; gap: 7px; padding: 0 15px 16px; }
.gift-actions > .btn { flex: 1; min-height: 37px; padding: 8px 10px; color: var(--pine); background: #f1f1e6; border-color: #dedec9; font-size: 14px; }
.gift-actions > .btn.funded { background: #e7eddf; color: #44613b; border-color: #d1ddc4; }
.chat-button { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 37px; padding: 8px; border: 1px solid #dedec9; border-radius: 50%; background: transparent; color: #587249; font-size: 9px; }
.chat-button .icon { width: 15px; height: 15px; }
.gift-status { margin-top: 12px; color: #7a5b29; font-size: 12px; line-height: 1.6; }
.empty-state, .loading-state { grid-column: 1 / -1; padding: 48px 24px; border: 1px dashed #d7ccba; border-radius: 10px; background: #fffaf280; text-align: center; }
.empty-state > .icon { width: 35px; height: 35px; margin-bottom: 16px; color: var(--gold); stroke-width: 1.2; }
.empty-state h3 { margin-bottom: 12px; font: 700 29px/1.25 var(--serif); }
.empty-state p { max-width: 430px; margin: 0 auto 24px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.connection-status { max-width: 1304px; margin: 24px auto 0; padding: 15px; border: 1px solid #dac68c; border-radius: 7px; background: #f8edce; color: #7b622a; font-size: 12px; }
.contribution-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; margin-bottom: 24px; border: 1px solid #d8ddca; border-radius: 9px; background: #eaf0e3; }
.contribution-summary p { color: #6b7a5d; font-size: 13px; line-height: 1.8; }
.contribution-summary strong { color: var(--pine); font: 700 35px var(--serif); }
.app-footer { display: flex; align-items: center; justify-content: center; gap: 20px; min-height: 82px; padding: 21px 28px; background-image: var(--tartan); color: #fff4df; font-size: 11px; }
.footer-privacy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 860px; padding: 11px 22px; border-radius: 25px; background: #fff8e9; color: #514331; font-size: 12px; font-weight: 500; text-align: center; }
.footer-privacy .icon { width: 15px; height: 15px; color: var(--pine); }
.footer-brand { font: 700 21px var(--serif); white-space: nowrap; }
.app-footer > span:last-child:not(.footer-privacy) { display: flex; align-items: center; gap: 7px; }
.demo-label { margin: 0; padding: 12px 24px; color: #a0927e; text-align: center; font-size: 10px; }
.mobile-nav { display: none; }

/* Paper forms and private messages remain fully functional in the new palette. */
.modal { width: min(560px,calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 26px 30px 30px; border: 1px solid #e0d4be; border-radius: 15px; background: var(--panel); color: var(--ink); box-shadow: 0 25px 100px #0a1b1460; }
.modal::backdrop, .chat-drawer::backdrop { background: #0d241cc9; backdrop-filter: blur(5px); }
.modal-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal h2 { margin-bottom: 12px; font: 700 33px/1.15 var(--serif); letter-spacing: -.7px; }
.modal .subtle { margin-bottom: 24px; font-size: 13px; }
.stack-form { display: flex; flex-direction: column; gap: 18px; text-align: left; }
.stack-form label { display: flex; flex-direction: column; gap: 8px; color: #5c5141; font-size: 14px; font-weight: 600; }
.stack-form input, .stack-form textarea, .stack-form select, .profile-select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #d9cbb4; border-radius: 8px; background: #fffdf8; color: var(--ink); font-size: 14px; }
.stack-form textarea { resize: vertical; }
.stack-form input::placeholder, .stack-form textarea::placeholder { color: #736653; }
.stack-form input[type=file] { font-size: 12px; }
.stack-form input::file-selector-button { margin-right: 10px; padding: 6px 10px; border: 0; border-radius: 4px; background: #e4eadb; color: var(--pine); font: inherit; }
.stack-form label small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-separator { padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions { display: flex; gap: 10px; margin-top: 7px; }
.form-actions > .btn { flex: 1; }
.form-error { padding: 12px; margin: 8px 0; border: 1px solid #e2b6a4; border-radius: 7px; background: #fae9df; color: #933e2e; font-size: 12px; line-height: 1.7; }
.info-note { display: flex; align-items: flex-start; gap: 8px; padding: 13px; margin: 18px 0; border: 1px solid #d8dfc7; border-radius: 7px; background: #edf2e4; color: #63744f; font-size: 12px; line-height: 1.7; }
.info-note .icon { width: 17px; height: 17px; margin-top: 2px; color: #76945a; }
.contributors { display: flex; flex-direction: column; gap: 14px; margin: 22px 0; }
.contributor-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.contributor-row span { color: var(--muted); }
.contribution-total { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: min(480px,90%); padding: 15px 24px; border: 1px solid #37513e; border-radius: 10px; background: var(--deep); color: #f8f2df; box-shadow: 0 8px 30px #153b2326; transform: translateX(-50%); font-size: 13px; line-height: 1.7; }
.chat-drawer { position: fixed; inset: 0 0 0 auto; width: 460px; max-width: 100%; height: 100dvh; max-height: none; overflow: hidden; margin: 0; padding: 26px; border: 0; border-left: 1px solid var(--line); background: var(--cream); color: var(--ink); }
.chat-drawer[open] { display: flex; flex-direction: column; }
.chat-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chat-heading h2 { margin-top: 10px; font: 700 29px/1.2 var(--serif); }
.chat-heading > .icon-button { margin-top: -6px; }
.chat-privacy { display: flex; align-items: center; gap: 8px; padding: 12px; margin: 22px 0; border: 1px solid #d9dfc8; border-radius: 7px; background: #edf0e2; color: #5e6a47; font-size: 12px; }
.chat-privacy .icon { width: 15px; height: 15px; color: #698a4d; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 20px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 0 20px; }
.message { display: flex; align-self: flex-start; gap: 9px; max-width: 92%; }
.message.mine { align-self: flex-end; flex-direction: row-reverse; }
.message .avatar { width: 28px; height: 28px; font-size: 9px; }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; color: #736653; font-size: 12px; }
.message-meta strong { color: #6f664e; font-weight: 600; }
.message-body { padding: 12px; border: 1px solid #e5dece; border-radius: 0 10px 10px 10px; background: #fffdf7; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .message-body { border-color: #d3ddc6; border-radius: 10px 0 10px 10px; background: #e6edda; }
.chat-form { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid #d9cbb4; border-radius: 9px; background: #fffdf8; }
.chat-form textarea { width: 100%; resize: none; padding: 5px; border: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.6; }
.chat-form textarea::placeholder { color: #736653; }
.chat-form .btn { padding: 10px; }
.chat-footer { margin-top: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.chat-empty { margin: auto; padding: 20px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.8; }
.chat-empty .icon { display: block; width: 33px; height: 33px; margin: 0 auto 16px; color: var(--gold); }
.copy-input { font-size: 12px !important; }
.inline-actions { display: flex; align-items: center; gap: 12px; }
.small { font-size: 12px; }
.detail-description { margin: 22px 0; color: var(--muted); font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-price { margin: 20px 0; color: var(--pine); font: 700 32px var(--serif); }
.detail-action { margin-top: 12px; }
.remove-contribution { margin-top: 20px; }
.profile-menu-actions { display: flex; flex-direction: column; gap: 12px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }

/* A real tree at the front door, and a quiet paper form alongside it. */
.login-layout { display: grid; grid-template-columns: 1.12fr 1fr; max-width: 1600px; min-height: 100dvh; margin: 0 auto; }
.login-header { grid-column: 1 / -1; width: 100%; min-height: 92px; }
.login-story { --hero-height: 760px; min-height: calc(100dvh - 92px); height: 100%; }
.login-story .hero-art { top: 0; right: auto; left: calc(50% - 878px); width: 1140px; height: 760px; }
.login-story::before { background: linear-gradient(0deg,#132d20 0%,#142d20eb 22%,transparent 48%); }
.login-story-copy { position: absolute; z-index: 1; left: 0; right: 0; bottom: 55px; padding: 0 35px; text-align: center; }
.login-story-copy .eyebrow { color: #e4bd6b; font-size: 10px; }
.login-story h1 { margin: 16px 0; color: #fff7e7; font: 700 49px/1.03 var(--serif); letter-spacing: -1.4px; text-wrap: balance; }
.login-story h1 em { font-style: normal; }
.login-story-copy > p { max-width: 380px; margin: 0 auto; color: #dce1d1; font-size: 14px; line-height: 1.7; }
.login-story .scene-toggle { top: 17px; right: 17px; bottom: auto; }
.login-form-side { display: flex; flex-direction: column; justify-content: center; padding: 56px 40px 35px; background: var(--cream); scroll-margin-top: 20px; }
.login-form-wrap { position: relative; width: 100%; max-width: 410px; margin: 0 auto; text-align: center; }
.form-ornament { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 17px; border: 1px solid #d6c6a4; border-radius: 50%; color: var(--gold); }
.form-ornament .icon { width: 22px; height: 22px; stroke-width: 1.4; }
.login-form-wrap h2 { margin: 7px 0 17px; color: #3a3024; font: 700 35px/1.12 var(--serif); letter-spacing: -.8px; }
.login-form-wrap > .subtle { margin-bottom: 27px; font-size: 13px; }
.login-form-wrap .btn { min-height: 49px; }
.login-form-wrap .stack-form input { min-height: 53px; border-radius: 10px; }
.privacy-line { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.privacy-line .icon { width: 13px; height: 13px; color: #86946e; }
.invitation-hint { max-width: 350px; margin: 20px auto 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.demo-section { margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.demo-section > span { color: #736653; font-size: 11px; letter-spacing: 1.2px; }
.demo-section form { margin-top: 15px; }
.demo-section > small { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; }
.login-copyright { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 40px; color: var(--muted); font-size: 12px; }
.login-copyright span { color: var(--gold); font-size: 18px; }
.dev-note { margin: 22px 0; padding: 18px; border: 1px solid #d8dec7; border-radius: 8px; background: #edf2e4; font-size: 12px; line-height: 1.7; }
.dev-note p { margin: 10px 0 16px; color: #6f7b5e; }
.standalone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; min-height: 100dvh; padding: 40px 24px; background: linear-gradient(#12302091,#123020b8), url('/assets/illustrations/christmas-tree.webp') 75% center / cover; }
.standalone > .brand { color: #fff3df; }
.standalone-card { width: 100%; max-width: 460px; padding: 40px; border: 1px solid #ece0c9; border-radius: 14px; background: #fcf6eaf5; box-shadow: 0 16px 60px #0c20154d; }
.small-tree { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 26px; border: 1px solid #d1c49f; border-radius: 50%; color: var(--gold); }
.standalone-card h1 { margin: 15px 0; font: 700 36px/1.15 var(--serif); }
.standalone-card p { margin: 15px 0 25px; color: #807460; font-size: 13px; line-height: 1.8; }
.standalone-card p:last-child { margin-bottom: 0; }

@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover, .btn.danger:hover { background: #c13c30; }
  .btn.secondary:hover { background: #e9ecdeda; border-color: #8e9d75; }
  .hero-actions .btn.secondary:hover { background: #ffffff12; border-color: #fff9e8; }
  .nav-item:not(.active):hover, .icon-button:hover { background: #e8e8d7; color: var(--pine); }
  .member-filter:hover { border-color: #95a17c; }
  .gift-actions > .btn:hover { background: #e3ead6; border-color: #b8c5a3; }
  .text-link:hover, .shop-link:hover { color: var(--red); }
  .family-ornament:hover .ornament-ball { transform: translateY(-3px); box-shadow: inset -5px -4px 11px #5d100f40, 0 8px 18px #07180ba6; }
  .btn:active { transform: translateY(1px); }
}
@media (max-width: 1320px) {
  .site-header { padding-inline: 28px; gap: 18px; }
  .nav-item { padding-inline: 12px; }
  .event-switch { max-width: 170px; }
  .profile-button strong { display: none; }
  .header-actions, .sidebar-bottom { gap: 8px; }
  .welcome-copy { width: 61%; padding-left: 42px; }
  .welcome-copy h1 { font-size: 63px; }
  .welcome-copy p { max-width: 430px; font-size: 16px; }
  .hero-actions .btn { padding-inline: 19px; font-size: 14px; }
  .gifts-grid { gap: 18px; }
  .gift-title { font-size: 17px; }
  .list-section { padding-inline: 36px; }
}
@media (max-width: 1080px) {
  .site-header { gap: 9px; padding-inline: 24px; }
  .brand { font-size: 28px; }
  .main-nav .icon { display: none; }
  .nav-item { padding-inline: 11px; }
  .event-switch { max-width: 145px; }
  .brand-caption { font-size: 8px; }
  .welcome-banner { --hero-height: 680px; }
  .welcome-copy { width: 62%; padding-top: 48px; padding-left: 35px; }
  .welcome-copy h1 { font-size: clamp(43px, 5.1vw, 55px); letter-spacing: -1.9px; }
  .welcome-copy p { max-width: 370px; font-size: 15px; }
  .hero-actions { gap: 9px; }
  .hero-actions .btn { min-height: 46px; padding: 10px 17px; font-size: 13px; }
  .countdown-tag { margin-top: 27px; }
  .ornament-ball { width: 48px; height: 48px; font-size: 15px; }
  .ornament-label { max-width: 115px; font-size: 12px; }
  .gifts-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .gift-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .toolbar-controls { width: 100%; justify-content: space-between; }
  .section-heading h2 { font-size: 31px; }
  .login-layout { grid-template-columns: 1fr 1fr; }
  .login-story h1 { font-size: 42px; }
  .login-form-side { padding-inline: 28px; }
  .login-form-wrap h2 { font-size: 31px; }
}
@media (max-width: 760px) {
  .site-header { min-height: 77px; padding: 20px 22px 15px; }
  .sidebar .main-nav, .sidebar .event-switch, .sidebar #admin-button { display: none !important; }
  .brand { font-size: 28px; }
  .brand-caption { display: none; }
  .brand-icon { width: 29px; height: 31px; }
  .topbar { min-height: 38px; padding: 3px 20px 8px; }
  .topbar-right { width: 100%; justify-content: space-between; gap: 8px; }
  .topbar .countdown { font-size: 12px; }
  .topbar .btn { min-height: 34px; font-size: 12px; padding: 6px 10px; }
  .welcome-banner { --hero-height: 380px; height: auto; min-height: 870px; padding-top: 370px; padding-bottom: 34px; }
  .welcome-banner .hero-art { right: auto; left: calc(50% - 439px); top: 0; width: 570px; height: 380px; }
  .welcome-banner::before { background: linear-gradient(0deg,#143324 0%,#143324 57%,#143324e6 60%,transparent 75%), linear-gradient(90deg,#132d2166,transparent 28%,transparent 75%,#132d2166); }
  .welcome-banner::after { bottom: -21px; }
  .welcome-copy { width: 100%; max-width: 550px; margin: 0 auto; padding: 12px 28px 0; text-align: center; }
  .welcome-copy .eyebrow { font-size: 12px; }
  .welcome-copy h1 { margin: 17px 0 20px; font-size: 49px; letter-spacing: -1.7px; }
  .welcome-copy p { max-width: 370px; margin: 0 auto; font-size: 14px; }
  .hero-actions { justify-content: center; max-width: none; margin-top: 24px; gap: 10px; }
  .hero-actions .btn { min-height: 47px; padding: 11px 19px; font-size: 14px; }
  .countdown-tag { margin: 30px auto 0; width: 218px; min-height: 73px; gap: 12px; text-align: left; }
  .countdown-tag strong { font-size: 43px; }
  .countdown-tag > span { font-size: 12px; }
  .family-tree { top: 0; left: 50%; width: 320px; height: 380px; }
  .family-ornament { min-width: 55px; min-height: 57px; gap: 3px; }
  .ornament-ball { width: 37px; height: 37px; font-size: 12px; }
  .ornament-ball::before { top: -4px; left: calc(50% - 5px); width: 10px; height: 5px; }
  .ornament-label { max-width: 105px; padding: 2px 6px; font-size: 12px; }
  .ornament-label small { font-size: 10px; }
  .family-ornament.is-me .ornament-ball { outline-offset: 3px; }
  .scene-toggle { right: 13px; bottom: 24px; min-height: 30px; padding: 6px 8px; font-size: 9px; }
  .scene-toggle span { display: none; }
  .scene-toggle .icon { width: 13px; height: 13px; }
  .list-section { padding: 35px 24px 40px; }
  .section-heading { flex-wrap: wrap; gap: 18px; }
  .section-heading h2 { font-size: 30px; }
  .section-heading .subtle { font-size: 13px; }
  .section-eyebrow { font-size: 11px; letter-spacing: 1px; }
  .section-heading > .btn { min-height: 44px; font-size: 14px; padding: 10px 17px; }
  .members-filter { padding-top: 22px; padding-bottom: 18px; }
  .member-filter { min-height: 40px; }
  .gifts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
  .gift-title { font-size: 17px; }
  .gift-actions > .btn, .chat-button { min-height: 42px; }
  .search-box input { width: 170px; font-size: 16px; }
  .toolbar-controls { gap: 14px; }
  .toolbar-controls select { max-width: 180px; font-size: 12px; }
  .main-content { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; z-index: 20; display: flex; justify-content: space-around; bottom: 0; left: 0; right: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid #ddd5c5; background: #fcf8eef5; backdrop-filter: blur(12px); }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 68px; min-height: 47px; padding: 6px 10px; border: 0; border-radius: 9px; background: transparent; color: #6d6b5f; font-size: 12px; }
  .mobile-nav button.active { color: var(--pine); background: #e9eddf; }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .app-footer { flex-direction: column; gap: 12px; padding: 22px 20px; }
  .footer-privacy { border-radius: 16px; padding: 12px 17px; font-size: 12px; line-height: 1.65; }
  .footer-brand { font-size: 20px; }
  .connection-status { margin: 20px 24px; }
  .chat-drawer { width: 100%; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); }
  .stack-form input, .stack-form textarea, .stack-form select, .profile-select, .chat-form textarea { font-size: 16px; }
  .modal { padding: 20px 24px 26px; }
  .modal h2 { font-size: 30px; }
  .login-layout { display: block; background: #142f22; }
  .login-header { min-height: 82px; color: #fff7e6; background: #142f22; }
  .login-header .btn { min-height: 36px; padding: 8px 12px; border-color: #e8d7aa80; color: #f8eed7; font-size: 12px; }
  .login-header .btn .icon { display: none; }
  .login-story { --hero-height: 480px; height: 480px; min-height: 0; }
  .login-story .hero-art { top: 0; left: calc(50% - 347px); width: 450px; height: 300px; }
  .login-story::before { background: linear-gradient(0deg,#142f22 0%,#142f22 36%,transparent 58%); }
  .login-story-copy { bottom: 30px; padding: 0 27px; }
  .login-story-copy .eyebrow { display: none; }
  .login-story h1 { max-width: 340px; margin: 14px auto 17px; font-size: 37px; letter-spacing: -1.4px; }
  .login-story-copy > p { max-width: 330px; font-size: 14px; }
  .login-story .scene-toggle { top: 8px; right: 16px; }
  .login-form-side { position: relative; z-index: 3; padding: 30px 27px 28px; border-radius: 27px 27px 0 0; overflow: hidden; background: var(--cream); }
  .login-form-side::before { content: ''; position: absolute; inset: 0 0 auto; height: 8px; background-image: var(--tartan); }
  .login-form-wrap { max-width: 430px; }
  .login-form-title, .login-form-introduction { display: none; }
  .login-form-wrap h2 { font-size: 31px; }
  .form-ornament { display: none; }
  .login-copyright { margin-top: 29px; }
}
@media (max-width: 480px) {
  .site-header { padding-inline: 20px; }
  .welcome-banner { min-height: 900px; }
  .welcome-copy { padding-inline: 23px; }
  .welcome-copy h1 { font-size: 39px; line-height: 1.04; }
  .welcome-copy p { max-width: 330px; font-size: 14px; }
  .hero-actions { flex-direction: column; gap: 9px; }
  .hero-actions .btn { width: 100%; max-width: 295px; }
  .countdown-tag { margin-top: 30px; }
  .list-section { padding: 31px 18px 35px; }
  .section-heading h2 { font-size: 28px; }
  .section-eyebrow { max-width: 290px; font-size: 11px; }
  .gifts-grid { grid-template-columns: 1fr; gap: 22px; }
  .gift-card { max-width: 430px; width: 100%; margin: 0 auto; }
  .gift-visual { aspect-ratio: 1.55; margin: 10px 12px 0; }
  .gift-owner { padding: 16px 18px 0; font-size: 14px; }
  .gift-body { padding: 12px 18px 16px; }
  .gift-title { font-size: 17px; }
  .gift-description { min-height: 0; font-size: 13px; }
  .gift-price { font-size: 17px; }
  .gift-actions { padding: 0 18px 18px; }
  .gift-actions > .btn { font-size: 14px; }
  .result-line { flex-wrap: wrap; gap: 10px; }
  .toolbar-controls { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-box { padding: 3px 11px; border: 1px solid #ddd3c0; border-radius: 7px; background: #fffcf5; }
  .search-box input { width: 100%; }
  .toolbar-controls select { width: 100%; max-width: 100%; min-height: 40px; }
  .form-row { grid-template-columns: 1fr; }
  .empty-state { padding: 30px 18px; }
  .empty-state h3 { font-size: 27px; }
  .contribution-summary { padding: 18px; }
  .contribution-summary p { font-size: 13px; }
  .contribution-summary strong { font-size: 28px; }
  .login-header { padding-inline: 20px; gap: 10px; }
  .login-header .brand { font-size: 27px; }
  .login-header .btn { padding-inline: 10px; font-size: 12px; }
  .login-form-side { padding-inline: 25px; }
  .login-form-wrap h2 { font-size: 29px; }
  .standalone-card { padding: 32px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .hero-snow, .village-3d, .scene-toggle { display: none !important; }
  .hero-art { opacity: 1 !important; }
}
