/* ============================================================
   SJ Formula Hub — Stylesheet
   Clean clinical design for dietitians, clinicians & parents
   ============================================================ */

:root {
  --primary:       #1a5276;
  --primary-light: #2e86c1;
  --primary-pale:  #ebf5fb;
  --accent:        #1abc9c;
  --text-dark:     #1c2833;
  --text-mid:      #5d6d7e;
  --text-light:    #aab7b8;
  --border:        #d5d8dc;
  --bg:            #f4f6f8;
  --white:         #ffffff;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.14);
  --radius:        10px;
  --radius-sm:     6px;
  --transition:    all 0.2s ease;

  /* Category colors */
  --cat-standard:  #2e86c1;
  --cat-preterm:   #e67e22;
  --cat-cma:       #8e44ad;
  --cat-soy:       #27ae60;
  --cat-organic:   #16a085;
  --cat-special:   #c0392b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;     /* prevent horizontal blowout from nav overflow */
}

/* ── Typography ─────────────────────────────────────────── */
h1 { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.4rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: var(--text-mid); }

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.5px;
}

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title { font-size: 1rem; font-weight: 700; color: var(--primary); }
.logo-sub   { font-size: 0.68rem; color: var(--text-mid); font-weight: 400; }

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
  min-width: 0;                   /* allow flex child to shrink */
}
.nav::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.nav-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-btn:hover { background: var(--primary-pale); color: var(--primary); }
.nav-btn.active { background: var(--primary); color: white; }

.header-disclaimer {
  font-size: 0.66rem;
  color: var(--text-light);
  text-align: right;
  flex-shrink: 0;
  max-width: 165px;
  line-height: 1.35;
  display: none;
}
/* Show full disclaimer only on very wide screens where the 7-button
   nav has plenty of room; on mid-desktop, the nav takes priority. */
@media (min-width: 1280px) { .header-disclaimer { display: block; } }
/* Hide the header disclaimer on the home page — the hero already carries
   the same trust messaging and the disclaimer competes with it visually. */
body.on-home .header-disclaimer { display: none !important; }

/* ── Ad Banner ──────────────────────────────────────────── */
.ad-banner {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  text-align: center;
  min-height: 0;
  overflow: hidden;
  max-height: 120px;
  transition: max-height 0.2s ease, padding 0.2s ease;
}
/* Collapse banner completely when AdSense reports unfilled */
.ad-banner:has(ins[data-ad-status="unfilled"]),
.ad-banner:has(ins:not([data-ad-status])[style*="display: none"]) {
  max-height: 0;
  padding: 0;
  border-bottom: none;
}
/* When ad is filled, restore padding */
.ad-banner:has(ins[data-ad-status="filled"]) {
  padding: 8px 24px;
}
.ad-slot {
  display: inline-block;
  background: #f8f9fa;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
}
.ad-slot.leaderboard { width: 100%; max-width: 728px; height: 32px; line-height: 22px; }
.ad-slot.rectangle   { width: 300px; height: 250px; line-height: 240px; }
.ad-slot.inline      { width: 100%; height: 60px; line-height: 50px; margin: 16px 0; }

/* ── Page Layout ────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }

/* ── Hero / Search ──────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 40px 24px;
  text-align: center;
}

.hero h1 { color: white; margin-bottom: 8px; }
.hero p   { color: rgba(255,255,255,0.80); max-width: 520px; margin: 0 auto 24px; font-size: 0.97rem; }

.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 48px 14px 18px;
  border: none;
  border-radius: 30px;
  font-size: 0.97rem;
  background: white;
  color: var(--text-dark);
  box-shadow: var(--shadow-md);
  outline: none;
}
.search-input::placeholder { color: var(--text-light); }
.search-input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,0.4), var(--shadow-md); }

.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-mid);
  pointer-events: none;
}

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.filter-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
  margin-right: 4px;
}

.chip {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-mid);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary-light); color: var(--primary); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.chip.cat-standard.active  { background: var(--cat-standard); border-color: var(--cat-standard); }
.chip.cat-preterm.active   { background: var(--cat-preterm);  border-color: var(--cat-preterm); }
.chip.cat-cma.active       { background: var(--cat-cma);      border-color: var(--cat-cma); }
.chip.cat-soy.active       { background: var(--cat-soy);      border-color: var(--cat-soy); }
.chip.cat-organic.active   { background: var(--cat-organic);  border-color: var(--cat-organic); }
.chip.cat-special.active   { background: var(--cat-special);  border-color: var(--cat-special); }

.filter-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

/* ── Results count ──────────────────────────────────────── */
.results-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 0 8px;
  font-size: 0.85rem;
  color: var(--text-mid);
}

/* ── Formula Grid ───────────────────────────────────────── */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

/* ── Formula Card ───────────────────────────────────────── */
.formula-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.formula-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-color, var(--primary-light));
}
.formula-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-name {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

.card-brand {
  font-size: 0.75rem;
  color: var(--text-mid);
  margin-top: 2px;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: white;
  background: var(--cat-color, var(--primary));
}

.region-flags {
  display: flex;
  gap: 4px;
}
.flag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-mid);
  font-weight: 500;
}

.card-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 0.68rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-pale);
  color: var(--primary);
  font-weight: 500;
}

.card-cta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
  flex: 1;
}
.btn-primary:hover { background: var(--primary-light); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-pale); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ── Detail Panel ───────────────────────────────────────── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.detail-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--white);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.detail-panel.open { transform: translateX(0); }

