/* ============================================================
   onlyonlytoxinfree — site styles
   Mobile-first, no frameworks
   ============================================================ */

:root {
  --green: #2d6a4f;
  --green-light: #d8f3dc;
  --green-mid: #52b788;
  --yellow: #b5770d;
  --yellow-light: #fff3cd;
  --red: #c62828;
  --red-light: #fdecea;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e5e5e5;
  --bg: #ffffff;
  --bg-off: #f8f8f6;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================================
   SAVE BANNER (loss aversion)
   ============================================================ */

#save-banner {
  background: #fef3c7;
  border-bottom: 2px solid #f59e0b;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 500;
}

#save-banner input[type="email"] {
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  flex: 1;
  max-width: 240px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
}

#save-banner input[type="email"]:focus {
  border-color: #d97706;
}

#save-banner-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: #92400e;
  font-size: 16px;
  margin-left: auto;
  padding: 0.2rem;
  line-height: 1;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  #save-banner {
    flex-direction: column;
    align-items: flex-start;
    font-size: 13px;
    gap: 8px;
  }
  #save-banner input[type="email"] {
    max-width: 100%;
    width: 100%;
  }
  #save-banner-dismiss {
    margin-left: 0;
    align-self: flex-end;
    position: absolute;
    top: 8px;
    right: 12px;
  }
  #save-banner {
    position: relative;
  }
}

/* ============================================================
   HEADER / NAV
   ============================================================ */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green);
  white-space: nowrap;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.site-name:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 480px;
}

.nav-search input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
}

.nav-search input[type="search"]::placeholder {
  color: var(--text-muted);
}

