/* ============================================================
   THE HERB INDEX — design tokens
   "Nature Backed by Science"
   ============================================================ */

/* Fonts are self-hosted (OFL licences in /assets/fonts) so no visitor data goes to a font service. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/fraunces-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --forest: #2D6A4F;
  --forest-bright: #3E8C68;
  --navy: #1B1B2F;
  --mint: #D8F3DC;
  --mint-deep: #B7E4C7;
  --bg: #F9FAFB;
  --ink: #1B1B2F;
  --ink-soft: #52525B;
  --ink-faint: #636374; /* 5.6:1 on --bg (was #8A8A99, 3.25:1) */
  --line: #E3E6E4;
  --white: #FFFFFF;

  --evidence-strong: #2D6A4F;
  --evidence-moderate: #B08900;
  --evidence-emerging: #8A6FBF;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-soft: 0 1px 2px rgba(27,27,47,0.04), 0 4px 16px rgba(27,27,47,0.05);
  --max-width: 960px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-bright); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em 0;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em 0; color: var(--ink-soft); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- site header (used on non-homepage pages) ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.site-header .brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}

.site-header .brand:hover { color: var(--forest); text-decoration: none; }

.site-header nav a {
  margin-left: 20px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---------- homepage hero ---------- */
.hero {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 80px;
  position: relative;
}

.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 18px;
}

.hero h1 {
  max-width: 720px;
  margin-bottom: 0.35em;
}

.hero .tagline {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 44px;
}

.search-form {
  width: 100%;
  max-width: 560px;
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  min-width: 0; /* lets the box shrink on phones instead of pushing the button off-screen */
  padding: 16px 20px;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.search-input::placeholder { color: var(--ink-faint); }

.search-input:focus {
  border-color: var(--forest);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45,106,79,0.14);
}

.search-submit {
  flex-shrink: 0;
  padding: 16px 24px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--forest);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-submit:hover { background: var(--forest-bright); }

.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  max-width: 640px;
}

.symptom-chips .chips-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  margin-right: 4px;
  flex-shrink: 0;
}

