/* Pharma RAG — three switchable themes.
   data-theme values: "apothecary" (light, default), "magazine" (light), "luxe" (dark).
   Legacy value "dark" maps to luxe. The initial theme is applied inline in each
   page's <head> (anti-FOUC); static/theme.js handles the picker + persistence
   (localStorage key: "theme"). */

:root {
  /* apothecary — vintage pharmacy: cream paper, deep green, brass */
  --bg: #f5efdf;
  --card: #fffdf4;
  --plate-bg: #f2ebd6;
  --border: #ddd2b4;
  --text: #2c2f22;
  --muted: #6f6c56;
  --accent: #2d5a3d;
  --accent-hover: #1f4d2e;
  --accent-2: #a5761c;
  --link: #245c4c;
  --danger: #b3261e;
  --warn: #b07d1e;
  --shadow: 0 1px 3px rgba(44, 47, 34, 0.10);
  --shadow-lg: 0 4px 14px rgba(44, 47, 34, 0.15);
  --accent-soft: rgba(45, 90, 61, 0.12);
  --link-soft: rgba(36, 92, 76, 0.12);
  --warn-soft: rgba(165, 118, 28, 0.18);
  --danger-soft: rgba(179, 38, 30, 0.10);
  --muted-soft: rgba(111, 108, 86, 0.16);
  --hover-bg: rgba(45, 90, 61, 0.06);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --hero-bg: #fffdf4;
  --hero-fg: #2c2f22;
  --texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.045'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme="magazine"] {
  /* magazine — modern health magazine: white, bold sans, green + amber blocks */
  --bg: #f6f6f2;
  --card: #ffffff;
  --plate-bg: #ffffff;
  --border: #e2e2da;
  --text: #151d17;
  --muted: #5f6b62;
  --accent: #14532d;
  --accent-hover: #0d4023;
  --accent-2: #e8a020;
  --link: #14532d;
  --danger: #c0392b;
  --warn: #b45309;
  --shadow: 0 1px 2px rgba(21, 29, 23, 0.08);
  --shadow-lg: 0 10px 28px rgba(21, 29, 23, 0.14);
  --accent-soft: rgba(20, 83, 45, 0.10);
  --link-soft: rgba(20, 83, 45, 0.10);
  --warn-soft: rgba(232, 160, 32, 0.25);
  --danger-soft: rgba(192, 57, 43, 0.10);
  --muted-soft: rgba(95, 107, 98, 0.16);
  --hover-bg: rgba(20, 83, 45, 0.05);
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 2px;
  --radius-lg: 4px;
  --hero-bg: #14532d;
  --hero-fg: #ffffff;
  --texture: none;
}

