/* Potluck, "Sunday dinner": bottle green and mustard on linen, a gingham tablecloth strip, Fraunces headings and
   Atkinson Hyperlegible (made for low-vision readers) for everything else. Big type, big tap targets. */
@font-face { font-family: 'Atkinson'; src: url(/fonts/atkinson-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url(/fonts/atkinson-700.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
:root {
  --bg: #f6f1e6; --card: #fffdf7; --ink: #1f2b24; --muted: #5d685f; --line: #e2d9c5; --soft: #efe8d8;
  --accent: #1f5c45; --accent-ink: #fffdf7; --accent-soft: #e2ede5; --accent-2: #174633;
  --gold: #c9922a; --gold-ink: #7a5410; --gold-soft: #f8ebcc; --tomato: #b9432b; --tomato-soft: #f7e0d8;
  --check: rgba(31, 92, 69, 0.13); --shadow: 0 1px 2px rgba(40, 30, 10, 0.06), 0 4px 14px rgba(40, 30, 10, 0.06);
  --focus: #1b6fc0; --radius: 16px;
  --serif: 'Fraunces', ui-serif, Georgia, serif; --sans: 'Atkinson', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121815; --card: #1b241f; --ink: #edf0e6; --muted: #b3bdb2; --line: #2f3b34; --soft: #222d27;
    --accent: #7cc39d; --accent-ink: #10180f; --accent-soft: #1f3529; --accent-2: #9ad4b4;
    --gold: #e0b14f; --gold-ink: #f0cd7c; --gold-soft: #3a2f17; --tomato: #ee8a72; --tomato-soft: #3d2219;
    --check: rgba(124, 195, 157, 0.14); --shadow: none; --focus: #7fb8ec; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 19px/1.5 var(--sans); }
/* the tablecloth: a gingham strip along the top of every page */
body::before { content: ''; display: block; height: 10px; padding-top: env(safe-area-inset-top);
  background: linear-gradient(90deg, var(--check) 50%, transparent 0) 0 0 / 20px 20px, linear-gradient(var(--check) 50%, transparent 0) 0 0 / 20px 20px, var(--accent-soft);
  background-clip: content-box, content-box, content-box; }
body.noscroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: 32px; } h2 { font-size: 24px; } h3 { font-size: 21px; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-underline-offset: 3px; }
small { font-size: 15px; color: var(--muted); font-weight: 400; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ico { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.top { display: flex; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)); max-width: 760px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 700 25px var(--serif); color: var(--accent); text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.back { font-size: 24px; text-decoration: none; color: var(--ink); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.wrap { max-width: 760px; margin: 0 auto; padding: 6px max(16px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.loading, .empty { color: var(--muted); }
section { margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 20px; border-radius: 999px;
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 700 18px var(--sans); text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.big { min-height: 58px; font-size: 19px; padding: 12px 26px; }
.btn.small { min-height: 44px; font-size: 16px; padding: 6px 16px; }
.btn.danger { border-color: var(--tomato); color: var(--tomato); }
.btn:disabled { opacity: 0.55; cursor: default; }
@media (hover: hover) { .btn:hover { background: var(--accent-2); border-color: var(--accent-2); } .btn.ghost:hover { background: var(--accent-soft); } .btn.danger:hover { background: var(--tomato-soft); border-color: var(--tomato); } }
.link { background: none; border: none; color: var(--accent); font: 700 17px var(--sans); text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; cursor: pointer; min-height: 44px; }

/* home */
.hero { display: grid; gap: 10px; padding: 18px 0 6px; }
.hero img { width: 76px; height: 76px; border-radius: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: 42px; margin: 6px 0 2px; }
.hero p { font-size: 20px; color: var(--muted); max-width: 32em; }
.hero .btn { justify-self: start; }
.sample { position: relative; padding: 16px 18px 6px; }
.sample::before { content: 'Example'; position: absolute; top: -11px; left: 16px; background: var(--gold-soft); color: var(--gold-ink); font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 10px; border-radius: 999px; }
.evlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.evlist a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.evlist a > span:first-child { display: grid; }
.evlist small { font-size: 16px; }
.evlist em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; }
.evlist.past a { opacity: 0.7; }
.how ol { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 12px; }
.how li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; }
.how li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 20px var(--serif); display: grid; place-items: center; }
.foot { color: var(--muted); font-size: 15px; margin-top: 30px; text-align: center; }

/* forms */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; border: none; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 700; padding: 0; }
.field.narrow input { max-width: 170px; }
.help { color: var(--muted); font-size: 16px; margin: 0; }
input, select, textarea { font: 19px var(--sans); color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; width: 100%; min-height: 52px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.row3 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row3 input { min-width: 0; padding-left: 10px; padding-right: 8px; }
/* Safari (iPhone) gives date and time boxes their own width and ignores width: 100%, so two side by side overlap.
   Without the native look they size like any other box; the picker still opens on tap. */
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font-size: 17px; }
.chip.big span { min-height: 54px; padding: 10px 20px; font-weight: 700; }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.chip input:checked + span::before { content: ''; width: 9px; height: 15px; border: solid var(--accent); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-2px, -2px); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.tagchip input:checked + span { border-color: var(--gold); background: var(--gold-soft); }
.tagchip input:checked + span::before { border-color: var(--gold-ink); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; } .check input { width: 24px; min-height: 24px; height: 24px; accent-color: var(--accent); }
.slot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto 44px; gap: 8px; align-items: center; margin-bottom: 10px; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 46px; height: 48px; border: none; background: none; font-size: 24px; color: var(--accent); cursor: pointer; }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }
.x { width: 44px; height: 44px; border: none; background: var(--soft); border-radius: 50%; font-size: 24px; color: var(--muted); cursor: pointer; }
.slotbtns, .actions, .headbtns, .rsvpbtns, .hostbtns { display: flex; flex-wrap: wrap; gap: 10px; }
.err { color: var(--tomato); font-weight: 700; margin: 0; }
.err:empty { display: none; }
.made h1 { font-size: 30px; }
.made .linkbox { font: 700 17px var(--sans); background: var(--soft); border: 2px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; word-break: break-all; }
.made .linkbox.small { font-size: 14px; font-weight: 400; }
.made h2 { margin-top: 24px; }
.made .ok { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.made .ok .ico { width: 30px; height: 30px; stroke-width: 3; }

/* the event */
.evhead .kind { display: inline-block; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; font-weight: 700; color: var(--gold-ink); background: var(--gold-soft); padding: 3px 12px; border-radius: 999px; margin-bottom: 10px; }
.evhead h1 { font-size: 34px; margin-bottom: 14px; }
.facts { display: grid; gap: 8px; margin-bottom: 14px; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact .ico { color: var(--accent); margin-top: 4px; }
.fact b { display: block; }
.fact a { font-weight: 700; }
.evnote { white-space: pre-wrap; background: var(--soft); padding: 12px 14px; border-radius: 12px; border-left: 4px solid var(--gold); }
.rsvp h2 { margin-bottom: 12px; }
.rsvp .mine { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; }
.rsvp .mine .badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.people { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
.people > ul { display: none; list-style: none; padding: 0; margin: 4px 0 0; }
.people.open > ul { display: block; }
.people li { padding: 8px 0; border-top: 1px solid var(--line); } .people li span { color: var(--muted); }
.allergies { margin-top: 12px; padding: 12px 14px; background: var(--tomato-soft); border-radius: 12px; font-size: 17px; display: flex; gap: 10px; }
.allergies .ico { color: var(--tomato); margin-top: 3px; } .allergies span { color: var(--muted); }
.hostbox { border: 2px solid var(--accent); }
.hostbox h2 { font-size: 21px; display: flex; align-items: center; gap: 8px; }
.news { background: var(--accent-soft); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.news h3 { font: 700 18px var(--sans); }
.news ul { margin: 0 0 10px; padding-left: 20px; }
.hostbtns { margin-bottom: 10px; }
.pill { display: inline-block; background: var(--gold); color: #1f1606; font: 700 13px var(--sans); border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
.list > h2 { margin: 6px 0 14px; font-size: 27px; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); }
.list .cat + .cat { margin-top: 14px; }
.cathead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.cathead h3 { margin: 0; }
.meter { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.meter i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); }
.meter i.on { background: var(--accent); }
.hint { font: 700 15px var(--sans); margin: 0 0 12px; }
.hint.short { color: var(--gold-ink); } .hint.ok, .hint.plenty { color: var(--accent); }
.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.slab { font-size: 15px; color: var(--muted); margin: 0 0 4px 4px; font-weight: 700; }
.dish { background: var(--bg); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 12px; padding: 12px 14px; }
.dish.mine { border-left-color: var(--gold); background: var(--gold-soft); }
.dtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.what { font-size: 20px; }
.who { color: var(--muted); font-size: 16px; }
.dnote { font-size: 16px; margin-top: 6px; color: var(--muted); }
.dnote::before { content: '\201C'; } .dnote::after { content: '\201D'; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag.t-nuts, .tag.t-spicy { background: var(--tomato-soft); color: var(--tomato); }
.tag.plain { background: var(--soft); color: var(--muted); }
.dfoot { display: flex; justify-content: flex-end; margin: 0 -2px -8px; }
.open { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 10px 10px 10px 16px; border: 2px dashed var(--gold);
  border-radius: 12px; background: transparent; color: var(--ink); font: 17px var(--sans); text-align: left; cursor: pointer; }
.open em { font-style: normal; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
@media (hover: hover) { .open:hover { background: var(--gold-soft); } }
.add { width: 100%; margin-top: 16px; }

/* sheets: title and close at the top, the main button pinned at the bottom */
#sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
#sheet .scrim { position: absolute; inset: 0; background: rgba(15, 22, 18, 0.5); animation: fade 0.2s; }
#sheet .panel { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; animation: up 0.22s ease-out; }
.sheethead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
.sheethead h2 { margin: 0; font-size: 23px; }
.close { width: 44px; height: 44px; flex: none; border: none; border-radius: 50%; background: var(--soft); color: var(--ink); font-size: 26px; cursor: pointer; }
.sheetbody { overflow: auto; padding: 16px max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); display: grid; gap: 18px; overscroll-behavior: contain; }
.sheetbody > .btn { width: 100%; }
.sheetfoot { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--card); }
.sheetfoot .btn.big { flex: 1 1 200px; }
.sheetfoot:empty { display: none; }
@media (min-width: 700px) and (min-height: 600px) { #sheet { align-items: center; } #sheet .panel { border-radius: 22px; overflow: hidden; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.party { display: flex; gap: 18px; flex-wrap: wrap; }
[data-party][hidden] { display: none; }
.count { display: flex; align-items: center; gap: 10px; font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 160%); background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 999px; font-weight: 700; max-width: calc(100% - 32px); transition: transform 0.25s; z-index: 20; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
#toast.on { transform: translate(-50%, 0); }
.msgpage { padding-top: 40px; }

@media (max-width: 520px) {
  h1 { font-size: 28px; } .hero h1 { font-size: 36px; } .evhead h1 { font-size: 29px; }
  .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .row3 .field:first-child { grid-column: 1 / -1; }
  .slot { grid-template-columns: minmax(0, 1fr) auto 44px; } .slot input { grid-column: 1 / -1; grid-row: 2; }
  .headbtns .btn, .rsvpbtns .btn { flex: 1 1 auto; }
  .card, .cat { padding: 18px 14px; }
}
@media (prefers-reduced-motion: reduce) { #toast, .btn { transition: none; } #sheet .panel, #sheet .scrim { animation: none; } }