.symptom-chips .chip {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.symptom-chips .chip:hover {
  background: var(--mint);
  border-color: var(--mint-deep);
  color: var(--forest);
  text-decoration: none;
}

.hero-links {
  margin-top: 30px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-links a {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-weight: 500;
}

.hero-links a:hover { color: var(--forest); }

/* root/branch signature line-art beneath the search bar */
.root-signature {
  margin-top: 56px;
  width: 100%;
  max-width: 620px;
  opacity: 0;
  animation: root-grow 1.1s ease-out 0.2s forwards;
}

.root-signature path {
  stroke: var(--mint-deep);
  stroke-width: 1.4;
  fill: none;
}

.root-signature circle {
  fill: var(--forest);
}

@keyframes root-grow {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- search results page ---------- */
.results-page { padding: 48px 24px 100px; } /* keep the side gutter from .container on phones */

.results-meta {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.result-card {
  display: block;
  padding: 22px 24px;
  margin-bottom: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.result-card:hover {
  border-color: var(--forest);
  transform: translateY(-1px);
  text-decoration: none;
}

.result-card .kind-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  background: var(--mint);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
}

.result-card h3 { margin-bottom: 6px; }
.result-card p { margin-bottom: 0; font-size: 0.92rem; }

.related-symptoms {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.related-symptoms h2 { font-size: 1.1rem; margin-bottom: 14px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--forest);
  font-weight: 500;
}

.chip:hover { background: var(--mint-deep); text-decoration: none; }

.mentions { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.mentions h2 { font-size: 1.1rem; margin-bottom: 6px; }
.mentions-note { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 16px; }
.mention-card h3 { font-size: 1rem; font-weight: 600; }
.mention-snippet { color: var(--ink-faint); }
.empty-state.fallback { padding: 28px 0; text-align: left; }
.fallback-line { color: var(--ink); font-size: 1.02rem; margin-bottom: 22px; }
.fallback-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 18px 0 8px; }

.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------- herb profile pages ---------- */
.herb-page { padding-bottom: 100px; }

.herb-hero {
  background: var(--navy);
  color: var(--mint);
  padding: 48px 0 40px;
}

.herb-hero .container { }

.herb-hero .category-tags { margin-bottom: 14px; }

.herb-hero .category-tags span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
  border: 1px solid rgba(216,243,220,0.35);
  padding: 3px 9px;
  border-radius: 4px;
  margin-right: 8px;
  display: inline-block;
  margin-bottom: 6px;
}

.herb-hero h1 { color: var(--white); }

.herb-hero .overview {
  color: rgba(216,243,220,0.85);
  max-width: 640px;
  font-size: 1.02rem;
}

.herb-body { padding-top: 40px; }

.herb-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

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

.research-claim {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.research-claim p { margin-bottom: 8px; color: var(--ink); font-size: 0.95rem; }

.evidence-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  display: inline-block;
  color: var(--white);
}

.evidence-strong { background: var(--evidence-strong); }
.evidence-moderate { background: var(--evidence-moderate); }
.evidence-emerging { background: var(--evidence-emerging); }
.evidence-limited { background: #8A6A4F; }
.evidence-mixed { background: #6B7280; }
.evidence-preclinical { background: var(--evidence-emerging); }
.evidence-not-supported { background: #991B1B; }

.source-link {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 6px;
}
.source-link a { color: var(--forest); white-space: nowrap; }

.di-entry { margin-bottom: 12px; }
.di-entry p { margin: 4px 0 0; }
.severity-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: 1px;
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent;
  border: 1.5px solid currentColor;
}
/* Warnings: outlined boxes in the warning colours (Jesse, Nov 1). No fill, so they never look like evidence chips. */
.severity-established { color: var(--warn-strong-fg); border-style: var(--warn-strong-style); }
.severity-documented { color: var(--warn-mid-fg); border-style: var(--warn-mid-style); }
.severity-theoretical { color: var(--warn-low-fg); border-style: dashed; }
.severity-unverified { color: #92400E; border-style: dashed; }
.severity-none { color: var(--ink-soft); border-style: dotted; }
.severity-legend { font-size: 0.75rem; color: var(--ink-faint); margin-top: 10px; }

.citation-note {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 4px;
}

.unverified-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.avoid-chip {
  border-color: #DC2626 !important;
  color: #991B1B !important;
}

.plain-summary-box {
  background: var(--mint);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.plain-summary-box .unverified-badge {
  margin-bottom: 8px;
}

.plain-summary-box p {
  color: var(--navy);
  font-size: 0.98rem;
  margin: 0;
}

.dosage-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }

.dosage-table td, .dosage-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: top;
  overflow-wrap: anywhere; /* long words like "immunocompromised" pushed phone tables past the screen edge */
}

.dosage-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  width: 120px;
}

.dosage-table td.figure { color: var(--navy); } /* amounts read as sentences: body font, not mono */
.dosage-table thead th { white-space: nowrap; }

.disclaimer-box {
  background: var(--mint);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 0.88rem;
  color: var(--navy);
  margin-top: 8px;
}

.safety-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 700px) {
  .safety-grid { grid-template-columns: 1fr 1fr; }
}

.safety-grid h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.safety-grid p { font-size: 0.92rem; }

/* ---------- referral tiers ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 700px) {
  .tier-grid { grid-template-columns: repeat(3, 1fr); }
}

.tier-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--white);
}

.tier-card .tier-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 6px;
  display: block;
}

.tier-card .retailer { font-weight: 600; color: var(--navy); margin-bottom: 12px; display: block; }

.tier-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--forest);
  color: var(--white);
  cursor: pointer;
  border: none;
}

.tier-btn:hover { background: var(--forest-bright); text-decoration: none; }

.tier-btn.disabled {
  background: var(--line);
  color: var(--ink-faint);
  cursor: not-allowed;
  pointer-events: none;
}

.related-herbs { display: flex; flex-wrap: wrap; gap: 10px; }

.related-herb-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 500;
}

.related-herb-chip:hover { border-color: var(--forest); text-decoration: none; }

/* ---------- footer ---------- */
.site-footer {
  padding: 32px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin: 0;
}

.site-footer a { color: var(--ink-faint); }

/* "Avoid combining with" warnings: reason shown as text, not only on hover */
.avoid-item { flex-basis: 100%; margin-bottom: 10px; }
.avoid-reason { margin: 6px 0 0; font-size: 0.88rem; color: var(--ink-soft); }


/* ============================================================
   B02 colour system
   Research: green / yellow / red = how well the sources back a point (with icon + reason).
   Drug interactions: the existing Established / Documented / Theoretical tags.
   Side effects: neutral "how well documented" markers (never seriousness).
   Visitors pick a palette; every palette keeps icons and words, so colour is never the only signal.
   ============================================================ */
:root {
  --sup-green-bg: #2D6A4F; --sup-green-fg: #FFFFFF; --sup-green-line: #2D6A4F;
  --sup-yellow-bg: #F2C94C; --sup-yellow-fg: #1B1B2F; --sup-yellow-line: #D9A800;
  --sup-red-bg: #B42318; --sup-red-fg: #FFFFFF; --sup-red-line: #B42318;
  --sup-style: solid;
  --warn-strong-bg: #FEE2E2; --warn-strong-fg: #991B1B; --warn-strong-line: #FECACA; --warn-strong-style: solid;
  --warn-mid-bg: #FEF3C7; --warn-mid-fg: #92400E; --warn-mid-line: #FDE68A; --warn-mid-style: solid;
  --warn-low-bg: #E5E7EB; --warn-low-fg: #374151; --warn-low-line: #D1D5DB; --warn-low-style: solid;
}
:root[data-palette="cvd"] {
  --sup-green-bg: #0072B2; --sup-green-fg: #FFFFFF; --sup-green-line: #0072B2;
  --sup-yellow-bg: #E69F00; --sup-yellow-fg: #1B1B2F; --sup-yellow-line: #B87F00;
  --sup-red-bg: #CC79A7; --sup-red-fg: #1B1B2F; --sup-red-line: #A85A86;
  --warn-strong-bg: #FBE3D6; --warn-strong-fg: #8A3B00; --warn-strong-line: #F2B999;
  --warn-mid-bg: #FDF0CC; --warn-mid-fg: #6B4A00; --warn-mid-line: #F0D27A;
}
:root[data-palette="contrast"] {
  --sup-green-bg: #000000; --sup-green-fg: #FFFFFF; --sup-green-line: #000000;
  --sup-yellow-bg: #FFFFFF; --sup-yellow-fg: #000000; --sup-yellow-line: #000000;
  --sup-red-bg: #FFFFFF; --sup-red-fg: #000000; --sup-red-line: #000000;
  --warn-strong-bg: #FFFFFF; --warn-strong-fg: #000000; --warn-strong-line: #000000;
  --warn-mid-bg: #FFFFFF; --warn-mid-fg: #000000; --warn-mid-line: #000000;
  --warn-low-bg: #FFFFFF; --warn-low-fg: #000000; --warn-low-line: #000000; --warn-low-style: dashed;
}
:root[data-palette="contrast"] .support-red { border-style: dashed; }
:root[data-palette="calm"] {
  --sup-green-bg: #4F7F69; --sup-green-fg: #FFFFFF; --sup-green-line: #4F7F69;
  --sup-yellow-bg: #E3CF9A; --sup-yellow-fg: #1B1B2F; --sup-yellow-line: #C9B06E;
  --sup-red-bg: #A3604E; --sup-red-fg: #FFFFFF; --sup-red-line: #A3604E;
  --warn-strong-bg: #F3DDD6; --warn-strong-fg: #7A3A2A; --warn-strong-line: #E3BFB2;
  --warn-mid-bg: #F5ECD5; --warn-mid-fg: #6B5320; --warn-mid-line: #E6D6A8;
  --warn-low-bg: #E7E5E0; --warn-low-fg: #4A4740; --warn-low-line: #D3D0C8;
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.support-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 4px; }
.support-chip {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px;
  border-width: 2px; border-style: var(--sup-style);
}
.ico { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; flex: none; }
.ico-full { background: currentColor; }
.ico-half { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.ico-empty { background: transparent; }
.support-green { background: var(--sup-green-bg); color: var(--sup-green-fg); border-color: var(--sup-green-line); }
.support-yellow { background: var(--sup-yellow-bg); color: var(--sup-yellow-fg); border-color: var(--sup-yellow-line); }
.support-red { background: var(--sup-red-bg); color: var(--sup-red-fg); border-color: var(--sup-red-line); }
.support-reason { font-size: 0.8rem; color: var(--ink-soft); }

.colour-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  font-size: 0.78rem; color: var(--ink-soft); margin: 0 0 12px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.support-swatch { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; border-width: 2px; border-style: solid; box-sizing: border-box; }
.legend-note { flex-basis: 100%; color: var(--ink-faint); }
.doc-ico { color: var(--ink); }
.doc-line { display: block; margin-top: 6px; }

.doc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; border: 1px solid var(--ink-faint); color: var(--ink); background: var(--white);
}
.doc-chip.doc-reported { border-style: dashed; }
.doc-chip.doc-none { border-style: dotted; color: var(--ink-soft); }
.doc-reason { display: block; font-size: 0.72rem; color: var(--ink-faint); margin-top: 2px; }

.palette-picker { margin-left: 20px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.palette-picker select {
  margin-left: 6px; font: inherit; font-size: 0.82rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px 6px; background: var(--white);
}
@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; gap: 8px; }
  .site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; }
  .palette-picker { margin-left: 16px; }
}

/* B03/B04 */
.affiliate-disclosure { font-size: 0.82rem; color: var(--ink-soft); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 14px; }
.buying-tips { margin: 0 0 0 18px; padding: 0; font-size: 0.92rem; color: var(--ink); }
.buying-tips li { margin: 6px 0; }

/* Which form to buy: every form and the tips share one card style */
.form-card .form-name { margin-bottom: 4px; }
.form-card .form-note { font-size: 0.88rem; color: var(--ink-soft); margin: 4px 0 0; }
.tips-card { background: var(--mint); border-color: var(--mint-deep); }
.tips-card .tips-title { font-family: var(--font-body); font-size: 0.95rem; margin: 0 0 6px; }

/* Evidence cards: long reasoning folded away (native <details>, no JavaScript) */
.study-details { margin-top: 8px; }
.study-details summary {
  cursor: pointer; display: inline-block; padding: 6px 0;
  font-size: 0.85rem; font-weight: 600; color: var(--forest);
}
.study-details summary:hover { color: var(--forest-bright); text-decoration: underline; }
.study-details summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 2px; }
.study-details[open] summary { margin-bottom: 2px; }

