/* ================================================================
   LocalHealth — Modern Design System
   ================================================================ */

/* ── Tokens ───────────────────────────────────────────────────────── */
:root {
  /* Brand greens */
  --g900: #071a0f;
  --g800: #0f3320;
  --g700: #154930;
  --g600: #1d6040;
  --g500: #2d7a50;
  --g400: #3d9968;
  --g300: #5fbf88;
  --g200: #90d9b0;
  --g150: #c3efd6;
  --g100: #e2f8ed;
  --g50:  #f2fbf6;

  /* Semantic colors */
  --color-bg:      #f4f8f5;
  --color-surface: #ffffff;
  --color-surf-2:  #f2fbf6;
  --color-surf-3:  #e2f8ed;
  --color-brand:   #2d7a50;
  --color-brand-dk:#154930;
  --color-brand-lt:#5fbf88;
  --color-text:    #0c1a12;
  --color-text-2:  #2a3d32;
  --color-text-3:  #587065;
  --color-border:  #d3e8d9;

  /* Backward-compat aliases used in old inline styles */
  --color-background:   var(--color-bg);
  --color-brand-strong: var(--color-brand-dk);
  --color-brand-soft:   var(--color-brand-lt);
  --color-text-soft:    var(--color-text-3);
  --color-surface-soft: var(--color-surf-2);
  --color-surface-strong: var(--color-surf-3);
  --color-accent:       var(--color-brand-lt);

  /* Shadows — neutral, not green-tinted */
  --s1: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --s2: 0 3px 10px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.05);
  --s3: 0 10px 28px rgba(0,0,0,.09), 0 3px 8px rgba(0,0,0,.05);
  --s4: 0 22px 52px rgba(0,0,0,.11), 0 6px 14px rgba(0,0,0,.07);

  /* Old shadow names */
  --shadow-soft:   var(--s2);
  --shadow-medium: var(--s3);

  /* Focus ring */
  --ring: 0 0 0 3px rgba(95,191,136,.32);

  /* Radii */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   30px;
  --r-pill: 9999px;

  /* Old radius names */
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-xl);

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-w:  1200px;
  --nav-h:  64px;
  --px:     clamp(1.1rem, 5vw, 2.75rem);

  /* Transitions */
  --t:      .18s cubic-bezier(.4,0,.2,1);
  --t-pop:  .28s cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open,
body.modal-open { overflow: hidden; }

a { color: var(--color-brand); text-decoration: none; }
a:hover { color: var(--color-brand-dk); }
button { font-family: inherit; }

main {
  width: min(var(--max-w), 100% - 2 * var(--px));
  margin-inline: auto;
  padding-block: 4rem 6rem;
}

/* ── Nav overlay ──────────────────────────────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,26,15,.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
  z-index: 80;
}
.nav-overlay.is-visible { opacity: 1; pointer-events: auto; }

/* ── Masthead — sticky glass nav ──────────────────────────────────── */
.site-header { position: relative; }

.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  padding-inline: var(--px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(244,248,245,.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(45,122,80,.1);
  box-shadow: 0 1px 0 rgba(45,122,80,.05), 0 2px 20px rgba(0,0,0,.05);
}

/* ── Logo ─────────────────────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.015em;
  text-transform: uppercase;
  color: var(--color-brand-dk);
  text-decoration: none;
}

.logo-mark {
  padding: .25rem .58rem;
  border-radius: var(--r-pill);
  background: var(--g100);
}

.logo-rest { color: var(--color-brand-dk); }
.logo--footer { display: inline-flex; margin-bottom: .65rem; }

/* ── Nav links ────────────────────────────────────────────────────── */
.primary-nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-2);
  padding: .45rem .85rem;
  border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--color-brand-dk);
  background: rgba(45,122,80,.1);
}

.nav-cta--mobile { display: none; width: 100%; }

