/* Giao diện công khai Cẩm nang cây trồng — bảng màu và bố cục theo theme/ (AgriHandbook), giữ font hệ thống cho thân bài và Noto Serif cho tiêu đề.
   Điện thoại trước; một file CSS, không framework. Biểu tượng: /img/icons.svg. Xem docs/design.md. */
:root {
  --primary: #15803d;
  --primary-strong: #00652c;
  --leaf: #16a34a;
  --leaf-soft: #f0fdf4;
  --gold: #a16207;
  --gold-strong: #854d0e;
  --gold-soft: #fef9c3;
  --gold-line: #fde047;
  --canvas: #fbfcf8;
  --canvas-subtle: #f4f6f0;
  --surface: #ffffff;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-green: #e6ecdf;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --info: #0369a1;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 3px 0 rgba(15, 23, 42, .04), 0 1px 2px -1px rgba(15, 23, 42, .03);
  --shadow-2: 0 10px 15px -3px rgba(21, 128, 61, .10), 0 4px 6px -4px rgba(15, 23, 42, .05);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Noto Serif", "Times New Roman", serif;
  /* tên cũ giữ cho các trang chưa đổi */
  --brand-500: var(--leaf); --brand-700: var(--primary); --brand-900: var(--primary-strong);
  --ink-muted: var(--muted); --surface-alt: var(--canvas-subtle); --accent-500: #f8752b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.65 var(--font-body); color: var(--body); background: var(--canvas); }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: var(--primary-strong); }
:focus-visible { outline: 3px solid var(--gold-line); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(21, 128, 61, .35); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 60; background: var(--surface); padding: 8px 12px; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 24px; min-height: 60vh; }
main.full { max-width: none; padding: 0; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--ink); line-height: 1.3; margin: 1.2em 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; margin-top: .4em; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

/* ---------- Nút, chip, huy hiệu ---------- */
.btn, .search button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; font: 600 .95rem/1.2 var(--font-body); color: #fff; background: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius); cursor: pointer; text-decoration: none; transition: transform .15s, background .15s; }
.btn:hover, .search button:hover { background: var(--leaf); border-color: var(--leaf); color: #fff; transform: translateY(-1px); }
.btn-warm { color: var(--gold-strong); background: var(--gold-soft); border-color: var(--gold-line); }
.btn-warm:hover { color: var(--gold-strong); background: #fef08a; border-color: #facc15; }
.btn-outline { color: var(--primary); background: transparent; border: 1.5px solid var(--primary); }
.btn-outline:hover { color: var(--primary); background: var(--leaf-soft); border-color: var(--primary); }
.btn-block { display: flex; justify-content: center; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0; }
.chips a, .chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px; font-size: .88rem; font-weight: 500; text-decoration: none; color: var(--body); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.chips a:hover { border-color: var(--primary); color: var(--primary); }
.chip { font-size: .75rem; font-weight: 600; padding: 3px 10px; }
.chip-veg { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.chip-fruit { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.chip-grain { background: #fefce8; color: #a16207; border-color: #fef08a; }
.chip-pest { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge { display: inline-block; padding: 2px 10px; font-size: .78rem; font-weight: 600; color: var(--primary-strong); background: var(--leaf-soft); border: 1px solid var(--line-green); border-radius: 999px; }
.eyebrow { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin: 0 0 4px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); box-shadow: 0 1px 8px rgba(15, 23, 42, .05); }
.header-main { display: flex; align-items: center; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); }
.brand img { display: block; height: 36px; width: auto; }
.brand-text { display: none; flex-direction: column; line-height: 1.2; }
.brand-text span { font-size: .72rem; color: var(--muted); }
.search { position: relative; display: flex; flex: 1 1 240px; max-width: 460px; margin-left: auto; }
.search input { width: 100%; min-width: 0; padding: 10px 70px 10px 40px; font: inherit; font-size: .92rem; color: var(--ink); background: #f8fafc; border: 1px solid var(--line); border-radius: 999px; }
.search input::placeholder { color: #6b7686; }
.search input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); outline: none; }
.search .i-lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search button { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 14px; border-radius: 999px; font-size: .85rem; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-actions .btn { padding: 8px 14px; font-size: .88rem; display: none; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; text-decoration: none; }
.avatar:hover { background: var(--leaf); color: #fff; }
.site-nav { background: var(--surface); border-top: 1px solid var(--line); }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-item { position: relative; flex: none; }
.nav-item > a { display: block; padding: 11px 12px; color: var(--body); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav-item > a:hover, .nav-item:focus-within > a, .nav-item > a[aria-current] { color: var(--primary); border-bottom-color: var(--primary); }
.nav-sub { display: none; position: absolute; left: 0; top: 100%; min-width: 250px; margin: 0; padding: 6px 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-2); z-index: 5; }
.nav-item:hover > .nav-sub, .nav-item:focus-within > .nav-sub { display: block; }
.nav-sub a { display: block; padding: 8px 14px; color: var(--body); text-decoration: none; font-size: .92rem; }
.nav-sub a:hover { background: var(--leaf-soft); color: var(--primary); }

/* ---------- Breadcrumb, meta ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 4px; padding: 0; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--muted); font-size: .88rem; margin: 0 0 .8em; }
.meta .i { margin-right: 3px; }
.lead { font-size: 1.08rem; color: var(--ink); background: var(--leaf-soft); border-left: 4px solid var(--primary); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- Thẻ nội dung ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; list-style: none; padding: 0; margin: 12px 0 24px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card > a { color: var(--ink); text-decoration: none; display: block; }
.card img, .card-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--canvas-subtle); }
.card-ph { display: grid; place-items: center; font: 700 2.4rem var(--font-heading); color: var(--leaf); }
.card-title { display: block; padding: 10px 14px 4px; font-weight: 600; line-height: 1.35; }
.card-sum { margin: 0 14px 14px; font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-media { position: relative; display: block; }
.card-media .chip { position: absolute; left: 10px; bottom: 10px; box-shadow: var(--shadow-1); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--primary); }
.card-body p { margin: 0; font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }
.card-foot a { font-weight: 600; text-decoration: none; }
.card-list { grid-template-columns: 1fr; }
.card-list .card { flex-direction: row; }
.card-list .card-media { flex: 0 0 38%; }
.card-list .card-media img { height: 100%; aspect-ratio: auto; }

/* ---------- Tiêu đề khối, lưới trang ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: 1.5rem; }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; font-size: .92rem; }
.section-head .more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.band { background: var(--surface); }
.band-subtle { background: var(--canvas-subtle); }
.with-aside { display: grid; gap: 24px 24px; grid-template-columns: minmax(0, 1fr); }
.side-col { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.box { background: var(--surface); border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 24px; }
.box h2, .box h3 { margin: 0 0 10px; font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.box ul { list-style: none; margin: 0; padding: 0; }
.box-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.box-list li:last-child { border-bottom: 0; }
.box-list a { color: var(--body); text-decoration: none; }
.box-list a:hover { color: var(--primary); }
.box-list .count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.box-rank li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.box-rank li:last-child { border-bottom: 0; }
.rank { font: 700 1.3rem var(--font-heading); color: #cbd5e1; min-width: 1.6em; }
.rank-title { font-weight: 600; font-size: .92rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
.rank-title:hover { color: var(--primary); }
.box-green { background: var(--primary); border-color: var(--primary); color: #e7ffe9; }
.box-green h2, .box-green h3 { color: #fff; }
.box-green a:not(.btn) { color: #fff; }
.box-green .btn { background: var(--gold-soft); color: var(--gold-strong); border-color: var(--gold-line); }
.box-warm { background: var(--gold-soft); border-color: var(--gold-line); }
.box-ask { text-align: left; }
.notice { padding: 12px 16px; border-left: 4px solid var(--primary); background: var(--leaf-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.notice.error { border-left-color: var(--danger); background: var(--danger-soft); }

/* ---------- Hero, thanh khuyến cáo, thời tiết (trang chủ) ---------- */
.ticker { background: #eff4ff; font-size: .85rem; }
.ticker .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 8px; padding-bottom: 8px; }
.ticker-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; background: var(--leaf); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ticker-tag.warn { background: #b45309; }
.ticker-tag.danger { background: var(--danger); }
.hero { background: linear-gradient(180deg, var(--canvas), #f8f9ff 55%, var(--canvas-subtle)); padding: 40px 0; }
.hero-grid { display: grid; gap: 24px; }
.hero h1 { font-size: 1.9rem; line-height: 1.25; margin: 10px 0 12px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-strong); font-size: .82rem; font-weight: 600; }
.hero p.lead-text { font-size: 1.05rem; max-width: 56ch; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-1); margin: 18px 0; }
.stats strong { display: block; font: 700 1.5rem var(--font-heading); color: var(--primary); }
.stats span { font-size: .78rem; color: var(--muted); }
.hero-search { position: relative; display: flex; max-width: 640px; }
.hero-search input { width: 100%; padding: 13px 130px 13px 46px; font: inherit; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow-1); }
.hero-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); outline: none; }
.hero-search .i-lead { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--leaf); width: 1.3em; height: 1.3em; }
.hero-search .btn { position: absolute; right: 5px; top: 5px; bottom: 5px; border-radius: 999px; padding: 0 16px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.weather { align-self: start; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-2); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.weather-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.weather-head > div { flex: 1 1 160px; min-width: 0; }
.weather-head form { flex: 1 1 180px; }
.weather-head select { width: 100%; }
.weather-head h2 { margin: 0; font: 600 .98rem var(--font-body); color: var(--ink); }
.weather-head small { color: var(--muted); font-size: .76rem; }
.weather select { max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .8rem; background: #fff; color: var(--ink); }
.weather-now { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px; background: #f8f9ff; border-radius: 12px; }
.weather-temp { font: 700 2.1rem/1 var(--font-heading); color: var(--ink); }
.weather-temp small { display: block; font: 400 .74rem var(--font-body); color: var(--muted); margin-top: 4px; }
.weather dl { margin: 0; display: grid; gap: 4px; font-size: .86rem; }
.weather dl div { display: flex; justify-content: space-between; color: var(--muted); }
.weather dd { margin: 0; font-weight: 600; color: var(--ink); }
.risk { padding: 12px 14px; background: var(--canvas-subtle); border-radius: 12px; font-size: .88rem; }
.risk strong { color: var(--ink); }
.risk .lv-watch { color: var(--gold-strong); }
.risk .lv-warn { color: #b45309; }
.risk .lv-danger { color: var(--danger); }
.advice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--gold-soft); border-left: 4px solid var(--gold-strong); border-radius: 0 12px 12px 0; font-size: .88rem; color: var(--ink); }
.advice.danger { background: var(--danger-soft); border-left-color: var(--danger); }
.advice .i { margin-top: 3px; color: var(--gold-strong); }
.advice.danger .i { color: var(--danger); }
.disclaimer { font-size: .76rem; color: var(--muted); margin: 0; }

/* ---------- Tác vụ nhanh ---------- */
.actions { display: grid; gap: 24px; grid-template-columns: 1fr; }
.action { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 12px; background: var(--canvas-subtle); text-decoration: none; color: var(--body); box-shadow: var(--shadow-1); transition: box-shadow .2s, background .2s; }
.action:hover { background: #fff; box-shadow: var(--shadow-2); color: var(--body); }
.action .ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 12px; font-size: 1.6rem; }
.action .ico.pest { background: var(--danger-soft); color: var(--danger); }
.action .ico.gold { background: var(--gold-soft); color: var(--gold-strong); }
.action .ico.green { background: #e6eeff; color: var(--primary); }
.action .ico.solid { background: var(--primary); color: #fff; }
.action h3 { margin: 0; font-size: 1.1rem; color: var(--ink); }
.action p { margin: 0; font-size: .9rem; color: var(--muted); }
.action .go { margin-top: auto; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.action-solid { background: var(--primary); color: #e7ffe9; }
.action-solid h3, .action-solid .go { color: #fff; }
.action-solid p { color: #d3ffd5; }
.action-solid:hover { background: var(--primary-strong); color: #e7ffe9; }

/* ---------- Giải pháp mới nhất ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--body); background: #fff; border: 1px solid var(--line); }
.tabs a[aria-current] { background: var(--primary); border-color: var(--primary); color: #fff; }
.feature { display: grid; gap: 24px; }
.feature-main { background: #fff; border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.feature-main .media { position: relative; display: block; }
.feature-main img, .feature-main .ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--canvas-subtle); }
.feature-main .body-pad { padding: 24px; }
.feature-main h3 { font-size: 1.4rem; margin: 6px 0 8px; }
.feature-main h3 a { color: var(--ink); text-decoration: none; }
.feature-main h3 a:hover { color: var(--primary); }
.feature-side { display: flex; flex-direction: column; gap: 14px; }
.row-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 10px; background: #fff; border: 1px solid var(--line-green); border-radius: 12px; box-shadow: var(--shadow-1); }
.row-card img, .row-card .ph { width: 112px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--canvas-subtle); display: block; }
.row-card h3 { margin: 2px 0 4px; font-size: .98rem; line-height: 1.35; }
.row-card h3 a { color: var(--ink); text-decoration: none; }
.row-card h3 a:hover { color: var(--primary); }

/* ---------- Hỏi - đáp chuyên gia ---------- */
.qa-grid { display: grid; gap: 24px; }
.qa-item { background: #fff; border: 1px solid var(--line-green); border-radius: 12px; box-shadow: var(--shadow-1); padding: 16px 18px; margin-bottom: 14px; }
.qa-q { font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.qa-a { margin: 0; padding: 10px 12px; background: var(--leaf-soft); border-radius: 8px; font-size: .92rem; white-space: pre-line; }
.qa-a-meta { font-size: .78rem; color: var(--muted); margin: 6px 0 0; }

/* ---------- Danh mục ---------- */
.cat-hero { padding: 16px 0 16px; }
.cat-hero h1 { font-size: 2rem; font-weight: 800; margin: 6px 0 8px; }
.cat-hero p { max-width: 70ch; color: var(--body); }
.filter { background: #fff; border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: 24px; margin: 16px 0 32px; }
.filter form { display: grid; gap: 12px; }
.filter-row { display: grid; gap: 12px; }
.filter label { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.filter select, .filter input[type="search"] { width: 100%; padding: 9px 12px; font: inherit; font-size: .92rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); }
.filter .search-row { position: relative; }
.filter .search-row .i-lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--leaf); }
.filter .search-row input { padding-left: 38px; padding-right: 96px; border-radius: 999px; }
.filter .search-row .btn { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 16px; border-radius: 999px; }
.featured-cat { display: grid; background: #fff; border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; margin-bottom: 28px; }
.featured-cat img, .featured-cat .ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--canvas-subtle); display: block; }
.featured-cat .pad { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.featured-cat h2 { margin: 0; font-size: 1.5rem; }
.featured-cat h2 a { color: var(--ink); text-decoration: none; }
.featured-cat h2 a:hover { color: var(--primary); }
.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.list-head h2 { margin: 0; font-size: 1.3rem; border-left: 5px solid var(--primary); padding-left: 10px; }
.list-head .total { font-size: .8rem; background: var(--leaf-soft); color: var(--primary-strong); padding: 2px 10px; border-radius: 999px; }
.list-head .view { margin-left: auto; display: inline-flex; gap: 4px; }
.list-head .view a { padding: 6px 8px; border-radius: 6px; color: var(--muted); display: inline-flex; }
.list-head .view a[aria-current] { background: var(--leaf-soft); color: var(--primary); }

/* ---------- Bài viết ---------- */
.entry { min-width: 0; }
.entry h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.25; }
.entry-head .chips { margin: 8px 0; }
.author-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0; font-size: .88rem; color: var(--muted); }
.author-line .avatar { width: 40px; height: 40px; background: var(--leaf-soft); color: var(--primary); font-weight: 700; }
.author-line strong { color: var(--ink); display: block; font-size: .95rem; }
.author-line .spacer { flex: 1; }
.entry-hero { margin: 0 0 18px; border-radius: var(--radius-lg); overflow: hidden; }
.entry-hero img { display: block; width: 100%; max-height: 460px; object-fit: cover; }
.toc { background: var(--leaf-soft); border: 1px solid var(--line-green); border-radius: 12px; padding: 14px 18px; margin: 16px 0 22px; }
.toc h2 { margin: 0 0 8px; font: 700 .95rem var(--font-body); color: var(--primary-strong); display: flex; gap: 6px; align-items: center; }
.toc ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.toc a { text-decoration: none; color: var(--body); font-size: .93rem; }
.toc a:hover { color: var(--primary); text-decoration: underline; }
.toc ol ol { margin-top: 4px; }
.body { overflow-wrap: anywhere; font-size: 1.04rem; line-height: 1.75; }
.body h2 { margin-top: 1.6em; padding-top: .2em; border-top: 1px solid var(--line); scroll-margin-top: 130px; }
.body h3 { scroll-margin-top: 130px; }
.body img { border-radius: 8px; margin: .6em 0; }
.body figure { margin: 1em 0; }
.body figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 4px; }
.body a { text-underline-offset: 2px; }
.body table, .table-wrap table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.body th, .body td, .table-wrap th, .table-wrap td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.body th, .table-wrap th { background: var(--leaf-soft); color: var(--primary-strong); }
.body tbody tr:nth-child(even) td { background: #fafcf8; }
.body iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; }
.table-wrap, .body { overflow-x: auto; }
blockquote { margin: 1em 0; padding: .6em 1em; border-left: 4px solid var(--line); color: var(--muted); }
.body aside.callout { margin: 1.2em 0; padding: 14px 16px 2px; border-left: 4px solid var(--primary); background: var(--leaf-soft); border-radius: 0 12px 12px 0; }
.body aside.callout-warning { border-left-color: var(--danger); background: var(--danger-soft); }
.body aside.callout-info { border-left-color: var(--info); background: #f0f9ff; }
.body aside.callout-tip { border-left-color: var(--gold-strong); background: var(--gold-soft); }
.body ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.2em 0; display: grid; gap: 12px; }
.body ol.steps > li { counter-increment: step; position: relative; padding: 14px 16px 14px 62px; background: #fff; border: 1px solid var(--line-green); border-radius: 12px; box-shadow: var(--shadow-1); }
.body ol.steps > li::before { content: counter(step); position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.body ol.steps > li > p:last-child { margin-bottom: 0; }
.body details.faq { margin: 10px 0; background: #fff; border: 1px solid var(--line-green); border-radius: 12px; padding: 0 16px; box-shadow: var(--shadow-1); }
.body details.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--ink); list-style: none; display: flex; gap: 8px; align-items: center; }
.body details.faq summary::-webkit-details-marker { display: none; }
.body details.faq summary::before { content: "?"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-strong); font-weight: 700; font-size: .8rem; flex: none; }
.body details.faq[open] summary { border-bottom: 1px dashed var(--line); }
.body details.faq > :not(summary) { margin: 10px 0; }
.sources { margin: 24px 0; padding: 14px 18px; background: var(--canvas-subtle); border: 1px solid var(--line); border-radius: 12px; }
.sources h2 { margin: 0 0 8px; font-size: 1.05rem; }
.sources ol { margin: 0; padding-left: 20px; }
.meta-inline { color: var(--muted); font-size: .9rem; }
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 16px; background: var(--leaf-soft); border: 1px solid var(--line-green); border-radius: 12px; margin: 24px 0; }
.feedback strong { color: var(--ink); }
.feedback button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; font: 600 .9rem var(--font-body); border-radius: 999px; border: 1.5px solid var(--primary); background: #fff; color: var(--primary); cursor: pointer; }
.feedback button:hover { background: var(--primary); color: #fff; }
.feedback button[disabled] { opacity: .6; cursor: default; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; font-size: .88rem; color: var(--muted); }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--body); text-decoration: none; font: 600 .85rem var(--font-body); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--primary); color: var(--primary); }
.author-card { display: flex; flex-direction: column; gap: 6px; }
.author-card .who { display: flex; gap: 10px; align-items: center; }
.author-card .avatar { width: 48px; height: 48px; background: var(--leaf-soft); color: var(--primary); font-weight: 700; font-size: 1.1rem; }
.author-card p { margin: 0; font-size: .88rem; }
.ask-article { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px; border: 1px dashed var(--primary); border-radius: 12px; background: #fff; margin: 20px 0; }

/* ---------- Phân trang, form, trạng thái ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; }
.pager a, .pager .cur { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; min-width: 44px; text-align: center; background: #fff; }
.pager .cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.status-page { max-width: 620px; padding: 32px 0; }
.status-page .search { margin: 16px 0; max-width: none; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; max-width: 40rem; padding: 10px 12px; font: inherit; border: 1px solid #94a3b8; border-radius: var(--radius); background: #fff; color: var(--ink); }
.contact-form input[type="checkbox"], .contact-form input[type="radio"] { width: auto; margin-right: 6px; }
.contact-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 1em; max-width: 40rem; }
.contact-form fieldset label { font-weight: 500; }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.payment { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; padding: 16px; background: #fff; border: 1px solid var(--line-green); border-radius: 12px; }
.payment dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.payment dt { color: var(--muted); }
.payment dd { margin: 0; }
.static-hero { display: block; max-width: 100%; height: auto; border-radius: var(--radius-lg); margin: 0 0 16px; }
.entity-head { display: grid; gap: 16px; }
.entity-head img { border-radius: var(--radius-lg); }
table { border-collapse: collapse; }
.card-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; color: var(--muted); font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; padding-top: 40px; padding-bottom: 40px; grid-template-columns: 1fr; }
.footer-grid h2 { font: 700 .78rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--primary); }
.footer-brand img { height: 36px; width: auto; display: block; margin-bottom: 10px; }
.footer-brand p { max-width: 38ch; }
.footer-contact li { display: flex; gap: 8px; align-items: flex-start; }
.footer-contact .i { margin-top: 3px; color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--line); padding: 24px 0; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: .82rem; }
.footer-bottom a { color: var(--muted); }

/* ---------- Quảng cáo ---------- */
.ad { margin: 16px 0; text-align: center; background: var(--canvas-subtle); border: 1px solid var(--line); border-radius: 12px; padding: 6px; overflow: hidden; }
.ad-label { display: block; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; }
.ad img { max-width: 100%; height: auto; }
.ad-h90 { min-height: 90px; }
.ad-h250 { min-height: 250px; }
.ad-h600 { min-height: 600px; }
.ad ins { display: block; }

/* ---------- Rộng hơn ---------- */
@media (min-width: 720px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  h1 { font-size: 2.2rem; }
  .brand-text { display: flex; }
  .header-actions .btn { display: inline-flex; }
  .hero { padding: 40px 0; }
  .header-main { min-height: 80px; }
  .hero h1 { font-size: 2.5rem; }
  .actions { grid-template-columns: repeat(2, 1fr); }
  .filter-row { grid-template-columns: repeat(3, 1fr); }
  .featured-cat { grid-template-columns: 1.1fr 1fr; }
  .featured-cat img, .featured-cat .ph { aspect-ratio: auto; height: 100%; min-height: 280px; }
  .entity-head { grid-template-columns: 320px 1fr; align-items: start; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
  .entry h1 { font-size: 2.3rem; }
  .feature { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

@media (min-width: 1000px) {
  .with-aside { grid-template-columns: minmax(0, 1fr) 340px; }
  .side-col { position: sticky; top: 150px; align-self: start; }
  .hero-grid { grid-template-columns: 7fr 5fr; align-items: stretch; }
  .actions { grid-template-columns: repeat(4, 1fr); }
  .qa-grid { grid-template-columns: 7fr 5fr; align-items: start; }
}

@media (max-width: 719px) {
  .nav-sub { display: none !important; }
  .search { max-width: none; flex-basis: 100%; order: 3; }
  .card-list .card { flex-direction: column; }
  .card-list .card-media { flex-basis: auto; }
  .row-card { grid-template-columns: 96px 1fr; }
  .row-card img, .row-card .ph { width: 96px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .action { transition: none; }
}

/* ---------- Trang chủ: duyệt theo nhóm, đọc nhiều, sâu bệnh, lịch nông vụ ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
.group { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); text-decoration: none; color: var(--body); transition: box-shadow .2s, transform .2s; }
.group:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); color: var(--body); }
.group-ico { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 12px; font-size: 1.35rem; background: var(--leaf-soft); color: var(--primary); }
.group-pest .group-ico, .group-disease .group-ico { background: var(--danger-soft); color: var(--danger); }
.group-nutrient .group-ico { background: var(--gold-soft); color: var(--gold-strong); }
.group-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.group-body strong { color: var(--ink); line-height: 1.3; }
.group-body small { color: var(--muted); font-size: .8rem; }
.group-go { color: var(--muted); flex: none; }

.insights { display: grid; gap: 40px 24px; }
.insights .section-head { margin-bottom: 12px; }
.ranked { list-style: none; counter-reset: rank; padding: 0; margin: 0; display: grid; gap: 10px; }
.ranked li { counter-increment: rank; position: relative; padding: 10px 12px 10px 52px; background: var(--canvas-subtle); border-radius: 12px; }
.ranked li::before { content: counter(rank); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font: 700 .95rem var(--font-heading); background: var(--primary); color: #fff; }
.ranked li:nth-child(n+4)::before { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.ranked a { color: var(--ink); text-decoration: none; line-height: 1.35; display: block; }
.ranked a:hover { color: var(--primary); }
.ranked .meta { margin: 4px 0 0; font-size: .8rem; }

.pest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; list-style: none; padding: 0; margin: 0 0 24px; }
.pest-card { background: #fff; border: 1px solid var(--line-green); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.pest-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.pest-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--canvas-subtle); }
.pest-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px 12px; }
.pest-body a { color: var(--ink); text-decoration: none; line-height: 1.3; }
.pest-body a:hover { color: var(--primary); }
.pest-body small { color: var(--muted); }
.searching { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.searching-label { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pill { padding: 5px 12px; border-radius: 999px; font-size: .85rem; text-decoration: none; background: #fff; border: 1px solid var(--line); color: var(--body); }
.pill:hover { border-color: var(--primary); color: var(--primary); background: var(--leaf-soft); }

.season { display: grid; gap: 24px; grid-template-columns: 1fr; }
.season-col { background: #fff; border: 1px solid var(--line-green); border-top: 4px solid var(--primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 20px 24px 24px; }
.season-col h3 { margin: 0 0 10px; font-size: 1rem; color: var(--ink); }
.season-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.season-col li { display: flex; flex-direction: column; gap: 2px; }
.season-col li a { color: var(--ink); }
.season-col li small { color: var(--muted); line-height: 1.4; }
.season-when { font-size: .75rem; font-weight: 600; color: var(--gold-strong); }
.season-care { border-top-color: var(--leaf); }
.season-pest_watch { border-top-color: var(--danger); background: var(--danger-soft); }
.season-harvest { border-top-color: #ca8a04; background: var(--gold-soft); }

@media (min-width: 720px) {
  .pest-grid { grid-template-columns: repeat(3, 1fr); }
  .season { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .insights { grid-template-columns: 5fr 7fr; align-items: start; }
  .insights > :only-child { grid-column: 1 / -1; }
  .insights > :only-child .pest-grid { grid-template-columns: repeat(6, 1fr); }
  .season { grid-template-columns: repeat(4, 1fr); }
}

@media print {
  .site-header, .site-footer, .pager, .search, .share, .feedback, .side-col, .ticker { display: none; }
  body { background: #fff; }
}