/* "On this page" jump links under the hero */
.jump-nav { background: var(--white); border-bottom: 1px solid var(--line); padding: 12px 0; }
.jump-nav .container { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.jump-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.jump-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jump-nav a {
  display: inline-block; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--bg); color: var(--navy); font-size: 0.85rem; font-weight: 500;
}
.jump-nav a:hover { border-color: var(--forest); text-decoration: none; }
.herb-section[id] { scroll-margin-top: 16px; }
html { scroll-behavior: smooth; }

/* Phones: dosage, timing and side-effect tables become stacked cards */
@media (max-width: 520px) {
  .dosage-table, .dosage-table tbody, .dosage-table tr, .dosage-table th, .dosage-table td { display: block; width: auto; }
  .dosage-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; } /* header labels move inline (still read by screen readers) */
  .dosage-table td, .dosage-table th { overflow-wrap: break-word; hyphens: manual; word-break: normal; border-bottom: 0; padding: 2px 0; }
  .dosage-table tr {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .dosage-table th { padding-bottom: 4px; }
  .dosage-table td[data-label]::before {
    content: attr(data-label) ": "; font-weight: 600; color: var(--ink-faint);
  }
  .dosage-table td[data-label] { margin-top: 6px; }
  .dosage-table .se-effect { font-weight: 600; color: var(--navy); }
  .dosage-table .se-effect .doc-line { font-weight: 400; }
  .jump-nav a { padding: 8px 12px; }
}

