
/* Herbarium: mỗi cây là một "tờ mẫu tiêu bản" — nhãn ghi Họ/Chi/Loài kiểu bảo tàng thực vật, nền giấy xanh xám. */
:root {
  --paper: #F7F2E8;
  --sheet: #FFFDF8;
  --ink: #1C2A21;
  --muted: #5E6C61;
  --line: #E6DDCB;
  --moss: #3F7A4B;
  --moss-soft: #E7F0DD;
  --rust: #B5562B;
  --gold: #8E7124;
  --display: "Noto Serif Display", "Noto Serif", Georgia, serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111712; --sheet: #182019; --ink: #E2EADE; --muted: #9AA99C; --line: #2B3A2F;
    --moss: #8FC096; --moss-soft: #223326; --rust: #E58C62; --gold: #D2B463; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111712; --sheet: #182019; --ink: #E2EADE; --muted: #9AA99C; --line: #2B3A2F;
  --moss: #8FC096; --moss-soft: #223326; --rust: #E58C62; --gold: #D2B463; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.65 var(--body); }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 18px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; text-wrap: balance; line-height: 1.2; margin: 0; }
i, em.sci { font-family: var(--display); font-style: italic; }
a { color: var(--moss); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Đầu trang */
header.top { border-bottom: 1px solid var(--line); background: var(--sheet); }
.mast { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 16px; min-height: 280px; padding: 32px 30px 26px; border-radius: 22px; color: #fff;
  background: linear-gradient(100deg, rgba(14, 34, 20, .92) 0%, rgba(14, 34, 20, .72) 45%, rgba(14, 34, 20, .25) 100%), url("/wiki/img/_banner.webp") center 55% / cover no-repeat, #1f3a27; }
.mast .label, .mast .label a { color: rgba(255, 255, 255, .8) !important; }
.mast h1 { color: #fff; }
.mast h1 span { color: #B9E4B0 !important; }
.mast p { color: rgba(255, 255, 255, .88) !important; }
.mast .counts, .mast .counts b { color: #fff; }
.mast .counts { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; padding: 10px 16px; backdrop-filter: blur(4px); }
.mast .counts div { color: rgba(255, 255, 255, .75); }
.wiki-switch { display: flex; gap: 8px; margin: 12px 0 4px; }
.wiki-switch a { flex: 1 1 0; text-align: center; text-decoration: none; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font-weight: 600; font-size: 14.5px; transition: border-color .15s, transform .15s; }
.wiki-switch a:hover { border-color: var(--moss); transform: translateY(-1px); }
.wiki-switch a.on { background: var(--moss); color: var(--sheet); border-color: var(--moss); }
@media (max-width: 480px) { .wiki-switch a { font-size: 13px; padding: 9px 8px; } }
.mast .hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mast .hero-tags span { font-size: 12px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 4px 10px; }
@media (max-width: 640px) { .mast { min-height: 230px; padding: 24px 18px 18px; border-radius: 18px; } .mast .hero-tags { display: none; } }

/* CTA sang cửa hàng Cobala Garden (hiệu ứng ánh sáng quét + nhịp thở nhẹ) */
.shop-cta, .plant-cta { position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-decoration: none; font-weight: 700; color: #20330f; background: linear-gradient(135deg, #e9fbc0, #b9f08a); border: 1px solid rgba(255,255,255,.65); border-radius: 999px; padding: 10px 18px; font-size: 14px; box-shadow: 0 6px 18px rgba(120, 200, 60, .35); animation: ctaPulse 2.6s ease-in-out infinite; }
.shop-cta { margin-top: 14px; }
.shop-cta::after, .plant-cta::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent); transform: skewX(-20deg); animation: ctaShine 3.2s ease-in-out infinite; }
.shop-cta:hover, .plant-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.plant-cta { display: flex; justify-content: center; margin: 4px 0 14px; border-radius: 14px; padding: 12px 16px; background: linear-gradient(135deg, #2f5d3a, #3f7a4a); color: #fff; border-color: rgba(255,255,255,.2); box-shadow: 0 8px 22px rgba(47, 93, 58, .35); }
.plant-cta b { color: #d7f7a8; }
/* Nút trên banner: kính trong suốt */
.mast .label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mast .label a.back-home { display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; font-size: 13px; letter-spacing: .02em; text-transform: none; color: #fff !important; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; padding: 7px 14px; backdrop-filter: blur(6px); transition: background .15s, transform .15s; }
.mast .label a.back-home:hover { background: rgba(255, 255, 255, .26); transform: translateY(-1px); }
.shop-cta { color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .5); box-shadow: none; backdrop-filter: blur(6px); animation: none; }
.shop-cta:hover { background: rgba(255, 255, 255, .26); filter: none; }
@keyframes ctaShine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes ctaPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .shop-cta, .plant-cta, .shop-cta::after, .plant-cta::after { animation: none; } }
.mast h1 { font-size: clamp(32px, 6vw, 56px); letter-spacing: -.01em; line-height: 1.05; margin-top: 6px; }
.mast h1 span { color: var(--moss); font-style: italic; }
.mast p { margin: 10px 0 0; color: var(--muted); max-width: 52ch; font-size: 16px; }
.counts { display: flex; gap: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.counts b { display: block; font-family: var(--display); font-size: 26px; color: var(--ink); font-weight: 600; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { flex-shrink: 0; border: 0; background: none; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
nav.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--moss); }
main { padding-block: 24px 60px; }
section[role="tabpanel"][hidden] { display: none; }
[data-solo-hide] { display: none !important; }
.solo-back { margin: 4px 0 14px; font-size: 14px; } .solo-back a { text-decoration: none; font-weight: 600; }
.bk-locked .paywall { max-height: 320px; overflow: hidden; filter: blur(5px); user-select: none; pointer-events: none; }

/* Thanh lọc */
.filters { display: grid; gap: 12px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.searchrow { display: flex; gap: 8px; flex-wrap: wrap; }
.searchrow input { flex: 1 1 240px; min-width: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 10px 16px; font: inherit; }
.searchrow select { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 9px 12px; font: inherit; max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: var(--sheet); }
.result-note { font-size: 13px; color: var(--muted); margin: 14px 2px 0; }

/* Nhóm họ */
.family { margin-top: 30px; }
.fam-head { display: grid; grid-template-columns: 6px 1fr; gap: 14px; align-items: stretch; }
.fam-bar { border-radius: 4px; }
.fam-head h2 { font-size: 26px; }
.fam-head h2 i { font-weight: 500; color: var(--muted); font-size: 18px; margin-left: 6px; }
.fam-head p { margin: 4px 0 0; color: var(--muted); max-width: 75ch; }
details.traits { margin-top: 8px; }
details.traits summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--moss); }
details.traits ul { margin: 8px 0 0; padding-left: 18px; max-width: 80ch; }
details.traits .care { margin-top: 8px; font-size: 13px; background: var(--moss-soft); border-radius: 10px; padding: 8px 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.card { text-align: left; border: 1px solid var(--line); background: var(--sheet); border-radius: 14px; padding: 14px 14px 12px; display: grid; gap: 6px; min-width: 0; transition: border-color .15s, transform .15s; position: relative; }
a.card { color: inherit; text-decoration: none; }
.sib-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sib-list a { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--sheet); }
.sib-list a:hover { border-color: var(--moss); }
.card:hover { border-color: var(--moss); transform: translateY(-2px); }
.card h3 { font-size: 19px; }
.card .sci { font-family: var(--display); font-style: italic; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.card .meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; border-radius: 6px; padding: 2px 7px; background: var(--moss-soft); color: var(--ink); white-space: nowrap; }
.tag.warn { background: color-mix(in srgb, var(--rust) 16%, transparent); color: var(--rust); }
.tag.ok { background: var(--moss-soft); color: var(--moss); }
.learned { position: absolute; top: 12px; right: 12px; font-size: 11px; color: var(--moss); font-weight: 700; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Tờ tiêu bản (chi tiết cây) */
.sheet-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent); z-index: 40; display: flex; justify-content: flex-end; }
.sheet-backdrop[hidden] { display: none; }
.specimen { width: min(760px, 100%); height: 100%; overflow-y: auto; background: var(--sheet); border-left: 1px solid var(--line); padding: calc(18px + env(safe-area-inset-top, 0px)) 22px calc(30px + env(safe-area-inset-bottom, 0px)); }
.spec-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.spec-top .nav { display: flex; gap: 6px; }

/* Thanh Đóng / ← → luôn dính trên cùng khi cuộn trong tờ mẫu (nhất là trên điện thoại) */
.specimen .spec-top { position: sticky; top: calc(-18px - env(safe-area-inset-top, 0px)); z-index: 6; background: var(--sheet); margin: calc(-18px - env(safe-area-inset-top, 0px)) -22px 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 22px 10px; border-bottom: 1px solid var(--line); }
.iconbtn { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.specimen h2 { font-size: clamp(28px, 5vw, 38px); margin-top: 16px; }
.specimen .sci-big { font-family: var(--display); font-style: italic; font-size: 19px; color: var(--moss); margin-top: 2px; overflow-wrap: anywhere; }
.specimen .aka { color: var(--muted); font-size: 14px; margin-top: 6px; }
.herb-label { margin-top: 18px; border: 1px solid var(--ink); border-radius: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 14px; }
.herb-label div { padding: 9px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.herb-label div:nth-child(odd) { border-right: 1px solid var(--line); }
.herb-label div:nth-last-child(-n+2) { border-bottom: 0; }
.herb-label .label { display: block; margin-bottom: 2px; }
.spec-sec { margin-top: 24px; }
.spec-sec h3 { font-size: 20px; margin-bottom: 8px; }
.spec-sec p { margin: 0; max-width: 70ch; }
.care-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.care-grid > div { background: var(--paper); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.care-grid .label { display: block; margin-bottom: 3px; }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.meter i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.meter i.on { background: var(--moss); }
.list-dl { display: grid; gap: 8px; margin: 0; }
.list-dl div { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.list-dl dt { font-weight: 600; }
.list-dl dd { margin: 0; color: var(--muted); }
.menh { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.menh span { border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.tip { margin-top: 24px; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.more-box { margin-top: 20px; border: 1px solid var(--line); background: var(--moss-soft); border-radius: 14px; padding: 12px 14px; scroll-margin-top: 12px; }
.more-box h3 { margin: 0; font-size: 16px; }
.more-box > p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.more-grid a > span:last-child { min-width: 0; overflow: hidden; }
.more-grid a { display: flex; gap: 8px; align-items: center; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-decoration: none; color: var(--ink); transition: border-color .15s; min-width: 0; }
.more-grid a:hover { border-color: var(--moss); }
.more-grid a.primary { background: var(--moss); border-color: var(--moss); color: var(--sheet); }
.more-grid a.primary small { color: var(--sheet); opacity: .85; }
.more-grid .ico { font-size: 17px; line-height: 1; flex-shrink: 0; }
.more-grid b { display: block; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-grid small { display: block; font-size: 11px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .more-grid { grid-template-columns: 1fr; } }
.quick-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; background: var(--moss); color: var(--sheet); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.quick-more:hover { filter: brightness(1.08); }
/* Ảnh minh hoạ nhỏ trong Chuyên đề */
.gfig { margin: 6px 0 12px; }
.gfig.flt { float: right; width: min(38%, 210px); margin: 4px 0 10px 14px; }
.gfig.row { display: flex; gap: 12px; align-items: center; max-width: 520px; }
.gfig.row img { width: 132px; flex: none; }
.gfig img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.gfig figcaption { font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 4px; }
.gfig.row figcaption { margin-top: 0; }
.gfig figcaption .cr { display: block; font-size: 10.5px; opacity: .85; }
.gfig figcaption .cr a { color: inherit; }
.gfig.svg { max-width: 360px; margin: 8px auto 14px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.gfig.svg svg { display: block; width: 100%; height: auto; font-family: var(--body); }
.chapter.guide, #chapters .chapter { display: flow-root; }
#chapters .chapter h4 { clear: both; }
.gfig.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 560px; }
.gfig.pair figcaption { grid-column: 1 / -1; }
.tech-gal { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; margin: 10px 0 14px; }
.tech-gal figure { margin: 0; }
.tech-gal img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.tech-gal figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.tech-gal figcaption .cr { display: block; font-size: 10.5px; }
.tech-gal figcaption .cr a { color: inherit; }
.chapter.guide h3 { clear: both; }
/* Phong thuỷ */
.pt-tool { border: 1px solid var(--gold); border-radius: 14px; padding: 14px 16px; margin: 14px 0 22px; background: color-mix(in srgb, var(--gold) 7%, var(--sheet)); }
.pt-tool h3 { margin-top: 0; }
.pt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.pt-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.pt-form input[type=number], .pt-form select { font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--sheet); color: var(--ink); }
.pt-form .pt-chk { display: flex; gap: 8px; align-items: center; font-weight: 400; grid-column: 1 / -1; }
.pt-form button { grid-column: 1 / -1; justify-self: start; }
.pt-res { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pt-head { display: flex; gap: 12px; align-items: center; font-size: 16px; line-height: 1.5; }
.pt-ico { font-size: 40px; line-height: 1; }
.pt-h { color: var(--gold); }
.pt-mute { color: var(--muted); font-size: 13px; }
.pt-dl { display: grid; gap: 6px; margin: 12px 0; }
.pt-dl div { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 10px; font-size: 14px; }
.pt-dl dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 3px; }
.pt-dl dd { margin: 0; }
.pt-res h4 { margin: 14px 0 8px; }
.pt-plants { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; max-width: 760px; }
.pt-plants a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); font-size: 12px; line-height: 1.3; text-align: center; }
.pt-plants img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pt-plants a:hover img { border-color: var(--moss); }
.pt-all { margin-top: 12px; border: 1px solid var(--moss); background: none; color: var(--moss); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (max-width: 640px) { .pt-dl div { grid-template-columns: 1fr; gap: 0; } .pt-tool { padding: 12px; } }
/* Nút lên đầu trang */
.to-top { position: fixed; right: 16px; bottom: 18px; z-index: 30; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--moss); color: var(--sheet); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.18); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
.end-top { display: block; margin: 18px 0 0 auto; border: 0; background: none; color: var(--moss); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pstrip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pstrip a { display: block; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; border: 2px solid var(--sheet); box-shadow: 0 0 0 1px var(--line); }
.pstrip a:hover { box-shadow: 0 0 0 2px var(--moss); }
.pstrip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ithumb { float: left; width: 44px; height: 44px; object-fit: cover; border-radius: 8px; margin: 0 10px 4px 0; border: 1px solid var(--line); }
@media (max-width: 640px) { .gfig.flt { width: 36%; margin-left: 10px; } .gfig.row img { width: 112px; } table.stack tr > *:first-child .pstrip { margin-top: 8px; } }
.hero-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.buy-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
.buy-btn:hover { border-color: var(--moss); color: var(--moss); }
.src-box { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 14px; font-size: 13px; color: var(--muted); }
.src-box h3 { font-size: 15px; margin: 0 0 6px; color: var(--ink); }
.src-box ul { margin: 0 0 8px; padding-left: 18px; }
.src-box li { margin: 2px 0; }
.src-box a { color: var(--moss); }
.src-box .disc { margin: 8px 0 10px; line-height: 1.5; }
.report-btn { border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.report-btn:hover { border-color: var(--rust); color: var(--rust); }
.folk { font-size: 12px; font-weight: 400; color: var(--muted); font-family: var(--mono); letter-spacing: .02em; }
.lead textarea { font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--paper); color: var(--ink); min-height: 110px; resize: vertical; }
.lead .ok-msg { color: var(--moss); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .more-grid a { transition: none; } .more-grid a:hover { transform: none; } }
.links a, .links button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px; font-size: 13px; text-decoration: none; color: var(--ink); }
.links button[aria-pressed="true"] { background: var(--moss); color: var(--sheet); border-color: var(--moss); }

/* Kiến thức */
.k-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
.k-nav { position: sticky; top: 16px; align-self: start; display: grid; gap: 2px; }
.k-nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.k-nav a:hover { background: var(--sheet); color: var(--ink); }
.chapter { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin-bottom: 18px; scroll-margin-top: 20px; }
.chapter h2 { font-size: 27px; }
.chapter .lead { color: var(--muted); font-size: 16px; margin: 8px 0 4px; max-width: 70ch; }
.chapter h4 { font-size: 18px; margin: 20px 0 6px; }
.chapter p, .chapter li { max-width: 72ch; }
.chapter ul, .chapter ol { padding-left: 20px; }
.ladder li { margin-bottom: 6px; }
.lux { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.lux div { background: var(--paper); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.lux span { font-family: var(--mono); font-size: 12px; color: var(--moss); }
.lux em { font-style: normal; font-size: 13px; color: var(--muted); }
.tablewrap { overflow-x: auto; }
table.mini { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 6px; }
table.mini th, table.mini td { text-align: left; border-bottom: 1px solid var(--line); padding: 7px 10px; vertical-align: top; }
table.mini th { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
/* Bảng trên điện thoại: mỗi dòng thành một thẻ có nhãn */
.chapter p.lead { background: none; box-shadow: none; padding: 0; border-radius: 0; width: auto; max-height: none; overflow: visible; display: block; }
@media (max-width: 640px) {
  .wrap { padding-inline: 12px; }
  .chapter { padding: 16px 14px; border-radius: 14px; }
  .chapter h2 { font-size: 23px; }
  .chapter .lead { font-size: 15px; }
  .chapter .tablewrap { overflow: visible; }
  table.stack, table.stack tbody, table.stack thead, table.stack tr { display: block; width: 100%; }
  table.stack tr.hdr, table.stack thead { display: none; }
  table.stack tr { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
  table.stack tr > * { display: grid; grid-template-columns: minmax(84px, 32%) 1fr; gap: 10px; border: 0; padding: 4px 0; font-size: 15px; line-height: 1.45; text-transform: none; letter-spacing: 0; font-family: inherit; color: var(--ink); font-weight: 400; }
  table.stack tr > *::before { content: attr(data-label); font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
  table.stack tr > *:first-child { display: block; font-weight: 700; font-size: 16px; padding: 0 0 6px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
  table.stack tr > *:first-child::before, table.stack tr > [data-label=""]::before { content: none; }
  table.stack tr > [data-label=""] { display: block; }
}
dl.methods dt { font-weight: 700; margin-top: 10px; }
dl.methods dd { margin: 2px 0 0; color: var(--muted); max-width: 72ch; }

/* Bắt bệnh */
.diag { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px; }
.sym-list { display: grid; gap: 6px; align-content: start; }
.sym-list button { text-align: left; border: 1px solid var(--line); background: var(--sheet); border-radius: 12px; padding: 10px 14px; }
.sym-list button[aria-pressed="true"] { border-color: var(--moss); background: var(--moss-soft); font-weight: 600; }
.cause { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.cause .if { font-size: 13px; color: var(--muted); }
.cause .why { font-family: var(--display); font-size: 19px; font-weight: 600; margin: 2px 0 6px; }
.cause .fix { border-left: 3px solid var(--moss); padding-left: 10px; }

/* Ôn tập */
.quiz { max-width: 720px; margin: 0 auto; }
.modes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.qcard { margin-top: 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.qcard .q { font-size: 17px; }
.qcard .q blockquote { margin: 10px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.45; }
.opts { display: grid; gap: 8px; margin-top: 18px; }
.opts button { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 11px 14px; }
.opts button.right { border-color: var(--moss); background: var(--moss-soft); font-weight: 700; }
.opts button.wrong { border-color: var(--rust); color: var(--rust); }
.score { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 14px; }
.reveal { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.primary { border: 0; background: var(--moss); color: var(--sheet); border-radius: 999px; padding: 10px 20px; font-weight: 600; }
.ghost { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 9px 18px; font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Thuật ngữ */
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.gloss div { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gloss b { font-family: var(--display); font-size: 17px; }
.gloss p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Ảnh */
.thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--moss-soft); display: block; }
.spec-hero { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 14px; }
.spec-hero img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; background: var(--moss-soft); }
.credit { font-size: 11px; color: var(--muted); margin-top: 4px; }
.credit a { color: var(--muted); }
/* Bệnh hại */
.dz-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px; }
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.dz { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.dz h3 { font-size: 21px; }
.dz .en { font-family: var(--display); font-style: italic; color: var(--muted); }
.dz .type { float: right; }
.dz dl { margin: 10px 0 0; display: grid; gap: 8px; }
.dz dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dz dd { margin: 0; font-size: 14px; }
.dz dd.treat { border-left: 3px solid var(--moss); padding-left: 10px; }
.dz dd.chem { border-left: 3px solid var(--rust); padding-left: 10px; }
.dzgal { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 8px; }
.dzgal a { display: block; }
.dzgal a:first-child { grid-column: 1 / -1; }
.dzgal img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.dzgal.one a:first-child, .dzgal.two a { grid-column: auto; }
.dzgal.one { grid-template-columns: 1fr; }
.symgal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; max-width: 620px; }
.symgal img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.dz .dzimg { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin: 0 0 10px; background: var(--paper); }
.dz .dzcr { font-size: 10.5px; color: var(--muted); margin: -6px 0 8px; }
.dz .dzcr a { color: inherit; }
.dz dd.conf { border-left: 3px solid var(--gold); padding-left: 10px; }
.list-dl .has-vimg { display: grid; grid-template-columns: 64px 1fr; column-gap: 12px; align-items: start; }
.list-dl .has-vimg .vimg { grid-row: span 2; }
.list-dl .has-vimg img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
/* Ô tìm kiếm trong từng tab */
.tab-search { position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 10px 0 12px; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tab-search input { flex: 1 1 260px; font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; background: var(--sheet); color: var(--ink); }
.tab-search input:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
.tab-search .ts-note { font-size: 13px; color: var(--muted); }
mark.hl { background: color-mix(in srgb, var(--gold) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.ts-hidden { display: none !important; }
/* Bệnh theo cây */
.pp-box { margin: 4px 0 22px; }
.pp-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.pp-cats button { border: 1px solid var(--line); background: var(--sheet); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.pp-cats button[aria-pressed="true"] { background: var(--moss); color: var(--sheet); border-color: var(--moss); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 10px; }
@media (max-width: 640px) { .pp-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } }
.pp-chips button { flex: none; display: grid; justify-items: center; gap: 4px; width: 84px; border: 1px solid var(--line); background: var(--sheet); border-radius: 14px; padding: 8px 4px; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.25; color: var(--ink); }
.pp-chips button img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; }
.pp-chips button[aria-pressed="true"] { border-color: var(--moss); background: var(--moss-soft); font-weight: 700; }
.pp-out { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.pp-out h3 { margin: 0 0 10px; font-size: 21px; }
.pp-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 12px 0; border-top: 1px dashed var(--line); }
.pp-side { display: grid; gap: 6px; align-content: start; }
.pp-img { display: block; width: 150px; text-decoration: none; }
.pp-img img, .pp-img svg { display: block; width: 150px; height: 112px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.pp-img small { display: block; font-size: 10px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.pp-row:first-of-type { border-top: 0; }
.pp-tag { align-self: start; justify-self: start; font-family: var(--mono); font-size: 11px; letter-spacing: .03em; border-radius: 999px; padding: 3px 9px; background: var(--moss-soft); color: var(--ink); white-space: nowrap; }
.pp-tag.wet { background: color-mix(in srgb, #3E6E9E 22%, transparent); }
.pp-tag.dry { background: color-mix(in srgb, var(--gold) 26%, transparent); }
.pp-tag.bug, .pp-tag.dis { background: color-mix(in srgb, var(--rust) 18%, transparent); }
.pp-tag.ok { background: color-mix(in srgb, var(--moss) 14%, transparent); }
.pp-sign { font-weight: 700; }
.pp-why { color: var(--muted); font-size: 14px; margin-top: 2px; }
.pp-fix { font-size: 14px; margin-top: 4px; border-left: 3px solid var(--moss); padding-left: 8px; }
.pp-fix a { color: var(--moss); font-weight: 600; white-space: nowrap; }
.dz .often { font-size: 12.5px; color: var(--moss); margin: 4px 0 0; }
@media (max-width: 640px) { .pp-row { grid-template-columns: 112px 1fr; gap: 10px; } .pp-img, .pp-img img, .pp-img svg { width: 112px; } .pp-img img, .pp-img svg { height: 84px; } }
/* Đất & chậu dạng thẻ */
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.sm-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.sm-card .sm-img { display: block; aspect-ratio: 4 / 3; background: var(--sheet); }
.sm-card .sm-img img, .sm-card .sm-img svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.sm-body { padding: 10px 12px 12px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; }
.sm-body h3 { margin: 0; font-size: 16px; }
.sm-cr { font-size: 10px; color: var(--muted); padding: 2px 12px 0; }
.sm-cr a { color: inherit; }
.sm-rate { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 11.5px; color: var(--muted); align-items: center; }
.sm-bar { display: flex; gap: 3px; }
.sm-bar i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.sm-bar i.on { background: var(--moss); }
.sm-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.shop-links:empty { display: none; }
.shop-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.shop-links a { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--moss); border: 1px solid var(--moss); border-radius: 999px; padding: 3px 10px; background: var(--sheet); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-links a:hover { background: var(--moss); color: var(--sheet); }
.mix { display: grid; gap: 12px; margin-top: 10px; }
.mix-row b { display: block; font-size: 14px; margin-bottom: 4px; }
.mix-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.mix-bar span { display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; }
.mix-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.mix-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.soil-dia { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-top: 10px; }
.soil-dia figure { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.soil-dia svg { display: block; width: 100%; height: auto; font-family: var(--body); }
.soil-dia figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.dz-count { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.disclaim { font-size: 13px; color: var(--muted); background: var(--sheet); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
/* Kỹ thuật */
.tech { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; scroll-margin-top: 20px; }
.tech h2 { font-size: 26px; }
.tech .when { color: var(--muted); margin: 6px 0 0; max-width: 72ch; }
.tech-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 22px; margin-top: 14px; }
.tech ol.steps { counter-reset: st; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tech ol.steps li { counter-increment: st; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; max-width: 72ch; }
.tech ol.steps li::before { content: counter(st); font-family: var(--mono); font-size: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--moss); color: var(--sheet); display: grid; place-items: center; }
.tech aside { background: var(--paper); border-radius: 12px; padding: 12px 14px; font-size: 14px; align-self: start; }
.tech aside ul { padding-left: 18px; margin: 4px 0 10px; }
.tech .bad { margin-top: 14px; font-size: 14px; color: var(--rust); }
.tech .bad ul { margin: 4px 0 0; padding-left: 18px; }
.qimg { width: min(320px, 100%); aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; display: block; margin: 12px auto 0; background: var(--moss-soft); }

@media (max-width: 760px) {
  .spec-hero, .tech-cols { grid-template-columns: minmax(0, 1fr); }
  .spec-hero img { width: min(260px, 100%); }
  .k-layout, .diag { grid-template-columns: minmax(0, 1fr); }
  .k-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .k-nav a { flex-shrink: 0; background: var(--sheet); }
  .care-grid, .herb-label { grid-template-columns: minmax(0, 1fr); }
  .herb-label div:nth-child(odd) { border-right: 0; }
  .herb-label div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .list-dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .chapter { padding: 18px; }
  .filters { position: static; }
}
.size-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.size-box > div { background: var(--paper); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.size-box .label { display: block; margin-bottom: 3px; }
.size-box .wide { grid-column: 1 / -1; }
.cls { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; margin: 3px 4px 0 0; font-size: 13px; }
.cls small { display: block; color: var(--muted); font-size: 11.5px; }
.wiz { display: grid; gap: 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 18px; }
.wiz .q { display: grid; gap: 6px; }
.wiz .q > b { font-size: 14px; }
.guide h3 { margin-top: 22px; }
img.thumb, .spec-hero img { background: var(--moss-soft); }
@media (max-width: 640px) { .size-box { grid-template-columns: 1fr; } }
.cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cats::-webkit-scrollbar { display: none; }
.cats .chip { flex-shrink: 0; font-weight: 600; color: var(--ink); }
.cats .chip small { font-weight: 500; color: var(--muted); margin-left: 4px; font-family: var(--mono); font-size: 11px; }
.cats .chip[aria-pressed="true"] small { color: var(--sheet); opacity: .8; }
/* Điện thoại: menu mục và bộ lọc xếp lưới/xuống dòng để thấy hết, không phải vuốt ngang mới biết còn mục khác */
@media (max-width: 640px) {
  nav.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow: visible; padding: 10px 0 6px; }
  nav.tabs button { padding: 11px 6px; font-size: 14px; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); line-height: 1.2; min-height: 46px; }
  nav.tabs button[aria-selected="true"] { background: var(--moss); color: var(--sheet); border-color: var(--moss); }
  .cats { flex-wrap: wrap; overflow: visible; gap: 8px; }
  .cats .chip { flex-shrink: 1; padding: 8px 14px; font-size: 14px; }
}

.btn-filter { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; white-space: nowrap; }
.btn-filter[aria-expanded="true"] { border-color: var(--moss); color: var(--moss); }
.btn-filter b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--moss); color: var(--sheet); font-size: 12px; margin-left: 4px; padding: 0 6px; }
.adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 20px; border-top: 1px dashed var(--line); padding-top: 12px; }
.adv[hidden] { display: none; }
.fgroup { display: grid; gap: 6px; align-content: start; min-width: 0; }
.fgroup > .label { display: block; }
.fgroup select { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 8px 12px; font: inherit; max-width: 100%; }
.adv-foot { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.listbar .result-note { margin: 0; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 26px 0 6px; }
.pager button { min-width: 40px; height: 40px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 10px; font: inherit; font-weight: 600; padding: 0 10px; }
.pager button[aria-current="page"] { background: var(--moss); border-color: var(--moss); color: var(--sheet); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.pager-mini { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pager-mini button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 8px; font: inherit; }
.pager-mini button:disabled { opacity: .4; }
.fam-cont h2 { font-size: 20px; }
@media (max-width: 760px) { .listbar { flex-direction: column; align-items: flex-start; } }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 8px 8px 10px; border-radius: 12px; }
  .card h3 { font-size: 15px; }
  .card .sci { font-size: 12.5px; }
  .card .meta .tag:nth-child(n+3) { display: none; }
}
.unlock-bar { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 14px; border-radius: 18px; padding: 16px 20px; color: #fff;
  background: linear-gradient(110deg, #24543A, #3B7A4E 45%, #2E6142 70%, #24543A); background-size: 220% 100%; animation: ub-bg 9s ease-in-out infinite; box-shadow: 0 10px 28px rgba(36, 84, 58, .28); }
.unlock-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent); transform: skewX(-20deg); animation: ub-shine 4.5s ease-in-out infinite; pointer-events: none; }
.unlock-bar .ub-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 420px; }
.unlock-bar .ub-ico { font-size: 30px; line-height: 1; flex-shrink: 0; animation: ub-wiggle 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.unlock-bar p { margin: 0; font-size: 14.5px; max-width: 70ch; color: rgba(255, 255, 255, .92); }
.unlock-bar p b { color: #fff; }
.unlock-bar .ub-free { display: inline-block; background: #F5C443; color: #2A2410; font-weight: 800; font-size: 11px; letter-spacing: .06em; border-radius: 6px; padding: 2px 7px; margin-right: 6px; vertical-align: 2px; }
.unlock-bar .btn-unlock { position: relative; z-index: 1; background: #F5C443; color: #2A2410; font-size: 16px; padding: 12px 22px; animation: ub-pulse 2.2s ease-out infinite; }
.unlock-bar .btn-unlock:hover { background: #FFD45E; }
.unlock-bar.done { background: var(--moss-soft); color: var(--ink); box-shadow: none; animation: none; border: 1px dashed color-mix(in srgb, var(--moss) 40%, transparent); }
.unlock-bar.done::after { display: none; }
.unlock-bar.done p { color: var(--ink); }
@keyframes ub-bg { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ub-shine { 0% { left: -40%; } 55%, 100% { left: 130%; } }
@keyframes ub-wiggle { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(-14deg); } 78% { transform: rotate(12deg); } 82% { transform: rotate(-8deg); } 86% { transform: rotate(5deg); } }
@keyframes ub-pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 196, 67, .65); } 70% { box-shadow: 0 0 0 14px rgba(245, 196, 67, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 196, 67, 0); } }
@media (prefers-reduced-motion: reduce) { .unlock-bar, .unlock-bar::after, .unlock-bar .ub-ico, .unlock-bar .btn-unlock { animation: none; } .unlock-bar::after { display: none; } }
@media (max-width: 640px) { .unlock-bar { padding: 14px; } .unlock-bar .btn-unlock { width: 100%; } }
.btn-unlock { border: 0; background: var(--moss); color: var(--sheet); border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.btn-unlock:hover { filter: brightness(1.08); }
.lock-card .btn-unlock, .lead .btn-unlock { background: #F5C443; color: #2A2410; font-size: 16px; animation: ub-pulse 2.2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .lock-card .btn-unlock, .lead .btn-unlock { animation: none; } }
.free-tag, .lock-tag { position: absolute; top: 20px; left: 20px; z-index: 1; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 8px; }
.free-tag { background: var(--moss); color: var(--sheet); }
.lock-tag { background: color-mix(in srgb, var(--sheet) 88%, transparent); color: var(--ink); }
.lock-wrap { position: relative; margin-top: 22px; }
.lock-fake { filter: blur(5px); opacity: .55; pointer-events: none; user-select: none; display: grid; gap: 10px; }
.lock-fake h3 { margin: 6px 0 0; }
.lock-fake .bar { height: 54px; border-radius: 12px; background: var(--paper); }
.lock-card { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; padding: 18px; }
.lock-card > div { background: var(--sheet); border: 2px solid var(--moss); border-radius: 16px; padding: 18px 20px; max-width: 460px; box-shadow: 0 10px 30px rgba(0,0,0,.12); display: grid; gap: 8px; justify-items: center; }
.lock-card h3 { margin: 0; font-size: 20px; }
.lock-card p { margin: 0; font-size: 14px; color: var(--muted); }
.lock-card small { color: var(--muted); }
.lock-inline { margin-top: 14px; }
.lock-inline .lock-card { position: static; }
.lead-bd { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--ink) 55%, transparent); display: grid; place-items: center; padding: 16px; }
.lead-bd[hidden] { display: none; }
.lead { width: min(440px, 100%); max-height: 100%; overflow-y: auto; background: var(--sheet); border-radius: 18px; padding: 20px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); position: relative; }
.lead h2 { margin: 0; font-size: 24px; }
.lead p { margin: 0; font-size: 14px; color: var(--muted); }
.lead label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.lead input[type="text"], .lead input[type="email"], .lead select { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 400; }
.lead .consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.lead .consent input { margin-top: 3px; }
.lead .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead .err { color: var(--rust); font-size: 13px; min-height: 1em; }
.lead .x { position: absolute; top: 10px; right: 10px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.lead .perks { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 2px; }
.gal { margin-top: 16px; }
.gal-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.gal-row button { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--moss-soft); aspect-ratio: 4 / 3; cursor: zoom-in; }
.gal-row img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gal-row button:hover img { transform: scale(1.05); }
.gal-row button span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 6px; padding: 2px 6px; }
.gal .credit { margin-top: 6px; }
.lb { position: fixed; inset: 0; z-index: 70; background: rgba(8, 14, 10, .92); display: grid; grid-template-rows: 1fr auto; padding: 16px; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; display: grid; place-items: center; min-height: 0; }
.lb img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 8px; }
.lb figcaption { color: rgba(255, 255, 255, .8); font-size: 13px; text-align: center; padding: 10px 40px 0; }
.lb figcaption a { color: #fff; }
.lb .lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 26px; cursor: pointer; }
.lb[data-single] .lb-btn { display: none; }
a[target="_blank"] > img, .sm-img img { cursor: zoom-in; }
.lb .lb-prev { left: 12px; } .lb .lb-next { right: 12px; }
.lb .lb-x { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 20px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .gal-row img { transition: none; } }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* ===== Giao diện ấm, gần gũi (Muse đợt 2) ===== */
.card { border-radius: 18px; padding: 10px 10px 14px; border-color: transparent; box-shadow: 0 1px 2px rgba(70, 55, 30, .06), 0 8px 20px -12px rgba(70, 55, 30, .22); gap: 4px; }
.card:hover { border-color: var(--moss); box-shadow: 0 2px 4px rgba(70, 55, 30, .08), 0 14px 28px -12px rgba(70, 55, 30, .3); transform: translateY(-3px); }
.card .thumb { aspect-ratio: 4 / 3; border-radius: 12px; }
.card h3 { font-size: 18px; margin-top: 6px; }
.filters { border-radius: 20px; padding: 16px; box-shadow: 0 1px 2px rgba(70, 55, 30, .05), 0 10px 24px -16px rgba(70, 55, 30, .25); }
.chip { transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--moss); color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick .label { margin-right: 2px; }
.quick button { border: 1px solid color-mix(in srgb, var(--moss) 35%, var(--line)); background: color-mix(in srgb, var(--moss) 8%, var(--sheet)); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; transition: transform .12s, background .15s; }
.quick button:hover { transform: translateY(-1px); background: var(--moss-soft); }
.quick button[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: var(--sheet); }
.colors { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.colors .cg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.colors .cg > .label { margin-right: 4px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); vertical-align: -2px; margin-right: 6px; flex: 0 0 auto; }
.colors .chip { display: inline-flex; align-items: center; padding: 4px 11px 4px 8px; }
.dots { display: flex; gap: 4px; margin-top: 2px; align-items: center; min-height: 14px; }
.dots i.sw { margin: 0; width: 12px; height: 12px; }
.dots small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.nf-note { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }
@media (max-width: 560px) { .card .thumb { aspect-ratio: 1 / 1; } .quick button { padding: 6px 11px; font-size: 13px; } }
/* Điện thoại: thu gọn bộ lọc (chip nhỏ hơn, khoảng cách sát hơn, hàng cuộn ngang cho gợi ý nhanh và màu) */
@media (max-width: 640px) {
  .filters { padding: 12px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; margin-right: -12px; padding-right: 12px; }
  .quick::-webkit-scrollbar { display: none; }
  .quick .label, .quick button { flex: 0 0 auto; white-space: nowrap; }
  .quick button { padding: 5px 10px; font-size: 12.5px; }
  .cats { gap: 5px; }
  .cats .chip { padding: 5px 10px; font-size: 12.5px; }
  .cats .chip small { margin-left: 3px; font-size: 10px; }
  .colors { gap: 6px; }
  .colors .cg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 5px; width: 100%; }
  .colors .cg::-webkit-scrollbar { display: none; }
  .colors .cg > .label { flex: 0 0 auto; }
  .colors .chip { flex: 0 0 auto; white-space: nowrap; padding: 3px 9px 3px 7px; font-size: 12.5px; }
  .sw { width: 12px; height: 12px; margin-right: 5px; }
  .nf-note { font-size: 11.5px; margin-top: 4px; }
}

@media (min-width: 641px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Điện thoại: sửa tràn ngang, "Cây tra nhiều" lướt ngang, lưới cây 3 cột */
@media (max-width: 640px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filters > * { min-width: 0; max-width: 100%; }
  .searchrow input { flex: 1 1 100%; }
  .searchrow select { flex: 1 1 0; min-width: 0; }
  .hot .hot-grid { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; scroll-snap-type: x proximity; margin-right: -4px; }
  .hot .hot-grid::-webkit-scrollbar { display: none; }
  .hot a { flex: 0 0 112px; scroll-snap-align: start; border-radius: 12px; }
  .hot a span { left: 8px; right: 8px; bottom: 7px; }
  .hot a b { font-size: .8rem; }
  .hot a small { display: none; }
  .hot p.sub { font-size: .82rem; margin-bottom: 10px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .card { padding: 5px 5px 7px; border-radius: 10px; }
  .card h3 { font-size: 12.5px; margin-top: 4px; line-height: 1.2; }
  .card .sci, .card .meta { display: none; }
  .card .thumb { border-radius: 8px; }
  .card .pet .pm i { width: 14px; height: 6px; }
  .card .pet-0 .pm i:nth-child(1), .card .pet-1 .pm i:nth-child(2), .card .pet-2 .pm i:nth-child(3) { height: 7px; }
  .card .dots small { display: none; }
  .free-tag, .lock-tag { top: 9px; left: 9px; font-size: 10px; padding: 2px 6px; }
  .learned { top: 8px; right: 8px; font-size: 10px; }
}
/* Thước đo độc với thú cưng: xanh = an toàn · cam nhạt = ít độc · đỏ = độc nhiều */
.pet { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 12px; font-weight: 600; }
.pet .pm { display: inline-flex; gap: 3px; }
.pet .pm i { width: 26px; height: 8px; border-radius: 4px; opacity: .2; }
.pet .pm i:nth-child(1) { background: #3FA35B; }
.pet .pm i:nth-child(2) { background: #F2B05E; }
.pet .pm i:nth-child(3) { background: #D6403A; }
.pet-0 .pm i:nth-child(1), .pet-1 .pm i:nth-child(2), .pet-2 .pm i:nth-child(3) { opacity: 1; height: 10px; box-shadow: 0 0 0 1.5px color-mix(in srgb, currentColor 35%, transparent); }
.pet-0 { color: #2F8049; } .pet-1 { color: #B9731A; } .pet-2 { color: #C0352F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pet-0 { color: #7BD08F; } :root:not([data-theme="light"]) .pet-1 { color: #F2B05E; } :root:not([data-theme="light"]) .pet-2 { color: #F08A84; } }