.nav-search button {
  background: none;
  border: none;
  padding: 0 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.nav-search button:hover {
  color: var(--green);
}

.nav-cta {
  background: var(--green);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.15s;
}

.nav-cta:hover {
  background: #245740;
  text-decoration: none;
}

/* ============================================================
   MAIN / FOOTER
   ============================================================ */

.site-main {
  flex: 1;
}

.site-footer {
  background: var(--bg-off);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-trust {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 540px;
  font-style: italic;
  opacity: 0.85;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ============================================================
   PRODUCT PAGE
   ============================================================ */

.product-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ---- Hero ---- */

.product-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.product-hero-text {
  flex: 1;
}

.product-brand {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.product-name {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.product-category {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.product-tagline {
  font-size: 0.95rem;
}

.flag-count-inline {
  color: var(--red);
  font-weight: 600;
}

.clean-inline {
  color: var(--green);
  font-weight: 600;
}

/* ---- Score Badge ---- */

.score-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.score-badge {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.score-badge.score-green {
  background: var(--green);
  color: #fff;
}

.score-badge.score-yellow {
  background: #e6a817;
  color: #fff;
}

.score-badge.score-red {
  background: var(--red);
  color: #fff;
}

.score-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin-top: 2px;
}

.score-scale {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Small badge variant for swap card */
.swap-badge-sm {
  width: 72px;
  height: 72px;
}

.swap-badge-sm .score-number {
  font-size: 1.3rem;
}

.swap-badge-sm .score-label {
  font-size: 0.6rem;
}

/* ---- Vouch Bar ---- */

.vouch-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s;
}

.vouch-bar:hover {
  border-color: var(--green-mid);
  background: var(--green-light);
}

.vouch-icon {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--green);
  color: #fff;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.vouch-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.vouch-text strong {
  color: var(--text);
}

/* ---- Swap Card ---- */

.swap-card {
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: var(--green-light);
}

.swap-card-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.swap-headline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.swap-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.swap-info {
  flex: 1;
}

.swap-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.swap-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.swap-buy-btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
  align-self: flex-start;
}

.swap-buy-btn:hover {
  background: #245740;
  text-decoration: none;
}

/* ---- Buy-clean Section (clean products) ---- */

.buy-clean-section {
  margin-bottom: 2rem;
}

.buy-clean-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  background: var(--green-light);
  flex-wrap: wrap;
}

.buy-clean-headline {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
  margin: 0;
}

.buy-clean-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.buy-clean-btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.buy-clean-btn:hover {
  background: #245740;
  text-decoration: none;
}

/* ---- Flags Section ---- */

.flags-section {
  margin-bottom: 2.5rem;
}

.flags-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.flags-subhead {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.flags-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flag-item {
  background: var(--bg-off);
  border-left: 4px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1rem;
}

.flag-item.flag-level-high {
  border-left-color: var(--red);
  background: var(--red-light);
}

.flag-item.flag-level-medium {
  border-left-color: #e6a817;
  background: var(--yellow-light);
}

.flag-item.flag-level-low {
  border-left-color: #888;
  background: var(--bg-off);
}

.flag-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.flag-ingredient {
  font-weight: 600;
  font-size: 0.95rem;
}

.flag-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.flag-badge-high {
  background: var(--red);
  color: #fff;
}

.flag-badge-medium {
  background: #e6a817;
  color: #fff;
}

.flag-badge-low {
  background: #888;
  color: #fff;
}

.flag-concern {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.flag-source-link {
  color: var(--green);
  text-decoration: underline;
  font-size: 0.8rem;
}

.flag-source {
  font-size: 0.8rem;
}

/* Clean state */
.flags-clean .clean-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--green-light);
  border: 1px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: var(--green);
  font-weight: 600;
}

/* ---- Ingredients Section ---- */

.ingredients-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.ingredients-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.ingredients-raw {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ============================================================
   INGREDIENT PAGE
   ============================================================ */

.ingredient-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ---- Ingredient Hero ---- */

.ingredient-hero {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.ingredient-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-transform: capitalize;
}

.concern-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.concern-badge-high {
  background: var(--red);
  color: #fff;
}

.concern-badge-medium {
  background: #e6a817;
  color: #fff;
}

.concern-badge-low {
  background: #888;
  color: #fff;
}

.concern-badge-unknown {
  background: var(--border);
  color: var(--text-muted);
}

.ingredient-flagged-by {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.ingredient-flagged-by strong {
  color: var(--text);
}

/* ---- What it is ---- */

.ingredient-what {
  background: var(--bg-off);
  border-left: 4px solid var(--green-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.1rem 1.25rem;
  margin-bottom: 2.5rem;
}

.ingredient-what h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ingredient-what p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

/* ---- Products list ---- */

.ingredient-products {
  margin-bottom: 2.5rem;
}

.ingredient-products h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.ingredient-products-subhead {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.ingredient-product-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ingredient-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ingredient-product-item:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.ingredient-product-info {
  flex: 1;
  min-width: 0;
}

.ingredient-product-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ingredient-product-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.ingredient-product-score {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ingredient-product-score .score-num {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.ingredient-product-score .score-lbl {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

/* ---- Avoid section ---- */

.ingredient-avoid {
  background: var(--green-light);
  border: 1px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.ingredient-avoid h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ingredient-avoid p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.ingredient-avoid-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ingredient-avoid-link {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
}

.ingredient-avoid-link:hover {
  background: #245740;
  text-decoration: none;
}

.ingredient-no-products {
  background: var(--bg-off);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

/* ============================================================
   SCORE BADGE EXTRA SIZES
   ============================================================ */

.score-badge-xs {
  width: 46px;
  height: 46px;
}

.score-badge-xs .score-number {
  font-size: 1rem;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--green);
}

.breadcrumb-sep {
  color: var(--border);
}

/* ============================================================
   CATEGORY PAGE
   ============================================================ */

.category-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ---- Hero ---- */

.category-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.category-h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.category-intro {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 1.5rem;
}

.category-stats-row {
  display: flex;
  gap: 2rem;
}

.category-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.category-stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--green);
}

.category-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ---- Section headings ---- */

.section-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

.avoid-heading {
  color: var(--red);
}

/* ---- Ranked list ---- */

.category-top-section {
  margin-bottom: 3rem;
}

.ranked-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranked-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ranked-item:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow);
}

.rank-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-mid);
  width: 2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.2rem;
  text-align: center;
}

.ranked-info {
  flex: 1;
  min-width: 0;
}

.ranked-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  display: block;
  margin-bottom: 0.15rem;
}

.ranked-name:hover {
  color: var(--green);
  text-decoration: none;
}

.ranked-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ranked-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.ranked-flag-chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: capitalize;
}

.ranked-flag-high {
  background: var(--red-light);
  color: var(--red);
}

.ranked-flag-medium {
  background: var(--yellow-light);
  color: var(--yellow);
}

.ranked-flag-low {
  background: var(--bg-off);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.ranked-flag-clean {
  background: var(--green-light);
  color: var(--green);
}

.ranked-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ranked-buy-btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.ranked-buy-btn:hover {
  background: #245740;
  text-decoration: none;
}

/* ---- Avoid section ---- */

.category-avoid-section {
  margin-bottom: 2rem;
  padding: 1.75rem;
  background: var(--red-light);
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
}

.avoid-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.avoid-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.avoid-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.avoid-link:hover {
  border-color: var(--red);
  text-decoration: none;
}

.avoid-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.avoid-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avoid-brand {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.avoid-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.avoid-flag-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  background: var(--red-light);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.avoid-cta-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================================
   CATEGORIES LISTING PAGE
   ============================================================ */

.categories-page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.categories-hero {
  margin-bottom: 2.5rem;
  text-align: center;
}

.categories-h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.categories-intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

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

.category-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.category-card:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.category-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.category-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  flex: 1;
}

.category-card-badge {
  flex-shrink: 0;
}

.category-card-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  flex: 1;
}

.category-card-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  margin-top: auto;
}

/* ============================================================
   HOMEPAGE
   ============================================================ */

/* ---- Hero ---- */

.home-hero {
  background: linear-gradient(135deg, #f0faf4 0%, #e8f5e9 60%, #f8f8f6 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1rem 3rem;
}

.home-hero-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.home-hero-text {
  flex: 1;
  max-width: 620px;
}

.home-hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-mid);
  margin-bottom: 0.75rem;
}

.home-hero-h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text);
}