.detail-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.detail-header-info { flex: 1; }
.detail-name { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.detail-brand { font-size: 0.82rem; color: var(--text-mid); margin-top: 3px; }
.detail-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.close-btn {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: var(--transition);
}
.close-btn:hover { background: var(--border); }

.detail-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 24px; }

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-mid);
  margin-bottom: 10px;
}

/* Nutrition table */
.nutrition-table {
  width: 100%;
  border-collapse: collapse;
}
.nutrition-table tr { border-bottom: 1px solid var(--bg); }
.nutrition-table tr:last-child { border-bottom: none; }
.nutrition-table td {
  padding: 7px 4px;
  font-size: 0.85rem;
}
.nutrition-table td:first-child { color: var(--text-mid); }
.nutrition-table td:last-child  { font-weight: 600; text-align: right; color: var(--text-dark); }
.nutrition-table .section-header td {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  font-weight: 700;
  padding-top: 14px;
}

.detail-description {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.6;
}

.detail-prep-box {
  background: var(--primary-pale);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--primary);
}

.detail-notes {
  background: #fef9e7;
  border-left: 3px solid #f39c12;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #7d6608;
}

.detail-source {
  font-size: 0.72rem;
  color: var(--text-light);
}

.detail-ingredients {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0;
}

.detail-calc-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.detail-calc-btn:hover { opacity: 0.9; box-shadow: var(--shadow-md); }

/* ── Calculator Page ────────────────────────────────────── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 48px;
}
@media (max-width: 860px) { .calc-layout { grid-template-columns: 1fr; } }

.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}

.calc-card h2 { margin-bottom: 4px; }
.calc-card > p { font-size: 0.85rem; margin-bottom: 20px; }

.mode-toggle {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
}
.mode-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.mode-btn.active { background: var(--white); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }

/* Recipe Check mode — input + unit-dropdown layout */
.check-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 8px;
}
.check-row .form-input { width: 100%; }
.check-row .form-select { width: 100%; }
@media (max-width: 480px) {
  .check-row { grid-template-columns: 1fr; }
}

/* Cal/oz density tier badge in Recipe Check results */
.density-tier {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.82rem;
  margin-left: 6px;
  vertical-align: middle;
}
.density-tier.tier-dilute    { background: #fff3e0; color: #6b3a00; border: 1px solid #ffb74d; }
.density-tier.tier-standard  { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.density-tier.tier-mild      { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.density-tier.tier-concentrated { background: #fff8e1; color: #8b6500; border: 1px solid #ffd54f; }
.density-tier.tier-high      { background: #ffebee; color: #b71c1c; border: 1px solid #ef9a9a; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-label span { color: var(--text-mid); font-weight: 400; font-size: 0.78rem; }

.form-select, .form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.form-select:focus, .form-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-pale); }

.target-presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.preset-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
}
.preset-btn:hover   { border-color: var(--primary); color: var(--primary); }
.preset-btn.active  { background: var(--primary); border-color: var(--primary); color: white; }

/* Result box */
.result-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  margin-top: 20px;
  display: none;
}
.result-box.visible { display: block; }

.result-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.75; margin-bottom: 12px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.result-item { display: flex; flex-direction: column; gap: 2px; }
.result-val { font-size: 1.5rem; font-weight: 700; }
.result-label { font-size: 0.72rem; opacity: 0.8; }

.result-note {
  margin-top: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.result-warning {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255,200,0,0.2);
  border-radius: 6px;
  font-size: 0.78rem;
  border-left: 3px solid rgba(255,200,0,0.8);
}

.error-msg {
  color: #c0392b;
  font-size: 0.82rem;
  padding: 10px;
  background: #fdf2f2;
  border-radius: var(--radius-sm);
  border: 1px solid #f1948a;
  margin-top: 12px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── Reference Table ────────────────────────────────────── */
.ref-table-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  grid-column: 1 / -1;
}

.ref-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-table-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ref-table-wrap { overflow-x: auto; }

table.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 580px;
}
.ref-table th {
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.ref-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.ref-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.ref-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--bg);
  white-space: nowrap;
}
.ref-table tr:hover td { background: var(--primary-pale); }
.ref-table td:first-child { font-weight: 600; color: var(--text-dark); }
.ref-table td:not(:first-child) { color: var(--text-mid); font-family: 'Menlo', monospace; }

.ref-table-note {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-light);
}

.print-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--text-mid);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.print-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Articles Page ──────────────────────────────────────── */
.articles-hero {
  text-align: center;
  padding: 60px 24px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 24px;
}
.articles-hero h2 { color: var(--primary); margin-bottom: 10px; }
.articles-hero p  { max-width: 480px; margin: 0 auto 24px; }

/* "Approx" badge for non-manufacturer-verified household measurements */
.measure-approx {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: #fff8e1;
  color: #8b6500;
  border: 1px solid #ffd54f;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: help;
}
.result-precision-note {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-mid);
  font-style: italic;
  line-height: 1.5;
}