/* ── Hamburger ────────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: .28rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .45rem;
  border-radius: var(--r-xs);
  transition: background var(--t);
}
.nav-toggle:hover { background: rgba(45,122,80,.1); }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-brand-dk);
  transition: var(--t);
}

/* ── Masthead actions ─────────────────────────────────────────────── */
.masthead-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1;
  padding: .7rem 1.3rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), transform var(--t-pop), box-shadow var(--t), opacity var(--t);
}
.btn:active { transform: scale(.97) !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-solid {
  background: var(--color-brand);
  color: #fff;
  box-shadow: 0 4px 16px rgba(45,122,80,.28);
}
.btn-solid:hover {
  background: var(--color-brand-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(45,122,80,.35);
}

.btn-ghost {
  background: rgba(45,122,80,.1);
  color: var(--color-brand-dk);
}
.btn-ghost:hover { background: rgba(45,122,80,.17); }

.btn-full { width: 100%; }

/* ── Hero actions (CTA buttons) ───────────────────────────────────── */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 2rem;
}

/* ── Site header ──────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(155deg, #dff6ea 0%, #c5efd8 55%, #edfaf3 100%);
  padding-top: calc(var(--nav-h) + 3.5rem);
  padding-bottom: 5rem;
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  top: 0; right: -10%;
  width: 65%;
  height: 100%;
  background: radial-gradient(ellipse at 70% 30%, rgba(144,217,176,.5) 0%, transparent 65%);
  pointer-events: none;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  width: min(var(--max-w), 100% - 2 * var(--px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Single-column variant used on homepage (planner moved below) */
.hero--wide {
  grid-template-columns: 1fr;
  max-width: 820px;
  text-align: left;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.035em;
  margin: .7rem 0 1.1rem;
  color: var(--color-brand-dk);
}

.hero-copy p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 2rem;
  color: var(--color-text-2);
  max-width: 500px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(45,122,80,.12);
  color: var(--color-brand-dk);
  border-radius: var(--r-pill);
  padding: .35rem 1rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.stat-pill {
  background: var(--color-surface);
  border-radius: var(--r-md);
  padding: .9rem 1rem;
  box-shadow: var(--s2);
  border: 1px solid rgba(45,122,80,.07);
}

.stat-value {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: var(--color-brand-dk);
  line-height: 1.25;
}

.stat-label {
  display: block;
  font-size: .74rem;
  color: var(--color-text-3);
  margin-top: .2rem;
  line-height: 1.35;
}

/* ── Hero panel ───────────────────────────────────────────────────── */
.hero-panel {
  background: var(--color-surface);
  border-radius: var(--r-xl);
  padding: 2rem;
  box-shadow: var(--s4);
  border: 1px solid rgba(45,122,80,.08);
  position: relative;
}

/* Remove old dashed inner border */
.hero-panel::after { display: none; }

.data-footnote {
  margin-top: .75rem;
  font-size: .77rem;
  color: var(--color-text-3);
  line-height: 1.5;
}
.data-footnote a { color: var(--color-brand); }

.hero.hero--subpage {
  margin-top: 2rem;
  grid-template-columns: 1fr;
}
.hero.hero--subpage .hero-copy { max-width: 760px; }

/* ── Planner ──────────────────────────────────────────────────────── */
.planner-card { position: relative; z-index: 2; }

.planner-badge {
  display: inline-flex;
  align-items: center;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .67rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: var(--r-pill);
  background: var(--g100);
  border: 1px solid rgba(45,122,80,.15);
}

.planner-lead {
  margin: .45rem 0 1.4rem;
  font-size: .9rem;
  color: var(--color-text-3);
  line-height: 1.55;
}

.planner-form { display: grid; gap: .85rem; }

/* ── Form ─────────────────────────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: .32rem; }

.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-2);
  letter-spacing: .01em;
}

.field-group { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.field-group select { flex: 1 1 180px; }
.field-group--stack { flex-direction: column; align-items: stretch; gap: .55rem; }
.field-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.field-row input[type="text"],
.field-row input[type="search"],
.field-row input[type="number"] { flex: 1 1 180px; }

.btn-field {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: .82rem;
  padding: .65rem 1rem;
}

.field-hint {
  margin: .22rem 0 0;
  font-size: .78rem;
  color: var(--color-text-3);
  line-height: 1.45;
}
.field-hint.is-success { color: var(--color-brand-dk); font-weight: 600; }
.field-hint.is-error   { color: #b83030; font-weight: 600; }
.field-hint.is-pending { color: var(--color-brand); font-weight: 600; }

select,
input,
textarea {
  font: inherit;
  font-size: .9rem;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--color-border);
  padding: .72rem .95rem;
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--color-brand);
  outline: none;
  box-shadow: var(--ring);
}

textarea { min-height: 130px; resize: vertical; }

/* ── Store suggestions ────────────────────────────────────────────── */
.store-suggestions {
  display: none;
  flex-direction: column;
  gap: .55rem;
  margin-top: .7rem;
  padding: .9rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--s2);
}
.store-suggestions.is-visible { display: flex; }

.store-suggestion-heading {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-brand-dk);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.store-suggestion-list { display: grid; gap: .4rem; }