:root[data-theme="luxe"],
:root[data-theme="dark"] {
  /* luxe — dark botanical luxe: near-black green, gold, serif */
  --bg: #12160f;
  --card: #1c2218;
  --plate-bg: #efe6cc;
  --border: #37422e;
  --text: #ece6d3;
  --muted: #a3a78c;
  --accent: #d2a94e;
  --accent-hover: #e2bd66;
  --accent-2: #d2a94e;
  --link: #b8c795;
  --danger: #e26a5c;
  --warn: #d9a441;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 6px 22px rgba(0, 0, 0, 0.55);
  --accent-soft: rgba(210, 169, 78, 0.15);
  --link-soft: rgba(184, 199, 149, 0.14);
  --warn-soft: rgba(217, 164, 65, 0.18);
  --danger-soft: rgba(226, 106, 92, 0.15);
  --muted-soft: rgba(163, 167, 140, 0.16);
  --hover-bg: rgba(210, 169, 78, 0.07);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 3px;
  --radius-lg: 6px;
  --hero-bg: #1c2218;
  --hero-fg: #ece6d3;
  --texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: var(--texture);
  color: var(--text);
  line-height: 1.6;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* --- typography --- */
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1em;
  margin-bottom: 0.3em;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35em;
  margin: 1.2em 0 0.5em;
  color: var(--accent);
}
h3 { font-size: 1.1em; margin: 1em 0 0.3em; color: var(--muted); }
:root[data-theme="magazine"] h1 { font-weight: 800; letter-spacing: -0.025em; }
:root[data-theme="magazine"] h2 { font-weight: 800; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.kicker {
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.7em;
}

/* --- nav + theme picker --- */
.nav {
  display: flex; gap: 16px; margin-bottom: 22px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap;
}
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--accent); text-decoration: none; }
.theme-picker {
  margin-left: auto; display: flex; gap: 2px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.theme-picker button {
  border: none; background: transparent; color: var(--muted);
  font-size: 0.75em; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 12px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.theme-picker button:hover { color: var(--accent); }
.theme-picker button.active { background: var(--accent); color: #fff; }
:root[data-theme="magazine"] .theme-picker { border-radius: var(--radius); }
:root[data-theme="magazine"] .theme-picker button { border-radius: var(--radius); text-transform: uppercase; }

/* --- generic form controls --- */
input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
  padding: 8px 12px; font-size: 1em; font-family: inherit;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
button {
  padding: 8px 16px; font-size: 0.95em; cursor: pointer; font-family: inherit;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
}
button:hover { border-color: var(--accent); color: var(--accent); }

/* --- search --- */
.search-box { display: flex; gap: 8px; margin: 16px 0; }
.search-box input {
  flex: 1; padding: 12px 16px; font-size: 1.05em;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box button {
  padding: 12px 24px; font-size: 1em; cursor: pointer;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); font-weight: 600;
}
.search-box button:hover { background: var(--accent-hover); color: #fff; }

/* --- badges --- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius);
  font-size: 0.78em; font-weight: 600;
}
.badge-bot { background: var(--accent-soft); color: var(--accent); }
.badge-vit { background: var(--link-soft); color: var(--link); }
.badge-min { background: var(--warn-soft); color: var(--warn); }
.badge-other { background: var(--muted-soft); color: var(--muted); }
.badge-published { background: var(--accent-soft); color: var(--accent); }
.badge-draft { background: var(--warn-soft); color: var(--warn); }

/* --- cards, grids, stats --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
/* The global * reset strips ul padding, so lists in cards need explicit indent */
.card ul { padding-left: 1.3em; margin: 8px 0 0; }
.card ul li { margin-bottom: 8px; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat .num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.8em;
  color: var(--accent);
  line-height: 1.15;
}
.stat .label { font-size: 0.8em; color: var(--muted); margin-top: 4px; }
:root[data-theme="apothecary"] .stat .num { color: var(--accent-2); }
:root[data-theme="magazine"] .stat { border: none; border-top: 4px solid var(--accent); border-radius: 0; text-align: left; }
:root[data-theme="magazine"] .stat .num { font-weight: 800; letter-spacing: -0.03em; }
:root[data-theme="magazine"] .section { margin: 42px 0; }

/* --- sections --- */
.section { margin: 28px 0; }
.section-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  margin: 1.6em 0 0.9em; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-head h1, .section-head h2 { margin: 0; }
:root[data-theme="apothecary"] .section-head { border-bottom: 3px double var(--border); }
.section-link { margin-left: auto; font-size: 0.9em; }
.page-head { margin: 0.6em 0 1em; }
.page-head p { margin: 0.1em 0 0; }

/* --- homepage hero --- */
.hero {
  display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 36px; align-items: center;
  background: var(--hero-bg); color: var(--hero-fg);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 42px 44px; margin: 6px 0 12px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
:root[data-theme="luxe"] .hero,
:root[data-theme="dark"] .hero { border-color: rgba(210, 169, 78, 0.35); }
.hero-title {
  font-size: 3.1em; line-height: 1.04; margin: 0 0 0.35em;
  color: inherit;
}
.hero-sub { font-size: 1.04em; max-width: 48ch; margin-bottom: 1.3em; opacity: 0.85; }
.hero .search-box { max-width: 520px; margin: 0; }
.hero .search-box button { background: var(--accent-2); color: #fff; }
.hero .search-box button:hover { filter: brightness(1.08); color: #fff; }
.hero-plate { justify-self: center; text-align: center; margin: 0; }
.hero-plate img {
  display: block; max-width: 300px; width: 100%; margin: 0 auto;
  background: var(--plate-bg); padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
:root[data-theme="magazine"] .hero-plate img { border: 6px solid #fff; padding: 0; }
.hero-plate figcaption { font-size: 0.78em; margin-top: 10px; font-style: italic; opacity: 0.75; }

/* --- herb cards (featured strip + herbs grid) --- */
.herb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.herb-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.herb-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plate-frame {
  display: block; background: var(--plate-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.herb-card-img { height: 170px; overflow: hidden; margin-bottom: 10px; }
.herb-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plate-placeholder { position: relative; }
.plate-placeholder::after {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M32 56V16'/%3E%3Cpath d='M32 46c-9-1-15-8-16-17 9 1 15 8 16 17z' fill='currentColor' fill-opacity='.2'/%3E%3Cpath d='M32 32c9-1 15-8 16-17-9 1-15 8-16 17z' fill='currentColor' fill-opacity='.2'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / 72px 72px;
  color: var(--muted);
  opacity: 0.6;
}
.herb-card-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.06em; line-height: 1.25; }
:root[data-theme="magazine"] .herb-card-name { font-family: var(--font-body); font-weight: 700; }
.herb-card:hover .herb-card-name { color: var(--accent); }
.herb-card-sci { display: block; font-style: italic; color: var(--muted); font-size: 0.85em; margin-top: 2px; }
.herb-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.herb-card-count { display: block; margin-top: auto; padding-top: 10px; font-size: 0.82em; color: var(--muted); }
:root[data-theme="magazine"] .herb-card { border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 0; box-shadow: none; }
:root[data-theme="magazine"] .herb-card:hover { box-shadow: var(--shadow-lg); }
:root[data-theme="luxe"] .herb-card:hover .herb-card-name,
:root[data-theme="dark"] .herb-card:hover .herb-card-name { color: var(--accent); }

/* --- link cards (quick links) --- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.link-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.link-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.link-card strong { color: var(--link); font-weight: 600; }
.link-card .muted { font-size: 0.88em; }

/* --- news cards --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 16px; }
.article-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.article-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.article-card-kicker {
  font-size: 0.72em; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-2);
}
.article-card-title {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 1.12em; line-height: 1.3; color: var(--text);
}
:root[data-theme="magazine"] .article-card-title { font-family: var(--font-body); font-weight: 700; }
.article-card:hover .article-card-title { color: var(--accent); }
.article-card-excerpt { color: var(--muted); font-size: 0.93em; }
.article-card-meta { display: flex; gap: 8px; align-items: center; margin-top: auto; font-size: 0.83em; color: var(--muted); }
.article-card--featured { padding: 34px; margin-top: 4px; gap: 12px; }
.article-card--featured .article-card-title { font-size: 1.75em; }
:root[data-theme="magazine"] .article-card { border-radius: 0; box-shadow: none; border-top: 3px solid var(--accent); }
:root[data-theme="magazine"] .article-card--featured {
  background: var(--accent); border: none; border-radius: 0;
}
:root[data-theme="magazine"] .article-card--featured .article-card-title { color: #fff; }
:root[data-theme="magazine"] .article-card--featured .article-card-excerpt { color: rgba(255, 255, 255, 0.85); }
:root[data-theme="magazine"] .article-card--featured .article-card-meta { color: rgba(255, 255, 255, 0.8); }
:root[data-theme="magazine"] .article-card--featured .article-card-kicker { color: var(--accent-2); }
:root[data-theme="magazine"] .article-card--featured .badge-published { background: var(--accent-2); color: #151d17; }

/* --- tables --- */
table { width: 100%; border-collapse: collapse; margin: 12px 0; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover { background: var(--hover-bg); }
.table-card { padding: 8px 18px; }

/* --- detail pages --- */
.herb-header { overflow: auto; margin-bottom: 8px; }
.herb-plate {
  float: right;
  margin: 0 0 16px 20px;
  max-width: 300px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.herb-plate img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--plate-bg);
}
.herb-plate figcaption {
  font-size: 0.78em;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
}

/* --- herb detail image carousel (works without JS: slides stack as links) --- */
.herb-carousel {
  float: right;
  margin: 0 0 16px 20px;
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-lg);
}
.herb-carousel-main { position: relative; }
.herb-carousel-slide { display: block; margin-bottom: 6px; }
.herb-carousel-slide:last-of-type { margin-bottom: 0; }
.herb-carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--plate-bg);
}
html.js .herb-carousel-slide { display: none; margin-bottom: 0; }
html.js .herb-carousel-slide.active { display: block; }
html:not(.js) .herb-carousel-arrow,
html:not(.js) .herb-carousel-dots { display: none; }
.herb-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0.92;
}
.herb-carousel-arrow:hover { background: var(--accent); color: var(--card); }
.herb-carousel-arrow.prev { left: 6px; }
.herb-carousel-arrow.next { right: 6px; }
.herb-carousel-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.75em;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
}
.herb-carousel-caption a { color: var(--muted); }
.herb-carousel-credit { overflow-wrap: anywhere; }
.herb-carousel-count { white-space: nowrap; font-style: normal; }
.herb-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.herb-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.herb-carousel-dot.active { background: var(--accent); border-color: var(--accent); }
.herb-carousel-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.herb-carousel-thumb {
  display: block;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--plate-bg);
}
.herb-carousel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.js .herb-carousel-thumb { opacity: 0.55; }
html.js .herb-carousel-thumb.active { opacity: 1; outline: 2px solid var(--accent); }
.herb-plate-thumb {
  width: 46px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--plate-bg);
  display: block;
}
.herb-plate-card {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--plate-bg);
  display: block;
  margin-bottom: 8px;
}
.detail-sci { font-style: italic; font-size: 1.12em; color: var(--muted); font-family: var(--font-display); margin-bottom: 0.4em; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0.5em 0 0.8em; }

.product-img {
  display: inline-block;
  max-width: 300px; max-height: 300px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 12px;
}

.description-text {
  font-family: var(--font-display);
  font-size: 1.05em;
  line-height: 1.8;
  max-width: 68ch;
}

/* --- misc shared --- */
.muted { color: var(--muted); }
.amount { font-weight: 600; color: var(--accent); }
.tag { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  font-size: 0.85em; }
.tag a { color: var(--text); }
.tag:hover { border-color: var(--accent); }
pre { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; overflow-x: auto; font-size: 0.9em; }
code { font-family: 'SF Mono', monospace; font-size: 0.9em; }

.ingredient-list { list-style: none; padding: 0; }
.ingredient-list li { padding: 8px 12px; margin-bottom: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.95em; }
.ingredient-list li a { color: var(--link); text-decoration: none; }
.ingredient-list li a:hover { color: var(--accent); text-decoration: underline; }

/* News + admin */
.article-body {
  font-family: var(--font-display);
  line-height: 1.8;
  font-size: 1.06em;
  max-width: 68ch;
  margin: 16px 0;
}
.article-body p { margin-bottom: 1em; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 12px 0; padding: 4px 16px;
  color: var(--muted); font-style: italic;
}
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { margin: 1em 0 0.4em; }
.pagination { margin: 16px 0; display: flex; gap: 12px; align-items: center; }
form.inline { display: inline; }
.btn {
  display: inline-block; padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  font-size: 0.9em; font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border: none; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { color: var(--danger); }
.field {
  width: 100%; padding: 8px 12px; font-size: 1em;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); margin-bottom: 12px;
}
.field:focus { outline: none; border-color: var(--accent); }
.field-label { display: block; font-size: 0.85em; color: var(--muted); margin-bottom: 4px; }
.error {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--radius);
  padding: 10px 14px; margin: 12px 0;
}
details.card summary { cursor: pointer; }
details.card summary:hover { color: var(--accent); }

/* Quill editor */
.ql-toolbar.ql-snow, .ql-container.ql-snow { background: var(--card); border-color: var(--border) !important; }
.ql-container.ql-snow { color: var(--text); font-size: 1em; }
.ql-editor { min-height: 320px; }
.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-picker { color: var(--muted); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 28px 24px; }
  .hero-title { font-size: 2.4em; }
  .hero-plate img { max-width: 240px; }
}
@media (max-width: 640px) {
  body { padding: 14px; }
  .herb-plate { float: none; margin: 0 auto 16px; }
  .herb-carousel { float: none; margin: 0 auto 16px; }
  .theme-picker { margin-left: 0; width: 100%; justify-content: center; }
  table { display: block; overflow-x: auto; }
}