/* Beehiiv newsletter embed (lives in the Articles hero) */
/* Newsletter signup card — Netlify Forms-backed (replaces broken Beehiiv iframe) */
.newsletter-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.newsletter-card h3 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--primary);
  font-weight: 700;
}
.newsletter-card p {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin: 0 0 14px;
  line-height: 1.5;
}
.newsletter-row {
  display: flex;
  gap: 8px;
}
.newsletter-row input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}
.newsletter-row input[type="email"]:focus { border-color: var(--primary); }
.newsletter-row button {
  padding: 10px 20px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.newsletter-row button:hover:not(:disabled) { background: var(--primary-light); }
.newsletter-row button:disabled { opacity: 0.7; cursor: default; }
/* Honeypot field — visually hidden but available to bots */
.hp-field {
  position: absolute;
  left: -5000px;
  height: 0;
  overflow: hidden;
}
.newsletter-message {
  margin-top: 10px;
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.45;
  min-height: 1.2em;
}
.newsletter-message.tone-success {
  color: #1b5e20;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.newsletter-message.tone-error {
  color: #b71c1c;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
@media (max-width: 480px) {
  .newsletter-row { flex-direction: column; }
  .newsletter-row button { width: 100%; }
}

.articles-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 32px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 48px;
}
.topic-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  opacity: 0.6;
}
.topic-card .topic-icon { font-size: 2rem; margin-bottom: 8px; }
.topic-card h4 { margin-bottom: 4px; }
.topic-card p  { font-size: 0.78rem; }
.coming-soon-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-pale);
  color: var(--primary);
  margin-top: 6px;
}

/* ── Topic card — live (has article) ──────────────────── */
.topic-card-live {
  opacity: 1;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.topic-card-live:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
  transform: translateY(-2px);
  border-color: var(--primary);
}
.topic-read-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  margin-top: 6px;
}

/* ── Article page layout ─────────────────────────────── */
.art-back-bar {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 0 16px;
}
.art-back-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.art-back-btn:hover { border-color: var(--primary); color: var(--primary); }

.art-body {
  max-width: 760px;
  margin: 24px auto 60px;
  padding: 0 16px;
}

/* ── Article header ──────────────────────────────────── */
.art-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.art-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  background: var(--primary-pale);
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.art-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 10px;
}
.art-subtitle {
  font-size: 1.05rem;
  color: var(--text-mid);
  margin-bottom: 14px;
  line-height: 1.5;
}
.art-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-mid);
  flex-wrap: wrap;
}

/* ── Article sections ────────────────────────────────── */
.art-section {
  margin-bottom: 40px;
}
.art-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-pale);
}
.art-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 20px 0 10px;
}
.art-section p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-dark);
  margin-bottom: 14px;
}

/* ── Tip & Warning boxes ─────────────────────────────── */
.art-tip-box, .art-warning-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.art-tip-box {
  background: #f0faf4;
  border: 1.5px solid #b7e4c7;
}
.art-warning-box {
  background: #fff8ec;
  border: 1.5px solid #fcd88a;
}
.art-tip-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }

/* ── Spectrum visual ─────────────────────────────────── */
.art-spectrum {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 18px;
  margin: 28px 0;
  text-align: center;
}
.art-spectrum-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mid);
  margin-bottom: 18px;
}
.art-spectrum-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.art-spectrum-step {
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 150px;
  flex: 1;
}
.step-standard { background: #eaf4ff; border: 1.5px solid #b3d9ff; }
.step-comfort   { background: #f0faf4; border: 1.5px solid #b7e4c7; }
.step-ha        { background: #f9f0ff; border: 1.5px solid #d8b4fe; }
.step-icon { font-size: 1.6rem; margin-bottom: 6px; }
.step-name { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.step-desc { font-size: 0.75rem; color: var(--text-mid); line-height: 1.4; }
.art-spectrum-arrow { font-size: 1.4rem; color: var(--text-mid); flex-shrink: 0; }
.art-spectrum-note { font-size: 0.78rem; color: var(--text-mid); margin: 14px 0 0; }

/* ── Comparison table ────────────────────────────────── */
.art-comparison-table {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0 20px;
  font-size: 0.85rem;
}
.art-cmp-row {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.art-cmp-row:last-child { border-bottom: none; }
.art-cmp-header { background: var(--bg); font-weight: 700; font-size: 0.78rem; }
.art-cmp-row > div { padding: 10px 12px; border-right: 1px solid var(--border); line-height: 1.5; }
.art-cmp-row > div:last-child { border-right: none; }
.art-cmp-row small { color: var(--text-mid); }

/* ── Decision flowchart ──────────────────────────────── */
.art-flowchart { margin: 20px 0; }
.art-flow-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.art-flow-connector {
  width: 2px;
  height: 20px;
  background: var(--border);
  margin: 0 0 0 22px;
}
.art-flow-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.art-flow-content { font-size: 0.88rem; line-height: 1.6; }
.art-flow-content strong { font-size: 0.92rem; display: block; margin-bottom: 4px; }
.art-flow-content p { margin: 4px 0 0; }
.art-flow-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 8px;
}
.tag-standard { background: #eaf4ff; color: #1a6fb5; }
.tag-comfort  { background: #f0faf4; color: #177a45; }
.tag-hypo     { background: #f9f0ff; color: #6b21a8; }
.tag-aaf      { background: #fff0f0; color: #991b1b; }

/* ── Red flags ───────────────────────────────────────── */
.art-redflags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.art-redflag-item {
  background: #fff5f5;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ── Switching tips grid ─────────────────────────────── */
.art-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.art-tips-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.art-tips-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ── Summary box ─────────────────────────────────────── */
.art-summary-box {
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}
.art-summary-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.6;
}
.art-summary-row:last-child { border-bottom: none; }
.art-summary-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Disclaimer ──────────────────────────────────────── */
.art-disclaimer {
  background: var(--bg);
  border-left: 4px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin: 32px 0 24px;
}

/* ── Related articles ────────────────────────────────── */
.art-related { margin-top: 40px; border-top: 2px solid var(--border); padding-top: 28px; }
.art-related h3 { font-size: 1.1rem; margin-bottom: 16px; }
.art-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.art-related-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.art-related-card.coming { opacity: 0.55; }
.art-related-icon { font-size: 1.5rem; margin-bottom: 6px; }
.art-related-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.art-related-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-pale);
  color: var(--primary);
}

/* ── References ──────────────────────────────────────── */
.art-references h2 { font-size: 1.1rem; }
.art-ref-list {
  padding-left: 20px;
  margin: 0;
}
.art-ref-list li {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-mid);
  margin-bottom: 10px;
}
.art-ref-list li a { color: var(--primary); text-decoration: none; }
.art-ref-list li a:hover { text-decoration: underline; }

/* ── Author bio ───────────────────────────────────────── */
.art-author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 32px 0 24px;
}
.art-author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.art-author-name  { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.art-author-title { font-size: 0.78rem; color: var(--primary); font-weight: 600; margin-bottom: 8px; }
.art-author-bio   { font-size: 0.83rem; line-height: 1.6; color: var(--text-mid); margin: 0; }

/* ── CMPA: Symptom cards ─────────────────────────────── */
.art-symptoms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.art-symptom-card {
  border-radius: var(--radius);
  padding: 16px;
  border: 1.5px solid var(--border);
}
.card-gut  { background: #fff8ec; border-color: #fcd88a; }
.card-skin { background: #fff0f6; border-color: #f9a8d4; }
.card-resp { background: #eaf4ff; border-color: #b3d9ff; }
.art-symptom-icon { font-size: 1.5rem; margin-bottom: 8px; }
.art-symptom-card h4 { font-size: 0.88rem; margin-bottom: 8px; }
.art-symptom-card ul { padding-left: 16px; margin: 0; }
.art-symptom-card li { font-size: 0.8rem; line-height: 1.55; margin-bottom: 4px; color: var(--text-dark); }

/* ── CMPA: Formula ladder ────────────────────────────── */
.art-formula-ladder { margin: 16px 0; }
.art-ladder-rung {
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  position: relative;
}
.rung-ehf { background: #f0faf4; border-color: #b7e4c7; }
.rung-aaf { background: #f9f0ff; border-color: #d8b4fe; }
.rung-soy { background: #fff8ec; border-color: #fcd88a; }
.art-ladder-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 10px;
  border-radius: 10px;
  background: #177a45;
  color: white;
  margin-bottom: 10px;
}
.badge-aaf { background: #6b21a8; }
.badge-soy { background: #92400e; }
.art-ladder-rung h4 { font-size: 0.95rem; margin-bottom: 8px; }
.art-ladder-rung p  { font-size: 0.88rem; line-height: 1.65; margin-bottom: 8px; }
.art-ladder-note    { font-size: 0.8rem; color: var(--text-mid); font-style: italic; margin-bottom: 0 !important; }
.art-ladder-arrow {
  text-align: center;
  padding: 10px 0;
  font-size: 0.8rem;
  color: var(--text-mid);
  font-style: italic;
}
.art-formula-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.art-formula-pill {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* ── CMPA: Tolerance track ───────────────────────────── */
.art-tolerance-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 20px;
}
.art-tolerance-step {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
}
.art-tol-pct {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.art-tol-label { font-size: 0.75rem; color: var(--text-mid); }

/* ── Article mobile responsive ───────────────────────── */
@media (max-width: 600px) {
  .art-spectrum-track { flex-direction: column; align-items: stretch; }
  .art-spectrum-arrow { transform: rotate(90deg); align-self: center; }
  .art-cmp-row { grid-template-columns: 1fr; }
  .art-cmp-row > div { border-right: none; border-bottom: 1px solid var(--border); }
  .art-cmp-header { display: none; }
  .art-cmp-row > div:last-child { border-bottom: none; }
  .art-flow-step { flex-direction: row; }
  .art-tips-grid { grid-template-columns: 1fr; }
  .art-symptoms-grid { grid-template-columns: 1fr; }
  .art-tolerance-track { grid-template-columns: repeat(2, 1fr); }
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.6);
  padding: 32px 24px;
  margin-top: 48px;
  text-align: center;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}
.footer-logo { color: white; font-weight: 700; margin-bottom: 12px; font-size: 1rem; }
.footer-disclaimer {
  font-size: 0.75rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 16px;
}
.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.footer-links a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
}
.footer-links a:hover { color: white; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-mid);
  grid-column: 1 / -1;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-dark); margin-bottom: 6px; }

/* ── Utilities ──────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Header */
  .header-inner   { gap: 8px; padding: 0 12px; height: 56px; }
  .logo-text      { display: none; }                 /* hide tagline, keep logo mark */
  .logo-mark      { width: 32px; height: 32px; font-size: 0.85rem; }
  /* Nav — scroll horizontally, never wrap */
  .nav            { gap: 2px; flex-shrink: 1; }
  .nav-btn        { padding: 5px 11px; font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }
  /* Filter bar */
  .filter-bar     { padding: 8px 12px; top: 56px; }
  .filter-bar-inner { gap: 6px; }
  .chip           { padding: 4px 10px; font-size: 0.75rem; }
  .filter-label   { font-size: 0.72rem; }
  .filter-sep     { display: none; }                 /* remove vertical dividers between filter rows */
  /* Main content */
  main            { padding: 14px 12px; }
  .hero           { padding: 24px 16px 20px; }
  h1              { font-size: 1.35rem; }
  .formula-grid   { grid-template-columns: 1fr; gap: 12px; }
  /* Detail panel */
  .detail-panel   { width: 100% !important; }
  /* Calculator */
  .calc-layout    { grid-template-columns: 1fr; }
  /* Compare page */
  .cmp-selector-bar  { padding: 0 12px; flex-direction: column; align-items: stretch; }
  .cmp-selector-actions { justify-content: flex-end; }
  .cmp-ing-grid   { grid-template-columns: 1fr !important; }
  .cmp-diff-grid  { grid-template-columns: 1fr; }
  .cmp-nutrition-table { font-size: 0.74rem; }
  .cmp-nutrition-table thead th,
  .cmp-nutrition-table tbody td { padding: 6px 8px; }
  /* Ingredient checker */
  .ing-input-row  { flex-wrap: wrap; }
  .ing-add-btn    { flex: 1; min-width: 100px; }
  .ingredient-results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-inner   { gap: 6px; padding: 0 10px; }
  .nav-btn        { padding: 5px 9px; font-size: 0.72rem; }
  .hero h1        { font-size: 1.2rem; }
  .hero p         { font-size: 0.85rem; }
  main            { padding: 12px 10px; }
  .filter-bar     { padding: 7px 10px; }
  .chip           { padding: 3px 9px; font-size: 0.72rem; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .header, .filter-bar, .ad-banner, .footer,
  .detail-overlay, .detail-panel, .card-cta,
  .print-btn { display: none !important; }
  .ref-table-card { border: none; }
}


/* ════════════════════════════════════════════════════════
   INGREDIENT CHECKER
════════════════════════════════════════════════════════ */

/* ── Placeholder (empty state) ──────────────────────────── */
.ing-placeholder {
  text-align: center;
  padding: 64px 24px 48px;
  max-width: 520px;
  margin: 0 auto;
}
.ing-placeholder h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
  color: var(--text-dark);
}
.ing-placeholder p {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 20px;
}
.ing-placeholder .empty-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}
.ing-placeholder-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ing-placeholder-examples span {
  padding: 4px 12px;
  background: var(--primary-pale);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
  cursor: default;
}

/* ── Summary bar ────────────────────────────────────────── */
.ing-summary {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 0 6px;
}
.ing-summary-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-mid);
}
.ing-summary-stat strong {
  font-size: 1.25rem;
  color: var(--primary);
}
.ing-summary-stat em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-dark);
}
.ing-pct-bar-wrap {
  flex: 1;
  min-width: 80px;
  max-width: 200px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ing-pct-bar {
  display: block;
  height: 100%;
  background: var(--primary-light);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ing-pct-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}

/* ── Two-column results grid ────────────────────────────── */
.ingredient-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 24px;
}
@media (max-width: 760px) {
  .ingredient-results-grid { grid-template-columns: 1fr; }
}

/* ── Column ─────────────────────────────────────────────── */
.ing-column {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ing-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ing-header-contains {
  background: #eafaf1;
  color: #1e8449;
  border-bottom-color: #a9dfbf;
}
.ing-header-avoids {
  background: #fdf2f8;
  color: #76448a;
  border-bottom-color: #d7bde2;
}
.ing-col-count {
  margin-left: auto;
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.75rem;
}
.ing-col-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 640px;
  overflow-y: auto;
}
.ing-empty {
  padding: 24px 16px;
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
}

/* ── Individual formula card inside results ─────────────── */
.ing-card {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}
.ing-card:last-child { border-bottom: none; }
.ing-card:hover { background: var(--primary-pale); }
.ing-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ing-card-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ing-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}
.ing-card-brand {
  font-size: 0.72rem;
  color: var(--text-light);
}
.ing-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Ingredient snippet with highlight ──────────────────── */
.ing-snippet {
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--text-mid);
  line-height: 1.4;
}
.ing-snippet mark {
  background: #fff3cd;
  color: #7d5a00;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
}
.ing-snippet-sep {
  color: var(--text-light);
  margin: 0 2px;
}

/* ── Disclaimer ─────────────────────────────────────────── */
.ing-disclaimer {
  max-width: 1280px;
  margin: 0 auto 40px;
  font-size: 0.78rem;
  color: var(--text-mid);
  padding: 12px 16px;
  background: #fffbf0;
  border: 1px solid #f0e0a0;
  border-radius: var(--radius-sm);
}
.ing-disclaimer a {
  color: var(--primary-light);
  text-decoration: none;
  margin-left: 8px;
}
.ing-disclaimer a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   READY-TO-FEED BADGES & INFO
═══════════════════════════════════════════════════════════ */

/* RTF badge on formula cards */
.rtf-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  background: #e8f4fd;
  color: #1a6fa8;
  border: 1px solid #b3d7f0;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* RTF info box in detail panel */
.rtf-info-box {
  background: #f0f8ff;
  border: 1px solid #b3d7f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   INGREDIENT CHECKER — MULTI-TERM FILTER
═══════════════════════════════════════════════════════════ */

/* Input row with Avoid + Require buttons */
.ing-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.ing-add-btn {
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.ing-add-btn:hover   { opacity: 0.85; transform: translateY(-1px); }
.ing-add-avoid       { background: #fdecea; color: #c0392b; border: 1.5px solid #e8a49a; }
.ing-add-require     { background: #eafaf1; color: #1e8449; border: 1.5px solid #a9dfbf; }

/* Active filter tags row */
.ing-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
}

.ing-tags-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

/* Individual tag pills */
.ing-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 4px 4px 6px;
  cursor: default;
  transition: box-shadow 0.15s;
}
.ing-tag-avoid   { background: #fdecea; color: #c0392b; border: 1.5px solid #e8a49a; }
.ing-tag-require { background: #eafaf1; color: #1e8449; border: 1.5px solid #a9dfbf; }

.ing-tag-mode {
  cursor: pointer;
  font-size: 0.85rem;
  title: "Toggle mode";
}
.ing-tag-mode:hover { transform: scale(1.15); }

.ing-tag-text {
  padding: 0 2px;
}

.ing-tag-remove {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.ing-tag-remove:hover { opacity: 1; }

/* Clear all button */
.ing-clear-all {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s;
}
.ing-clear-all:hover { background: rgba(255,255,255,0.15); }

/* Summary line showing active filter terms */
.ing-summary-terms {
  font-size: 0.78rem;
  color: var(--text-mid);
  margin-top: 4px;
}
.ing-summary-terms em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-dark);
}

/* Exclusion reason pills inside cards */
.ing-exclude-reason {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ing-exclude-pill {
  font-size: 0.68rem;
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #e8a49a;
  border-radius: 10px;
  padding: 2px 8px;
}
.ing-missing-pill {
  font-size: 0.68rem;
  background: #fef9e7;
  color: #9a7d0a;
  border: 1px solid #f7dc6f;
  border-radius: 10px;
  padding: 2px 8px;
}

/* Snippet term wrapper (one span per required term found) */
.ing-snippet-term {
  display: inline;
}

/* ═══════════════════════════════════════════════════════════
   FORMULA COMPARE PAGE
═══════════════════════════════════════════════════════════ */

/* Selector bar */
.cmp-selector-bar {
  max-width: 1280px;
  margin: 0 auto 24px;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.cmp-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.cmp-slot {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 220px;
  flex: 1;
}

.cmp-select { flex: 1; }

.cmp-remove-slot {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-mid);
  flex-shrink: 0;
}
.cmp-remove-slot:hover { background: #fdecea; color: #c0392b; }

.cmp-selector-actions { display: flex; gap: 8px; align-items: center; }

/* Section titles */
.cmp-section-title {
  max-width: 1280px;
  margin: 0 auto 12px;
  padding: 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cmp-section-title span {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-mid);
}

/* Nutrition table */
.cmp-nutrition-table {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 28px;
  border-collapse: collapse;
  font-size: 0.83rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cmp-nutrition-table thead th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
}
.cmp-nutrition-table thead th:first-child { width: 180px; }
.cmp-nutrition-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cmp-nutrition-table tbody tr:last-child td { border-bottom: none; }
.cmp-row-label { font-weight: 600; color: var(--text-mid); font-size: 0.78rem; }
.cmp-row-diff  { background: #fffbec; }
.cmp-row-diff .cmp-row-label { color: #9a7d0a; }
.cmp-source-cell { font-size: 0.75rem; color: var(--text-mid); }
.cmp-nd { color: #bbb; }

/* Diff summary */
.cmp-diff-summary {
  max-width: 1280px;
  margin: 0 auto 24px;
  padding: 0 16px;
}
.cmp-diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.cmp-diff-col {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.cmp-diff-col-header {
  font-size: 0.75rem;
  font-weight: 700;
  border-left: 3px solid;
  padding-left: 8px;
  margin-bottom: 10px;
}
.cmp-unique-pill {
  display: inline-block;
  font-size: 0.72rem;
  background: color-mix(in srgb, var(--col) 12%, white);
  color: var(--col);
  border: 1px solid color-mix(in srgb, var(--col) 30%, white);
  border-radius: 10px;
  padding: 3px 8px;
  margin: 2px 2px;
}
.cmp-none { font-size: 0.78rem; color: var(--text-light); font-style: italic; }

/* Full ingredient columns */
.cmp-ing-grid {
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 0 16px;
  display: grid;
  gap: 12px;
}
.cmp-ing-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.cmp-ing-col-header {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cmp-ing-count {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.85;
}
.cmp-ing-list { padding: 8px 6px; }
.cmp-ing-item {
  padding: 4px 8px;
  font-size: 0.76rem;
  border-radius: 4px;
  margin: 2px 0;
  line-height: 1.4;
}
.cmp-ing-shared  { color: var(--text-dark); }
.cmp-ing-partial { background: #fff8e1; color: #9a7d0a; }
.cmp-ing-unique  { background: #f3e8ff; color: #6c3483; font-weight: 600; }

/* Legend */
.cmp-legend {
  font-size: 0.72rem;
  margin-left: 6px;
}
.cmp-legend.shared  { color: var(--text-mid); }
.cmp-legend.partial { color: #9a7d0a; }
.cmp-legend.unique  { color: #6c3483; }

/* Responsive — stack columns on mobile */
@media (max-width: 700px) {
  .cmp-ing-grid { grid-template-columns: 1fr !important; }
  .cmp-diff-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CLINICIAN-MODE NUTRITION BREAKDOWN
   (lives inside .result-box on the calculator page)
   ============================================================ */
.result-nutrition {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.nut-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}
.nut-energy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.nut-energy-cell {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.nut-energy-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-mid);
}
.nut-energy-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 2px 0;
}
.nut-energy-sub {
  font-size: 0.7rem;
  color: var(--text-mid);
}
.nut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 4px;
}
.nut-table thead th.nut-group-header {
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.nut-table thead th {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-mid);
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.nut-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.nut-table tbody tr:last-child td { border-bottom: none; }
.nut-disclaimer {
  font-size: 0.74rem;
  color: var(--text-mid);
  margin-top: 12px;
  line-height: 1.55;
}

/* ============================================================
   DAILY NEEDS PAGE
   ============================================================ */
.needs-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
.needs-inputs-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}
.needs-inputs-card h2 { font-size: 1.05rem; margin-bottom: 4px; }
.needs-inputs-card h3 { color: var(--text-dark); }
.needs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#needs-height-hint {
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: 400;
  margin-left: 4px;
}
.needs-results-wrap { min-width: 0; }
.needs-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.needs-empty {
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 50px 24px;
  text-align: center;
  color: var(--text-mid);
}
.needs-empty .empty-icon { font-size: 2.4rem; margin-bottom: 12px; }
.needs-empty h3 { color: var(--text-dark); margin-bottom: 6px; }
.needs-summary {
  background: var(--primary-pale);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
}
.needs-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.needs-card h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--primary);
}
.needs-card .big-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
}
.needs-card .big-number .big-sub {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-mid);
  font-weight: 500;
  margin-left: 8px;
}
.needs-note {
  font-size: 0.78rem;
  color: var(--text-mid);
  margin-top: 8px;
  line-height: 1.5;
}

/* Anthropometry */
.anthro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 12px;
}
.anthro-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.anthro-label {
  font-size: 0.72rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.anthro-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 2px 0;
}
.anthro-sub {
  font-size: 0.72rem;
  color: var(--text-mid);
}
.anthro-classification {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.cls-tag {
  display: inline-block;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.cls-tag.tone-ok      { background:#e8f5e9; color:#1b5e20; border:1px solid #a5d6a7; }
.cls-tag.tone-warn    { background:#fff8e1; color:#8b6500; border:1px solid #ffd54f; }
.cls-tag.tone-danger  { background:#ffebee; color:#b71c1c; border:1px solid #ef9a9a; }
.cls-tag.tone-neutral { background:var(--bg); color:var(--text-mid); border:1px solid var(--border); }

/* Macro distribution */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.macro-grid.macro-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Inline flag for AMDR comparison in the Protein card */
.amdr-flag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
  margin-left: 4px;
  font-style: normal;
}
.amdr-flag.warn {
  background: #fff8e1;
  color: #8b6500;
  border-color: #ffd54f;
}
.macro-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.macro-item.dimmed { opacity: 0.55; }
.macro-label {
  font-size: 0.72rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.macro-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 2px 0;
}
.macro-sub {
  font-size: 0.72rem;
  color: var(--text-mid);
}

/* Tables */
.needs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 0.85rem;
}
.needs-table th {
  text-align: left;
  font-weight: 600;
  background: var(--bg);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.needs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.needs-table tr:last-child td { border-bottom: none; }
.catchup-table td:first-child { color: var(--text-mid); width: 60%; }

/* Coverage badges */
.cov-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}
.cov-low  { background:#ffebee; color:#b71c1c; border:1px solid #ef9a9a; }
.cov-ok   { background:#e8f5e9; color:#1b5e20; border:1px solid #a5d6a7; }
.cov-high { background:#fff8e1; color:#8b6500; border:1px solid #ffd54f; }
.cov-over { background:#fbe9e7; color:#bf360c; border:1px solid #ffab91; }

.needs-catchup {
  border-left: 4px solid var(--cat-preterm);
}
.needs-coverage {
  border-left: 4px solid var(--accent);
}
.needs-disclaimer {
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #6b5300;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .needs-layout { grid-template-columns: 1fr; }
  .needs-inputs-card { position: static; }
  .anthro-grid, .macro-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .anthro-grid, .macro-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   INFO PAGES (About / Contact / Privacy / Disclaimer / Methodology)
   ============================================================ */
.info-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  background: var(--white);
}
.info-page h1 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 6px;
}
.info-page .info-subtitle {
  font-size: 0.95rem;
  color: var(--text-mid);
  margin-bottom: 24px;
  font-style: italic;
}
.info-page .info-section {
  margin-bottom: 26px;
}
.info-page .info-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 14px 0 8px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.info-page .info-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 10px 0 4px;
  color: var(--primary);
}
.info-page .info-section p {
  margin-bottom: 8px;
  line-height: 1.65;
  color: var(--text-dark);
}
.info-page code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--primary);
}
.info-page a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.info-page a:hover { color: var(--primary-light); }
.info-author-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--primary-pale);
  border-radius: var(--radius);
  padding: 16px;
  margin: 10px 0;
}
.info-author-avatar {
  flex: 0 0 56px;
  height: 56px;
  width: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.info-author-info { flex: 1; min-width: 0; }
.info-author-name { font-weight: 700; font-size: 1.05rem; color: var(--text-dark); }
.info-author-title {
  font-size: 0.82rem;
  color: var(--primary);
  margin: 2px 0 8px;
  font-style: italic;
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(28, 40, 51, 0.97);
  color: var(--white);
  z-index: 9999;
  padding: 14px 18px;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.20);
  font-size: 0.86rem;
  line-height: 1.5;
}
.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-text { flex: 1; min-width: 280px; }
.cookie-text a { color: #82caff; text-decoration: underline; }
.cookie-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.cookie-btn-reject { background: rgba(255,255,255,0.12); color: var(--white); }
.cookie-btn-reject:hover { background: rgba(255,255,255,0.22); }
.cookie-btn-accept { background: var(--accent); color: var(--white); }
.cookie-btn-accept:hover { background: #16a085; }
@media (max-width: 540px) {
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-buttons { width: 100%; }
  .cookie-btn { flex: 1; }
}

/* ============================================================
   HOME / LANDING PAGE
   ============================================================ */
#page-home main { background: var(--bg); padding: 0; }

/* Hero — tightened so the stats strip peeks above the fold on a 720-820px viewport */
.home-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 42px 24px 48px;
  text-align: center;
}
.home-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}
.home-hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.16);
  color: var(--white);
  font-size: 0.78rem;
  padding: 5px 13px;
  border-radius: 20px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.22);
  letter-spacing: 0.2px;
}
.home-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.home-hero-sub {
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.92);
  max-width: 720px;
  margin: 0 auto 20px;
}
.home-hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 22px;
}
.home-btn {
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.home-btn-primary {
  background: var(--white);
  color: var(--primary);
}
.home-btn-primary:hover { transform: translateY(-1px); background: #f4f9fd; }
.home-btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.45);
}
.home-btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); transform: translateY(-1px); }
.home-hero-trust {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.1px;
}

/* Stats strip */
.home-stats {
  background: var(--white);
  padding: 24px 24px;
  border-bottom: 1px solid var(--border);
}
.home-stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}
.home-stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.home-stat-label {
  font-size: 0.82rem;
  color: var(--text-mid);
  margin-top: 4px;
  letter-spacing: 0.2px;
}

