:root {
  --bg: #fbf6ec;
  --surface: #ffffff;
  --surface-2: #f4ecdc;
  --ink: #2b2118;
  --ink-soft: #6b5d4f;
  --line: #e6dac4;
  --brand: #a3283a;      /* cranberry */
  --brand-ink: #ffffff;
  --brand-soft: #f6e1e3;
  --sage: #5f7d5c;
  --sage-soft: #e3ece1;
  --gold: #b97a1d;
  --gold-soft: #f7ead2;
  --danger: #a3283a;
  --shadow: 0 1px 2px rgba(43, 33, 24, .06), 0 4px 16px rgba(43, 33, 24, .06);
  --radius: 14px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1713; --surface: #26201a; --surface-2: #2f2720; --ink: #f3ebde; --ink-soft: #bfae99;
    --line: #3d3329; --brand: #e0667a; --brand-ink: #1c1713; --brand-soft: #3d2328;
    --sage: #9cbf98; --sage-soft: #26332a; --gold: #e2ab55; --gold-soft: #3a2f1e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1713; --surface: #26201a; --surface-2: #2f2720; --ink: #f3ebde; --ink-soft: #bfae99;
  --line: #3d3329; --brand: #e0667a; --brand-ink: #1c1713; --brand-soft: #3d2328;
  --sage: #9cbf98; --sage-soft: #26332a; --gold: #e2ab55; --gold-soft: #3a2f1e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font-body);
}
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; font-weight: 650; }
h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* gingham strip */
.gingham {
  height: 10px;
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--brand) 55%, transparent) 0 10px, transparent 10px 20px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--brand) 35%, transparent) 0 5px, transparent 5px 10px);
  background-color: var(--brand-soft);
}

.topbar { padding: 14px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.logo span { color: var(--brand); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 0 0 16px;
}
.card.tint { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.card.host { background: var(--sage-soft); border-color: color-mix(in srgb, var(--sage) 40%, var(--line)); }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 4px; }
input[type=text], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px;
}
.field { margin: 0 0 12px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 480px) { .row, .row3 { grid-template-columns: 1fr 1fr; } .row3 > :first-child { grid-column: 1 / -1; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 650; border-radius: 999px; border: 1px solid transparent;
  padding: 10px 18px; min-height: 44px; cursor: pointer; text-decoration: none;
  background: var(--brand); color: var(--brand-ink);
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.sage { background: var(--sage); color: #fff; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .875rem; }
.btn.link { background: none; border: 0; color: var(--ink-soft); padding: 4px 6px; min-height: 0; font-weight: 500; text-decoration: underline; }
.btn.block { width: 100%; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 550; font-size: .925rem;
}
.choice input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); }

/* landing */
.hero { padding: 28px 0 8px; }
.hero p.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.points { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 20px 0 28px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.point b { display: block; font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 2px; }
.occasions .choice span { padding: 10px 16px; }

/* event page */
.event-head { padding: 18px 0 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-soft); margin: 4px 0 10px; }
.meta strong { color: var(--ink); font-weight: 600; }
.note { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat .n { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: .8rem; color: var(--ink-soft); }

.tabs { display: flex; gap: 6px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; margin-bottom: 4px; }
.tab {
  flex: 1; font: inherit; font-weight: 650; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 999px; padding: 9px 6px; min-height: 44px; cursor: pointer; font-size: .95rem;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab .badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: 4px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; }

.group h3 { margin: 18px 0 8px; color: var(--ink-soft); font-family: var(--font-body); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.item.open { border-style: dashed; }
.item.claimed { background: var(--sage-soft); border-color: color-mix(in srgb, var(--sage) 35%, var(--line)); }
.item.mine { box-shadow: inset 4px 0 0 var(--sage); }
.item .what { min-width: 0; flex: 1; }
.item .label { font-weight: 650; }
.item .by { font-size: .9rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.item .actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); margin-left: 4px; }
.claim-form { background: var(--surface-2); border-radius: 12px; padding: 12px; margin: -2px 0 10px; }

.household { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.household:last-child { border-bottom: 0; }
.pill { font-size: .78rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; }
.pill.yes { background: var(--sage-soft); color: var(--sage); }
.pill.maybe { background: var(--gold-soft); color: var(--gold); }
.pill.no { background: var(--surface-2); color: var(--ink-soft); }

.sharebox { display: flex; gap: 8px; }
.sharebox input { flex: 1; min-width: 0; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}
.error { color: var(--danger); font-weight: 600; }
footer { padding: 30px 0 40px; text-align: center; color: var(--ink-soft); font-size: .875rem; }
details summary { cursor: pointer; font-weight: 650; }