/* --- account menu + auth pages --- */
.nav-signin { font-weight: 600; }
.account-dropdown { position: relative; }
.account-toggle {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 4px 14px; font-size: 0.85em; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.account-toggle:hover { color: var(--accent); border-color: var(--accent); }
.account-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 210px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px;
}
/* Invisible bridge across the 6px gap so hover travels from the pill to the panel */
.account-panel::before {
  content: ""; position: absolute; top: -8px; right: 0; left: 0; height: 8px;
}
.account-dropdown:hover .account-panel,
.account-dropdown:focus-within .account-panel { display: block; }
.account-panel a,
.account-panel .account-email,
.account-panel button.account-logout {
  display: block; width: 100%; text-align: left; padding: 8px 10px; font-size: 0.9em;
  border-radius: var(--radius); color: var(--text); background: transparent; border: none;
  font-family: inherit;
}
.account-panel a:hover { background: var(--hover-bg); text-decoration: none; color: var(--accent); }
.account-panel .account-email { color: var(--muted); font-size: 0.8em; overflow-wrap: anywhere; }
.account-panel form { margin: 0; }
.account-panel button.account-logout { cursor: pointer; color: var(--danger); }
.account-panel button.account-logout:hover { background: var(--danger-soft); }

.api-key-plain {
  background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0; overflow-wrap: anywhere;
  font-family: 'SF Mono', monospace; font-size: 0.95em;
}
.cf-turnstile { margin: 12px 0; }

@media (max-width: 640px) {
  .account-dropdown { width: 100%; }
  .account-panel { position: static; display: block; box-shadow: none; border: none; padding: 4px 0 0; }
}
