/* =========================================================
   VƯỜN THẢO DƯỢC – Stylesheet
   ========================================================= */
:root {
  --bg: #f4f7ef;
  --bg-2: #eaf1e0;
  --surface: #ffffff;
  --surface-2: #f8faf4;
  --text: #1d2b1f;
  --muted: #5c6d5e;
  --border: #dde6d3;
  --primary: #2f7d4f;
  --primary-2: #4fa36b;
  --primary-soft: #e1f0e4;
  --accent: #e39b2d;
  --danger: #c4473a;
  --danger-soft: #fbe9e6;
  --info-soft: #e7f2fb;
  --shadow: 0 6px 24px rgba(36, 72, 40, .08);
  --shadow-lg: 0 18px 50px rgba(36, 72, 40, .16);
  --radius: 18px;
  --radius-sm: 10px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Lora", Georgia, "Times New Roman", serif;
  --hero-grad: linear-gradient(135deg, #1f5e3a 0%, #2f7d4f 45%, #7cb342 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --bg-2: #16201a; --surface: #1a241d; --surface-2: #1f2b23;
    --text: #e4ece3; --muted: #9fb0a1; --border: #2c3a30;
    --primary: #6cc48a; --primary-2: #8fd6a4; --primary-soft: #1f3527;
    --danger-soft: #3a211e; --info-soft: #1b2a36;
    --shadow: 0 6px 24px rgba(0,0,0,.35); --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
    --hero-grad: linear-gradient(135deg, #0f2a1b 0%, #1d4a31 50%, #3d6b25 100%);
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --bg-2: #16201a; --surface: #1a241d; --surface-2: #1f2b23;
  --text: #e4ece3; --muted: #9fb0a1; --border: #2c3a30;
  --primary: #6cc48a; --primary-2: #8fd6a4; --primary-soft: #1f3527;
  --danger-soft: #3a211e; --info-soft: #1b2a36;
  --shadow: 0 6px 24px rgba(0,0,0,.35); --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
  --hero-grad: linear-gradient(135deg, #0f2a1b 0%, #1d4a31 50%, #3d6b25 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  line-height: 1.65; font-size: 16px; -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
mark { background: #ffe58a; color: #3a2a00; border-radius: 3px; padding: 0 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--hero-grad); color: #fff; font-size: 1.3rem; box-shadow: var(--shadow);
}
.logo small { display: block; font-family: var(--font); font-weight: 400; font-size: .7rem; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .95rem; white-space: nowrap;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.header-search { position: relative; margin-left: auto; flex: 0 1 300px; }
.header-search input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .92rem; outline: none; transition: .2s;
}
.header-search input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
.header-search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .55; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; color: var(--text); flex-shrink: 0; transition: .2s;
}
.icon-btn:hover { transform: rotate(15deg); border-color: var(--primary-2); }
.menu-toggle { display: none; }

/* Suggest dropdown */
.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: none; max-height: 420px; overflow-y: auto; z-index: 60;
}
.suggest.open { display: block; animation: pop .18s ease-out; }
.suggest a { display: flex; gap: 12px; align-items: center; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.suggest a:last-child { border-bottom: 0; }
.suggest a:hover, .suggest a.focus { background: var(--primary-soft); text-decoration: none; }
.suggest .s-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.suggest .s-name { font-weight: 600; }
.suggest .s-sub { font-size: .8rem; color: var(--muted); display: block; line-height: 1.35; }
.suggest a.s-benh { background: var(--surface-2); }
.suggest a.s-benh .s-name { color: var(--primary); }
.fav-btn:focus-visible { outline: 3px solid var(--primary-2); outline-offset: 2px; }
.suggest .s-empty { padding: 14px; color: var(--muted); font-size: .9rem; }
.suggest .s-all { justify-content: center; color: var(--primary); font-weight: 600; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; background: var(--hero-grad);
  padding: 72px 0 96px; isolation: isolate;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 -1px 0; height: 60px; background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%); z-index: 1;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: .3em; text-shadow: 0 2px 20px rgba(0,0,0,.2); }
.hero p.lead { font-size: clamp(1rem, 2vw, 1.2rem); opacity: .92; max-width: 640px; }
.hero .container { position: relative; z-index: 2; }
.leaf { position: absolute; font-size: 2rem; opacity: .22; z-index: 0; animation: float 14s ease-in-out infinite; pointer-events: none; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(25deg); }
}
.big-search { margin-top: 28px; max-width: 720px; }
.big-search form {
  display: flex; background: #fff; border-radius: 999px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.big-search input {
  flex: 1; border: 0; outline: none; padding: 14px 20px; font: inherit; font-size: 1.05rem; border-radius: 999px; color: #1d2b1f; background: transparent; min-width: 0;
}
.big-search button {
  border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600; padding: 0 26px;
  border-radius: 999px; cursor: pointer; transition: .2s; white-space: nowrap;
}
.big-search button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.big-search .modes { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.quick-tags span.lbl { opacity: .85; font-size: .9rem; margin-right: 4px; }
.quick-tags a {
  color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  padding: 5px 14px; border-radius: 999px; font-size: .88rem; transition: .2s;
}
.quick-tags a:hover { background: #fff; color: var(--primary); text-decoration: none; }
.stats { display: flex; gap: 32px; margin-top: 34px; flex-wrap: wrap; }
.stats b { display: block; font-size: 2rem; font-family: var(--font-head); }
.stats span { font-size: .85rem; opacity: .85; }

.page-hero { padding: 48px 0 72px; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); }

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; transition: .2s; text-decoration: none !important;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-light { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-light:hover { background: #fff; color: var(--primary); }
.btn.active-fav { background: #ffe3ea; color: #c2185b; border-color: #f5b5c8; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; transition: .18s; white-space: nowrap;
}
.chip:hover { border-color: var(--primary-2); color: var(--primary); text-decoration: none; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .count { font-size: .75rem; opacity: .7; }
.tag {
  display: inline-block; font-size: .75rem; padding: 3px 10px; border-radius: 999px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
}

/* ---------- Category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cat-card {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border); color: var(--text); transition: .25s; overflow: hidden;
}
.cat-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--primary)); transition: .25s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cat-card:hover::before { width: 100%; opacity: .07; }
.cat-ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; flex-shrink: 0;
  background: color-mix(in srgb, var(--c) 15%, transparent);
}
.cat-card h3 { font-family: var(--font); font-size: 1.02rem; margin: 2px 0 4px; }
.cat-card p { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.45; }
.cat-card .n { position: relative; font-size: .75rem; font-weight: 700; color: var(--c); margin-top: 6px; display: inline-block; }

/* ---------- Herb cards ---------- */
.herb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.herb-card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; color: var(--text); transition: transform .25s, box-shadow .25s;
}
.herb-card:hover, .herb-card:focus-within { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.herb-card .card-link { color: inherit; text-decoration: none; outline: none; }
.herb-card .card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.herb-card:focus-within { outline: 3px solid var(--primary-2); outline-offset: 2px; }
.herb-card:has(.fav-btn:focus-visible) { outline: none; }
.herb-thumb {
  position: relative; height: 130px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 35%, #fff) 0%, var(--c) 100%);
}
.herb-thumb .emoji { font-size: 3.6rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); transition: transform .35s; z-index: 1; }
.herb-card:hover .herb-thumb .emoji { transform: scale(1.18) rotate(-8deg); }
.herb-thumb svg.pattern { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .18; }
.herb-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.herb-body h3 { font-size: 1.2rem; margin: 0; }
.herb-body .sci { font-style: italic; font-size: .82rem; color: var(--muted); }
.herb-body .alias { font-size: .82rem; color: var(--muted); }
.herb-body .uses { font-size: .88rem; margin: 4px 0 0; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.herb-body .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); cursor: pointer; font-size: 1.05rem; display: grid; place-items: center; transition: .2s;
}
.fav-btn:hover { transform: scale(1.15); }
.match-note { font-size: .78rem; color: var(--accent); font-weight: 600; }

/* ---------- Herb of the day ---------- */
.hotd {
  display: grid; grid-template-columns: 280px 1fr; background: var(--surface); border-radius: 24px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hotd-visual { display: grid; place-items: center; font-size: 7rem; position: relative; min-height: 260px;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 30%, #fff), var(--c)); }
.hotd-visual span { animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 12px 20px rgba(0,0,0,.3)); }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-6deg); } }
.hotd-body { padding: 28px 32px; }
.hotd-body h3 { font-size: 1.8rem; }
.hotd-body ul { padding-left: 1.2em; margin: 10px 0 18px; }

/* ---------- Toolbar (list page) ---------- */
.toolbar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); margin-top: -48px; position: relative; z-index: 5;
}
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 320px; }
.search-box input {
  width: 100%; padding: 14px 44px 14px 46px; font: inherit; font-size: 1rem; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface-2); color: var(--text); outline: none; transition: .2s;
}
.search-box input:focus { border-color: var(--primary-2); background: var(--surface); }
.search-box .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; opacity: .6; }
.search-box .clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: var(--bg-2); color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: none; }
.search-box .clear.show { display: block; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 10px 14px; border-radius: 9px; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; font-weight: 500;
}
.seg button.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); font-weight: 600; }
select.sort {
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
}
.filter-row { margin-top: 14px; }
.result-info { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 16px; flex-wrap: wrap; gap: 8px; }
.result-info b { color: var(--primary); }
.benh-hint { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 18px; padding: 12px 14px;
  background: var(--primary-soft); border-radius: 14px; }