.store-suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background: var(--g50);
  color: var(--color-text);
  cursor: pointer;
  font-size: .86rem;
  text-align: left;
  transition: background var(--t), border-color var(--t);
}
.store-suggestion-item:hover { background: var(--g100); border-color: rgba(45,122,80,.2); }
.store-suggestion-item.is-active {
  border-color: var(--color-brand);
  background: rgba(45,122,80,.08);
  color: var(--color-brand-dk);
  font-weight: 600;
}

.store-suggestion-name { flex: 1; }
.store-suggestion-distance { font-size: .78rem; color: var(--color-text-3); white-space: nowrap; }

/* ── Store map ────────────────────────────────────────────────────── */
.store-map {
  margin-top: .8rem;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--s1);
  border: 1px solid var(--color-border);
  background: var(--g50);
}
.store-map iframe,
.store-map > div { width: 100%; height: 100%; border: 0; display: block; }

/* ── Planner output ───────────────────────────────────────────────── */
.planner-output { margin-top: 1.1rem; }

.placeholder {
  margin: 0;
  font-size: .87rem;
  color: var(--color-text-3);
}

.planner-result-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 1.1rem;
}

.planner-result {
  background: var(--color-surface);
  padding: 1.35rem;
  border-radius: var(--r-lg);
  border: 1px solid rgba(45,122,80,.09);
  box-shadow: var(--s1);
  display: flex;
  flex-direction: column;
  gap: .95rem;
  transition: box-shadow var(--t), transform var(--t);
}
.planner-result:hover { box-shadow: var(--s3); transform: translateY(-2px); }

.planner-result--empty {
  background: #fff;
  padding: 1.4rem;
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--color-border);
  color: var(--color-text-3);
  font-size: .9rem;
}

.planner-result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.planner-result h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--color-brand-dk);
}

.planner-result-heading {
  display: flex;
  flex-direction: column;
  gap: .32rem;
  flex: 1;
  min-width: 0;
}

.planner-result-tags {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.planner-result-heading .planner-result-tags { margin-top: .1rem; }

.planner-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .4rem;
}

.planner-result-summary {
  margin: 0;
  font-size: .87rem;
  color: var(--color-text-3);
  line-height: 1.55;
}

.planner-result-body {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .6rem;
}
.planner-result-body .macro-list { flex: 1 1 200px; }
.planner-result-body .meal-price { flex: 0 0 165px; align-self: flex-start; }

.planner-result-impact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.planner-result-impact .eco-meter { flex: 1 1 140px; }

.eco-score-detail { margin: 0; font-size: .8rem; color: var(--color-text-3); }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  background: rgba(45,122,80,.1);
  color: var(--color-brand-dk);
  border-radius: var(--r-pill);
  padding: .26rem .68rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.badge--co2     { background: rgba(95,191,136,.18); }
