:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f3ede2;
  --text: #2a2622;
  --muted: #776e64;
  --border: #e6ddcf;
  --primary: #2f5d50;
  --primary-ink: #ffffff;
  --accent: #c0563f;
  --gold: #c99a3a;
  --ok: #3f7d4e;
  --ok-bg: #e5f1e7;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 6px 20px rgba(40, 30, 20, .06);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171513; --surface: #211e1b; --surface-2: #2a2622; --text: #f1ebe2; --muted: #a89e92;
    --border: #3a342e; --primary: #7fb8a4; --primary-ink: #10201b; --accent: #e58a72; --gold: #e0b660;
    --ok: #8fcf9d; --ok-bg: #1f3325; --danger: #f2877e; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* buttons & inputs */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; padding: .62em 1.15em; font: 600 .95rem var(--font);
  cursor: pointer; background: var(--primary); color: var(--primary-ink); text-decoration: none; display: inline-flex;
  align-items: center; gap: .45em; transition: transform .08s, opacity .15s, background .15s; white-space: nowrap;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn.sm { padding: .4em .85em; font-size: .85rem; }
.btn.accent { background: var(--accent); color: #fff; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .3em; }
.field { margin-bottom: 14px; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: .65em .8em; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; border-color: var(--primary); }
.check { display: flex; gap: .6em; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: .3em; accent-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }

/* hero */
.hero { padding: 40px 0 24px; }
.hero-img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin-bottom: 24px; box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; display: flex; gap: .8em; flex-wrap: wrap; }
.hero .desc { max-width: 720px; font-size: 1.05rem; }

/* toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 0 20px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .35em .9em; font: 500 .88rem var(--font); cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* gift cards */
.cat-title { margin: 22px 0 12px; font-size: 1.3rem; }
.gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative; }
.card .img { aspect-ratio: 1 / 1; background: #fff; display: grid; place-items: center; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card .img .ph { font-size: 3rem; opacity: .4; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card .price { font-weight: 700; }
.card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.card.done .img img { filter: grayscale(.7); opacity: .55; }
.ribbon { position: absolute; z-index: 2; top: 12px; left: 12px; background: var(--ok); color: #fff; font-weight: 700; font-size: .8rem; padding: .3em .75em; border-radius: 999px; box-shadow: var(--shadow); }
.ribbon.partial { background: var(--gold); color: #2a2208; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 99px; }
.card.done .bar > i { background: var(--ok); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 15, 10, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal header { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal header img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #fff; }
.modal .content { padding: 20px; }
.modal .close { margin-left: auto; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
@keyframes fade { from { opacity: 0 } }
.choice { display: grid; gap: 10px; margin-bottom: 16px; }
.choice label { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 500; margin: 0; }
.choice label:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.choice input { accent-color: var(--primary); margin-top: .3em; }
.money { position: relative; }
.money span { position: absolute; left: .8em; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money input { padding-left: 3.4em; }
.error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: .7em .9em; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; }
.thanks { text-align: left; }
.thanks .big { font-size: 2.6rem; text-align: center; }
.pay { display: grid; gap: 8px; margin-top: 16px; }
.pay div { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: .55em .8em; }
.pay b { white-space: pre-line; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; overflow-wrap: anywhere; }

footer.site { padding: 30px 0 50px; text-align: center; color: var(--muted); font-size: .85rem; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* event list */
.events { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); padding-bottom: 40px; }
.event-card { text-decoration: none; color: inherit; }
.event-card .img { aspect-ratio: 16/9; background: var(--surface-2); }
.event-card .img img { object-fit: cover; padding: 0; }

/* admin */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.topbar .brand { font-family: var(--display); font-weight: 600; font-size: 1.2rem; text-decoration: none; color: var(--text); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 16px 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: 600 .95rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.list-item { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.list-item .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; background: #fff; flex: none; border: 1px solid var(--border); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15em .6em; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--gold) 22%, transparent); color: color-mix(in srgb, var(--gold) 60%, var(--text)); }
table.contribs { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.contribs td, table.contribs th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.img-edit { display: flex; gap: 14px; align-items: center; }
.img-edit img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .7em 1.2em; border-radius: 999px; z-index: 99; font-weight: 600; box-shadow: var(--shadow); }
.ph-list { font-size: .82rem; color: var(--muted); }
.ph-list code { background: var(--surface-2); padding: .05em .35em; border-radius: 5px; cursor: pointer; }
@media (max-width: 600px) {
  .list-item { flex-wrap: wrap; }
  .hero { padding-top: 24px; }
}

/* =====================================================================
   Christmas theme – painterly, naive gouache look: peach paper, confetti,
   gold stars, striped baubles, bold reds and greens.
   ===================================================================== */
body.theme-christmas {
  --bg: #f7e3d7;
  --surface: #fffaf4;
  --surface-2: #f6e9de;
  --text: #3a2320;
  --muted: #8a6a60;
  --border: #ecd3c4;
  --primary: #d4433a;
  --primary-ink: #ffffff;
  --accent: #2f7a45;
  --gold: #d9a52b;
  --ok: #2f7a45;
  --ok-bg: #dcefdc;
  --shadow: 0 2px 0 rgba(120, 60, 40, .08), 0 10px 24px rgba(150, 80, 50, .12);
  --display: "Caveat Brush", "Fraunces", Georgia, cursive;
  color-scheme: light;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, #e2574b 2.2px, transparent 2.8px),
    radial-gradient(circle, #4fae74 2px, transparent 2.6px),
    radial-gradient(circle, #6f9fe0 2px, transparent 2.6px),
    radial-gradient(circle, #f0b93a 2.2px, transparent 2.8px),
    radial-gradient(circle, #ec8fc0 1.8px, transparent 2.4px),
    radial-gradient(circle, #9fd0e8 1.6px, transparent 2.2px);
  background-size: 97px 89px, 131px 113px, 71px 83px, 157px 139px, 109px 61px, 83px 127px;
  background-position: 10px 20px, 40px 70px, 60px 15px, 90px 100px, 25px 45px, 5px 5px;
  background-attachment: fixed;
}
body.theme-christmas h1 { font-size: clamp(2.8rem, 8vw, 4.6rem); color: #b8302a; font-weight: 400; letter-spacing: 0; line-height: 1; }
body.theme-christmas h2, body.theme-christmas h3 { font-weight: 400; letter-spacing: 0; }
body.theme-christmas .cat-title { font-size: 2.1rem; color: var(--accent); }
body.theme-christmas .card h3 { font-family: var(--font); font-weight: 700; font-size: 1.02rem; }
body.theme-christmas .modal h3 { font-size: 1.6rem; }
body.theme-christmas .eyebrow { color: var(--accent); }
body.theme-christmas .hero { position: relative; padding-top: 56px; }
body.theme-christmas .hero > *:not(.deco) { position: relative; z-index: 1; }
body.theme-christmas .hero .desc { background: color-mix(in srgb, var(--surface) 82%, transparent); border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow); }
body.theme-christmas .toolbar { background: transparent; backdrop-filter: blur(6px); }
body.theme-christmas .chip { border-width: 2px; font-weight: 600; }
body.theme-christmas .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* cards: colourful hand-made frames, slightly tilted */
body.theme-christmas .card { border-width: 3px; border-radius: 22px; transition: transform .2s, box-shadow .2s; }
body.theme-christmas .gifts .card:nth-child(4n+1) { border-color: #f2a7c3; transform: rotate(-.7deg); }
body.theme-christmas .gifts .card:nth-child(4n+2) { border-color: #8cc59a; transform: rotate(.5deg); }
body.theme-christmas .gifts .card:nth-child(4n+3) { border-color: #94b8ea; transform: rotate(-.4deg); }
body.theme-christmas .gifts .card:nth-child(4n+4) { border-color: #f3cf6b; transform: rotate(.7deg); }
body.theme-christmas .gifts .card:hover { transform: rotate(0) translateY(-3px); box-shadow: 0 16px 30px rgba(150, 80, 50, .18); }
body.theme-christmas .card .img { background: #fff; }
body.theme-christmas .ribbon { background: var(--ok); transform: rotate(-4deg); }
body.theme-christmas .ribbon.partial { background: var(--gold); }
body.theme-christmas .bar { height: 10px; background: #f3dccf; }
body.theme-christmas .bar > i { background: repeating-linear-gradient(-45deg, #d4433a 0 7px, #f08b80 7px 14px); }
body.theme-christmas .card.done .bar > i { background: repeating-linear-gradient(-45deg, #2f7a45 0 7px, #6db383 7px 14px); }
body.theme-christmas .btn:not(.ghost):not(.danger) { box-shadow: 0 3px 0 #a52f28; }
body.theme-christmas .btn.ghost { background: var(--surface); }
body.theme-christmas .modal { border: 3px solid #f2a7c3; border-radius: 24px; }
body.theme-christmas footer.site { color: var(--text); }

/* decorations */
.deco { position: absolute; pointer-events: none; z-index: 0; }
.deco svg { display: block; width: 100%; height: 100%; }
.deco.d1 { width: 46px; height: 46px; top: 14px; right: 6%; transform: rotate(12deg); }
.deco.d2 { width: 70px; height: 92px; top: -6px; right: 17%; animation: swing 4s ease-in-out infinite; transform-origin: 50% 0; }
.deco.d3 { width: 84px; height: 110px; top: 70px; right: 2%; }
.deco.d4 { width: 30px; height: 30px; top: 150px; right: 22%; transform: rotate(-10deg); }
.deco.d5 { width: 56px; height: 76px; top: -4px; left: 46%; animation: swing 5s ease-in-out infinite; transform-origin: 50% 0; }
.deco.d6 { width: 36px; height: 36px; top: 24px; left: 30%; }
@keyframes swing { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }
@media (prefers-reduced-motion: reduce) { .deco { animation: none !important; } }
@media (max-width: 700px) {
  .deco.d3, .deco.d4, .deco.d6 { display: none; }
  .deco.d2 { right: 4%; width: 52px; height: 70px; }
  .deco.d5 { left: auto; right: 22%; width: 44px; height: 60px; }
  .deco.d1 { top: 14px; right: 42%; width: 34px; height: 34px; }
  .toolbar { position: static; }
}

/* QR bill */
.qr-box { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding: 14px; background: var(--surface-2); border-radius: 14px; }
.qr-box .qr-img { width: 170px; flex: none; background: #fff; border-radius: 8px; padding: 4px; }
.qr-box .qr-img svg { width: 100%; height: auto; display: block; }
.qr-box p { margin: .3em 0 .6em; }
@media (max-width: 480px) { .qr-box { flex-direction: column; text-align: center; } .qr-box .qr-img { width: 200px; } }

/* language switch */
.lang-switch { position: absolute; top: 12px; left: 16px; z-index: 20; display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.lang-switch button { border: 0; background: none; color: var(--muted); font: 700 .78rem var(--font); padding: .35em .75em; border-radius: 999px; cursor: pointer; letter-spacing: .04em; }
.lang-switch button.on { background: var(--text); color: var(--bg); }
body.theme-christmas .lang-switch button.on { background: var(--primary); color: #fff; }
