:root {
  color-scheme: light;
  --bg: #f7f2e8;
  --card: #fffdf8;
  --ink: #22201c;
  --muted: #6a645a;
  --line: #e2d9c8;
  --green: #1f5c45;
  --green-dark: #17462f;
  --red: #b3372a;
  --gold: #f3e3b3;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { max-width: 580px; margin: 0 auto; padding: 8px 16px 64px; }
.top { max-width: 580px; margin: 0 auto; padding: 14px 16px 6px; display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--green); text-decoration: none; letter-spacing: .01em; }
.brand::before { content: ""; display: inline-block; width: 26px; height: 26px; margin-right: 8px; vertical-align: -5px; background: url(/static/icon.svg) center/contain no-repeat; }

h1 { font-size: 1.7rem; line-height: 1.2; margin: 14px 0 4px; text-wrap: balance; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
h3 { font-size: 1.08rem; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--green); }
.lead { font-size: 1.1rem; }
.meta { color: var(--muted); margin-bottom: 14px; }
.hint, .optional { color: var(--muted); font-size: .92rem; }
.optional { font-weight: 400; }
.back { margin: 6px 0 0; font-size: .95rem; }
.empty { color: var(--muted); font-style: italic; }
.quote { border-left: 4px solid var(--gold); padding: 4px 0 4px 12px; white-space: pre-line; }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 16px 0; }
.card > :last-child, .card form > :last-child { margin-bottom: 0; }
.card-link { text-decoration: none; color: inherit; }
.card-link .go { color: var(--green); font-weight: 600; }
/* Feedback after every button: pinned to the bottom of the screen so it is seen wherever the page is scrolled. */
.flash {
  position: fixed; z-index: 10; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 556px; margin: 0 auto; padding: 14px 16px; border-radius: var(--radius);
  font-weight: 700; color: #fff; background: var(--red); box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  animation: rise .25s ease-out;
}
.flash.ok { background: var(--green-dark); }
.flash.gone { opacity: 0; transition: opacity .4s; pointer-events: none; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
section[id] { scroll-margin-top: 12px; }

.santa { background: var(--green); color: #fff; border-color: var(--green); }
.santa .hint, .santa .empty { color: #d5e6dc; }
.santa a { color: #fff; }
.santa .quote { border-color: #6fa58b; }
.santa .wish { background: rgba(255, 255, 255, .1); border-color: transparent; }
.santa .note { color: #d5e6dc; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; margin-bottom: 2px; opacity: .85; }
.receiver { font-size: 2.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 8px; overflow-wrap: anywhere; }
.waiting { background: var(--gold); border-color: #e6d294; }

label { display: block; font-weight: 600; margin: 0; }
input, textarea, select {
  display: block; width: 100%; margin: 6px 0 16px; padding: 12px;
  font: inherit; color: inherit; background: #fff;
  border: 2px solid #cfc5b1; border-radius: 10px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); }
input.code { font-size: 2rem; letter-spacing: .4em; text-align: center; max-width: 220px; }
input.share { font-size: .9rem; color: var(--muted); }
input + .hint, textarea + .hint { margin-top: -8px; }
textarea { resize: vertical; }

button, .button {
  display: block; width: 100%; min-height: 54px; padding: 12px 18px; margin: 0 0 12px;
  font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
  color: #fff; background: var(--green); border: 2px solid var(--green); border-radius: 12px;
}
.button { display: flex; align-items: center; justify-content: center; }
button:hover, .button:hover { background: var(--green-dark); border-color: var(--green-dark); }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #e0a526; outline-offset: 2px; }
.secondary { background: transparent; color: var(--green); }
.secondary:hover { background: #e8f0ea; }
.danger { background: transparent; color: var(--red); border-color: var(--red); }
.danger:hover { background: #f8e6e3; border-color: var(--red); }
button.small { width: auto; min-height: 44px; padding: 8px 14px; margin: 0; }
button.link {
  display: inline; width: auto; min-height: 0; padding: 6px 2px; margin: 0;
  background: none; border: 0; color: var(--green); font-weight: 600; text-decoration: underline;
}
button.link:hover { background: none; }
.danger-link { color: var(--red) !important; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.top form { margin: 0; }

.choices { display: grid; gap: 10px; margin: 8px 0 18px; }
.choices.inline { grid-template-columns: 1fr 1fr; }
.choice { margin: 0; font-weight: 600; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: block; padding: 14px; border: 2px solid #cfc5b1; border-radius: 12px; background: #fff; }
.choice input:checked + span { border-color: var(--green); background: #e8f0ea; box-shadow: inset 0 0 0 1px var(--green); }
.choice input:focus-visible + span { outline: 3px solid #e0a526; outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 16px; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--green); }

.wishes, .roster { list-style: none; margin: 0 0 14px; padding: 0; }
.wish { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: #eee; }
.wish-text { flex: 1 1 60%; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.note { color: var(--muted); font-size: .95rem; }
.wish-actions { flex: 1 1 100%; display: flex; gap: 14px; align-items: center; justify-content: flex-end; }
.wish-actions form { margin: 0; }
.edit { font-weight: 600; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #ece5d6; color: #4d473d; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.tag.ok, .tag.mine { background: #d9eadf; color: var(--green-dark); }
.tag.warn { background: #f6e0c2; color: #7a4a05; }

.roster { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.roster li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.roster li:first-child { border-top: 0; }
.who { flex: 1 1 auto; font-weight: 600; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 12px; }
.row-actions form { margin: 0; }

.rowform { flex: 1 1 100%; }
.rowform > summary { cursor: pointer; color: var(--green); font-size: .92rem; font-weight: 600; padding: 4px 0; }
.rowform[open] { padding: 4px 0 2px; }
.rowform form { margin-top: 10px; }
.rowform button { min-height: 46px; margin-bottom: 0; }
.rowform > summary { text-align: right; }
details.add { margin: 4px 0 14px; }
details.add > summary { cursor: pointer; font-weight: 700; color: var(--green); padding: 12px 0; list-style: none; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 8px; }
.addwish { margin-top: 16px; padding: 14px; border-radius: 12px; background: #f1ecdf; }
.addwish button { margin-bottom: 0; }
details.more { margin: -6px 0 14px; }
details.more > summary { cursor: pointer; color: var(--green); font-weight: 600; font-size: .95rem; padding: 6px 0; }
details.more[open] > summary { margin-bottom: 8px; }
.persona { margin: 28px 0 -4px; padding-top: 16px; border-top: 2px solid var(--line); font-size: 1.4rem; }
.child + .child { border-top: 1px solid var(--line); margin-top: 16px; }
/* Kids' wishes: action buttons sit beside the text instead of on their own row. */
.kids .child h3 { margin: 12px 0 8px; }
.kids .wish { align-items: center; padding: 10px 12px; margin-bottom: 6px; flex-wrap: nowrap; }
.kids .wish-actions { flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 4px; }
.kids .thumb { width: 44px; height: 44px; }
.kids details.add { margin: 0 0 4px; }
.kids details.add > summary { padding: 6px 0; }
footer { max-width: 580px; margin: -40px auto 0; padding: 0 16px 40px; font-size: .95rem; }
footer a { color: var(--muted); }