.badge--eco     { background: rgba(45,122,80,.16); }
.badge--season  { background: rgba(21,73,48,.14); }
.badge--estimate{ background: rgba(194,149,43,.16); color: #5c4002; }

.eco-score-badge { letter-spacing: .05em; }
.eco-score-badge--excellent { background: rgba(31,117,74,.14); color: #0c3f1e; }
.eco-score-badge--good      { background: rgba(47,138,92,.16); color: #10502e; }
.eco-score-badge--balanced  { background: rgba(192,149,43,.16); color: #5a3d00; }
.eco-score-badge--attention { background: rgba(216,120,31,.18); color: #6a2b00; }
.eco-score-badge--critical  { background: rgba(199,67,67,.18);  color: #681010; }

/* ── Eco meter ────────────────────────────────────────────────────── */
.eco-meter {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(45,122,80,.1);
  overflow: hidden;
  flex: 1;
}
.eco-meter__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.eco-meter__bar--excellent { background: linear-gradient(90deg,#1f754a,#6dde9e); }
.eco-meter__bar--good      { background: linear-gradient(90deg,#2f8a5c,#8ee3b6); }
.eco-meter__bar--balanced  { background: linear-gradient(90deg,#c0952b,#f5de88); }
.eco-meter__bar--attention { background: linear-gradient(90deg,#d8781f,#ffc47d); }
.eco-meter__bar--critical  { background: linear-gradient(90deg,#c74343,#f58f8f); }

/* ── Footprint pill ───────────────────────────────────────────────── */
.footprint-pill {
  display: grid;
  gap: .12rem;
  padding: .62rem .82rem;
  border-radius: var(--r-sm);
  background: rgba(95,191,136,.13);
  border: 1px solid rgba(45,122,80,.13);
  min-width: 150px;
  max-width: 210px;
}
.footprint-pill__label {
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-text-3);
}
.footprint-pill__value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-brand-dk);
  line-height: 1.1;
}
.footprint-pill__hint { font-size: .7rem; color: var(--color-text-3); }

/* ── Tags ─────────────────────────────────────────────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: .38rem; }
.tag {
  background: var(--g100);
  color: var(--color-brand-dk);
  border-radius: var(--r-pill);
  padding: .26rem .68rem;
  font-size: .7rem;
  font-weight: 500;
}

/* ── Macros ───────────────────────────────────────────────────────── */
.macro-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .45rem;
  list-style: none;
  padding: 0;
  margin: .45rem 0;
}
.macro-list li {
  background: var(--g50);
  padding: .52rem .68rem;
  border-radius: var(--r-sm);
  border: 1px solid rgba(45,122,80,.08);
  font-size: .8rem;
  color: var(--color-text-2);
}
.macro-list strong {
  display: block;
  font-size: .94rem;
  font-weight: 700;
  color: var(--color-brand-dk);
}
.macro-list--compact { gap: .4rem; margin: .35rem 0; }
.macro-list--compact li { padding: .45rem .62rem; }
.macro-list--compact strong { font-size: .9rem; }

/* ── Meal price ───────────────────────────────────────────────────── */
.meal-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--g50);
  border-radius: var(--r-sm);
  padding: .52rem .8rem;
  font-size: .86rem;
  border: 1px solid rgba(45,122,80,.08);
}
.meal-price span { color: var(--color-text-3); }
.meal-price strong { color: var(--color-brand-dk); font-weight: 700; }
.meal-price--compact { margin: 0; padding: .46rem .72rem; font-size: .82rem; }
.meal-price--compact strong { font-size: .9rem; }

/* ── Products ─────────────────────────────────────────────────────── */
.product-section { display: flex; flex-direction: column; gap: .38rem; }

.product-heading {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-brand-dk);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.product-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .45rem;
  max-height: 190px;
  overflow-y: auto;
}

.product-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: .65rem;
  align-items: center;
  background: var(--g50);
  border-radius: var(--r-sm);
  border: 1px solid rgba(45,122,80,.09);
  padding: .55rem .75rem;
}

.product-thumb {
  width: 42px; height: 42px;
  border-radius: var(--r-xs);
  background: var(--g100);
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  color: var(--color-brand-dk);
  text-transform: uppercase;
  flex-shrink: 0;
}
.product-thumb--placeholder {
  background: linear-gradient(135deg,rgba(45,122,80,.18),rgba(45,122,80,.06));
}

.product-info { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }

.product-name {
  margin: 0;
  font-size: .82rem; font-weight: 600;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.product-meta {
  display: flex; flex-wrap: wrap; gap: .28rem;
  font-size: .72rem; color: var(--color-text-3);
}
.product-meta span {
  background: rgba(45,122,80,.08);
  padding: .08rem .38rem;
  border-radius: var(--r-pill);
}

.product-price {
  font-size: .86rem; font-weight: 700;
  color: var(--color-brand-dk);
  white-space: nowrap;
}

.product-shop-link {
  color: var(--color-brand);
  font-size: .76rem;
  margin-left: .3rem;
  opacity: .75;
  transition: opacity var(--t);
}
.product-shop-link:hover { opacity: 1; }

.shop-tip { margin: 0; font-size: .84rem; color: var(--color-text-2); line-height: 1.55; }
.co2-source { margin: 0; font-size: .75rem; color: var(--color-text-3); }

.store-suggestion { margin: .4rem 0; font-size: .88rem; color: var(--color-brand-dk); font-weight: 600; }

.legal-note { margin-top: 1rem; font-size: .8rem; color: var(--color-text-3); }
.legal-note strong { color: var(--color-brand-dk); }

/* ── Legal pages ──────────────────────────────────────────────────── */
.legal-content { max-width: 800px; margin: 0 auto; display: grid; gap: 1.5rem; }
.legal-content h2 { margin-bottom: .4rem; color: var(--color-brand-dk); font-weight: 700; }
.legal-content ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.legal-content li { margin-bottom: .35rem; }

/* ── Sections ─────────────────────────────────────────────────────── */
.section { margin-top: 4rem; }

.section--soft {
  background: linear-gradient(175deg, rgba(196,239,213,.22) 0%, transparent 100%);
  padding: 3rem clamp(1.5rem,3vw,2.5rem);
  border-radius: var(--r-xl);
  border: 1px solid rgba(45,122,80,.07);
}

.section--split {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
  padding: clamp(2rem,3vw,3rem);
  background: var(--color-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--s2);
  border: 1px solid rgba(45,122,80,.07);
}

.section--cta { display: flex; justify-content: center; margin-bottom: 2rem; }

.section-header { margin-bottom: 2rem; }

.section-kicker {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--color-brand);
  background: var(--g100);
  padding: .28rem .78rem;
  border-radius: var(--r-pill);
}

.section h2 {
  margin: .6rem 0 0;
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--color-brand-dk);
}

.section p { color: var(--color-text-3); max-width: 650px; line-height: 1.7; }

/* ── Cards ────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.cards-grid--two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  background: var(--color-surface);
  padding: 1.65rem;
  border-radius: var(--r-lg);
  box-shadow: var(--s1);
  border: 1px solid rgba(45,122,80,.08);
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--s3); transform: translateY(-2px); }

.card h3 {
  margin: 0 0 .6rem;
  font-size: 1rem; font-weight: 700;
  letter-spacing: -.015em;
  color: var(--color-brand-dk);
}
.card p { margin: 0; font-size: .9rem; color: var(--color-text-3); line-height: 1.6; }

.card--plan ul { list-style: none; padding: 0; margin: .9rem 0 0; }
.card--plan li {
  display: flex; gap: .5rem; align-items: flex-start;
  margin-bottom: .5rem; font-size: .88rem; color: var(--color-text-2);
}
.card--plan li::before { content: "✓"; color: var(--color-brand); font-weight: 700; flex-shrink: 0; }

.plan-label {
  display: inline-flex; padding: .24rem .68rem;
  border-radius: var(--r-pill); background: var(--g100);
  font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 700; color: var(--color-brand-dk); margin-bottom: .8rem;
}
.plan-price { margin-top: 1rem; font-weight: 800; color: var(--color-brand-dk); font-size: 1.2rem; }

/* ── Feature list ─────────────────────────────────────────────────── */
.feature-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.feature-list li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: .8rem;
  font-size: .93rem;
  color: var(--color-text-2);
  line-height: 1.6;
}
.feature-list li::before {
  content: "→";
  position: absolute; left: 0;
  color: var(--color-brand); font-weight: 700;
}

/* ── Metrics card ─────────────────────────────────────────────────── */
.metrics-card {
  background: var(--g50);
  padding: 1.65rem;
  border-radius: var(--r-lg);
  border: 1px solid rgba(45,122,80,.1);
  box-shadow: var(--s1);
}
.metric {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid rgba(45,122,80,.1);
  padding: .72rem 0;
}
.metric:last-of-type { border-bottom: none; }
.metric-label { font-size: .88rem; color: var(--color-text-3); }
.metric-value { font-weight: 700; color: var(--color-brand-dk); font-size: .92rem; }
.metric-footnote { margin-top: 1.1rem; font-size: .78rem; color: var(--color-text-3); }

/* ── CTA ──────────────────────────────────────────────────────────── */
.cta-card {
  background: linear-gradient(135deg, #cff0e2 0%, #b0e6cc 100%);
  padding: clamp(2rem,4vw,3.5rem);
  border-radius: var(--r-xl);
  text-align: center;
  box-shadow: var(--s3);
  width: min(720px, 100%);
  border: 1px solid rgba(45,122,80,.14);
}
.cta-card h2 { margin-top: 0; color: var(--color-brand-dk); }
.cta-card p { margin: .75rem auto 1.75rem; max-width: 520px; color: var(--color-text-2); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }

/* ── Timeline & team ──────────────────────────────────────────────── */
.timeline { display: grid; gap: 1rem; margin-top: 1.5rem; }
.timeline-item {
  background: var(--color-surface); border-radius: var(--r-lg);
  padding: 1.4rem; border: 1px solid rgba(45,122,80,.09); box-shadow: var(--s1);
}
.timeline-meta {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--color-brand); font-weight: 700; margin-bottom: .45rem;
}

.team-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.team-card {
  background: var(--color-surface); padding: 1.4rem;
  border-radius: var(--r-lg); box-shadow: var(--s1);
  border: 1px solid rgba(45,122,80,.07);
}
.team-card h3 { margin: 0 0 .28rem; color: var(--color-brand-dk); font-size: .98rem; font-weight: 700; }
.team-role { font-size: .83rem; color: var(--color-brand); font-weight: 600; margin-bottom: .6rem; }

/* ── Contact ──────────────────────────────────────────────────────── */
.contact-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.contact-card {
  background: var(--color-surface); border-radius: var(--r-lg);
  padding: 1.65rem; box-shadow: var(--s1);
  border: 1px solid rgba(45,122,80,.07);
  display: flex; flex-direction: column; gap: .8rem;
}
.form-actions { display: flex; justify-content: flex-start; margin-top: .35rem; }
.map-placeholder {
  background: linear-gradient(135deg,var(--g100),var(--g150));
  border-radius: var(--r-lg); padding: 2rem;
  color: var(--color-brand-dk); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  background: #0b1c12;
  color: #deeee4;
  padding: 4rem var(--px) 2.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.footer-grid h3 {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(222,238,228,.5); margin: 0 0 .8rem;
}

.footer-copy { margin: .55rem 0 0; color: rgba(222,238,228,.7); font-size: .88rem; line-height: 1.65; }

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(222,238,228,.82); font-size: .86rem; transition: color var(--t); }
.footer-links a:hover { color: #fff; }

.footer-attribution {
  font-size: .76rem;
  color: rgba(222,238,228,.45);
  margin-bottom: .75rem;
  line-height: 1.6;
}
.footer-attribution a { color: rgba(222,238,228,.65); text-decoration: underline; }
.footer-attribution a:hover { color: #fff; }

.badge--estimate { background: rgba(230,189,71,.22); color: #6a4b08; }

.footer-meta {
  display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center;
  color: rgba(222,238,228,.45); font-size: .78rem;
}
.footer-meta a { color: rgba(222,238,228,.45); transition: color var(--t); }
.footer-meta a:hover { color: #fff; }

[aria-disabled="true"] { pointer-events: none; opacity: .55; }

/* ── Cookie banner ────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 2rem));
  background: #0c1d13;
  color: #deeee4;
  padding: 1.4rem 1.5rem;
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.08);
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  z-index: 95;
}
.cookie-banner.is-visible { display: flex; }

.cookie-content h2 { margin: 0 0 .35rem; font-size: .97rem; font-weight: 700; }
.cookie-content p { margin: 0; font-size: .83rem; color: rgba(222,238,228,.75); line-height: 1.55; }
.cookie-content a { color: var(--color-brand-lt); }

.cookie-actions { display: flex; flex-direction: column; gap: .45rem; flex-shrink: 0; }
.cookie-actions .btn { font-size: .84rem; padding: .62rem 1.1rem; }
.cookie-actions .btn-solid { background: var(--color-brand); }
.cookie-actions .btn-ghost { background: rgba(222,238,228,.12); color: #deeee4; }
.cookie-actions .btn-ghost:hover { background: rgba(222,238,228,.2); }

/* ── Auth modal ───────────────────────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0;
  background: rgba(7,20,12,.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
  z-index: 110;
}
.auth-modal.is-visible { opacity: 1; pointer-events: auto; }

.auth-card {
  background: var(--color-surface);
  border-radius: var(--r-xl);
  width: min(400px, 100%);
  padding: clamp(1.75rem,3vw,2.4rem);
  position: relative;
  box-shadow: var(--s4);
  border: 1px solid rgba(45,122,80,.09);
}

.auth-close {
  position: absolute; top: .8rem; right: .8rem;
  border: none; background: var(--g100); color: var(--color-brand-dk);
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 1.15rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.auth-close:hover { background: var(--g150); }

.auth-header h2 {
  margin: 0; color: var(--color-brand-dk);
  font-weight: 800; font-size: 1.35rem; letter-spacing: -.025em;
}
.auth-header p { margin: .38rem 0 1.2rem; color: var(--color-text-3); font-size: .86rem; }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--g50); border-radius: var(--r-sm);
  padding: .28rem; margin-bottom: 1.1rem;
  border: 1px solid rgba(45,122,80,.09);
}
.auth-tab {
  border: none; background: transparent;
  padding: .6rem; border-radius: calc(var(--r-sm) - 2px);
  font-family: var(--font); font-size: .86rem; font-weight: 600;
  color: var(--color-text-3); cursor: pointer;
  transition: background var(--t), color var(--t);
}
.auth-tab.is-active {
  background: #fff; color: var(--color-brand-dk);
  box-shadow: var(--s1);
}

.auth-form { display: flex; flex-direction: column; gap: .8rem; }
.auth-form.is-hidden { display: none; }

.auth-status {
  font-size: .84rem; margin: 0 0 .5rem;
  color: var(--color-brand); display: none; font-weight: 500;
}
.auth-status.is-error { color: #b83030; }

/* ── Planner section (full-width) ─────────────────────────────────── */
.planner-section {
  background: var(--color-surface);
  border-radius: var(--r-xl);
  padding: 2.5rem clamp(1.5rem,3vw,2.75rem) 2rem;
  box-shadow: var(--s2);
  border: 1px solid rgba(45,122,80,.08);
  margin-bottom: 0;
}

.planner-section-header {
  margin-bottom: 1.75rem;
}
.planner-section-header h2 {
  margin: .5rem 0 .6rem;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--color-brand-dk);
}
.planner-section-header p {
  margin: 0;
  font-size: .95rem;
  color: var(--color-text-3);
  max-width: 640px;
}
.planner-section-header p a { color: var(--color-brand); font-weight: 500; }

/* ── Planner controls row ─────────────────────────────────────────── */
.planner-controls { margin-bottom: 1rem; }

.planner-controls-row {
  display: flex;
  align-items: flex-end;
  gap: .85rem;
  flex-wrap: wrap;
}

.planner-field {
  display: flex;
  flex-direction: column;
  gap: .32rem;
  flex: 1 1 160px;
  min-width: 130px;
}

.planner-field select {
  width: 100%;
}

.planner-submit {
  flex: 0 0 auto;
  align-self: flex-end;
  padding: .77rem 1.6rem;
  font-size: .92rem;
  white-space: nowrap;
  height: auto;
}

/* ── Location drawer ──────────────────────────────────────────────── */
.location-drawer {
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: var(--g50);
}

.location-drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.1rem;
  cursor: pointer;
  list-style: none;
  font-size: .88rem;
  font-weight: 600;
  color: var(--color-brand-dk);
  user-select: none;
  gap: .5rem;
  transition: background var(--t);
}
.location-drawer-toggle::-webkit-details-marker { display: none; }
.location-drawer-toggle:hover { background: var(--g100); }

.location-drawer-chevron {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: .65rem;
  color: var(--color-brand);
  flex-shrink: 0;
  transition: transform .22s ease;
}
.location-drawer-chevron::after { content: "›"; display: block; line-height: 1; }
.location-drawer[open] .location-drawer-chevron { transform: rotate(90deg); }

.location-drawer-body {
  padding: 1.1rem 1.1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: .85rem;
}

.location-drawer-inputs {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.location-drawer-inputs .field-row { flex: 1 1 260px; }
.location-drawer-inputs .btn { flex-shrink: 0; align-self: center; }

/* ── Planner output grid ──────────────────────────────────────────── */
.planner-output { margin-top: .25rem; }

.planner-result-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.1rem;
}

/* ── OFF Grade badges (on ingredients) ───────────────────────────── */
.off-grade {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  border-radius: var(--r-pill);
  padding: .12rem .5rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.4;
}

.off-eco-a, .off-nutri-a { background: #1f754a22; color: #0c3f1e; }
.off-eco-b, .off-nutri-b { background: #2f8a5c22; color: #10502e; }
.off-eco-c, .off-nutri-c { background: #c0952b22; color: #5a3d00; }
.off-eco-d, .off-nutri-d { background: #d8781f22; color: #6a2b00; }
.off-eco-e, .off-nutri-e { background: #c7434322; color: #681010; }
.off-loading { background: rgba(45,122,80,.08); color: var(--color-text-3); font-style: italic; }

/* ── OFF grade showcase (info section) ───────────────────────────── */
.off-grades-card {
  background: var(--g50);
  padding: 1.65rem;
  border-radius: var(--r-lg);
  border: 1px solid rgba(45,122,80,.1);
  box-shadow: var(--s1);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.off-grade-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(45,122,80,.09);
}
.off-grade-row:last-of-type { border-bottom: none; }

.off-grade-badge {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
  flex-shrink: 0;
}

.off-eco--a { background: #1a7a45; color: #fff; }
.off-eco--b { background: #5cb85c; color: #fff; }
.off-eco--c { background: #f0c020; color: #333; }
.off-eco--d { background: #e07820; color: #fff; }
.off-eco--e { background: #d43a2a; color: #fff; }

.off-grade-label { font-size: .9rem; color: var(--color-text-2); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════ */

/* ── Large screens ────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-grid > div:first-child .footer-copy { max-width: 440px; }
}

/* ── Tablet landscape / medium (≤ 900px) ─────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-copy { text-align: center; }
  .hero-copy p { margin-inline: auto; }
  .hero-copy h1 { font-size: clamp(2rem, 6vw, 2.75rem); }
  .hero-badge { display: inline-flex; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-actions { justify-content: center; }

  .site-header {
    padding-top: calc(var(--nav-h) + 2.5rem);
    padding-bottom: 3.5rem;
  }

  /* Planner 2 cols on tablet */
  .planner-result-grid { grid-template-columns: repeat(2, 1fr); }

  .planner-controls-row { flex-wrap: wrap; }
  .planner-field { flex: 1 1 200px; }
  .planner-submit { width: 100%; }
}

/* ── Mobile (≤ 768px) ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --nav-h: 58px; --px: 1.1rem; }

  main { padding-block: 2.5rem 4rem; }

  /* Nav */
  .nav-toggle { display: flex; }

  .primary-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(260px, 78vw);
    background: var(--color-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--nav-h) + 1.25rem) 1.25rem 2rem;
    transform: translateX(110%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 90;
    box-shadow: -6px 0 32px rgba(0,0,0,.14);
    gap: .2rem;
  }
  .primary-nav.is-open { transform: translateX(0); }
  .nav-link { font-size: .95rem; width: 100%; padding: .65rem .85rem; }

  .nav-cta--mobile { display: block; margin-top: .5rem; width: 100%; }
  .nav-cta--mobile .btn { width: 100%; }
  .masthead-actions { display: none; }

  /* Hero */
  .hero { gap: 2rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats .stat-pill:last-child { grid-column: span 2; }
  .hero-panel { padding: 1.4rem; }

  /* Store map */
  .store-map { aspect-ratio: 4/3; }

  /* Planner results */
  .planner-result-header { flex-direction: column; }
  .planner-result-meta { flex-direction: row; flex-wrap: wrap; }
  .planner-result-body { flex-direction: column; }
  .planner-result-body .meal-price { width: 100%; flex: none; }
  .planner-result-grid { grid-template-columns: 1fr; }

  /* Planner controls */
  .planner-controls-row { flex-direction: column; align-items: stretch; }
  .planner-field { flex: none; width: 100%; min-width: 0; }
  .planner-submit { width: 100%; }
  .planner-section { padding: 1.75rem 1.1rem 1.5rem; border-radius: var(--r-lg); }

  /* Form */
  .field-group { flex-direction: column; align-items: stretch; }
  .field-row   { flex-direction: column; align-items: stretch; }
  .btn-field   { width: 100%; }

  /* Sections */
  .section { margin-top: 2.5rem; }
  .section--soft  { padding: 2rem 1.25rem; }
  .section--split { padding: 2rem 1.25rem; grid-template-columns: 1fr; }
  .cards-grid, .cards-grid--two { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-meta { flex-direction: column; gap: .4rem; }

  /* Cookie */
  .cookie-banner { flex-direction: column; }
  .cookie-actions { flex-direction: row; gap: .5rem; }

  /* CTA */
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; }

  /* Products */
  .product-item { grid-template-columns: 42px 1fr; }
  .product-price { grid-column: 2; }
}

/* ── Small mobile (≤ 480px) ──────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --px: .9rem; --nav-h: 54px; }

  .site-header {
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: 2.5rem;
  }

  .hero { gap: 1.75rem; }
  .hero-copy h1 { font-size: clamp(1.8rem, 9vw, 2.4rem); }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }
  .hero-stats .stat-pill:last-child { grid-column: span 2; }

  .hero-panel { padding: 1.15rem; border-radius: var(--r-lg); }

  main { padding-block: 2rem 3rem; }

  .section h2 { font-size: 1.7rem; }
  .planner-result { padding: 1.1rem; border-radius: var(--r-md); }

  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }

  /* Cookie slides up from bottom */
  .cookie-banner {
    bottom: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    width: 100%;
  }
  .cookie-actions { flex-direction: column; }
  .cookie-actions .btn { width: 100%; }

  /* Auth modal slides up */
  .auth-modal { padding: 0; align-items: flex-end; }
  .auth-card {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    width: 100%;
    padding: 1.65rem 1.15rem calc(1.65rem + env(safe-area-inset-bottom, 0px));
    max-height: 90dvh;
    overflow-y: auto;
  }

  .macro-list { grid-template-columns: 1fr 1fr; }
  .store-map { aspect-ratio: unset; height: 185px; }
}
