/* Still at the Table — deep red + warm cream, big tap targets, plain language. */
/* The hidden attribute must always win over component display rules
   (login overlay, logout button, toasts, error lines). */
[hidden] { display: none !important; }
:root {
  --red: #8B0000;
  --red-dark: #6d0000;
  --cream: #FFF8E7;
  --paper: #fffdf7;
  --ink: #2b2118;
  --muted: #7a6a58;
  --line: #e7dcc4;
  --gold: #b8860b;
  --gold-bg: #fdf3d7;
  --sage: #6b7d5e;
  --sage-bg: #edf1e6;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
}

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 64px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--red);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.brand { color: #fff; font-weight: 700; font-size: 19px; text-decoration: none; letter-spacing: .2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border: 2px solid var(--red); border-radius: 999px;
  background: #fff; color: var(--red);
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-big { width: 100%; min-height: 56px; font-size: 18px; }
.btn-ghost { border-color: transparent; background: transparent; color: #fff; min-height: 40px; padding: 6px 10px; }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.btn-danger { border-color: #b3543f; color: #b3543f; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--cream);
}
.login-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 22px; max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 6px 24px rgba(90, 60, 20, .12);
}
.login-emoji { font-size: 44px; }
.login-card h1 { color: var(--red); margin: 8px 0 4px; font-size: 28px; }
.login-sub { color: var(--muted); margin: 0 0 18px; }
.form-error { color: #b00020; font-weight: 600; }

/* ---------- home hero ---------- */
.hero { text-align: center; padding: 18px 6px 4px; }
.hero h1 { color: var(--red); font-size: 34px; margin: 4px 0 6px; line-height: 1.15; }
.memory-line { font-size: 19px; font-style: italic; color: var(--gold); font-weight: 600; margin: 6px 0; }
.framing { max-width: 560px; margin: 10px auto 0; color: #4d3f30; }
.framing strong { color: var(--red); }

.section { margin-top: 34px; }
.section > h2 {
  color: var(--red); font-size: 24px; margin: 0 0 4px;
  border-bottom: 2px solid var(--line); padding-bottom: 6px;
}
.section-sub { color: var(--muted); margin: 4px 0 12px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: inherit; display: block;
  box-shadow: 0 2px 8px rgba(90, 60, 20, .06);
}
.card h3 { margin: 0 0 4px; font-size: 20px; color: var(--red); }
.card .by { color: var(--muted); margin: 0 0 8px; }
.card .story-snippet { margin: 8px 0 0; color: #4d3f30; }
.card img.thumb { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
a.card:active { background: #fff6e0; }

/* ---------- chips & badges ---------- */
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 14px; font-weight: 600; margin: 2px 0;
}
.chip-memory { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold); }
.chip-far { background: var(--sage-bg); color: var(--sage); border: 1px solid var(--sage); }
.chip-here { background: #f3ead3; color: var(--muted); border: 1px solid var(--line); }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 13px; font-weight: 700;
  background: var(--red); color: #fff; margin-left: 6px; vertical-align: middle;
}

/* ---------- recipe page ---------- */
.back-link { display: inline-block; margin: 6px 0 10px; color: var(--red); font-weight: 600; text-decoration: none; }
.recipe-head h1 { color: var(--red); margin: 4px 0 2px; font-size: 30px; line-height: 1.2; }
.recipe-head .by { color: var(--muted); margin: 0 0 8px; font-size: 18px; }
.story { font-size: 18px; background: var(--paper); border-left: 4px solid var(--gold); padding: 12px 16px; border-radius: 0 10px 10px 0; }
.hand { margin-top: 22px; }
.hand h2, .block h2 { color: var(--red); font-size: 22px; margin: 0 0 8px; }
.hand .photos { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .hand .photos { grid-template-columns: 1fr 1fr; } }
.hand img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.block { margin-top: 24px; }
.notes-text { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }

/* scaler */
.scaler {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.scaler .lbl { font-weight: 700; color: var(--red); }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--red);
  background: #fff; color: var(--red); font-size: 24px; font-weight: 700; cursor: pointer; line-height: 1;
}
.stepper .val { min-width: 92px; text-align: center; font-weight: 700; font-size: 18px; }
.quick { display: inline-flex; gap: 6px; }
.quick button {
  min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}

/* ingredients */
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.ing-list .amt { font-weight: 700; min-width: 86px; }
.ing-list .nm { flex: 1 1 140px; }
.ing-list .cost { font-weight: 600; color: var(--sage); white-space: nowrap; }
.ing-list .pending { color: var(--gold); font-weight: 600; font-size: 15px; }
.wm-link { font-size: 14px; color: var(--red); white-space: nowrap; }
.cost-box {
  margin-top: 14px; background: var(--sage-bg); border: 1px solid var(--sage);
  border-radius: var(--radius); padding: 14px 16px;
}
.cost-box .big { font-size: 20px; font-weight: 700; }
.cost-box p { margin: 4px 0; }
.cost-label { color: var(--muted); font-size: 14px; font-style: italic; }

/* ---------- forms ---------- */
.field { display: block; margin: 0 0 14px; text-align: left; }
.field > span { display: block; font-weight: 600; margin-bottom: 5px; }
.field input[type="text"], .field input[type="password"], .field input[type="date"],
.field input[type="number"], .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 10px 12px; font-size: 17px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 14px; }
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; }
.ing-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.ing-row { display: grid; grid-template-columns: 64px 74px 1fr 74px 40px; gap: 6px; align-items: center; }
.ing-row input {
  min-height: 46px; padding: 8px; font-size: 16px; width: 100%;
  border: 2px solid var(--line); border-radius: 8px; background: #fff;
}
.ing-remove { min-height: 40px; border-radius: 8px; }
.photo-manage { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.photo-manage .pm { position: relative; width: 110px; }
.photo-manage img { width: 110px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-manage button { width: 100%; margin-top: 4px; }
details.rename { margin-top: 10px; }
details.rename summary { color: var(--red); font-weight: 600; cursor: pointer; min-height: 44px; }

/* ---------- gatherings ---------- */
.gap-banner {
  background: var(--gold-bg); border: 1px solid var(--gold); color: #6d5200;
  border-radius: var(--radius); padding: 12px 16px; font-weight: 600; margin: 12px 0;
}
.course { margin-top: 20px; }
.course h3 { color: var(--red); margin: 0 0 6px; font-size: 20px; text-transform: capitalize; }
.item-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.item-row .dish { font-weight: 700; }
.item-row .bringer { color: var(--muted); }
.item-row .spacer { flex: 1; }
.item-row.open-slot { border-style: dashed; background: transparent; }
.item-row.open-slot .dish { color: var(--gold); font-style: italic; }
.add-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.add-block h3 { margin: 0 0 8px; font-size: 18px; color: var(--red); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input, .inline-form select {
  min-height: 48px; padding: 8px 10px; font-size: 16px; flex: 1 1 140px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
}

/* ---------- chef library & queues ---------- */
.chef-card .full-recipe { font-weight: 700; color: var(--red); margin: 8px 0 0; }
.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.queue-list .spacer { flex: 1; }
.empty { color: var(--muted); font-style: italic; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-weight: 600; z-index: 50; max-width: 92vw; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.error { background: #b00020; }
