:root {
  --paper: #fbf6ee;
  --card: #fffdf9;
  --ink: #2e2722;
  --ink-soft: #6b5f55;
  --ink-faint: #a3968a;
  --line: #e9dfd1;
  --accent: #c2603a;
  --accent-ink: #fff8f2;
  --accent-soft: #f6e3d8;
  --sage: #6f7f62;
  --sage-soft: #e7ecdf;
  --danger: #a8432f;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -12px rgba(60, 40, 20, .18);
  --radius: 18px;
  --head: "Poppins", system-ui, sans-serif;
  --body: "Merriweather Sans", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 40px 16px 80px; }

h1, h2, h3, .head { font-family: var(--head); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 17px; }
p { margin: 0; }

.kicker {
  font-family: var(--head); font-size: 12px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.lede { color: var(--ink-soft); margin-top: 12px; font-size: 16px; }
/* the personal note: reads like a card tucked into an invite */
.note {
  position: relative; display: grid; gap: 14px;
  max-width: 30em; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 30px 24px 26px;
  font-size: 16px; line-height: 1.7; color: var(--ink);
  box-shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 14px 28px -18px rgba(60, 40, 20, .35);
  transform: rotate(-.6deg);
}
.note::before { /* a strip of washi tape holding the note */
  content: ""; position: absolute; top: -11px; left: 50%; width: 92px; height: 22px;
  transform: translateX(-50%) rotate(2deg);
  background: var(--accent-soft); opacity: .9; border-radius: 2px;
}
.note-hi { font-family: var(--head); font-weight: 500; font-size: 17px; }
.note strong { font-weight: 700; color: var(--accent); }
.note-sign { font-style: italic; color: var(--ink-soft); text-align: right; margin-top: 4px; }
.how { text-align: center; padding: 34px 8px 28px; }
.how > p { font-family: var(--head); font-weight: 500; font-size: 18px; line-height: 1.4; max-width: 22em; margin: 0 auto; text-wrap: balance; }
@media (prefers-reduced-motion: no-preference) { .note { transition: transform .3s ease; } .note:hover { transform: rotate(0deg); } }
.warn { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; display: grid; gap: 10px; }
.where { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-soft); font-size: 14px; margin-top: 14px; }

.hero { text-align: center; padding: 8px 4px 36px; }
.hero .ornament { color: var(--accent); font-size: 18px; letter-spacing: .5em; margin-top: 22px; opacity: .7; }

