:root {
  --pine-900: #0b2a20;
  --pine-800: #0f3a2c;
  --pine-700: #145039;
  --berry: #c8102e;
  --berry-600: #a50d26;
  --gold: #e7b94c;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --veg: #12936f;
  --veg-bg: #e8f6f1;
  --nonveg: #d9480f;
  --nonveg-bg: #fdefe7;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: #3a0610; }
body {
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--ink);
  min-height: 100vh; min-height: 100dvh;
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- elegant Christmas background ---------- */
.bg { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 500px at 50% -8%, rgba(231,194,107,.16), transparent 65%),
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.45), transparent 60%),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22140%22%20height%3D%22140%22%20viewBox%3D%220%200%20140%20140%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23e7c26b%22%20stroke-width%3D%221%22%20stroke-linecap%3D%22round%22%20opacity%3D%22.16%22%3E%3Cg%20transform%3D%22translate(35%2035)%22%3E%3Cpath%20d%3D%22M0-9V9M-7.8-4.5%207.8%204.5M-7.8%204.5%207.8-4.5M0-9l-2.5-2.5M0-9l2.5-2.5M0%209l-2.5%202.5M0%209l2.5%202.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(105%20105)%20scale(.7)%22%3E%3Cpath%20d%3D%22M0-9V9M-7.8-4.5%207.8%204.5M-7.8%204.5%207.8-4.5%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Ccircle%20cx%3D%22105%22%20cy%3D%2230%22%20r%3D%221.2%22%20fill%3D%22%23e7c26b%22%20opacity%3D%22.35%22%2F%3E%3Ccircle%20cx%3D%2230%22%20cy%3D%22110%22%20r%3D%221%22%20fill%3D%22%23fff%22%20opacity%3D%22.3%22%2F%3E%3C%2Fsvg%3E"),
    linear-gradient(175deg, #240a1f 0%, #4a0b1d 30%, #6e0e1f 62%, #3a0610 100%); }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }

.wrap { position: relative; z-index: 1; max-width: 580px; margin: 0 auto; padding: 28px 16px 40px; }

/* ---------- compact hero ---------- */
.hero { color: #fff; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(231,194,107,.28); }
/* title: always one line, full width — font size is also auto-fitted by rsvp.js */
.hero h1 { font-family: 'Playfair Display', Georgia, serif; font-size: min(6vw, 34px); line-height: 1.15; margin: 0 0 20px;
  white-space: nowrap; overflow: hidden; text-shadow: 0 2px 12px rgba(0,0,0,.35); letter-spacing: -.005em; }
.hero-row { display: flex; align-items: center; gap: 14px; }
.hero .logo { width: 84px; height: auto; flex-shrink: 0; background: #fff; border-radius: 14px; padding: 5px;
  box-shadow: 0 10px 26px -10px rgba(0,0,0,.6), 0 0 0 3px rgba(231,185,76,.45); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.meta span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); padding: 4px 9px; border-radius: 8px; white-space: nowrap; }
.meta b { font-weight: 600; }
.meta i { color: var(--gold); }

/* card */
.card { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04);
  position: relative; overflow: hidden; animation: rise .5s ease both; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #b8892e, #f1d58a 50%, #b8892e); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.field { margin-bottom: 24px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 10px; color: var(--ink); }
.hint { font-weight: 500; color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.input-ico { position: relative; }
.input-ico i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 18px; }
.input-ico input { width: 100%; height: 50px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 14px 0 44px; font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s; background: #fafafa; }
.input-ico input:focus { outline: none; border-color: var(--pine-700); background: #fff; box-shadow: 0 0 0 4px rgba(20,80,57,.12); }
.input-ico input.invalid { border-color: var(--berry); box-shadow: 0 0 0 4px rgba(200,16,46,.1); }
.err { display: block; color: var(--berry); font-size: 12px; margin-top: 6px; min-height: 0; }

/* segmented yes/no switch */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #f3f4f6; border-radius: 14px; padding: 5px; }
.seg-btn { position: relative; z-index: 1; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2);
  height: 46px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: color .2s; }
.seg-btn.active { color: #fff; }
.seg-glider { position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 10px;
  background: linear-gradient(135deg, var(--pine-700), #1d7553); box-shadow: 0 6px 16px -6px rgba(20,80,57,.6); transition: transform .3s cubic-bezier(.4,1.4,.6,1), background .3s; }
.seg.no .seg-glider { transform: translateX(100%); background: linear-gradient(135deg, #6b7280, #4b5563); box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); }

.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease, opacity .3s; opacity: 0; }
.collapse > * { min-height: 0; }
.collapse.open { grid-template-rows: 1fr; opacity: 1; }
#attendBlock > div { overflow: hidden; }

/* people chips */
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.chip { width: 100%; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: 16px;
  color: var(--ink-2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--pine-700); color: var(--pine-700); transform: translateY(-1px); }
.chip.active { background: var(--berry); border-color: var(--berry); color: #fff; box-shadow: 0 8px 18px -8px rgba(200,16,46,.7); transform: translateY(-1px); }

/* meals */
.meals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meal { border-radius: 14px; padding: 14px; border: 1.5px solid transparent; }
.meal.veg { background: var(--veg-bg); border-color: rgba(18,147,111,.25); }
.meal.nonveg { background: var(--nonveg-bg); border-color: rgba(217,72,15,.25); }
.meal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.meal-head b { display: block; font-size: 14px; }
.meal-head small { color: var(--ink-2); font-size: 12px; }
.dot { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: #fff; }
.stepper { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px; padding: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 9px; border: 0; font-size: 20px; font-weight: 600; cursor: pointer; background: #f3f4f6; color: var(--ink); transition: background .15s, transform .1s; }
.stepper button:hover:not(:disabled) { background: #e5e7eb; }
.stepper button:active:not(:disabled) { transform: scale(.94); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.veg .stepper output { color: var(--veg); }
.nonveg .stepper output { color: var(--nonveg); }
.stepper output { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.plate { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; animation: pop .25s ease both; }
.plate.v { background: var(--veg-bg); box-shadow: inset 0 0 0 2px var(--veg); }
.plate.n { background: var(--nonveg-bg); box-shadow: inset 0 0 0 2px var(--nonveg); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.alert { padding: 12px 14px; border-radius: 12px; background: #fdecee; color: var(--berry-600); font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.submit { width: 100%; height: 54px; border: 0; border-radius: 14px; font: inherit; font-size: 16px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--berry), #e0314c); box-shadow: 0 14px 28px -12px rgba(200,16,46,.8);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .15s, filter .15s; }
.submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.submit:disabled { opacity: .7; cursor: progress; transform: none; }

/* done */
.done, .closed { text-align: center; }
.done-ico { font-size: 54px; margin: 6px 0 4px; animation: pop .5s ease both; }
.done h2, .closed h2 { font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; font-size: 26px; margin: 6px 0; }
.done p, .closed p { color: var(--ink-2); line-height: 1.6; margin: 0 0 18px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.summary div { background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; }
.summary b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.summary small { color: var(--ink-2); font-size: 12px; }
.link { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--pine-700); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 10px; }
.link:hover { background: #f0f7f4; }
.foot { text-align: center; color: rgba(255,255,255,.45); font-size: 12px; margin-top: 22px; }

/* ---------- phones: everything fits on one screen ---------- */
@media (max-width: 520px) {
  .wrap { padding: 12px 12px 16px; }
  .hero { margin-bottom: 10px; padding-bottom: 10px; }
  .hero h1 { margin-bottom: 14px; }
  .hero-row { gap: 10px; }
  .hero .logo { width: 64px; border-radius: 11px; padding: 3px; }
  .meta { gap: 5px; }
  .meta span { font-size: 11px; padding: 3px 7px; }
  .card { padding: 16px 14px 14px; border-radius: 16px; }
  .card .welcome { margin: 0 0 10px; font-size: 12.5px; -webkit-line-clamp: 1; padding-right: 0; }
  .field { margin-bottom: 12px; }
  .field > label { font-size: 13px; margin-bottom: 6px; line-height: 1.3; }
  .input-ico input { height: 42px; font-size: 15px; }
  .seg { padding: 4px; border-radius: 12px; }
  .seg-glider { top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); }
  .seg-btn { font-size: 12.5px; height: 38px; gap: 5px; }
  .chips { gap: 6px; }
  .chip { height: 36px; font-size: 14.5px; border-radius: 10px; }
  .meals { gap: 8px; }
  .meal { padding: 8px; border-radius: 12px; }
  .meal-head { margin-bottom: 6px; gap: 6px; }
  .meal-head small { display: none; }
  .meal-head b { font-size: 13px; }
  .dot { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
  .stepper { padding: 3px; border-radius: 10px; }
  .stepper button { width: 32px; height: 32px; font-size: 18px; }
  .stepper output { font-size: 19px; }
  .plates { display: none; }            /* the counters already show the split */
  .alert { margin-bottom: 10px; padding: 9px 12px; }
  .submit { height: 46px; font-size: 15px; border-radius: 12px; }
  .foot { margin-top: 10px; }
}
/* short phones (e.g. 375×667, 360×640): tighten a little more */
@media (max-width: 520px) and (max-height: 700px) {
  .hero .logo { width: 54px; }
  .field { margin-bottom: 10px; }
  .input-ico input { height: 40px; }
  .seg-btn { height: 36px; }
  .chip { height: 34px; }
  .submit { height: 44px; }
}
/* very small phones (320×568) */
@media (max-width: 520px) and (max-height: 600px) {
  .wrap { padding: 8px 10px 10px; }
  .hero { margin-bottom: 8px; padding-bottom: 8px; }
  .hero h1 { margin-bottom: 11px; }
  .hero .logo { width: 44px; border-radius: 9px; padding: 2px; }
  .card { padding: 12px 12px 12px; }
  .field { margin-bottom: 8px; }
  .field > label { font-size: 12.5px; margin-bottom: 5px; }
  .input-ico input { height: 36px; }
  .seg-btn { height: 32px; font-size: 12px; }
  .chips { gap: 5px; }
  .chip { height: 30px; font-size: 13.5px; }
  .meal { padding: 6px; }
  .meal-head { margin-bottom: 4px; }
  .dot { width: 22px; height: 22px; font-size: 12px; }
  .stepper button { width: 28px; height: 28px; }
  .stepper output { font-size: 17px; }
  .submit { height: 40px; }
  .foot { display: none; }
  .meta { gap: 4px; }
  .meta span { font-size: 10px; padding: 2px 6px; }
  .seg { padding: 3px; }
  .seg-glider { top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); }
  .hint { display: none; }
}
@media (max-width: 340px) {
  .meals { grid-template-columns: 1fr 1fr; }
  .meal-head b { font-size: 12px; }
  .stepper button { width: 28px; height: 28px; }
  .hero .logo { width: 50px; }
  .meta span { font-size: 10.5px; padding: 3px 6px; }
  .seg-btn i { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.welcome { margin: 2px 0 16px; padding-right: 30px; font-size: 13px; line-height: 1.5; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.welcome:empty { display: none; }
@media (min-width: 768px) { .wrap { max-width: 640px; } }

/* very light placeholder text */
.input-ico input::placeholder { color: #c9ced6; opacity: 1; font-weight: 400; }