/* ---------- A-Z index (az.html) ---------- */
.az-page { padding-top: 40px; padding-bottom: 100px; }
.az-page h2 { margin-top: 48px; }
.az-intro { color: var(--ink-faint); font-size: 0.95rem; }
.az-jump ul { list-style: none; margin: 16px 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.az-jump a, .az-jump .az-off {
  display: inline-block; min-width: 34px; padding: 6px 0; text-align: center;
  border-radius: 6px; font-size: 0.9rem; font-weight: 600;
}
.az-jump a { background: var(--mint); color: var(--forest); }
.az-jump a:hover { background: var(--mint-deep); text-decoration: none; }
.az-jump .az-off { color: var(--ink-faint); opacity: 0.45; background: transparent; border: 1px dashed var(--line); }
.az-group { margin-top: 28px; scroll-margin-top: 16px; }
.az-group h3 { font-size: 1.4rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.az-list { list-style: none; margin: 0; padding: 0; }
.az-list li { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.az-name { font-weight: 600; }
.az-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.az-chip { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; background: var(--mint); color: var(--forest); }
.az-summary { display: block; margin-top: 4px; font-size: 0.9rem; color: var(--ink-faint); }

.shop-warning { margin: 0 0 10px; padding: 8px 12px; border: 1.5px solid var(--evidence-moderate, #b08900); border-radius: 6px; font-size: .9rem; line-height: 1.45; }
.tier-card.no-shop { display: block; }

/* ---- Review and donate pages ---- */
.rv-main { padding: 48px 24px 64px; max-width: 760px; }
.rv-kicker { font-family: var(--font-mono, monospace); letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: var(--forest, #2d6a4f); margin-bottom: 10px; }
.rv-h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; margin-bottom: 14px; }
.rv-lead { color: var(--ink-soft, #52525b); margin-bottom: 24px; line-height: 1.6; }
.rv-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.rv-tabs button { font: inherit; font-size: .92rem; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line, #e3e6e4); background: var(--white, #fff); color: var(--ink, #1b1b2f); cursor: pointer; }
.rv-tabs button[aria-selected="true"] { background: var(--forest, #2d6a4f); border-color: var(--forest, #2d6a4f); color: #fff; }
.rv-form { display: grid; gap: 18px; background: var(--white, #fff); border: 1px solid var(--line, #e3e6e4); border-radius: var(--radius, 10px); padding: 22px; }
.rv-field { display: grid; gap: 8px; }
.rv-field label, .rv-q { font-weight: 600; }
.rv-form select, .rv-form input[type=text], .rv-form input[type=email], .rv-form textarea { font: inherit; width: 100%; padding: 11px 12px; border: 1.5px solid var(--line, #e3e6e4); border-radius: var(--radius-sm, 6px); background: var(--bg, #f9fafb); color: var(--ink, #1b1b2f); }
.rv-stars { display: flex; gap: 4px; }
.rv-stars button { font-size: 1.9rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--line, #cfd4d1); padding: 2px; }
.rv-stars button.on { color: var(--evidence-moderate, #b08900); }
.rv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-pills button { font: inherit; font-size: .9rem; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line, #e3e6e4); background: var(--bg, #f9fafb); color: var(--ink, #1b1b2f); cursor: pointer; }
.rv-pills button.on { border-color: var(--forest, #2d6a4f); background: var(--mint, #d8f3dc); color: var(--forest, #2d6a4f); font-weight: 600; }
.rv-inline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.rv-inline input { margin-top: 4px; }
.rv-consent { font-size: .9rem; color: var(--ink-soft, #52525b); }
.rv-note { border: 1.5px solid var(--evidence-moderate, #b08900); border-radius: var(--radius-sm, 6px); padding: 12px 14px; font-size: .92rem; line-height: 1.5; }
.rv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rv-send { display: inline-block; font: inherit; font-weight: 600; padding: 12px 26px; border-radius: var(--radius, 10px); border: 0; background: var(--forest, #2d6a4f); color: #fff; cursor: pointer; text-decoration: none; justify-self: start; }
.rv-send:disabled { opacity: .5; cursor: not-allowed; }
.rv-status { color: var(--ink-soft, #52525b); min-height: 1.2em; }
.rv-thanks { background: var(--white, #fff); border: 1px solid var(--line, #e3e6e4); border-radius: var(--radius, 10px); padding: 26px; display: grid; gap: 12px; }
.rv-donate-line { color: var(--ink-soft, #52525b); font-size: .95rem; }
.dn-box { background: var(--white, #fff); border: 1px solid var(--line, #e3e6e4); border-radius: var(--radius, 10px); padding: 24px; display: grid; gap: 10px; margin-bottom: 30px; }
.dn-small { font-size: .9rem; color: var(--ink-soft, #52525b); }
.dn-h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 22px 0 10px; }
.dn-list { padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.rate-page { margin: 28px 0 0; font-size: .95rem; }

[hidden] { display: none !important; }

/* ===== PILOT v2 (261105): earth brown page, paper panels, deep blue hero band, Köhler plates ===== */
:root {
  --earth: #5A4330;          /* page background, warm brown */
  --earth-deep: #4A3728;
  --paper: #F6F1E7;          /* content panels */
  --paper-hi: #FBF8F1;       /* cards on paper */
  --paper-edge: #E2D6C1;     /* warm borders */
  --deep-blue: #1E3A5F;      /* hero band, deep accent */
  --ink: #2B2118;            /* text on paper, warm near-black */
  --ink-soft: #5A4D42;
  --ink-faint: #6B5D50;
  --cream: #F6F1E7;          /* text on brown or blue */
  --line: #E2D6C1;
}
body { background: var(--earth); color: var(--ink); }
.site-header { background: var(--earth); border-bottom: 1px solid rgba(246,241,231,0.18); }
.site-header .brand { color: var(--cream); }
.site-header nav a { color: var(--cream); }
.site-header nav a:hover { color: var(--mint); }
.site-footer { background: var(--earth-deep); color: var(--cream); }
.site-footer p, .site-footer a { color: var(--cream); }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
main.hero, main.herb-page {
  background: var(--paper);
  margin: 0 auto;
  max-width: 1040px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(20,12,6,0.25);
}
@media (min-width: 1100px) { main.hero, main.herb-page { margin: 18px auto; } }
.herb-hero { background: var(--deep-blue); color: var(--cream); }
.herb-hero h1, .herb-hero .overview, .herb-hero p { color: var(--cream); }
.tier-card { background: var(--paper-hi); border-color: var(--paper-edge); }
.tier-card .retailer { color: var(--deep-blue); }
.chip { background: #DCEBDD; }

/* hero with plate */
.hero-grid { display: grid; gap: 24px; align-items: center; }
@media (min-width: 760px) { .hero-grid { grid-template-columns: 1fr 300px; } }
.plate-frame { margin: 0; text-align: center; }
.plate-paper {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  padding: 14px;
  box-shadow: inset 0 0 0 4px #FBF8F1, 0 8px 22px rgba(20,12,6,0.35);
}
.plate-paper img { display: block; width: 100%; height: auto; border-radius: 4px; }
.plate-frame figcaption {
  margin-top: 10px; font-size: 11px; line-height: 1.4; color: var(--cream); opacity: 0.85;
}
.plate-frame figcaption em { font-family: var(--font-display); font-size: 13px; }

/* shop card, horizontal */
.tier-grid.single { grid-template-columns: 1fr; }
.tier-card.shop-wide {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.shop-thumb {
  width: 96px; height: 96px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--paper-edge); flex: 0 0 96px; background: var(--paper);
}
.shop-text { flex: 1 1 260px; min-width: 0; }
.tier-card.shop-wide .tier-btn { width: auto; min-width: 200px; flex: 0 0 auto; }
@media (max-width: 560px) { .tier-card.shop-wide .tier-btn { width: 100%; } }

/* home: popular herbs row */
.popular-herbs { margin: 28px 0 8px; text-align: center; }
.popular-herbs .chips-label { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.popular-herbs ul { list-style: none; padding: 0; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; }
.herb-tile { display: block; text-decoration: none; color: var(--ink); background: var(--paper-hi); border: 1px solid var(--paper-edge); border-radius: 12px; padding: 12px; }
.herb-tile:hover { text-decoration: none; border-color: var(--deep-blue); }
.herb-tile img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: var(--paper); }
.tile-name { display: block; font-family: var(--font-display); font-size: 17px; margin-top: 10px; color: var(--ink); }
.tile-latin { display: block; font-style: italic; font-size: 12.5px; color: var(--ink-soft); }
@media (max-width: 560px) { .popular-herbs ul { grid-template-columns: repeat(3, 1fr); gap: 8px; } .tile-name { font-size: 14px; } .tile-latin { font-size: 11px; } }
.site-header .palette-picker, .site-header .palette-picker label, .site-header .palette-picker span { color: var(--cream); }
.site-header .palette-picker { opacity: 1; }

/* ===== PILOT v2.1 type (261105): orange titles, deep green reading text, dyslexia-friendly defaults + Easy read mode =====
   Colour meaning, kept the same everywhere:
   orange = titles (where you are) | deep green = reading text | deep blue + underline = a source or link you can check
   brown = notes and captions | the evidence chips keep their own green / yellow / red + icon + words (never colour alone).
   Contrast on paper #F6F1E7: orange #C2410C 4.6:1, green #1F4A36 8.9:1, blue #1E3A5F 10.2:1, brown #5A4D42 7.2:1.
   On the deep blue band: glow orange #FF9F4A 5.7:1, cream 10.2:1. */
:root {
  --title-orange: #C2410C;
  --title-glow: #FF9F4A;
  --text-green: #1F4A36;
  --link-blue: #1E3A5F;
  --note-brown: #5A4D42;
}
body { font-size: 18px; line-height: 1.65; letter-spacing: 0.012em; word-spacing: 0.06em; }
main.hero, main.herb-page { color: var(--text-green); }
main h1, main h2, main h3 { color: var(--title-orange); letter-spacing: 0; }
.herb-hero h1 { color: var(--title-glow); }
.herb-hero .overview, .herb-hero p { color: var(--cream); }
.herb-section p, .herb-section li, main.hero .tagline { max-width: 70ch; text-align: left; }
.herb-section p + p { margin-top: 0.9em; }
main a:not(.tier-btn):not(.chip):not(.herb-tile):not(.btn) { color: var(--link-blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.support-reason, .plate-frame figcaption, .site-footer p, .tier-desc, .tile-latin { letter-spacing: 0.01em; }
.support-reason, .tier-desc, .tile-latin { color: var(--note-brown); }
main em, main i { font-style: italic; }  /* italics only for short Latin names */

/* Easy read: bigger text, wider letter and word spacing (Zorzi 2012; Rello 2013; Dyslexia Scotland) */
:root[data-read="easy"] body { font-size: 21px; line-height: 1.8; letter-spacing: 0.035em; word-spacing: 0.16em; }
:root[data-read="easy"] .herb-section p, :root[data-read="easy"] .herb-section li { max-width: 60ch; }
.read-toggle {
  font: 600 13px/1 var(--font-body); letter-spacing: 0.02em; color: var(--cream);
  background: transparent; border: 1px solid rgba(246,241,231,0.55); border-radius: 999px;
  padding: 7px 12px; margin-left: 12px; cursor: pointer;
}
.read-toggle[aria-pressed="true"] { background: var(--cream); color: var(--earth-deep); border-color: var(--cream); }
.read-toggle:focus-visible { outline: 2px solid var(--title-glow); outline-offset: 2px; }
main .herb-section p, main .herb-section li, main .herb-section td, main.hero .tagline { color: var(--text-green); }
main .jump-nav, main .on-this-page { background: var(--paper-hi); border-color: var(--paper-edge); }
main.hero .tagline { text-align: center; margin-left: auto; margin-right: auto; }

/* ===== PILOT v2.2 (261105): Large print (low vision), reader panel, private notes ===== */
/* Large print: WCAG AAA-level contrast for body text, 24 px, bigger targets, thick focus ring */
:root[data-read="large"] body { font-size: 24px; line-height: 1.75; letter-spacing: 0.02em; word-spacing: 0.1em; }
:root[data-read="large"] { --text-green: #123526; --title-orange: #9A3412; }
:root[data-read="large"] .herb-section p, :root[data-read="large"] .herb-section li { max-width: 55ch; }
:root[data-read="large"] main a:not(.tier-btn):not(.chip):not(.herb-tile) { text-decoration-thickness: 2px; }
:root[data-read="large"] .tier-btn, :root[data-read="large"] .chip, :root[data-read="large"] .read-toggle, :root[data-read="large"] .jump-nav a { min-height: 48px; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }
:root[data-read="large"] .tier-label, :root[data-read="large"] .jump-label, :root[data-read="large"] .support-chip, :root[data-read="large"] .chips-label { font-size: 0.85rem; }
:root[data-read="large"] .support-reason, :root[data-read="large"] .tier-desc, :root[data-read="large"] .tile-latin { font-size: 0.95em; color: var(--ink); }
:root[data-read="large"] :focus-visible { outline: 3px solid var(--deep-blue); outline-offset: 3px; }
:root[data-read="large"] main.hero, :root[data-read="large"] main.herb-page { box-shadow: none; }

/* Reader panel: a small card, not a blocking pop-up. Esc or "Not now" closes it. */
.reader-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 1000; width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); color: var(--ink);
  border: 1px solid var(--paper-edge); border-radius: 14px; padding: 20px 20px 16px;
  box-shadow: 0 16px 40px rgba(20,12,6,0.4); font-size: 16px; letter-spacing: 0.01em;
}
.reader-panel h2 { margin: 0 0 6px; font-family: var(--font-display); color: var(--title-orange); font-size: 1.4rem; }
.reader-panel h2:focus { outline: none; }
.reader-panel .rp-lead { margin: 0 0 12px; color: var(--text-green); }
.reader-panel fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.reader-panel legend { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.rp-opt { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: start; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--paper-edge); border-radius: 10px; background: var(--paper-hi); cursor: pointer; }
.rp-opt input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--deep-blue); }
.rp-opt-name { font-weight: 600; color: var(--ink); }
.rp-opt-hint { grid-column: 2; font-size: 14px; color: var(--note-brown); }
.rp-opt:has(input:checked) { border-color: var(--deep-blue); box-shadow: inset 0 0 0 1px var(--deep-blue); }
.rp-note { font-size: 13px; color: var(--note-brown); margin: 4px 0 12px; }
.rp-actions { display: flex; gap: 10px; }
.rp-save, .rp-later { font: 600 15px/1 var(--font-body); padding: 12px 18px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.rp-save { background: var(--forest); color: #fff; border: 0; }
.rp-later { background: transparent; color: var(--deep-blue); border: 1px solid var(--deep-blue); }
.rp-save:focus-visible, .rp-later:focus-visible, .rp-opt:focus-within { outline: 2px solid var(--title-orange); outline-offset: 2px; }
@media (max-width: 560px) { .reader-panel { right: 8px; left: 8px; bottom: 8px; width: auto; } }

/* Private notes + suggest a change */
.my-notes { max-width: var(--max-width); margin: 18px auto 0; padding: 0 24px; }
.my-notes summary { cursor: pointer; font-weight: 600; color: var(--deep-blue); }
.my-notes summary span { font-weight: 400; color: var(--note-brown); }
.my-notes textarea { width: 100%; margin-top: 10px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--paper-hi); border: 1px solid var(--paper-edge); border-radius: 8px; }
.mn-suggest { font-size: 0.9em; color: var(--note-brown); }
/* v2.2 sizing fix: scale the root so rem-sized text grows too (standard 18 px, easy 20 px, large 24 px) */
:root { font-size: 112.5%; }
body { font-size: 1rem; }
:root[data-read="easy"] { font-size: 125%; }
:root[data-read="easy"] body { font-size: 1rem; }
:root[data-read="large"] { font-size: 150%; }
:root[data-read="large"] body { font-size: 1rem; }
.reader-panel { font-size: 1rem; }
.tier-btn:hover, .tier-btn:focus { color: #fff; }   /* hover text was turning green on green */
:root[data-read="large"] .plate-frame figcaption { font-size: 0.7rem; }

/* ---- PILOT v3 fixes (GT-VISUAL-261105 FIX-LIST) ---- */
.tier-btn:hover, .tier-btn:focus { background: #245A42; color: #fff; }   /* 1: white on #245A42 = 8.03:1 */
.plate-frame figcaption { font-size: 12.5px; }                            /* 11: was 11px */
.plate-frame figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rp-more { margin: 4px 0 10px; }
.rp-more > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.rp-more[open] > summary { margin-bottom: 4px; }
:root[data-read="large"] { --ink-faint: #5A4D42; --forest: #1F5A40; }   /* 7: small text toward 7:1 */
:root[data-read="large"] .tier-btn, :root[data-read="large"] .rp-save { background: #245A42; }
:root[data-read="large"] .chip { color: #1F4A36; }
:root[data-palette="contrast"] { --title-orange: #9A3412; --ink-faint: #5A4D42; }   /* 8: label matches */
@media (max-width: 560px) { .site-header .palette-picker { display: none; } }   /* phones: Colours lives in the Reading card; header back to 2 rows */
.rp-opt-hint, .rp-note, .reader-panel legend { font-size: .875em; }   /* GT item B: hint/note text scales with the card in Large print */