/* Generic section */
.home-section {
  padding: 56px 24px;
  background: var(--white);
}
.home-section-alt { background: var(--bg); }
.home-section-inner { max-width: 1100px; margin: 0 auto; }
.home-h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: -0.3px;
}
.home-section-sub {
  text-align: center;
  font-size: 0.98rem;
  color: var(--text-mid);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.55;
}

/* Features grid */
.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.home-feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
}
.home-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.home-feature-icon {
  font-size: 1.9rem;
  margin-bottom: 10px;
}
.home-feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.home-feature-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-mid);
  flex: 1;
}
.home-feature-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

/* Featured articles */
.home-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.home-article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.home-article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.home-article-icon {
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.home-article-tag {
  font-size: 0.72rem;
  color: var(--primary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}
.home-article-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  line-height: 1.3;
}
.home-article-card p {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.5;
}
.home-article-card-see-more {
  background: var(--primary-pale);
  border-color: var(--primary-light);
  justify-content: center;
  align-items: center;
  text-align: center;
}
.home-article-card-see-more h3 { color: var(--primary); }

/* About the editor */
.home-author {
  display: flex;
  gap: 24px;
  background: var(--primary-pale);
  border-radius: var(--radius);
  padding: 28px 28px;
  max-width: 880px;
  margin: 0 auto;
  align-items: flex-start;
}
.home-author-avatar {
  flex: 0 0 84px;
  height: 84px;
  width: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  font-weight: 800;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
}
.home-author-info { flex: 1; min-width: 0; }
.home-author-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}
.home-author-title {
  font-size: 0.88rem;
  color: var(--primary);
  margin: 2px 0 12px;
  font-style: italic;
}
.home-author-info p { font-size: 0.92rem; line-height: 1.6; color: var(--text-dark); }
.home-author-info a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* Editorial standards */
.home-sources {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}
.home-source {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.home-source strong { color: var(--primary); display: block; font-size: 0.95rem; margin-bottom: 4px; }
.home-source span { color: var(--text-mid); font-size: 0.82rem; }
.home-independence {
  background: var(--white);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 880px;
  margin: 0 auto;
}
.home-independence a { color: var(--primary); text-decoration: underline; }

/* Final CTA */
.home-final-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 56px 24px;
  text-align: center;
}
.home-final-cta h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.home-final-cta p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 900px) {
  .home-hero { padding: 44px 18px 50px; }
  .home-hero h1 { font-size: 1.85rem; }
  .home-hero-sub { font-size: 0.98rem; }
  .home-stats-inner { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .home-features, .home-articles, .home-sources { grid-template-columns: repeat(2, 1fr); }
  .home-section { padding: 44px 18px; }
  .home-h2 { font-size: 1.5rem; }
  .home-author { flex-direction: column; align-items: center; text-align: center; padding: 22px; }
  .home-author-avatar { flex-basis: 72px; height: 72px; width: 72px; font-size: 1.4rem; }
}
@media (max-width: 560px) {
  .home-features, .home-articles, .home-sources { grid-template-columns: 1fr; }
  .home-stats-inner { grid-template-columns: 1fr 1fr; }
  .home-hero h1 { font-size: 1.6rem; }
  .home-stat-num { font-size: 1.5rem; }
}
