:root {
  --pine-900: #14291c;
  --pine-800: #1f3d2b;
  --pine-700: #2d5840;
  --pine-600: #3d7355;
  --moss:     #6f9d6b;
  --paper:    #f6f0e2;
  --paper-2:  #efe6d2;
  --bark:     #5c4633;
  --ink:      #2a2419;
  --ink-soft: #6b6151;
  --ember:    #e07a3c;
  --ember-2:  #f0a04b;
  --sky:      #cfe0e6;
  --line:     #e3d8c0;
  --danger:   #b8442e;
  --shadow:   0 12px 30px -12px rgba(31, 61, 43, 0.35);
  --radius:   18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 50% -10%, #2d5840 0%, #1f3d2b 42%, #14291c 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- ridge backdrop ---- */
.ridges { position: fixed; inset: auto 0 0 0; height: 38vh; z-index: 0; pointer-events: none; opacity: 0.6; }
.ridges svg { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; }
.ridges svg:nth-child(1) path { fill: #18331f; }
.ridges svg:nth-child(2) path { fill: #102619; }

/* ---- screens ---- */
.screen { display: none; position: relative; z-index: 1; }
body[data-view="app"] [data-screen="app"],
body[data-view="landing"] [data-screen="landing"] { display: block; }
body[data-view="loading"] [data-screen="loading"],
body[data-view="gate"]    [data-screen="gate"],
body[data-view="choose"]  [data-screen="choose"] { display: grid; }

.card-wrap {
  min-height: 100vh; place-items: center; padding: 24px 18px 14vh;
}

/* ---- spinner ---- */
body[data-view="loading"] [data-screen="loading"] { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.2); border-top-color: var(--ember-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- cards ---- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.04);
}
.auth-card { width: 100%; max-width: 420px; padding: 30px 26px 24px; }

/* ---- brand ---- */
.brand { text-align: center; margin-bottom: 22px; }
.brand-mark { font-size: 44px; display: block; line-height: 1; }
.brand h1 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 30px;
  line-height: 1.05; margin: 12px 0 8px; color: var(--pine-800); letter-spacing: -0.01em;
}
.brand.small h1 { font-size: 24px; }
.tagline { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---- forms ---- */
form { display: flex; flex-direction: column; }
label {
  font-size: 13px; font-weight: 600; color: var(--bark);
  margin: 14px 0 6px; display: block;
}
label .opt { font-weight: 400; color: var(--ink-soft); }
input, textarea {
  font-family: inherit; font-size: 16px; color: var(--ink);
  background: #fffdf8; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus {
  outline: none; border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgba(61, 115, 85, 0.16);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row label { margin-top: 14px; }

.btn-primary {
  margin-top: 20px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 16px; color: #fff;
  background: linear-gradient(180deg, var(--ember-2), var(--ember));
  border-radius: 12px; padding: 14px 18px;
  box-shadow: 0 8px 18px -8px rgba(224, 122, 60, 0.7);
  transition: transform .08s, filter .15s;
}
.btn-primary.slim { margin-top: 0; padding: 11px 18px; font-size: 15px; }
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary .arrow { transition: transform .15s; display: inline-block; }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.btn-ghost {
  border: 1.5px solid var(--line); background: #fffdf8; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px; color: var(--bark);
  border-radius: 10px; padding: 9px 14px; transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--paper-2); }
.btn-ghost.danger { color: var(--danger); border-color: #e8c4bb; }
.btn-ghost.danger:hover { background: #f7e7e2; }

.form-error {
  color: var(--danger); font-size: 13.5px; font-weight: 500;
  margin: 12px 0 0; min-height: 1px;
}
.form-error:empty { margin: 0; }

.switch { text-align: center; margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); }
.switch a { color: var(--pine-700); font-weight: 600; text-decoration: none; }
.switch a:hover { text-decoration: underline; }

/* ===== app ===== */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(20, 41, 28, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 13px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-family: 'Fraunces', serif; font-weight: 600; color: var(--paper); font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { color: var(--sky); font-size: 13.5px; font-weight: 500; }
.topbar .btn-ghost { background: rgba(255,255,255,0.08); color: var(--paper); border-color: rgba(255,255,255,0.18); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.16); }

.container { max-width: 720px; margin: 0 auto; padding: 20px 18px 40px; }
section { margin-top: 26px; }
.section-head h2, .summary-head h2 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px;
  color: var(--paper); margin: 0;
}
.section-sub { margin: 5px 0 14px; color: rgba(246,240,226,0.72); font-size: 14px; line-height: 1.45; }

/* summary */
.summary { background: var(--paper); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-top: 22px; }
.summary-head { display: flex; align-items: center; justify-content: space-between; }
.summary-head h2 { color: var(--pine-800); }
.dates-pill { background: var(--pine-700); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.stat { text-align: center; background: var(--paper-2); border-radius: 14px; padding: 12px 6px; }
.stat-num { display: block; font-family: 'Fraunces', serif; font-weight: 700; font-size: 26px; color: var(--ember); line-height: 1; }
.stat-label { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

/* meal board */
.meal-board { display: flex; flex-direction: column; gap: 12px; }
.day-group { margin-top: 4px; }
.day-label { color: rgba(246,240,226,0.6); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 10px 2px 8px; }
.meal {
  background: var(--paper); border-radius: 15px; padding: 15px 16px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  border-left: 5px solid var(--line); transition: transform .1s;
}
.meal.open { border-left-color: var(--ember-2); cursor: pointer; }
.meal.mine { border-left-color: var(--pine-600); background: #f0f4e9; }
.meal.taken { border-left-color: var(--bark); }
.meal.open:hover, .meal.mine:hover { transform: translateY(-1px); }
.meal-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.meal-body { flex: 1; min-width: 0; }
.meal-when { font-weight: 600; font-size: 15px; color: var(--pine-800); }
.meal-when .meal-date { color: var(--ink-soft); font-weight: 500; font-size: 13px; margin-left: 6px; }
.meal-status { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.35; }
.meal-status .cook { color: var(--pine-700); font-weight: 600; }
.meal-status .dish { color: var(--ink); }
.meal-cta { font-size: 13px; font-weight: 600; color: var(--ember); white-space: nowrap; }
.meal.mine .meal-cta { color: var(--pine-700); }
.tag-you { background: var(--pine-600); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

/* family card */
.family-card { padding: 18px 20px; }
.save-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.saved-flag { color: var(--pine-600); font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s; }
.saved-flag.show { opacity: 1; }

/* roster */
.roster { display: flex; flex-direction: column; gap: 10px; }
.roster-item {
  background: var(--paper); border-radius: 14px; padding: 13px 16px;
  box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 12px;
}
.roster-avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--pine-700); color: #fff;
  display: grid; place-items: center; font-family: 'Fraunces', serif; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.roster-main { flex: 1; min-width: 0; }
.roster-name { font-weight: 600; color: var(--pine-800); font-size: 15.5px; }
.roster-count { color: var(--ink-soft); font-size: 13.5px; }
.roster-diet { margin-top: 5px; font-size: 13px; color: var(--bark); background: #fbeede; border-radius: 8px; padding: 5px 9px; display: inline-block; }
.roster-diet::before { content: "⚠ "; }

.foot { text-align: center; color: rgba(246,240,226,0.5); font-size: 13px; margin-top: 36px; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(20, 41, 28, 0.55);
  display: grid; place-items: center; padding: 18px; backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 420px; padding: 24px 22px; }
.modal h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px; color: var(--pine-800); margin: 0 0 4px; }
.modal-sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 6px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; flex-wrap: wrap; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(10px);
  background: var(--pine-800); color: var(--paper); padding: 12px 20px; border-radius: 12px;
  font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow); z-index: 30;
  opacity: 0; transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- select + choose screen ---- */
select {
  font-family: inherit; font-size: 16px; color: var(--ink);
  background: #fffdf8; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; width: 100%; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c4633' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select:focus { outline: none; border-color: var(--pine-600); box-shadow: 0 0 0 3px rgba(61,115,85,.16); }
.hint { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 0; }
.family-preview {
  margin: 14px 0 4px; padding: 12px 14px; background: var(--paper-2); border-radius: 12px; font-size: 13.5px;
}
.prev-label { color: var(--ink-soft); font-weight: 600; display: block; margin-bottom: 7px; }
.prev-chip { display: inline-block; background: #fffdf8; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; margin: 0 4px 4px 0; font-weight: 500; color: var(--pine-800); }

/* who-are-you chips */
#who-block { margin-top: 6px; }
.who-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.who-chip { font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: #fffdf8; border: 1.5px solid var(--line); color: var(--pine-800);
  border-radius: 999px; padding: 8px 15px; transition: all .12s; }
.who-chip:hover { border-color: var(--pine-600); }
.who-chip.active { background: var(--pine-600); border-color: var(--pine-600); color: #fff; }
.who-chip.add { color: var(--ember); border-style: dashed; border-color: #f0c79e; }
.who-chip.add.active { background: var(--ember); border-color: var(--ember); color: #fff; }
.m-you, .r-you { color: var(--pine-600); font-weight: 700; }
.m-you { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  background: #e1ecdb; padding: 2px 7px; border-radius: 999px; }
.r-you { font-size: 12px; }

/* ---- rich meal cards ---- */
.meal { align-items: flex-start; }
.meal-time { color: var(--ink-soft); font-weight: 500; font-size: 13px; margin-left: 4px; }
.open-tag { color: var(--ember); font-weight: 600; font-size: 13.5px; }
.meal-cook { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.meal-cook .cook { color: var(--pine-700); font-weight: 600; }
.meal-entree { font-weight: 600; color: var(--ink); font-size: 14.5px; margin-top: 2px; }
.meal-sides { font-size: 13px; color: var(--bark); margin-top: 1px; }
.meal-cta { align-self: center; }

/* ---- member checklist ---- */
.member-list { display: flex; flex-direction: column; }
.member { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: none; }
.member.away { opacity: .5; }
.m-check { position: relative; display: inline-flex; cursor: pointer; }
.m-check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.checkmark { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); background: #fffdf8; transition: all .15s; }
.m-check input:checked + .checkmark { background: var(--pine-600); border-color: var(--pine-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 7.5l3 3 6-6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }
.m-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.m-name { font-weight: 600; color: var(--pine-800); font-size: 15px; }
.m-guest { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: #efe1cf; color: var(--bark); padding: 2px 7px; border-radius: 999px; }
.m-note { font-size: 12px; color: var(--ink-soft); }
.role-pill { border: 1.5px solid var(--line); background: #fffdf8; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 11px; transition: all .12s; }
.role-pill.adult { color: var(--pine-700); }
.role-pill.child { color: var(--ember); border-color: #f0d3b8; background: #fbeede; }
.role-pill:hover { transform: translateY(-1px); }
.m-remove { border: none; background: none; color: var(--ink-soft); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0 2px; }
.m-remove:hover { color: var(--danger); }
.add-member { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.add-member input { flex: 1; }
.add-member select { width: auto; }
.family-sub em { font-style: normal; color: var(--ember); font-weight: 600; }

/* ---- roster ---- */
.roster-people { color: var(--bark); font-size: 13.5px; margin-top: 3px; line-height: 1.5; }
.roster-count { font-size: 12px; font-weight: 600; color: var(--pine-600); margin-left: 8px;
  background: #e9f0e4; padding: 2px 9px; border-radius: 999px; }
.r-kid { font-size: 10px; font-weight: 700; color: var(--ember); margin-left: 3px; vertical-align: 1px; }
.r-none { color: var(--ink-soft); font-style: italic; }

/* ---- quantity helper ---- */
.quantity-box { background: #eef4e8; border: 1px solid #d6e4cc; border-radius: 13px; padding: 13px 15px; margin: 4px 0 8px; }
.qty-head { font-size: 13.5px; color: var(--pine-800); }
.qty-head b { color: var(--ember); font-size: 16px; }
.qty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 8px; }
.qty-grid > div { background: #fffdf8; border-radius: 9px; padding: 8px 6px; text-align: center; }
.qty-grid span { display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }
.qty-grid b { font-size: 14px; color: var(--pine-800); }
.qty-note { font-size: 11.5px; color: var(--ink-soft); }

/* ===== landing / splash ===== */
.landing { min-height: 100vh; }
.hero { position: relative; height: 78vh; min-height: 540px; max-height: 820px; overflow: hidden; }
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-scrim { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,33,46,.55) 0%, rgba(20,33,46,.05) 32%, rgba(20,41,28,0) 55%, rgba(20,41,28,.35) 100%); }
.hero-content { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px; }
.hero-eyebrow { color: #fbe9cf; font-weight: 600; font-size: 14px; letter-spacing: .03em;
  text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 58px; line-height: .96;
  color: #fff; margin: 12px 0 14px; letter-spacing: -.01em; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
.hero-dates { color: #fff; font-weight: 500; font-size: 16px; margin: 0 0 26px; text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.hero-cta { margin-top: 0; font-size: 17px; padding: 15px 30px; box-shadow: 0 10px 26px -8px rgba(224,122,60,.8); }
.hero-sub { color: #f3e7d4; font-size: 13px; margin: 14px 0 0; text-shadow: 0 1px 8px rgba(0,0,0,.5); }

.landing-body { max-width: 640px; margin: 0 auto; padding: 22px 18px 40px; margin-top: -34px; position: relative; z-index: 3; }
.land-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 16px; }
.land-card h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px; color: var(--pine-800); margin: 0 0 10px; }
.land-card p { margin: 0; color: var(--ink); font-size: 14.5px; line-height: 1.6; }
.land-card.know { background: #fbf3e6; border: 1px solid #f0e2c8; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.fact { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 15px;
  display: flex; gap: 11px; align-items: flex-start; }
.fact-ic { font-size: 22px; line-height: 1; }
.fact b { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.fact span { font-size: 13.5px; color: var(--pine-800); font-weight: 500; }

.map-wrap { border-radius: 13px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 12px; line-height: 0; }
.map-wrap iframe { width: 100%; height: 240px; border: 0; }
.btn-ghost.wide { display: block; width: 100%; text-align: center; }
.map-note { margin-top: 12px !important; font-size: 13px !important; color: var(--ink-soft) !important; }

.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li { font-size: 14.5px; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.bullets li:last-child { border-bottom: none; }

.final-cta { text-align: center; padding: 26px 18px 10px; }
.final-cta h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 24px; color: var(--paper); margin: 0 0 16px; }

@media (max-width: 420px) {
  .stat-num { font-size: 22px; }
  .brand h1 { font-size: 26px; }
  .hero-title { font-size: 46px; }
  .facts { grid-template-columns: 1fr; }
}
