:root {
    --bg: #faf6f0;
    --surface: #ffffff;
    --ink: #2b2420;
    --muted: #7a6f66;
    --line: #e8dfd4;
    --red: #b3262e;
    --red-dark: #8f1d24;
    --green: #1f6f4a;
    --green-soft: #e6f2ea;
    --gold: #c99a2e;
    --warn-bg: #fff4dc;
    --error-bg: #fde8e8;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(43, 36, 32, .06), 0 4px 16px rgba(43, 36, 32, .05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, system-ui, sans-serif; }
h1, h2, h3, .brand { font-family: Fraunces, Georgia, serif; line-height: 1.2; }
h1 { font-size: 2rem; margin: 0 0 .25rem; }
h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0; font-family: Inter, sans-serif; font-weight: 600; }
a { color: var(--green); }
code { background: #f3ede5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.right { text-align: right; }
.ok { color: var(--green); }

.site-header { background: var(--red); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.site-header nav { display: flex; gap: 16px; align-items: center; white-space: nowrap; font-size: .95rem; }
.site-header nav a, .site-header .link-button { color: #fff; }
main.wrap { padding-top: 28px; padding-bottom: 48px; }
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: .25rem 0; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 460px; margin: 24px auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; color: var(--muted); margin: 0 0 .25rem; }
.count { font-family: Inter, sans-serif; font-size: .9rem; background: #f3ede5; border-radius: 99px; padding: 2px 10px; vertical-align: middle; }

.button { display: inline-block; background: var(--green); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: 600 1rem Inter, sans-serif; text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(1.08); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.big { padding: 14px 26px; font-size: 1.1rem; }
.button.small { padding: 6px 12px; font-size: .875rem; }
.button.secondary { background: #fff; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.button.light { background: #fff; color: var(--red); }
.button.danger { background: var(--red); }
.site-header .button.small { background: #fff; color: var(--red); }
.link-button { background: none; border: 0; padding: 0; color: var(--green); font: inherit; text-decoration: underline; cursor: pointer; }
.icon-button { background: none; border: 1px solid var(--line); border-radius: 6px; width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--muted); text-decoration: none; cursor: pointer; font-size: .95rem; }
.icon-button:disabled { opacity: .35; }
form.inline { display: inline; }

.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 200px; }
label { display: grid; gap: 4px; font-weight: 500; font-size: .95rem; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #d6cbbd; border-radius: 8px; background: #fff; width: 100%; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
select { width: auto; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.hint { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.money-input { display: flex; align-items: center; border: 1px solid #d6cbbd; border-radius: 8px; background: #fff; padding-left: 11px; }
.money-input input { border: 0; padding-left: 4px; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; display: grid; gap: 8px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash-success { background: var(--green-soft); color: #174d34; }
.flash-error { background: var(--error-bg); color: #8f1d24; }
.notice { background: var(--warn-bg); box-shadow: none; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #f0e9df; color: var(--muted); vertical-align: middle; }
.tag.accent { background: var(--red); color: #fff; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.error { background: var(--error-bg); color: var(--red); }
.tag.warn { background: var(--warn-bg); color: #8a6412; }

.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
.hero h1 em { color: var(--red); font-style: normal; }
.lead { font-size: 1.15rem; max-width: 560px; margin: 12px auto 24px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 32px; }
.step { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.step p { color: var(--muted); margin: .4rem 0 0; font-size: .95rem; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; margin-bottom: 8px; }
.big-emoji { font-size: 3rem; }

.group-list { list-style: none; padding: 0; margin: 0; }
.group-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.group-row h2 { margin-bottom: .2rem; }
.group-row h2 a { color: var(--ink); text-decoration: none; }
.group-row p { margin: .2rem 0; }

.match-banner { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.match-banner .eyebrow { color: rgba(255,255,255,.75); }
.match-name { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; margin: 0 0 12px; }
.wishlist.is-match { box-shadow: inset 0 0 0 2px var(--red), var(--shadow); }
.wishlist-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.wishlist-head h2 { margin: 0; }
.items { list-style: none; padding: 0; margin: 0 0 12px; }
.item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.item:first-child { border-top: 0; }
.item-thumb { width: 72px; height: 72px; border-radius: 8px; background: #f6f1ea; display: grid; place-items: center; overflow: hidden; font-size: 1.8rem; }
.item-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.item-body p { margin: .2rem 0 0; }
.item-body h3 a { color: var(--ink); }
.item-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 600; color: var(--green); }
.item-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.item.claimed .item-body h3 { text-decoration: line-through; text-decoration-color: var(--muted); }
.claimed-note { color: var(--green); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.add-item summary { list-style: none; display: inline-block; margin-bottom: 12px; }
.add-item summary::-webkit-details-marker { display: none; }
.add-item[open] summary { display: none; }
.settings-mini { padding: 16px 24px; }

.progress { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 20px; flex-wrap: wrap; counter-reset: step; }
.progress li { counter-increment: step; }
.progress a { display: inline-block; padding: 6px 14px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--muted); font-weight: 500; font-size: .9rem; }
.progress a::before { content: counter(step) ". "; }
.progress li.done a { color: var(--green); }
.progress li.done a::before { content: "✓ "; }
.people, .rules, .reveal { list-style: none; padding: 0; margin: 0 0 16px; }
.people li, .rules li, .reveal li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person-name { font-weight: 600; min-width: 140px; }
.people li form { margin-left: auto; }
.rules li form { margin-left: auto; }
.add-person, .add-rule { margin-top: 12px; align-items: center; }
.add-rule select { flex: 1 1 140px; }
.message-preview { white-space: pre-wrap; background: #f6f1ea; padding: 16px; border-radius: 8px; font: .95rem/1.5 Inter, sans-serif; }
details.preview summary, details.danger-zone summary { cursor: pointer; color: var(--green); margin-top: 12px; }
details.danger-zone { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
details.danger-zone summary { color: var(--red); }
.status-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.status-table th, .status-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.status-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.status-table td.right { text-align: right; }
.debug { text-align: left; white-space: pre-wrap; font-size: .75rem; overflow: auto; }
.prose p { max-width: 640px; }

@media (max-width: 560px) {
    h1 { font-size: 1.6rem; }
    .card { padding: 18px; }
    .item { grid-template-columns: 56px 1fr; }
    .item-thumb { width: 56px; height: 56px; }
    .item-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .brand { font-size: 1.05rem; }
    .status-table { font-size: .875rem; }
}
@media (max-width: 420px) {
    .brand { font-size: .95rem; }
    .site-header nav { gap: 12px; font-size: .875rem; }
}
