:root {
  color-scheme: light;
  --paper: #fffaf2;
  --ink: #29342d;
  --muted: #5c665c;
  --green: #173f32;
  --berry: #9f2f3c;
  --line: #e9ded0;
  --gold: #f6cf83;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
header, main, footer {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}
header { padding: 26px 0 22px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font: bold 1.22rem Georgia, serif;
  text-decoration: none;
}
.brand-tree {
  display: block;
  flex: 0 0 32px;
  block-size: 38px;
  perspective: 125px;
}
.tree-spin {
  position: relative;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  transform-style: preserve-3d;
  animation: tree-turn 8s linear infinite;
}
.tree-face { position: absolute; inset: 0; }
.tree-face:nth-child(2) { transform: rotateY(60deg); }
.tree-face:nth-child(3) { transform: rotateY(120deg); }
.tree-face::before, .tree-face::after { content: ''; position: absolute; }
.tree-face::before {
  inset: 0 0 5px;
  background: linear-gradient(90deg, #1c5942, #44805b 49%, #236149 51%, #133f30);
  clip-path: polygon(50% 0, 74% 38%, 65% 38%, 86% 68%, 75% 68%, 100% 100%, 0 100%, 25% 68%, 14% 68%, 35% 38%, 26% 38%);
}
.tree-face::after {
  inset: auto 42% 0;
  block-size: 6px;
  border-radius: 0 0 2px 2px;
  background: #734430;
}
.tree-face i {
  position: absolute;
  z-index: 1;
  inline-size: 3px;
  block-size: 3px;
  border-radius: 50%;
  background: currentColor;
  color: #ffe394;
  box-shadow: 0 0 5px currentColor;
  animation: tree-twinkle 2.7s ease-in-out infinite alternate;
}
.tree-face i:nth-child(1) { inset: 11px auto auto 14px; }
.tree-face i:nth-child(2) { inset: 20px auto auto 10px; color: #ff9591; animation-delay: -.7s; }
.tree-face i:nth-child(3) { inset: 23px auto auto 18px; color: #fff2be; animation-delay: -1.5s; }
.tree-face i:nth-child(4) { inset: 29px auto auto 23px; color: #ffc277; animation-delay: -2.2s; }
@keyframes tree-turn {
  from { transform: rotateY(12deg); }
  to { transform: rotateY(372deg); }
}
@keyframes tree-twinkle {
  from { opacity: .55; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tree-spin, .tree-face i { animation: none; }
}
main { flex: 1; }
footer { padding: 26px 0; color: var(--muted); font-size: .9rem; }
h1, h2, h3, p { margin: 0 0 .8rem; }
h1, h2, h3 { font-family: Georgia, serif; line-height: 1.09; }
h1 { color: var(--green); font-size: clamp(2.35rem, 6vw, 4.6rem); letter-spacing: -.055em; }
h2 { color: var(--green); font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.03em; }
h3 { font-size: 1.2rem; }
p { color: var(--muted); }
.landing { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: stretch; }
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(26px, 5vw, 56px);
  background: radial-gradient(ellipse at 50% 18%, #356c59, transparent 60%), #173f32;
  min-height: 530px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid #ffffff29;
  border-radius: 22px;
  pointer-events: none;
}
.hero h1 { color: #fff6e3; max-width: 9ch; }
.hero p { max-width: 38ch; color: #edf4de; margin: 0; }
.art { position: relative; height: 210px; width: min(300px, 100%); align-self: center; }
.star { position: absolute; color: var(--gold); font-size: 2rem; }
.s1 { top: 13%; left: 12%; }
.s2 { top: 0; right: 22%; }
.s3 { top: 39%; right: 5%; font-size: 1.35rem; }
.parcel {
  position: absolute;
  width: 112px;
  height: 95px;
  bottom: 38px;
  left: 24%;
  border-radius: 5px 5px 12px 12px;
  background: linear-gradient(90deg, transparent 43%, var(--gold) 43% 58%, transparent 58%),
    repeating-linear-gradient(145deg, #ad3846 0 14px, #ba4250 14px 27px);
  box-shadow: 9px 13px 20px #081f39a0;
  transform: rotate(-12deg);
}
.parcel::before {
  content: '';
  position: absolute;
  width: 110%;
  height: 22%;
  left: -5%;
  top: -7%;
  border-radius: 4px;
  background: linear-gradient(90deg, #c6515c 43%, var(--gold) 43% 57%, #c6515c 57%);
}
.parcel i::before, .parcel i::after {
  content: '';
  position: absolute;
  left: 21%;
  top: -32%;
  width: 29%;
  height: 27%;
  border: 5px solid var(--gold);
  border-radius: 50% 55% 0 55%;
  transform: rotate(15deg);
}
.parcel i::after { left: 49%; transform: scaleX(-1) rotate(15deg); }
.parcel.little { left: 57%; bottom: 24px; transform: rotate(12deg) scale(.69); transform-origin: bottom left; }
.card {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 25px;
  overflow-wrap: anywhere;
  box-shadow: 0 12px 28px #3820170b;
}
.create-card { display: flex; flex-direction: column; justify-content: center; }
.card + .card { margin-top: 18px; }
form { display: grid; gap: 15px; }
form:last-child, p:last-child { margin-bottom: 0; }
label { display: grid; gap: 5px; font-size: .9rem; font-weight: 650; min-width: 0; }
input, select, textarea {
  font: inherit;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid #cfc6b8;
  border-radius: 10px;
  background: #fffdfa;
}
textarea { resize: vertical; }
button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 43px;
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: white;
  background: var(--berry);
}
button:hover, .button:hover { filter: brightness(.91); }
.secondary { background: #fff7eb; color: var(--green); border-color: var(--line); }
:focus-visible { outline: 3px solid #286a54; outline-offset: 3px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.exchange-heading { margin-bottom: 24px; overflow-wrap: anywhere; }
.exchange-heading p { display: flex; gap: 8px; flex-wrap: wrap; }
.exchange-heading span, .count {
  font: 600 .9rem system-ui, sans-serif;
  background: #f2ecdf;
  color: var(--green);
  padding: 4px 9px;
  border-radius: 20px;
}
.share { display: flex; align-items: end; gap: 7px; margin: 14px 0; }
.share label { flex: 1; }
.share button { flex-shrink: 0; }
.check { display: flex; align-items: center; }
.check input { width: auto; accent-color: var(--green); }
.people, .rules { list-style: none; padding: 0; margin: 12px 0 0; }
.people li, .rules li { border-top: 1px solid var(--line); padding: 8px 0; }
.rules li { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.rules { margin-bottom: 12px; }
.celebrate { background: #edf5e8; }
.recipient { font-size: clamp(2rem, 5vw, 3.5rem); }
.gift-icon { font-size: 2.5rem; display: block; }
.wish { white-space: pre-wrap; }
progress { width: 100%; accent-color: var(--green); display: block; margin: 10px 0; }
.narrow { max-width: 580px; }
.alert { color: #7f1327; background: #ffe9ea; padding: 12px 16px; border-radius: 12px; }
@media (max-width: 760px) {
  .landing, .dashboard { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  header, main, footer { width: calc(100% - 28px); }
  .form-row { grid-template-columns: 1fr; }
  .share { align-items: stretch; flex-direction: column; }
}

/* Keep native date controls inside their grid tracks on narrow iOS screens. */
[hidden] { display: none !important; }
.landing > *, .dashboard > *, .card form, .schedule { min-inline-size: 0; }
.card input, .card select, .card textarea {
  max-inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  font-size: max(16px, 1rem);
}
.card input[type="date"] {
  display: block;
  inline-size: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.card input[type="date"]::-webkit-date-and-time-value { min-inline-size: 0; text-align: start; }
.card input[type="checkbox"] { min-block-size: auto; }
.schedule {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}
.date-fields:not(.date-range) { grid-template-columns: minmax(0, 1fr); }
.optional { color: var(--muted); font-weight: 400; }
button, .button { min-block-size: 44px; white-space: normal; overflow-wrap: anywhere; }
.rules li > span { min-inline-size: 0; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  header { padding-block: 16px; }
  .landing { gap: 16px; }
  .hero { min-height: 0; padding: 22px 24px; border-radius: 22px; }
  .hero::before { inset: 8px; border-radius: 16px; }
  .hero h1 { max-width: none; font-size: clamp(1.8rem, 6.5vw, 2.65rem); }
  .hero .art { display: none; }
}
@media (max-width: 400px) {
  .card, .hero { padding: 18px; }
  .rules li { flex-wrap: wrap; }
}
@media (max-width: 320px) {
  header, main, footer { width: calc(100% - 20px); }
  .card, .hero { padding: 14px; }
  .card input, .card select, .card textarea { padding-inline: 8px; }
}

header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
header nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: var(--green);
  font-weight: 650;
  text-underline-offset: .22em;
}
.groups-page { max-inline-size: 760px; }
.groups-page .exchange-heading { margin-block-end: 12px; }
.groups-empty { margin-block-start: 22px; }
.groups-list { display: grid; gap: 14px; list-style: none; padding: 0; margin-block: 20px 0; }
.groups-list .card + .card { margin-top: 0; }
.group-links { display: flex; flex-wrap: wrap; gap: 8px; }
.group-links a { max-inline-size: 100%; min-inline-size: 0; }
.holiday-footer {
  --holiday-color: #842b45;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
}
.holiday-footer[data-holiday-color="green"] { --holiday-color: #21634e; }
.holiday-footer[data-holiday-color="ochre"] { --holiday-color: #855511; }
.holiday-footer .footer-sparkle, .holiday-message { color: var(--holiday-color); }
.holiday-message, .footer-sparkle { position: relative; z-index: 1; }
.holiday-flurry {
  position: absolute;
  z-index: 0;
  inset: 12px 0 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--holiday-color);
}
.holiday-footer .holiday-flurry span {
  position: absolute;
  inset-block-start: 0;
  color: inherit;
  font-size: .8rem;
}
.holiday-flurry span:nth-child(1) { inset-inline-start: 2%; }
.holiday-flurry span:nth-child(2) { inset-inline-start: 16%; }
.holiday-flurry span:nth-child(3) { inset-inline-start: 32%; }
.holiday-flurry span:nth-child(4) { inset-inline-start: 49%; }
.holiday-flurry span:nth-child(5) { inset-inline-start: 70%; }
.holiday-flurry span:nth-child(6) { inset-inline-start: 90%; }
@media (prefers-reduced-motion: reduce) {
  .holiday-flurry { display: none; }
}
.holiday-message { min-inline-size: 0; min-block-size: 3.85em; margin: 0; font-weight: 700; }
.footer-support {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: var(--green);
  font-weight: 650;
  text-underline-offset: .2em;
}
.footer-support:hover { color: var(--berry); }
@media (max-width: 600px) {
  .holiday-footer { grid-template-columns: auto minmax(0, 1fr); row-gap: 0; }
  .footer-support { grid-column: 2; justify-self: start; }
}
.holiday-word { display: inline-block; white-space: nowrap; }
.holiday-letter { display: inline-block; }
.footer-sparkle, .holiday-message { padding-block-start: .64rem; }
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 400px) {
  .holiday-message { min-block-size: 5.4em; }
}

.account-action { margin-block: 16px; }
.account-action a + p { margin-block-start: 8px; }
.groups-page > form { display: block; margin-block: 12px; }
.groups-page > .button + p, .groups-page > .button + .button { margin-block-start: 12px; }
.narrow > h1 { font-size: clamp(2rem, 5vw, 3rem); }

.member-greeting {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  color: var(--green);
  overflow-wrap: anywhere;
}
.member-dashboard { grid-template-areas: "actions overview"; }
.member-actions { grid-area: actions; }
.member-overview { grid-area: overview; min-inline-size: 0; }
.member-facts { display: grid; gap: 10px; margin: 0; }
.member-facts > div {
  border-block-start: 1px solid var(--line);
  padding-block-start: 10px;
}
.member-facts dt { font-size: .85rem; color: var(--muted); }
.member-facts dd { margin: 0; font-weight: 650; }
.match-wishlist { border-block-start: 1px solid var(--line); margin-block-start: 16px; padding-block-start: 16px; }
@media (max-width: 760px) {
  .member-dashboard { grid-template-areas: "overview" "actions"; }
}

.winter-post { border-color: #ded2b7; background: #fdf8ed; }
.winter-post h2::before { content: '✧'; color: #855511; margin-inline-end: .35em; }
.note-body { padding: 12px; border-inline-start: 2px solid #b79556; background: #fffdf7; border-radius: 4px; }

.group-edit { margin-block-start: 18px; }
.group-edit summary { cursor: pointer; font-weight: 700; color: var(--green); }
.group-edit[open] summary { margin-block-end: 14px; }

.people li:has(form) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.people li span { overflow-wrap: anywhere; min-inline-size: 0; }
.people li small { color: var(--muted); }
.remove-dialog { inline-size: min(480px, calc(100% - 24px)); margin: auto; }
.remove-dialog::backdrop { background: #132b22a8; }
.remove-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.draw-review-actions a { margin-block-start: 12px; }

.profile-avatars, .profile-contacts { min-inline-size: 0; padding: 12px; margin: 0; border: 1px solid var(--line); border-radius: 12px; }
.profile-avatars legend, .profile-contacts legend { color: var(--green); font-weight: 700; }
.profile-avatars > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.profile-avatars label {
  gap: 4px;
  justify-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 4px;
  text-align: center;
  cursor: pointer;
}
.profile-avatars label:has(:checked) { background: #edf5e8; border-color: var(--green); }
.profile-avatars input { inline-size: auto; min-block-size: 0; accent-color: var(--green); }
.profile-avatars label > span { font-size: 1.4rem; }
.profile-contacts { display: grid; gap: 8px; }
.profile-contacts p { margin: 0; }
.profile-directory li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; }
.profile-directory dl, .profile-directory dd { margin: 0; }
.profile-directory dt { font-size: .82rem; color: var(--muted); }