.benh-hint .lbl { font-weight: 600; font-size: .9rem; margin-right: 4px; }
.disease-chips small { opacity: .65; }
.empty {
  text-align: center; padding: 60px 20px; background: var(--surface); border-radius: var(--radius); border: 2px dashed var(--border);
}
.empty .big { font-size: 3.5rem; }

/* ---------- Detail page ---------- */
.detail-hero { padding: 40px 0 80px; }
.breadcrumb { font-size: .88rem; opacity: .85; margin-bottom: 18px; }
.breadcrumb a { color: #fff; }
.detail-head { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.detail-emoji {
  width: 140px; height: 140px; border-radius: 32px; display: grid; place-items: center; font-size: 4.8rem;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.2); flex-shrink: 0; animation: bob 5s ease-in-out infinite;
}
.detail-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.detail-head .sci { font-style: italic; opacity: .9; font-size: 1.05rem; }
.detail-head .alias { opacity: .85; margin-top: 4px; }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.detail-tags a { background: rgba(255,255,255,.2); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: .82rem; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-top: -52px; position: relative; z-index: 5; overflow: hidden;
}
.fact { padding: 18px 20px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.fact .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.fact .v { font-weight: 500; margin-top: 4px; font-size: .95rem; }

.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin-top: 32px; align-items: start; }
.detail-layout > *, .disease-layout > * { min-width: 0; }
.detail-head > div:last-child { flex: 1 1 260px; min-width: 0; }
.facts .fact { min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: 12px 16px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: .2s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; padding: 24px 0; animation: fadeUp .35s ease-out; }
.tab-panel.active { display: block; }
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.panel-card h2, .panel-card h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list li::before {
  content: "✓"; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .8rem; margin-top: 2px;
}
.warn-list li::before { content: "!"; background: var(--danger-soft); color: var(--danger); }
.disease-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.disease-chips a { background: var(--bg-2); padding: 6px 12px; border-radius: 999px; color: var(--text); font-size: .88rem; }
.disease-chips a:hover { background: var(--primary); color: #fff; text-decoration: none; }

.recipe {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px;
}
.recipe-head { padding: 18px 22px; display: flex; gap: 14px; align-items: center; background: linear-gradient(90deg, var(--primary-soft), transparent); }
.recipe-num {
  width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex-shrink: 0; font-family: var(--font-head); font-size: 1.1rem;
}
.recipe-head h3, .recipe-head h4 { margin: 0; font-size: 1.12rem; }
.recipe-head p { margin: 0; font-size: .86rem; color: var(--muted); }
.recipe-body { padding: 4px 22px 20px; }
.ingredients { background: var(--surface-2); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: .94rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 10px 40px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--primary-2); color: var(--primary); display: grid; place-items: center; font-size: .78rem; font-weight: 700;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 32px; bottom: 0; width: 2px; background: var(--border); }

.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 14px; margin: 18px 0; font-size: .93rem; }
.callout .ci { font-size: 1.4rem; line-height: 1; }
.callout.warn { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.callout.info { background: var(--info-soft); border: 1px solid color-mix(in srgb, #3b9ad9 30%, transparent); }
.callout.tip { background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }

.sidebar .side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.sidebar { position: sticky; top: 88px; }
.side-card h4, .side-card .side-title { font-family: var(--font); font-size: .95rem; margin-bottom: 12px; }
.mini-herb { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; color: var(--text); }
.mini-herb:hover { background: var(--primary-soft); text-decoration: none; }
.mini-herb .s-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.mini-herb small { display: block; color: var(--muted); font-size: .78rem; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }

/* ---------- Disease page ---------- */
.disease-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.cat-nav { position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.cat-nav button {
  width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; border-radius: 10px;
  font: inherit; font-size: .92rem; color: var(--text); cursor: pointer; text-align: left; transition: .15s;
}
.cat-nav button:hover { background: var(--bg-2); }
.cat-nav button.active { background: var(--c, var(--primary)); color: #fff; }
.cat-nav button .n { margin-left: auto; font-size: .75rem; opacity: .7; }
.cat-banner { border-radius: var(--radius); padding: 24px; color: #fff; margin-bottom: 20px; display: flex; gap: 18px; align-items: center; }
.cat-banner .big { font-size: 3rem; }
.cat-banner h2 { margin: 0; }
.cat-banner p { margin: 4px 0 0; opacity: .9; }
.az-index { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.az-index a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--text); }
.az-index a:hover { background: var(--primary); color: #fff; text-decoration: none; }
.disease-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.disease-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.disease-item h4 { font-family: var(--font); font-size: 1rem; margin: 0 0 6px; }
.disease-item h4 a { color: var(--text); }
.disease-item .aka { font-size: .8rem; color: var(--muted); margin: -2px 0 8px; line-height: 1.4; }
.disease-item .herbs { display: flex; flex-wrap: wrap; gap: 6px; }
.disease-item .herbs a { font-size: .82rem; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.letter-head { grid-column: 1 / -1; font-family: var(--font-head); font-size: 1.6rem; color: var(--primary); border-bottom: 2px solid var(--border); padding: 12px 0 4px; scroll-margin-top: 90px; }

/* ---------- Guide page ---------- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.method { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: .25s; scroll-margin-top: 90px; }
.method:hover { box-shadow: var(--shadow-lg); }
.method .m-ico { font-size: 2.4rem; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); margin-bottom: 12px; }
.method h3 { font-size: 1.3rem; }
.method .when { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-2); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; background: #13261a; color: #b9cbb9; padding: 48px 0 24px; font-size: .92rem; }
.site-footer a { color: #d8e8d6; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-family: var(--font); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.disclaimer { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; opacity: .8; }

/* ---------- Misc ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary);
  color: #fff; font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .3s; z-index: 40;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #1d2b1f; color: #fff;
  padding: 12px 20px; border-radius: 12px; opacity: 0; transition: .3s; z-index: 100; pointer-events: none; font-size: .92rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .detail-layout, .disease-layout { grid-template-columns: 1fr; }
  .sidebar, .cat-nav { position: static; }
  .cat-nav { display: flex; overflow-x: auto; gap: 4px; }
  .cat-nav button { width: auto; white-space: nowrap; }
  .cat-nav button .n { display: none; }
}
@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 10px 16px; display: none; margin: 0; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav a { border-radius: 10px; }
  .header-search { flex: 1 1 auto; }
  .logo small { display: none; }
  .hotd { grid-template-columns: 1fr; }
  .hotd-visual { min-height: 180px; font-size: 5rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .logo-text { display: none; }
  .big-search form { flex-direction: column; border-radius: 20px; gap: 6px; }
  .big-search button { padding: 12px; }
  .hero { padding: 48px 0 80px; }
  .stats { gap: 20px; }
  .detail-emoji { width: 100px; height: 100px; font-size: 3.4rem; border-radius: 24px; }
  .hotd-body { padding: 20px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 10px 6px; }
  .facts { grid-template-columns: 1fr; }
  .prev-next { flex-direction: column; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .to-top, .sidebar, .tabs, .detail-actions, .fav-btn { display: none !important; }
  .tab-panel { display: block !important; }
  .hero, .detail-hero { background: none !important; color: #000 !important; padding: 0 !important; }
  .hero::after { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  body { background: #fff; }
}

/* Ẩn khỏi mắt nhưng vẫn đọc được bởi trình đọc màn hình / máy tìm kiếm */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