/* ─── cards ─── */
.stack { display: grid; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.lunch { text-align: center; }
.lunch .date { font-family: var(--head); font-weight: 600; font-size: 21px; }
.lunch .time { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.rule { border: 0; border-top: 1px dashed var(--line); margin: 18px auto; width: 60%; }
.menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.menu li { font-size: 15.5px; }
.menu li::before { content: none; }
.lunch .note { font-style: italic; color: var(--ink-soft); font-size: 14px; margin-top: 14px; }
.lunch .actions { margin-top: 20px; }
.lunch.taken { opacity: .62; box-shadow: none; }
.lunch.yours { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }

.pill {
  display: inline-block; font-family: var(--head); font-size: 12px; font-weight: 500;
  padding: 4px 11px; border-radius: 999px; background: var(--line); color: var(--ink-soft);
}
.pill.open { background: var(--sage-soft); color: var(--sage); }
.pill.mine, .pill.booked { background: var(--accent-soft); color: var(--accent); }

/* ─── buttons ─── */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--head); font-weight: 500; font-size: 15px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .08s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.quiet { background: transparent; color: var(--ink-soft); min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #ecd2c9; }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.col { display: grid; gap: 10px; }
a { color: var(--accent); }

/* ─── sheet (bottom drawer on phones, dialog on desktop) ─── */
.scrim {
  position: fixed; inset: 0; background: rgba(46, 39, 34, .38); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 20;
  animation: fade .18s ease;
}
.sheet {
  background: var(--paper); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  border-radius: 24px 24px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  animation: rise .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 18px; }
.sheet .close { float: right; margin: -6px -8px 0 0; }
@media (min-width: 640px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 24px; padding: 20px 28px 28px; }
  .sheet .grab { display: none; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.recap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 16px 0 20px; }
.recap .date { font-family: var(--head); font-weight: 600; }
.recap .small { color: var(--ink-soft); font-size: 14px; }

/* ─── forms ─── */
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-family: var(--head); font-size: 14px; font-weight: 500; }
label .hint { font-family: var(--body); font-weight: 400; color: var(--ink-faint); font-size: 13px; }
input, textarea, select {
  font: inherit; font-family: var(--body); font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 88px; resize: vertical; }
::placeholder { color: #c4b8ab; opacity: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.counter { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.counter .lbl { font-family: var(--head); font-size: 15px; font-weight: 500; }
.counter .lbl small { display: block; font-family: var(--body); font-weight: 400; font-size: 12.5px; color: var(--ink-faint); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  font-size: 20px; color: var(--ink); cursor: pointer; line-height: 1;
}
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 28px; text-align: center; font-family: var(--head); font-weight: 600; font-size: 17px; }
.seats { font-size: 13px; color: var(--ink-faint); text-align: right; margin-top: -8px; }

.error { color: var(--danger); font-size: 14px; background: #fbeae4; border-radius: 10px; padding: 10px 12px; }
.heads-up { margin: 16px auto 0; max-width: 24em; font-size: 14.5px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; text-wrap: balance; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--sage-soft); color: var(--sage); display: grid; place-items: center; font-size: 26px; margin: 4px auto 14px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.tiny { font-size: 13px; color: var(--ink-faint); }
.linkbox { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; font-size: 13px; }
.linkbox span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }

.empty { text-align: center; padding: 40px 12px; color: var(--ink-soft); }
.loading { text-align: center; padding: 40px; color: var(--ink-faint); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-family: var(--head); font-size: 14px;
  padding: 10px 18px; border-radius: 999px; z-index: 40; animation: rise .2s ease;
}

footer { text-align: center; margin-top: 40px; color: var(--ink-faint); font-size: 13px; }

/* ─── admin bits ─── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 20px; }
.countdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.countdown { border-radius: 16px; padding: 14px 14px 16px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.countdown.booked { background: var(--accent-soft); }
.countdown.open { background: var(--sage-soft); }
.cd-label { font-family: var(--head); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.countdown.booked .cd-label { color: var(--accent); }
.countdown.open .cd-label { color: var(--sage); }
.cd-num { font-family: var(--head); font-weight: 600; font-size: 40px; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.cd-num .word { font-size: 28px; }
.cd-num small { font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.cd-date { font-family: var(--head); font-weight: 500; font-size: 14px; margin-top: 2px; }
.cd-sub { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.cd-sub b { font-family: var(--head); font-weight: 600; color: var(--ink); }
.cd-none { font-family: var(--head); font-weight: 600; font-size: 17px; margin-top: 8px; }
@media (max-width: 340px) { .countdowns { grid-template-columns: 1fr; } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-family: var(--head); font-size: 22px; font-weight: 600; }
.stat span { font-size: 12px; color: var(--ink-soft); }
.admin-lunch { padding: 18px 18px 16px; }
.admin-lunch .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.admin-lunch .date { font-family: var(--head); font-weight: 600; font-size: 18px; }
.admin-lunch .time { color: var(--ink-soft); font-size: 14px; }
.admin-lunch .menu-inline { color: var(--ink-soft); font-size: 14px; margin-top: 10px; }
.guest { margin-top: 14px; padding: 14px; background: var(--paper); border-radius: 12px; }
.guest .name { font-family: var(--head); font-weight: 600; font-size: 16px; }
.guest .meta { font-size: 14px; color: var(--ink-soft); }
.guest .notes { font-size: 14px; margin-top: 6px; font-style: italic; }
.admin-lunch .row { margin-top: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; }