.home-hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.home-hero-ctas {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.home-cta-primary {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.home-cta-primary:hover {
  background: #245740;
  text-decoration: none;
}

.home-cta-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}

.home-cta-search:focus-within {
  border-color: var(--green-mid);
}

.home-cta-search input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}

.home-cta-search input::placeholder {
  color: var(--text-muted);
}

.home-cta-search button {
  background: none;
  border: none;
  padding: 0 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.home-cta-search button:hover {
  color: var(--green);
}

/* ---- Hero stats ---- */

.home-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  min-width: 180px;
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.home-stat-num {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--green);
}

.home-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* ---- Section shell ---- */

.home-section {
  padding: 3rem 1rem;
  border-bottom: 1px solid var(--border);
}

.home-section:last-child {
  border-bottom: none;
}

.home-section-inner {
  max-width: 1060px;
  margin: 0 auto;
}

.home-section-h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.home-section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ---- Featured product cards ---- */

.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.home-product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  gap: 0.75rem;
}

.home-product-card:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.home-product-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

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

.home-product-brand {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.home-product-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-badge-sm {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.home-badge-sm .score-number {
  font-size: 1.15rem;
}

.home-badge-sm .score-label {
  font-size: 0.55rem;
}

.home-product-cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  margin-top: auto;
}

/* ---- Score pill (small inline badge for category cards) ---- */

.home-score-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.home-score-pill.score-green {
  background: var(--green-light);
  color: var(--green);
}

.home-score-pill.score-yellow {
  background: var(--yellow-light);
  color: var(--yellow);
}

.home-score-pill.score-red {
  background: var(--red-light);
  color: var(--red);
}

/* ---- Browse category grid ---- */

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

/* ---- Recent products ---- */

.home-recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-recent-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-recent-item:hover {
  border-color: var(--green-mid);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.home-recent-badge {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.home-recent-badge .score-number {
  font-size: 1rem;
}

.home-recent-badge .score-label {
  display: none;
}

.home-recent-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-recent-brand {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.home-recent-arrow {
  color: var(--green-mid);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .home-hero-inner {
    flex-direction: column;
  }

  .home-hero-stats {
    flex-direction: row;
    min-width: unset;
    width: 100%;
    padding: 1.25rem 1.5rem;
    justify-content: space-around;
  }

  .home-stat {
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .nav-inner {
    gap: 0.5rem;
  }

  .site-name {
    font-size: 0.82rem;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-cta {
    padding: 0.38rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Hide secondary nav items on mobile to prevent overflow */
  .nav-shop-link,
  a.nav-cta[href="/ingredient-scan"] {
    display: none;
  }

  .product-hero {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .score-badge {
    width: 96px;
    height: 96px;
  }

  .score-number {
    font-size: 1.7rem;
  }

  .swap-product {
    flex-direction: column;
    align-items: flex-start;
  }

  .swap-buy-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .nav-search {
    display: none;
  }
}

/* ============================================================
   PWA Install Banner
   ============================================================ */
#install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #2d6a4f;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 12px 16px;
  border-radius: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

#install-banner.install-banner-visible {
  transform: translateY(0);
}

#install-banner span {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fff;
}

#install-btn {
  background: #fff;
  color: #2d6a4f;
  border: none;
  border-radius: 6px;
  padding: 0.38rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#install-btn:hover {
  opacity: 0.88;
}

#install-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

#install-dismiss:hover {
  color: #fff;
}

/* =========================================================
   Share card (chat SSE event rendering)
   ========================================================= */
.chat-share-card {
  background: #f0fdf4;
  border: 1.5px solid #52b788;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.35rem 0;
  max-width: 340px;
}

.chat-share-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #2d6a4f;
}

.chat-share-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
}

.chat-share-url-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.chat-share-url-input {
  flex: 1;
  border: 1.5px solid #b7e4c7;
  border-radius: 6px;
  padding: 0.32rem 0.5rem;
  font-size: 0.75rem;
  color: #374151;
  background: #fff;
  outline: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-share-copy-btn {
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.chat-share-copy-btn:hover { opacity: 0.88; }

.chat-share-actions {
  display: flex;
  gap: 0.4rem;
}

.chat-share-native-btn {
  background: #fff;
  border: 1.5px solid #52b788;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2d6a4f;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-share-native-btn:hover { background: #f0fdf4; }

/* =========================================================
   Share card (renderShareCard DOM component)
   ========================================================= */

.share-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1.5px solid var(--green-mid);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #f0fdf4;
  max-width: 320px;
}

.share-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
}

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

.share-btn-native {
  width: 100%;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  min-height: 44px;
}

.share-btn-native:hover {
  background: #245740;
}

.share-btn-copy {
  width: 100%;
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green-mid);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  min-height: 40px;
}

.share-btn-copy:hover {
  background: #d8f3dc;
  border-color: var(--green);
}

/* Copy toast */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--green);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.copy-toast.copy-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   Collections chips (share intent list picker)
   ========================================================= */
.chat-collections-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0;
}

.chat-coll-chip {
  background: #f0fdf4;
  border: 1.5px solid #52b788;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1b5e35;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chat-coll-chip:hover {
  background: #b7e4c7;
  border-color: #2d6a4f;
}

/* =========================================================
   Social pills and cards (chat social intents)
   ========================================================= */
.chat-social-pill {
  display: inline-flex;
  align-items: center;
  background: #f0fdf4;
  border: 1.5px solid #52b788;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1b5e35;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  margin: 0.25rem 0;
}
.chat-social-pill:hover {
  background: #b7e4c7;
  border-color: #2d6a4f;
  text-decoration: none;
}

.chat-social-card {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #f0fdf4;
  border: 1.5px solid #52b788;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  margin: 0.25rem 0;
}
.chat-social-stat {
  font-size: 0.88rem;
  color: #1b5e35;
  font-weight: 500;
}
.chat-social-names {
  font-size: 0.78rem;
  color: #2d6a4f;
}
