:root {
  /* ezPlates brand palette — 2026 identity. See docs/brand.md for full guidance. */
  --orange: #f26b2e;       /* Harvest Orange — primary action, brand energy */
  --orange-dark: #d85a20;  /* Harvest Orange (hover/pressed) */
  --green: #2e7d4f;        /* Plate Green — recovery, matching, community trust */
  --green-dark: #256b43;
  --green-light: #e6f0e9;  /* Plate Green tint — success surfaces, hovers */
  --gold: #f2c94c;         /* Community Gold — verified impact, badges, milestones */
  --amber: #9a6413;        /* readable gold-brown for text on gold surfaces */
  --coral: #e95a47;        /* Tomato Coral — urgency, expiring surplus, alerts */
  --red: #c23a2b;          /* readable coral-red for error text / destructive actions */
  --blue: #2f80ed;         /* Trust Blue — confirmations, links, data states */
  --sage: #a8c49a;         /* Soft Sage — sustainability context, secondary surfaces */
  --ink: #1f2a24;          /* Deep Charcoal — text, reports, dashboards */
  --muted: #6b7280;
  --line: #e8e0cd;         /* warm neutral border for cream surfaces */
  --bg: #fff7e8;           /* Warm Cream — main background */
  --card: #ffffff;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Typography per docs/brand.md §4; tokens in tokens.css. */
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: var(--font-display, inherit);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand img { display: block; }
.brand strong { color: var(--orange); }

nav { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
nav a, nav button {
  text-decoration: none;
  color: var(--ink);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
}
nav a:hover, nav button:hover { background: var(--green-light); }
nav a.cta { background: var(--orange); color: #fff; }
nav a.cta:hover { background: var(--orange-dark); }

.container { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2.4rem; margin: 0 0 0.5rem; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 42rem; margin: 0 auto 1.5rem; }

.counter-card {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 2.5rem;
  margin: 1rem auto;
}
.counter-card .big { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.counter-card .label { opacity: 0.9; }
.counter-sub { color: var(--muted); font-size: 0.9rem; }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.stat {
  flex: 1 1 130px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat .big { font-size: 1.6rem; font-weight: 700; color: var(--green); }
.stat .label { color: var(--muted); font-size: 0.85rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2, .card h3 { margin-top: 0; }

.tier { display: flex; flex-direction: column; }
.tier .price { font-size: 1.8rem; font-weight: 700; margin: 0.25rem 0; }
.tier .price small { font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.tier ul { padding-left: 1.2rem; margin: 0.5rem 0 1rem; color: var(--muted); font-size: 0.92rem; flex: 1; }
.tier.selected { border: 2px solid var(--green); }

form.stack { display: flex; flex-direction: column; gap: 0.75rem; }
label.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; font-weight: 600; }
input, select, textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

button.primary, button.ghost, button.danger {
  font: inherit;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
button.primary { background: var(--orange); color: #fff; }
button.primary:hover { background: var(--orange-dark); }
button.ghost { background: none; border-color: var(--line); color: var(--ink); }
button.ghost:hover { background: var(--green-light); }
button.danger { background: none; border-color: var(--red); color: var(--red); }
button.danger:hover { background: #fbe3df; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.msg { padding: 0.6rem 0.9rem; border-radius: 8px; margin: 0.5rem 0; font-size: 0.93rem; }
.msg.error { background: #fbe3df; color: var(--red); }
.msg.ok { background: var(--green-light); color: var(--green-dark); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--line);
  color: var(--ink);
  white-space: nowrap;
}
.badge.logged { background: #e4edfc; color: #1f5fc0; }
.badge.matched { background: #fdefc6; color: var(--amber); }
.badge.accepted { background: #e2edda; color: #3d6b2c; }
.badge.picked_up { background: #dceee2; color: var(--green-dark); }
.badge.completed { background: var(--green); color: #fff; }
.badge.canceled, .badge.expired { background: #fbe3df; color: var(--red); }
.badge.verified { background: var(--green-light); color: var(--green-dark); }
.badge.pending { background: #fdefc6; color: var(--amber); }

.steps { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.step { padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--line); font-size: 0.85rem; }
.step.active { background: var(--green); color: #fff; }
.step.done { background: var(--green-light); color: var(--green-dark); }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.right { text-align: right; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }

/* Receipt rendering — looks right on screen and prints cleanly (issue #2). */
.receipt {
  max-width: 340px;
  margin: 0 auto;
  background: #fff;
  border: 1px dashed #9ca3af;
  padding: 1.25rem;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
}
.receipt h4 { text-align: center; margin: 0 0 0.75rem; font-size: 1rem; }
.receipt .line { display: flex; justify-content: space-between; gap: 0.5rem; }
.receipt .rule { border-top: 1px dashed #9ca3af; margin: 0.5rem 0; }
.receipt .donation-line { font-weight: 700; color: var(--green-dark); }
.receipt .mission { font-size: 0.75rem; color: var(--muted); margin: 0.35rem 0; }
.receipt .qr { text-align: center; margin-top: 0.75rem; }
.receipt .qr img { width: 110px; height: 110px; }
.receipt .qr .small { font-size: 0.7rem; }

@media print {
  .topbar, .footer, nav, .no-print { display: none !important; }
  body { background: #fff; }
  .receipt { border: none; }
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
}

.impact-page { max-width: 420px; margin: 2rem auto; text-align: center; }
.impact-page .hero-meal { font-size: 3.4rem; font-weight: 800; color: var(--green); line-height: 1; }
