/* Nông Dân AI — bộ nhận diện theo thiết kế Premium v39: xanh rừng, kem, vàng lúa; sáng / tối. */
:root {
  --ink:#193629; --forest:#194331; --green:#365e39; --leaf:#246b43; --lime:#d5e68d; --gold:#ecaf25; --soil:#5c3d2e;
  --page:#faf9f5; --surface:#ffffff; --soft:#eeeadd; --text:#193629; --muted:#5d7065; --line:#e1ddcd;
  --warn:#8a5a00; --warnbg:#fff4dc; --ok:#246b43; --okbg:#e6f1df; --danger:#b3261e;
  --on-accent:#ffffff; --accent:var(--forest); --link:var(--leaf);
  --radius:18px; --radius-s:12px;
  --shadow:0 1px 2px rgba(25,54,41,.05),0 8px 24px rgba(25,54,41,.07);
  --shadow-hover:0 14px 34px rgba(25,54,41,.14);
  color-scheme:light;
}
:root[data-theme="dark"] {
  --ink:#eaf1e8; --forest:#a4ce8e; --green:#98c38f; --leaf:#98c38f; --lime:#c9df7a; --gold:#e9bc58; --soil:#d89c61;
  --page:#101c16; --surface:#1b2c22; --soft:#22362a; --text:#eaf1e8; --muted:#a9bcad; --line:#2f4537;
  --warn:#f3c77a; --warnbg:#3a2f17; --ok:#a4ce8e; --okbg:#203a28; --danger:#ff8a80;
  --on-accent:#10201a; --accent:#a4ce8e; --link:#b9dca6;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 24px rgba(0,0,0,.25); --shadow-hover:0 18px 40px rgba(0,0,0,.45);
  color-scheme:dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:#eaf1e8; --forest:#a4ce8e; --green:#98c38f; --leaf:#98c38f; --lime:#c9df7a; --gold:#e9bc58; --soil:#d89c61;
    --page:#101c16; --surface:#1b2c22; --soft:#22362a; --text:#eaf1e8; --muted:#a9bcad; --line:#2f4537;
    --warn:#f3c77a; --warnbg:#3a2f17; --ok:#a4ce8e; --okbg:#203a28; --danger:#ff8a80;
    --on-accent:#10201a; --accent:#a4ce8e; --link:#b9dca6;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 24px rgba(0,0,0,.25); --shadow-hover:0 18px 40px rgba(0,0,0,.45);
    color-scheme:dark;
  }
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--page); color:var(--text); line-height:1.55; font-size:16px; }
a { color:var(--link); }
img { max-width:100%; }
.dark-only { display:none; }
:root[data-theme="dark"] .light-only { display:none; } :root[data-theme="dark"] .dark-only { display:inline-block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .light-only { display:none; } :root:not([data-theme="light"]) .dark-only { display:inline-block; } }

/* ---------- Thanh trên (theo bản v39) ---------- */
.wrap { width:min(1200px, calc(100% - 48px)); margin:0 auto; }
.top { position:sticky; top:0; z-index:30; background:var(--surface); border-bottom:1px solid var(--line); box-shadow:0 4px 20px rgba(28,61,38,.055); }
.topline { background:#163a2a; color:#d6e6d7; font-size:12px; }
.topline-in { display:flex; justify-content:space-between; gap:12px; padding:7px 0; }
.topline-in span { display:flex; align-items:center; gap:8px; }
.live-dot { width:8px; height:8px; border-radius:50%; background:#d5e68d; box-shadow:0 0 0 3px rgba(213,230,141,.25); display:inline-block; }
.brandrow { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0 6px; }
.logo { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); flex:none; }
.logo-sym { width:42px; height:38px; }
.logo-text { display:flex; flex-wrap:wrap; align-items:center; gap:0 7px; line-height:1.15; }
.logo-text b { font-size:22px; font-weight:800; letter-spacing:-.3px; }
.logo-text i { font-style:normal; font-size:11px; font-weight:800; background:var(--gold); color:#17251a; border-radius:999px; padding:2px 8px; justify-self:start; }
.logo-text small { flex-basis:100%; font-size:8.5px; font-weight:800; letter-spacing:.9px; text-transform:uppercase; color:var(--soil); margin-top:3px; }
.top-tools { display:flex; align-items:center; gap:10px; }
.btn.btn-dark { background:#1c3d26; color:#fff; border-radius:8px; }
:root[data-theme="dark"] .btn.btn-dark { background:#d5e68d; color:#132a1c; }
.join-btn { padding:11px 16px; font-size:13px; font-weight:800; }
.theme-btn { font:inherit; font-size:13px; font-weight:700; display:flex; align-items:center; gap:8px; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:999px; padding:7px 10px 7px 12px; cursor:pointer; }
.theme-btn .switch { width:28px; height:16px; border-radius:999px; background:#5f6f63; position:relative; }
.theme-btn .switch::after { content:""; position:absolute; top:2px; inset-inline-start:2px; width:12px; height:12px; border-radius:50%; background:#fff; transition:transform .2s; }
:root[data-theme="dark"] .theme-btn .switch { background:var(--leaf); }
:root[data-theme="dark"] .theme-btn .switch::after { transform:translateX(12px); }
.iconbtn { font:inherit; font-size:20px; width:42px; height:42px; border-radius:10px; border:1px solid var(--line); background:var(--surface); color:var(--text); cursor:pointer; display:grid; place-items:center; }
.menu-btn { display:none; }
.navrow { padding:4px 0 10px; }
.mainnav { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.mainnav > a, .more summary { color:var(--text); text-decoration:none; font-size:13.5px; font-weight:700; padding:10px 14px; border-radius:10px; white-space:nowrap; position:relative; cursor:pointer; }
.mainnav > a:hover, .more summary:hover { color:var(--leaf); }
.mainnav > a.active { background:var(--okbg); color:var(--ink); }
.mainnav > a.active::after { content:""; position:absolute; left:14px; right:14px; bottom:6px; height:2px; border-radius:2px; background:var(--leaf); }
.mainnav > a.nav-feature { background:#1c3d26; color:#fff; }
.mainnav > a.nav-feature.active::after { background:#d5e68d; }
:root[data-theme="dark"] .mainnav > a.nav-feature { background:#d5e68d; color:#132a1c; }
.more { position:relative; }
.more summary { list-style:none; border:1px solid var(--line); background:var(--soft); }
.more summary::-webkit-details-marker { display:none; }
.more summary::after { content:" ⌄"; }
.more-panel { position:absolute; inset-inline-end:0; top:calc(100% + 6px); min-width:260px; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-hover); padding:8px; display:grid; z-index:40; }
.more-panel a { display:block; padding:10px 12px; border-radius:10px; text-decoration:none; color:var(--ink); font-weight:700; font-size:14px; }
.more-panel a small { display:block; font-weight:400; color:var(--muted); font-size:12px; }
.more-panel a:hover, .more-panel a.active { background:var(--okbg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.btn-dark, :root:not([data-theme="light"]) .mainnav > a.nav-feature { background:#d5e68d; color:#132a1c; }
  :root:not([data-theme="light"]) .theme-btn .switch { background:var(--leaf); }
  :root:not([data-theme="light"]) .theme-btn .switch::after { transform:translateX(12px); }
}
@media (max-width: 1180px) {
  .menu-btn { display:grid; }
  .navrow { padding:0; }
  .mainnav { display:none; position:absolute; left:0; right:0; top:100%; background:var(--surface); border-bottom:1px solid var(--line); padding:10px 16px 18px; flex-direction:column; align-items:stretch; gap:2px; box-shadow:0 16px 35px rgba(10,30,20,.18); max-height:calc(100dvh - 110px); overflow-y:auto; }
  .mainnav.open { display:flex; }
  .mainnav > a, .more summary { padding:12px 14px; font-size:16px; }
  .mainnav > a.active::after { display:none; }
  .more { border-top:1px solid var(--line); margin-top:6px; padding-top:6px; }
  .more summary { border:0; background:none; }
  .more-panel { position:static; box-shadow:none; border:0; padding:0 0 0 8px; min-width:0; }
}
@media (max-width: 640px) {
  .wrap { width:calc(100% - 32px); }
  .topline-in .topline-right, .top-tools .join-btn, .theme-btn .theme-label, .logo-text small { display:none; }
  .topline-in { justify-content:center; }
  .brandrow { padding:10px 0; }
  .theme-btn { padding:8px 10px; }
}

/* ---------- Bố cục ---------- */
main { width:min(1200px, calc(100% - 48px)); margin:0 auto; padding:28px 0 48px; min-height:60vh; }
@media (max-width: 640px) { main { width:calc(100% - 32px); padding-top:20px; } }
h1 { font-size:clamp(26px, 4vw, 34px); line-height:1.2; letter-spacing:-.5px; margin:8px 0 10px; color:var(--ink); }
h2 { font-size:18px; color:var(--ink); margin:0 0 8px; letter-spacing:-.2px; }
.muted { color:var(--muted); font-size:14.5px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px; margin:14px 0; box-shadow:var(--shadow); }
.card.warn { background:var(--warnbg); color:var(--warn); border-color:transparent; box-shadow:none; }
a.link { display:block; text-decoration:none; color:inherit; transition:transform .15s, box-shadow .15s; }
a.link:hover { box-shadow:var(--shadow-hover); transform:translateY(-2px); }
.grid { display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); }
.grid > .card { margin:0; }
.tag { display:inline-block; font-size:12px; font-weight:600; background:var(--warnbg); color:var(--warn); padding:3px 10px; border-radius:999px; }
.tag.ok { background:var(--okbg); color:var(--ok); }
.chip { display:inline-block; font-size:12.5px; font-weight:500; background:var(--okbg); color:var(--ok); padding:3px 10px; border-radius:999px; margin:4px 4px 0 0; }
table { width:100%; border-collapse:collapse; font-size:14px; margin-top:8px; }
th, td { text-align:start; padding:9px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-weight:600; }
table.kv th { width:60%; color:var(--muted); font-weight:500; }
code { overflow-wrap:anywhere; }

/* ---------- Trang chủ (theo bản v39) ---------- */
main.full { width:auto; max-width:none; padding:0; }
.eyebrow { font-size:12px; font-weight:800; letter-spacing:.15em; text-transform:uppercase; color:#406a42; }
:root[data-theme="dark"] .eyebrow { color:var(--lime); }
.hero { position:relative; min-height:650px; overflow:hidden; background:#213f2a; display:flex; align-items:center; }
.hero::before { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(20,39,25,.92),rgba(22,48,30,.67) 53%,rgba(21,45,28,.22)), url('/img/hero-field.jpg') center/cover; }
.hero::after { content:""; position:absolute; inset:0; background:linear-gradient(0deg,rgba(27,20,16,.24),transparent 48%); pointer-events:none; }
.hero .wrap { position:relative; z-index:1; }
.hero-copy { max-width:760px; color:#fff; padding:65px 0 100px; }
.hero .eyebrow { color:#ddf0b2; }
.hero h1 { color:#fff; font-size:clamp(43px,6.5vw,86px); line-height:1.05; letter-spacing:-.055em; margin:25px 0; font-weight:800; max-width:none; }
.hero h1 em { font-style:normal; color:#ddf0b2; }
.hero p { font-size:17px; color:#e1e9d8; line-height:1.85; max-width:580px; margin:0; }
.heroactions { display:flex; gap:12px; flex-wrap:wrap; margin-top:29px; }
.btn.btn-light, .btn.btn-outline { padding:15px 24px; border-radius:8px; font-weight:800; font-size:14px; }
.btn.btn-light { background:#ddf0b2; color:#1c3d26; }
.btn.btn-outline { background:transparent; color:#fff; border:1px solid #bbc9ba; }
.btn-light:hover, .btn-outline:hover { transform:translateY(-2px); }
.hero-note { position:absolute; z-index:2; bottom:30px; inset-inline-end:max(24px, calc((100% - 1200px)/2)); background:rgba(246,249,233,.96); color:#1c3d26; border-radius:12px; padding:17px 20px; max-width:250px; box-shadow:0 15px 40px #0002; }
.hero-note b { display:block; font-size:14px; }
.hero-note span { font-size:12px; color:#5f7361; line-height:1.6; display:block; margin-top:5px; }
.band { padding:80px 0; }
.band.tint { background:linear-gradient(180deg, var(--page), color-mix(in srgb, var(--okbg) 70%, var(--page))); }
.band.soft { background:color-mix(in srgb, var(--okbg) 60%, var(--page)); }
.band-head { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap; margin-bottom:34px; }
.band-head .eyebrow { display:flex; align-items:center; gap:12px; }
.band-head .eyebrow::before { content:""; width:26px; height:2px; background:currentColor; opacity:.6; }
.band-head h2 { font-size:clamp(30px,4.4vw,52px); line-height:1.08; letter-spacing:-.045em; font-weight:800; margin:14px 0 10px; max-width:22ch; color:var(--ink); }
.band-head p { margin:0; color:var(--muted); max-width:56ch; }
.band-head > a { font-weight:800; font-size:14px; color:var(--ink); text-decoration:none; }
.pillars { display:grid; gap:18px; grid-template-columns:repeat(3,1fr); }
.pillar { position:relative; overflow:hidden; border-radius:20px; padding:32px 28px 30px; min-height:330px; display:flex; flex-direction:column; justify-content:flex-end; gap:10px; text-decoration:none; transition:transform .2s, box-shadow .2s; border:1px solid transparent; }
.pillar:hover { transform:translateY(-3px); box-shadow:var(--shadow-hover); }
.pillar .num { position:absolute; top:30px; inset-inline-start:28px; font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.pillar .glyph { position:absolute; top:30px; inset-inline-end:26px; font-size:92px; line-height:1; opacity:.22; font-family:"DejaVu Sans", "Segoe UI Symbol", sans-serif; }
.pillar h3 { margin:0; font-size:32px; letter-spacing:-.04em; font-weight:700; }
.pillar p { margin:0; font-size:14px; line-height:1.75; max-width:36ch; }
.pillar .go { margin-top:18px; font-weight:800; font-size:13px; align-self:flex-start; border-bottom:2px solid currentColor; padding-bottom:3px; }
.pillar.p1 { background:#1b432f; color:#fff; } .pillar.p1 p { color:#d3e2d4; }
.pillar.p2 { background:#efe8dc; color:#1c3d26; border-color:#e2d9c8; } .pillar.p2 p { color:#5d6b5f; }
.pillar.p3 { background:#ddedb4; color:#1c3d26; border-color:#cfe39c; } .pillar.p3 p { color:#4f6450; }
:root[data-theme="dark"] .pillar.p2 { background:#2b2a22; color:#f0eadf; border-color:#3b3a30; } :root[data-theme="dark"] .pillar.p2 p { color:#c8c1b3; }
:root[data-theme="dark"] .pillar.p3 { background:#2e3b1f; color:#e7f2cc; border-color:#3d4d2a; } :root[data-theme="dark"] .pillar.p3 p { color:#c6d3ad; }
.facts { display:flex; flex-wrap:wrap; align-items:center; gap:14px 34px; border-top:1px solid var(--line); margin-top:26px; padding-top:22px; color:var(--muted); font-size:13px; }
.facts b { font-size:22px; color:var(--ink); margin-inline-end:6px; font-weight:800; }
.facts .note { margin-inline-start:auto; font-size:12px; }
.shortcuts { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.shortcut { display:flex; align-items:center; gap:14px; padding:22px 20px; background:var(--surface); border:1px solid var(--line); border-radius:14px; text-decoration:none; color:var(--ink); box-shadow:var(--shadow); transition:transform .2s, box-shadow .2s; }
.shortcut:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); }
.shortcut .ico { width:44px; height:44px; flex:none; border-radius:10px; background:var(--okbg); color:var(--ok); display:grid; place-items:center; font-size:20px; }
.shortcut b { display:block; font-size:16px; }
.shortcut small { color:var(--muted); font-size:13px; }
.shortcut .arr { margin-inline-start:auto; color:var(--muted); }
.crops { display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
.crop { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:18px 10px 14px; text-align:center; text-decoration:none; color:var(--ink); font-weight:700; font-size:15px; transition:transform .15s, box-shadow .15s; }
.crop:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); }
.crop img { width:70px; height:70px; display:block; margin:0 auto 10px; }
.crop small { display:block; font-weight:500; color:var(--muted); font-size:12px; margin-top:2px; }
.news-mini { display:grid; gap:16px; grid-template-columns:repeat(3,1fr); }
.news-mini a { display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line); border-radius:16px; overflow:hidden; text-decoration:none; color:var(--ink); box-shadow:var(--shadow); transition:transform .2s, box-shadow .2s; }
.news-mini a:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); }
.news-mini .thumb { aspect-ratio:16/9; width:100%; object-fit:cover; display:block; background:var(--soft); }
.news-mini .body { padding:18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.news-mini small { font-size:11px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:#406a42; }
:root[data-theme="dark"] .news-mini small { color:var(--lime); }
.news-mini strong { font-size:17px; line-height:1.4; letter-spacing:-.02em; }
.news-mini .src { margin-top:auto; font-size:12.5px; color:var(--muted); }
.principle { display:grid; grid-template-columns:1fr 1.3fr; gap:40px; align-items:start; }
.principle h2 { font-size:clamp(30px,4vw,46px); line-height:1.08; letter-spacing:-.045em; margin:14px 0; color:var(--ink); }
.principle p { color:var(--muted); line-height:1.8; }
.principle-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.principle-cards div { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:22px 18px; }
.principle-cards i { font-style:normal; color:var(--leaf); font-size:20px; }
.principle-cards b { display:block; margin:12px 0 8px; color:var(--ink); }
.principle-cards span { font-size:13px; color:var(--muted); line-height:1.7; }
.cta { display:flex; justify-content:space-between; align-items:center; gap:30px; flex-wrap:wrap; }
.cta h2 { font-size:clamp(34px,5.4vw,64px); line-height:1.12; letter-spacing:-.05em; margin:18px 0; color:var(--ink); font-weight:800; }
.cta p { color:var(--text); max-width:60ch; line-height:1.8; margin:0; }
.cta .btn-dark { padding:16px 24px; font-weight:800; }
@media (max-width: 900px) {
  .pillars, .shortcuts, .news-mini, .principle, .principle-cards { grid-template-columns:1fr; }
  .pillar { min-height:260px; }
  .hero-note { display:none; }
  .facts .note { margin-inline-start:0; }
}
@media (max-width: 640px) {
  .hero { min-height:560px; }
  .hero::before { background:linear-gradient(90deg,rgba(20,39,25,.92),rgba(22,48,30,.72)), url('/img/hero-field-sm.jpg') center/cover; }
  .hero-copy { padding:45px 0; }
  .hero h1 { font-size:44px; }
  .hero p { font-size:15px; }
  .band { padding:56px 0; }
}

/* ---------- Biểu mẫu, nút ---------- */
.form { display:grid; gap:12px; }
label { display:grid; gap:5px; font-size:14.5px; font-weight:500; }
label.check { display:flex; align-items:center; gap:8px; margin:6px 0; font-weight:400; }
input, select, textarea { font:inherit; padding:11px 12px; border:1px solid var(--line); border-radius:var(--radius-s); background:var(--surface); color:var(--text); }
input:focus, select:focus, textarea:focus { outline:2px solid color-mix(in srgb, var(--leaf) 55%, transparent); outline-offset:1px; border-color:var(--leaf); }
label.check input { padding:0; accent-color:var(--leaf); }
textarea { resize:vertical; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; font:inherit; font-weight:600; background:var(--accent); color:var(--on-accent); border:0; border-radius:999px; padding:11px 20px; cursor:pointer; text-decoration:none; }
.btn:hover { filter:brightness(1.07); }
.btn:disabled { opacity:.6; cursor:default; }
.btn.small { padding:7px 13px; font-size:13.5px; }
.btn.ghost { background:transparent; color:var(--link); border:1px solid currentColor; }
.btn.danger { background:var(--danger); color:#fff; }
.linkbtn { font:inherit; font-size:13.5px; background:none; border:0; color:var(--link); text-decoration:underline; cursor:pointer; padding:2px 0; }
.actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
fieldset.checks { border:1px solid var(--line); border-radius:var(--radius-s); padding:8px 12px; margin:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); }
fieldset.checks legend { font-size:14.5px; font-weight:500; padding:0 4px; }
fieldset.checks .err { grid-column:1/-1; }
.req { color:var(--danger); }
.err { color:var(--danger); font-size:13px; }
.err:empty { display:none; }
.hp { position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }
.code { font-family:ui-monospace,monospace; font-size:18px; letter-spacing:1px; }
.narrow { max-width:440px; }
.filters { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }

/* ---------- Danh bạ, kết nối ---------- */
button.card.role { display:block; width:100%; text-align:start; border:2px solid var(--line); cursor:pointer; font:inherit; color:inherit; }
button.card.role:hover { box-shadow:var(--shadow-hover); }
button.card.role.active { border-color:var(--leaf); background:var(--okbg); }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin:12px 0; }
.stat { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-s); padding:12px 14px; display:grid; }
.stat strong { font-size:24px; color:var(--ink); }
.stat span { font-size:13px; color:var(--muted); }
.member-head { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; flex-wrap:wrap; }
.match { border-top:1px solid var(--line); padding:10px 0; }
ul.reasons { margin:6px 0; padding-inline-start:20px; color:var(--ok); font-size:14px; }
ol.steps { padding-inline-start:0; list-style:none; }
ol.steps li { margin:12px 0; }
ol.steps label { display:flex; gap:10px; align-items:flex-start; font-weight:400; }
details summary { cursor:pointer; }
details ul { margin:6px 0 0; }

/* ---------- Quản trị ---------- */
.adminbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; }
.tabs { display:flex; gap:4px; flex-wrap:wrap; }
.tab { font:inherit; font-size:14px; background:var(--surface); color:var(--text); border:1px solid var(--line); border-radius:999px; padding:7px 14px; cursor:pointer; }
.tab.active { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.tablewrap { overflow-x:auto; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-s); }
.tablewrap table { font-size:13px; min-width:720px; }
.tablewrap code { font-size:12px; word-break:break-all; }

/* ---------- Tin tức ---------- */
.story h2 { font-size:18px; margin:8px 0 6px; }
.story-meta { display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:13px; }
.story-meta .chip { margin:0; }
.story-img { margin:10px 0 4px; }
.story-img img { width:100%; max-height:320px; object-fit:cover; border-radius:var(--radius-s); display:block; background:var(--soft); }
.story-img figcaption { font-size:12px; color:var(--muted); margin-top:4px; }
.update-note { font-size:14px; color:var(--ok); background:var(--okbg); padding:7px 11px; border-radius:var(--radius-s); }
.story details { margin-top:8px; }
.sources { font-size:13px; margin-top:8px; color:var(--muted); }
.sources a { color:var(--link); }
.hidden-story { opacity:.55; }
.fresh { position:sticky; top:84px; z-index:5; display:block; margin:8px auto; box-shadow:var(--shadow-hover); }
.fresh[hidden], #newsMore[hidden] { display:none; }
.brief ul { padding-inline-start:20px; }

/* ---------- AI ---------- */
.photo-prev img { max-width:100%; max-height:280px; border-radius:var(--radius-s); margin:8px 0; display:block; }
.chat { display:flex; flex-direction:column; gap:10px; min-height:180px; }
.bubble { max-width:88%; padding:11px 14px; border-radius:16px; overflow-wrap:anywhere; }
.bubble.user { align-self:flex-end; background:var(--accent); color:var(--on-accent); border-bottom-right-radius:6px; }
.bubble.assistant { align-self:flex-start; background:var(--soft); border-bottom-left-radius:6px; }
.bubble .sources { margin-top:6px; font-size:13px; }
button.chip.ask-ex { border:0; cursor:pointer; font:inherit; font-size:13.5px; padding:7px 12px; text-align:start; }
.chat-form textarea { width:100%; }

/* ---------- Chân trang (theo bản v39), thanh dưới (điện thoại) ---------- */
.foot { background:#112d21; color:#d6e6d7; padding:65px 0 24px; }
.footgrid { display:grid; grid-template-columns:2fr 1fr 1fr 1.2fr; gap:35px; }
.foot-brand { display:flex; align-items:center; gap:12px; text-decoration:none; color:#fff; }
.foot-brand .logo-text small { color:#e9bc58; }
.foot-brand .logo-text b { color:#fff; }
.foot p { font-size:13px; line-height:1.8; color:#bdcfc1; max-width:340px; margin-top:16px; }
.foot h4 { font-size:14px; color:#fff; margin:6px 0 14px; }
.foot a { color:#c3d5c5; }
.footgrid > div > a:not(.foot-brand) { display:block; font-size:13px; margin:11px 0; text-decoration:none; }
.footgrid > div > a:not(.foot-brand):hover { color:#fff; }
.bottom { border-top:1px solid #3b5a47; margin-top:50px; padding-top:22px; color:#96b09d; font-size:12px; display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.bottom span:last-child { max-width:70ch; }
.dock { display:none; }
@media (max-width: 900px) { .footgrid { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 640px) { .footgrid { grid-template-columns:1fr; } }
@media (max-width: 760px) {
  body { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
  .dock { display:grid; grid-template-columns:repeat(5,1fr); position:fixed; left:0; right:0; bottom:0; z-index:20; background:var(--surface); border-top:1px solid var(--line); padding:4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow:0 -6px 20px rgba(0,0,0,.08); }
  .dock a { display:flex; flex-direction:column; align-items:center; gap:1px; text-decoration:none; color:var(--muted); font-size:11px; font-weight:700; padding:6px 2px; border-radius:12px; }
  .dock a span { font-size:19px; line-height:1.2; }
  .dock a.active { color:var(--ink); background:var(--okbg); }
  .card { padding:15px; }
}


/* ---------- Trang con theo v39 ---------- */
.pad { padding:40px 0; }
.pagehead { background:linear-gradient(120deg, color-mix(in srgb, var(--okbg) 55%, var(--page)), var(--page) 60%, color-mix(in srgb, var(--okbg) 70%, var(--page))); border-bottom:1px solid var(--line); }
.pagehead-in { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:24px 0 10px; }
.pagehead h1 { font-size:clamp(28px,3.6vw,40px); letter-spacing:-.03em; margin:6px 0 4px; font-weight:700; }
.pagehead p { margin:0; color:var(--muted); font-size:14px; }
.pagehead .eyebrow { font-size:10.5px; }
.pagehead-note { color:var(--muted); font-size:12px; white-space:nowrap; }
.pagelinks { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; padding:6px 0 10px; margin:0 -4px; }
.pagelinks::-webkit-scrollbar { display:none; }
.pagelinks a { flex:none; text-decoration:none; color:var(--text); font-size:13px; font-weight:700; padding:7px 12px; border-radius:8px; }
.pagelinks a:hover { background:var(--soft); }
.pagelinks a.current { color:var(--ink); text-decoration:underline; text-decoration-color:var(--leaf); text-decoration-thickness:2px; text-underline-offset:7px; }
.band.plain { padding:36px 0 56px; }
.band.plain .wrap > h1:first-child { display:none; }
.small { font-size:12.5px; }
.small-overline { display:block; font-size:10.5px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#406a42; }
:root[data-theme="dark"] .small-overline { color:var(--lime); }
.big { font-size:clamp(30px,4.4vw,50px); line-height:1.08; letter-spacing:-.045em; margin:14px 0; color:var(--ink); }
.lead { color:var(--muted); line-height:1.8; }
.btn.btn-ghost-dark { background:transparent; color:var(--ink); border:1px solid var(--line); border-radius:8px; }
.pill-btn { font:inherit; font-size:12.5px; font-weight:700; background:var(--soft); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:7px 12px; cursor:pointer; }
.status-pill { display:inline-block; font-size:13px; font-weight:700; padding:10px 16px; border-radius:999px; background:var(--okbg); color:var(--ink); border:1px solid var(--line); }
.status-pill.lime { background:#ddf0b2; color:#1c3d26; font-size:11px; letter-spacing:.04em; text-transform:uppercase; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:24px; box-shadow:var(--shadow); }
.panel h3 { margin:0 0 6px; font-size:19px; color:var(--ink); }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.panel-head h3 { margin:0; }
/* Ngành hàng */
.industry-count { display:grid; grid-template-columns:auto auto; gap:6px 12px; align-items:center; border-inline-start:1px solid var(--line); padding-inline-start:22px; }
.industry-count strong { font-size:24px; color:var(--ink); }
.industry-count span { font-size:10.5px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }
.sector-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.sector-card { display:flex; align-items:center; gap:14px; text-align:start; font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:24px 20px; cursor:pointer; position:relative; transition:transform .15s, box-shadow .15s; }
.sector-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); }
.sector-card[aria-pressed="true"] { background:#1b432f; color:#fff; border-color:#1b432f; box-shadow:var(--shadow-hover); }
.sector-symbol { width:58px; height:58px; flex:none; border-radius:14px; background:#eef4e6; display:grid; place-items:center; }
.sector-text strong { display:block; font-size:19px; font-weight:700; }
.sector-text small { display:block; font-size:12px; color:var(--muted); line-height:1.6; margin-top:4px; }
.sector-card[aria-pressed="true"] small { color:#d3e2d4; }
.sector-arrow { position:absolute; top:14px; inset-inline-end:16px; color:var(--muted); }
.sector-card[aria-pressed="true"] .sector-arrow { color:#fff; }
.commodity-panel { margin-top:20px; background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:28px; }
.commodity-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.commodity-top h3 { font-size:24px; margin:6px 0 18px; color:var(--ink); letter-spacing:-.02em; }
.commodity-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; }
.commodity-chip { font:inherit; color:var(--ink); background:color-mix(in srgb, var(--soft) 45%, var(--surface)); border:1px solid var(--line); border-radius:12px; padding:14px 8px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:8px; position:relative; }
.commodity-chip img { width:48px; height:48px; }
.commodity-chip strong { font-size:14.5px; }
.commodity-chip small { position:absolute; top:6px; inset-inline-end:8px; font-size:9.5px; font-weight:800; color:var(--ok); text-transform:uppercase; letter-spacing:.06em; }
.commodity-chip[aria-pressed="true"] { border-color:var(--leaf); background:var(--okbg); box-shadow:0 0 0 2px color-mix(in srgb, var(--leaf) 35%, transparent); }
.commodity-choice { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:22px; padding:14px 16px; border-radius:12px; background:color-mix(in srgb, var(--okbg) 60%, var(--surface)); border:1px solid var(--line); font-size:14px; font-weight:600; }
.choice-icon { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:var(--surface); color:var(--ok); }
.choice-actions { margin-inline-start:auto; display:flex; gap:8px; flex-wrap:wrap; }
.choice-actions .btn { padding:10px 16px; font-size:13px; }
.choice-go.disabled { opacity:.45; pointer-events:none; }
/* Bảng điều khiển */
.dash-grid { display:grid; grid-template-columns:1fr 1.2fr 1.2fr; gap:16px; }
.dash-card { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:24px; display:flex; flex-direction:column; gap:8px; }
.dash-card.dark { background:#1b432f; color:#fff; border-color:#1b432f; }
.dash-card.dark h3 { color:#fff; font-size:28px; margin:0; }
.dash-card.dark p { color:#d3e2d4; font-size:14px; }
.dash-card.dark .small-overline { color:#d5e68d; }
.link-line { color:#fff; font-weight:800; font-size:13px; margin-top:auto; }
.checks-list { margin:6px 0; padding-inline-start:18px; display:grid; gap:8px; font-size:14px; }
.ask-link { display:block; padding:10px 12px; border-radius:10px; background:var(--soft); text-decoration:none; color:var(--ink); font-size:14px; font-weight:600; }
.ask-link:hover { background:var(--okbg); }
.empty-pick h3 { margin:0 0 6px; }
.stat-row { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.stat-row div { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:20px; }
.stat-row span { display:block; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.stat-row strong { display:block; font-size:22px; margin-top:10px; color:var(--ink); }
.shortcuts { grid-template-columns:repeat(3,1fr); }
/* Nhật ký */
.split-head { display:flex; justify-content:space-between; gap:24px; align-items:flex-end; flex-wrap:wrap; }
.split-head .band-head { margin-bottom:10px; }
.balance-card { background:#1b432f; color:#fff; border-radius:14px; padding:22px 24px; min-width:240px; display:grid; gap:6px; }
.balance-card .small-overline { color:#d5e68d; }
.balance-card strong { font-size:30px; }
.balance-card span:last-child { font-size:13px; color:#d3e2d4; }
.inline-filter { display:flex; align-items:center; gap:10px; margin:16px 0; font-size:13px; font-weight:700; color:var(--ok); }
.journal-grid { display:grid; grid-template-columns:1fr 1.25fr; gap:20px; align-items:start; }
.sum-row { display:flex; justify-content:space-between; background:var(--soft); border-radius:10px; padding:12px 14px; margin-bottom:8px; }
.sum-row span { display:block; font-size:12.5px; color:var(--muted); }
.sum-row div:last-child { text-align:end; }
.tablewrap.flat { border:0; }
.tablewrap.flat table { min-width:0; }
td.pos { color:var(--ok); font-weight:700; white-space:nowrap; } td.neg { color:var(--danger); font-weight:700; white-space:nowrap; }
.calc-wrap { display:grid; grid-template-columns:1fr 1.1fr; gap:40px; align-items:center; }
.calc-box { display:grid; grid-template-columns:1fr 1fr; gap:18px; background:color-mix(in srgb, var(--okbg) 55%, var(--surface)); border:1px solid var(--line); border-radius:18px; padding:22px; }
.calc-out { background:#1b432f; color:#fff; border-radius:14px; padding:24px; display:flex; flex-direction:column; gap:8px; }
.calc-out .small-overline { color:#d5e68d; }
.calc-out strong { font-size:36px; line-height:1.1; letter-spacing:-.03em; }
.calc-out p { color:#d3e2d4; font-size:13px; margin:0; }
.calc-out hr { border:0; border-top:1px solid rgba(255,255,255,.2); width:100%; }
/* Tái sinh */
.about { display:grid; grid-template-columns:1fr 1fr; gap:60px; align-items:center; }
.about-photo { position:relative; margin:0; }
.about-photo img { width:100%; aspect-ratio:8/7; object-fit:cover; border-radius:18px; display:block; }
.about-photo figcaption { position:absolute; inset-inline-start:24px; bottom:24px; background:#fbf8f0; color:#1c3d26; border-radius:10px; padding:14px 16px; max-width:230px; font-size:13px; line-height:1.5; }
.about-photo figcaption b { display:block; }
.tri { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:24px 0; }
.tri div { border-inline-start:2px solid var(--soil); padding:4px 0 4px 12px; }
.tri b { display:block; color:var(--ink); }
.tri span { font-size:12.5px; color:var(--muted); }
.principles { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:18px; }
.principles div { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:26px 22px; }
.p-ico { font-size:28px; }
.principles h3 { font-size:18px; margin:16px 0 10px; color:var(--ink); }
.principles p { font-size:13.5px; color:var(--muted); line-height:1.7; margin:0; }
/* Nông trại */
.farm-filter { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.farm-filter input { min-width:240px; }
.farm-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.farm-card { background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:var(--shadow); }
.farm-card img { width:100%; aspect-ratio:7/3; object-fit:cover; display:block; }
.farm-body { padding:18px; }
.farm-body h3 { margin:10px 0 8px; font-size:18px; color:var(--ink); }
.farm-body p { font-size:13px; color:var(--muted); margin:0 0 10px; }
.tagline { display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; background:var(--okbg); color:var(--ok); padding:5px 10px; border-radius:999px; }
.ok-note { font-size:12px; font-weight:700; color:var(--ok); } .warn-note { font-size:12px; font-weight:700; color:#a5622a; }
.story-layout { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.story-main { min-height:320px; border-radius:16px; padding:28px; display:flex; flex-direction:column; justify-content:flex-end; color:#fff; background:linear-gradient(0deg, rgba(17,45,33,.9), rgba(17,45,33,.15) 70%), url('/img/k-econ.jpg') center/cover; }
.story-main .small-overline { color:#d5e68d; }
.story-main h3 { font-size:28px; letter-spacing:-.03em; margin:8px 0 0; }
.story-steps { display:grid; gap:12px; }
.story-steps div { display:flex; gap:16px; align-items:center; background:color-mix(in srgb, var(--okbg) 60%, var(--surface)); border-radius:12px; padding:20px; }
.story-steps b { font-size:30px; color:#8fb07a; }
.story-steps strong { display:block; color:var(--ink); margin-bottom:4px; }
.story-steps span { font-size:13px; color:var(--muted); }
/* Mã & Nguồn gốc */
.head-note { color:var(--muted); }
.trace-grid { display:grid; grid-template-columns:1.6fr 1fr; gap:18px; align-items:start; }
.ico-box { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; background:#1b432f; color:#d5e68d; margin-bottom:12px; }
.dashed-note { border:1px dashed var(--leaf); border-radius:10px; padding:14px; font-size:13px; color:var(--muted); background:color-mix(in srgb, var(--okbg) 40%, var(--surface)); margin-top:14px; }
.lot-list { display:grid; gap:6px; margin-top:8px; }
.lot-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:13px; border-top:1px solid var(--line); padding-top:8px; }
.stages { display:grid; grid-template-columns:repeat(9,1fr); gap:8px; margin-bottom:12px; }
.stage { font:inherit; text-align:start; font-size:12px; font-weight:700; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:12px 8px; min-height:80px; cursor:pointer; display:flex; flex-direction:column; gap:6px; }
.stage b { font-size:14px; }
.stage.active { background:#1b432f; color:#fff; border-color:#1b432f; }
.stage-detail { display:flex; justify-content:space-between; gap:20px; align-items:center; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:22px; flex-wrap:wrap; }
.stage-detail h3 { margin:0 0 8px; color:var(--ink); }
.warn-text { color:#a5622a; font-weight:700; }
.lot-badge { background:#1b432f; color:#fff; border-radius:10px; padding:16px 18px; display:grid; gap:4px; }
.lot-badge span, .lot-badge small { font-size:11px; color:#d3e2d4; }
.legacy h1 { font-size:26px; }
/* Trợ lý AI */
.ai-section { background:#1b3d2a; color:#fff; padding:80px 0; }
.ai-grid { display:grid; grid-template-columns:1fr 1.1fr; gap:50px; align-items:center; }
.ai-copy .eyebrow { color:#d5e68d; }
.ai-copy h2 { font-size:clamp(34px,4.6vw,56px); line-height:1.08; letter-spacing:-.05em; margin:16px 0; }
.ai-copy p { color:#dfe9da; line-height:1.8; }
.ai-feats { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:20px; }
.ai-feats a { border:1px solid rgba(255,255,255,.28); border-radius:12px; padding:18px; text-decoration:none; color:#fff; }
.ai-feats b { display:block; color:#d5e68d; margin-bottom:6px; }
.ai-feats span { font-size:13px; color:#dfe9da; }
.ai-card { background:var(--page); color:var(--text); border-radius:18px; padding:22px; }
.ai-card h1 { font-size:20px; margin:0 0 6px; }
.ai-card .card { box-shadow:none; }
/* Kiến thức */
.kchips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.kchip { font:inherit; font-size:13px; font-weight:700; padding:9px 16px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--text); cursor:pointer; }
.kchip.active { background:#1b432f; color:#fff; border-color:#1b432f; }
.article-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.article { display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; text-decoration:none; color:var(--ink); box-shadow:var(--shadow); transition:transform .15s, box-shadow .15s; }
.article[hidden] { display:none; }
.article:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); }
.article img { width:100%; aspect-ratio:16/8.5; object-fit:cover; display:block; }
.art-body { padding:22px; display:flex; flex-direction:column; gap:10px; flex:1; }
.art-body small { font-size:10.5px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:#406a42; }
.art-body strong { font-size:18px; line-height:1.4; letter-spacing:-.02em; }
.art-body span { font-size:13px; color:var(--muted); line-height:1.7; }
.art-body em { font-style:normal; font-weight:800; font-size:13px; margin-top:auto; }
/* Cộng đồng */
.comm-top { display:grid; grid-template-columns:1.6fr 1fr; gap:14px; }
.comm-hero { border-radius:22px; padding:40px; color:#fff; background:radial-gradient(80% 90% at 90% 20%, rgba(213,230,141,.18), transparent 60%), linear-gradient(135deg,#1b432f,#2c6a45); }
.comm-hero h2 { font-size:clamp(32px,4vw,48px); line-height:1.1; letter-spacing:-.04em; margin:18px 0; }
.comm-hero p { color:#dfe9da; max-width:52ch; }
.pill-dark { display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; background:rgba(255,255,255,.12); padding:7px 12px; border-radius:999px; }
.comm-stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.comm-stats div { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:20px; }
.comm-stats strong { display:block; font-size:30px; color:var(--ink); letter-spacing:-.03em; }
.comm-stats b { display:block; font-size:13.5px; margin:8px 0 6px; color:var(--ink); }
.comm-stats span { font-size:12px; color:var(--muted); }
.comm-tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:22px 0 0; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:6px; }
.comm-tabs a { display:flex; align-items:center; gap:14px; padding:14px 18px; border-radius:12px; text-decoration:none; color:var(--ink); }
.comm-tabs a.active { background:#1b432f; color:#fff; }
.comm-tabs i { font-style:normal; width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:var(--soft); color:var(--ink); font-size:12px; font-weight:800; }
.comm-tabs b { display:block; }
.comm-tabs small { font-size:12px; opacity:.8; }
.comm-panel { background:var(--surface); border:1px solid var(--line); border-radius:0 0 20px 20px; padding:28px; margin-top:10px; }
.comm-panel h1 { font-size:26px; }
/* Bảng giá theo nhóm */
.group-title { font-size:22px; margin:28px 0 10px; }
.price-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.price-grid .card { margin:0; }
.price-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.price-head h2 { margin:0; }
/* Dải hệ sinh thái cuối trang */
.ecostrip { background:var(--soft); border-top:1px solid var(--line); }
.ecostrip-in { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; padding:18px 0; }
.ecostrip span { font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }
.ecostrip b { color:var(--ink); font-size:15px; }
@media (max-width: 1000px) {
  .sector-grid, .principles { grid-template-columns:repeat(2,1fr); }
  .commodity-grid { grid-template-columns:repeat(3,1fr); }
  .dash-grid, .journal-grid, .calc-wrap, .about, .story-layout, .trace-grid, .ai-grid, .comm-top, .farm-grid, .article-grid { grid-template-columns:1fr; }
  .stat-row { grid-template-columns:repeat(2,1fr); }
  .stages { grid-template-columns:repeat(3,1fr); }
  .shortcuts { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  .sector-grid, .principles, .tri, .ai-feats, .calc-box, .two, .comm-stats { grid-template-columns:1fr; }
  .commodity-grid { grid-template-columns:repeat(2,1fr); }
  .pagehead-note, .industry-count { display:none; }
  .comm-tabs { grid-template-columns:1fr; }
  .comm-hero { padding:26px; }
  .ecostrip-in { justify-content:flex-start; }
}
.ai-copy h2, .comm-hero h2, .dash-card.dark h3, .story-main h3 { color:#fff; }
.comm-panel > p + a.btn:first-of-type { display:none; }

/* ---------- Màn hình chờ ---------- */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.boot { min-height:calc(100vh - 160px); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; animation:boot-in .3s ease both; }
.boot-mark { position:relative; width:112px; height:112px; display:grid; place-items:center; }
.boot-mark img { width:58px; height:auto; animation:boot-pulse 1.6s ease-in-out infinite; }
.boot-ring { position:absolute; inset:0; border-radius:50%; border:3px solid color-mix(in srgb, var(--leaf) 18%, transparent); border-top-color:var(--gold); border-right-color:var(--leaf); animation:spin 1.1s linear infinite; }
.boot-text { font-weight:800; font-size:17px; letter-spacing:-.01em; color:var(--ink); opacity:.85; }
.boot-text b { font-size:11px; background:var(--gold); color:#17251a; border-radius:999px; padding:2px 7px; vertical-align:2px; }
.spin { width:34px; height:34px; margin:28px auto; border-radius:50%; border:3px solid color-mix(in srgb, var(--leaf) 18%, transparent); border-top-color:var(--gold); border-right-color:var(--leaf); animation:spin .9s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes boot-pulse { 0%, 100% { transform:scale(1); opacity:1; } 50% { transform:scale(.9); opacity:.75; } }
@keyframes boot-in { from { opacity:0; } to { opacity:1; } }
@media (prefers-reduced-motion: reduce) { .boot-ring, .spin { animation-duration:2.5s; } .boot-mark img { animation:none; } }

/* ---------- Tài khoản, dữ liệu của tôi ---------- */
.pagehead-in { padding:26px 0 24px; }
.login-cta { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; background:color-mix(in srgb, var(--okbg) 65%, var(--surface)); border:1px solid var(--line); border-inline-start:4px solid var(--leaf); border-radius:14px; padding:18px 20px; margin:0 0 18px; }
.login-cta strong { display:block; color:var(--ink); }
.login-cta span { font-size:13.5px; color:var(--muted); }
.acc-wrap { display:grid; grid-template-columns:1fr 1fr; gap:40px; align-items:start; }
.acc-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; background:var(--soft); border-radius:12px; padding:4px; margin-bottom:18px; }
.acc-tab { font:inherit; font-weight:700; border:0; background:transparent; color:var(--text); padding:10px; border-radius:9px; cursor:pointer; }
.acc-tab.active { background:var(--surface); color:var(--ink); box-shadow:var(--shadow); }
.acc-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; align-items:start; }
.stat-link { text-decoration:none; color:inherit; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:20px; }
.stat-link:hover { box-shadow:var(--shadow-hover); }
.stat-link span { display:block; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.stat-link strong { display:block; font-size:22px; margin-top:10px; color:var(--ink); }
.my-list { display:grid; gap:14px; }
.my-list > details > summary { cursor:pointer; list-style:none; }
.farm-mine summary { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; align-items:center; }
.farm-mine summary small { display:block; color:var(--muted); font-size:13px; margin-top:4px; }
.farm-badges { display:flex; flex-wrap:wrap; gap:4px; }
.chip.lime { background:#ddf0b2; color:#1c3d26; }
.farm-form { margin-top:16px; }
.progress { height:8px; background:var(--soft); border-radius:999px; overflow:hidden; margin:10px 0 4px; }
.progress span { display:block; height:100%; background:linear-gradient(90deg, var(--leaf), var(--gold)); }
.task-list { list-style:none; padding:0; margin:10px 0; display:grid; gap:4px; }
.task-list li { display:flex; justify-content:space-between; gap:10px; align-items:center; border-top:1px solid var(--line); padding:6px 0; }
.task-list .done { text-decoration:line-through; color:var(--muted); }
.task-list small { color:var(--ok); font-size:11.5px; margin-inline-start:6px; }
.add-task { display:flex; gap:8px; margin:8px 0; }
.add-task input { flex:1; }
.sj-bar { display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; margin-bottom:18px; }
.sj-bar label { min-width:180px; }
.sj-season { display:flex; gap:6px; }
.balance-card.mini { margin-inline-start:auto; padding:14px 18px; min-width:220px; }
.balance-card.mini strong { font-size:22px; }
.balance-card.mini span:last-child { font-size:12px; }
@media (max-width: 1000px) { .acc-wrap, .acc-grid { grid-template-columns:1fr; } .balance-card.mini { margin-inline-start:0; } }

/* ---------- Dữ liệu mẫu, xem như vai trò ---------- */
.tag.seed { background:#ece4fb; color:#5b3fa0; }
.viewas-bar { position:sticky; top:0; z-index:40; display:flex; justify-content:center; align-items:center; gap:14px; flex-wrap:wrap; padding:8px 16px; background:#5b3fa0; color:#fff; font-size:13px; }
.viewas-bar button { font:inherit; font-weight:800; background:#fff; color:#5b3fa0; border:0; border-radius:8px; padding:6px 12px; cursor:pointer; }
.viewas-bar + .top { top:0; }
.viewas-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.viewas { display:flex; flex-direction:column; gap:6px; align-items:flex-start; border:1px solid var(--line); border-radius:12px; padding:14px; background:var(--surface); }
.inline-form { display:flex; gap:8px; flex-wrap:wrap; }
.inline-form input { min-width:240px; }

/* ======================================================================
   Theo bản gốc v39 (đo bằng ảnh chụp so sánh 24/11/2026) — ghi đè các luật phía trên.
   ====================================================================== */
:root { --page:#f9faf8; --line:#dee5d8; --soft:#f0f4ed; --text:#1c3022; --ink:#1c3022; --muted:#5f7361; }
:root[data-theme="dark"] { --page:#101c16; --line:#2f4537; --soft:#22362a; --text:#eaf1e8; --ink:#eaf1e8; --muted:#a9bcad; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --page:#101c16; --line:#2f4537; --soft:#22362a; --text:#eaf1e8; --ink:#eaf1e8; --muted:#a9bcad; } }
h1, h2, h3, h4 { line-height:1.2; }
b, strong { line-height:inherit; }

/* Nút */
.btn { font-size:13px; font-weight:800; padding:14px 23px; border-radius:8px; gap:12px; transition:transform .2s, filter .2s; }
.btn:hover { transform:translateY(-2px); }
.btn.small { padding:8px 13px; font-size:12px; }
.btn.btn-dark { box-shadow:0 8px 22px rgba(28,61,38,.16); }
.btn.btn-light, .btn.btn-outline { font-size:13px; padding:14px 23px; }
.top-tools .join-btn { font-size:12px; font-weight:800; padding:11px 15px; border-radius:12px; box-shadow:0 6px 16px rgba(28,61,38,.14); }
.theme-btn { font-size:11px; font-weight:800; padding:6px 9px 6px 11px; border-color:#c7d8c9; box-shadow:0 3px 10px rgba(28,61,38,.06); }

/* Header */
.topline { background:#163824; color:#e5f2da; font-size:11px; letter-spacing:.015em; }
.topline-in { padding:7px 0 6px; }
.logo-sym { width:52px; height:47px; }
.logo-text b { font-size:25px; }
.mainnav > a, .more summary { font-size:12px; padding:11px 12px; }
.mainnav > a.nav-feature { font-weight:850; background:#1d5132; border:1px solid #1d5132; box-shadow:0 6px 18px rgba(23,65,36,.14); }
.mainnav > a.nav-feature.active { background:var(--okbg); color:var(--ink); border-color:var(--line); }
.mainnav > a.nav-feature.active::after { background:var(--leaf); }
.more summary { font-weight:750; background:#f0f4ec; border-color:#dee8d9; border-radius:11px; }
.more-panel { min-width:255px; padding:10px; }
.more-title { display:block; font-size:10px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); padding:6px 12px 8px; }
.more-panel a { font-size:13px; font-weight:800; padding:12px; }
.more-panel a small { display:none; }

/* Dải tiêu đề trang con */
.pagehead-in { padding:20px 0 16px; }
.pagehead .eyebrow { font-size:10px; letter-spacing:.12em; color:#688464; }
.pagehead h1 { font-size:38px; letter-spacing:-.035em; line-height:1.15; margin:4px 0; }
.pagehead p { font-size:13px; color:#58715c; }
:root[data-theme="dark"] .pagehead .eyebrow, :root[data-theme="dark"] .pagehead p { color:var(--muted); }

/* Section */
.band { padding:92px 0; }
.band.cream { background:#f7f5ec; } .band.sage { background:#eff3ec; } .band.white { background:#ffffff; } .band.mist { background:#e8f0df; } .band.flat { background:var(--page); }
:root[data-theme="dark"] .band.cream, :root[data-theme="dark"] .band.sage, :root[data-theme="dark"] .band.white, :root[data-theme="dark"] .band.mist { background:var(--page); }
.band-head h2 { max-width:660px; line-height:1.12; letter-spacing:-.05em; margin:10px 0 24px; }
.band-head p { font-size:15px; line-height:1.8; max-width:660px; }
.band-head.split { display:grid; grid-template-columns:1fr 350px; align-items:end; gap:30px; }
.band-head.split > p { margin:0 0 30px; max-width:none; }
.band-head.split h2 { margin-bottom:0; }
@media (max-width: 900px) { .band-head.split { grid-template-columns:1fr; gap:12px; } .band-head.split > p { margin:0; } }
.eyebrow.plain::before, .band-head .eyebrow.plain::before { display:none; }

/* Form */
label { font-size:12px; font-weight:800; }
label.check { font-size:13px; font-weight:500; }
input, select, textarea { font-size:13px; padding:12px 13px; border-radius:8px; border-color:#d7ddd1; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { border-color:var(--line); }
.panel { border:0; box-shadow:0 5px 18px rgba(28,61,38,.055); padding:25px; border-radius:16px; }
.sum-row { background:#eef4ea; }
:root[data-theme="dark"] .sum-row { background:var(--soft); }
@media (max-width: 640px) { input, select, textarea { font-size:16px; } } /* tránh iOS phóng to khi gõ */

/* Footer */
.foot-brand { flex-direction:column; align-items:flex-start; gap:10px; }
.foot-brand img { width:67px; height:auto; }
.foot-brand .logo-text b { font-size:30px; }
.foot h4 { font-size:13px; }
.footgrid > div > a:not(.foot-brand) { font-size:12px; }
.foot p { font-size:12px; line-height:1.8; }
.ecostrip { background:#f0f4ed; }
.ecostrip-in { padding:25px 0; }
:root[data-theme="dark"] .ecostrip { background:var(--soft); }

/* Trang chủ */
.hero-copy { max-width:705px; }
.hero h1 { letter-spacing:-.065em; }
.hero-note { max-width:235px; }
.hero-note b { font-size:13px; } .hero-note span { font-size:11px; }
.pillar h3 { line-height:1.2; }
.band.shortcuts-band { padding:44px 0 54px; }
.shortcuts-band .band-head h2 { font-size:39px; font-weight:700; }
.shortcut { min-height:119px; }
.principle { grid-template-columns:410px 1fr; gap:60px; }
@media (max-width: 900px) { .principle { grid-template-columns:1fr; gap:28px; } .principle h2 { font-size:32px; } }
.principle h2 { font-size:42px; }
.principle-cards div { border:0; box-shadow:0 5px 18px rgba(28,61,38,.055); }
.band.principle-band { padding:78px 0; background:#e9eee4; }
.band.cta-band { padding:85px 0; background:#e8eee2; }
.cta h2 { font-size:clamp(34px,4.6vw,55px); font-weight:700; }
:root[data-theme="dark"] .band.principle-band, :root[data-theme="dark"] .band.cta-band { background:var(--soft); }

/* Nguyên tắc tái sinh */
.principles div { padding:30px 25px; border-radius:10px; border:0; box-shadow:0 5px 18px rgba(28,61,38,.055); min-height:240px; }
.principles h3 { font-size:19px; letter-spacing:-.035em; }
.principles p { font-size:12px; line-height:1.8; }

/* Câu chuyện nông trại */
.story-steps div { min-height:123px; }
.story-steps strong { font-size:16px; }
.story-main h3 { font-size:30px; letter-spacing:-.05em; max-width:400px; }

/* Bảng điều khiển cá nhân */
.stat-row div, .stat-row .stat-link { border:0; box-shadow:0 5px 18px rgba(28,61,38,.055); }
.stat-row span { letter-spacing:0; }

/* Kiến thức */
.kchip { font-size:12px; font-weight:800; }
.art-body strong { font-size:19px; letter-spacing:-.04em; }

/* Mã & Nguồn gốc */
.ico-box { width:44px; height:44px; }
.trace-grid .panel h3 { font-size:24px; letter-spacing:-.02em; }

/* Ô trống viền đứt (dùng chung) */
.empty-dashed { border:1px dashed #c9d5c2; border-radius:12px; background:#f4f6f0; padding:18px 20px; color:var(--muted); font-size:13px; }
:root[data-theme="dark"] .empty-dashed { background:var(--soft); border-color:var(--line); }
.farm-grid > .card:only-child, .farm-grid > .empty-dashed { grid-column:1/-1; }
.band.sand { background:#f1f1e7; }
:root[data-theme="dark"] .band.sand { background:var(--page); }

/* Tin tức & Giá: 2 khung */
.market-grid { display:grid; grid-template-columns:1.35fr 1fr; gap:20px; align-items:start; margin-bottom:14px; }
.market-panel { display:flex; flex-direction:column; gap:10px; background:var(--surface); }
.market-panel h3 { font-size:20px; margin:6px 0 0; }
.market-panel .ico-box { background:#1b432f; color:#d5e68d; border-radius:10px; }
.filters.compact { grid-template-columns:repeat(3,1fr); gap:10px; margin:6px 0; }
.news-list .story { box-shadow:none; border:0; border-top:1px solid var(--line); border-radius:0; margin:0; padding:16px 0; background:transparent; }
.news-list .story h2 { font-size:17px; }
.news-list .story-img img { max-height:190px; }
.price-mini { list-style:none; padding:0; margin:4px 0 6px; display:grid; gap:6px; }
.price-mini li { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; background:#f4f6f0; font-size:13px; font-weight:700; }
.price-mini em { margin-inline-start:auto; font-style:normal; font-weight:500; font-size:12px; color:var(--muted); }
.price-mini em.ok { color:var(--ok); font-weight:700; }
.brief-box { border:1px dashed #c9d5c2; border-radius:12px; padding:12px 14px; background:#f4f6f0; }
.brief-box summary { cursor:pointer; }
.brief-box .card { box-shadow:none; }
:root[data-theme="dark"] .price-mini li, :root[data-theme="dark"] .brief-box { background:var(--soft); border-color:var(--line); }

/* Cộng đồng */
.band.comm-band { padding:30px 0 92px; background:linear-gradient(180deg, #f3f6ef, var(--page)); }
:root[data-theme="dark"] .band.comm-band { background:var(--page); }
.comm-hero { position:relative; overflow:hidden; min-height:539px; display:flex; flex-direction:column; justify-content:center; border-radius:28px; padding:50px 44px; }
.comm-hero::before, .comm-hero::after { content:""; position:absolute; border-radius:50%; pointer-events:none; }
.comm-hero::before { width:520px; height:520px; right:-140px; top:-120px; background:repeating-radial-gradient(circle, rgba(255,255,255,.07) 0 1px, transparent 1px 46px); }
.comm-hero::after { width:300px; height:300px; right:40px; bottom:-150px; border:1px solid rgba(213,230,141,.25); }
.comm-hero > * { position:relative; z-index:1; }
.comm-hero h2 { font-size:clamp(36px,4.5vw,64.8px); font-weight:850; letter-spacing:-.06em; line-height:1.02; }
.comm-stats strong { font-size:44px; font-weight:800; color:#1d5132; }
:root[data-theme="dark"] .comm-stats strong { color:var(--lime); }
.comm-stats div { min-height:262px; display:flex; flex-direction:column; justify-content:flex-start; }
.comm-panel { border-radius:22px; padding:34px; box-shadow:0 5px 18px rgba(28,61,38,.055); border:0; }
.pill-soft { display:inline-block; font-size:12px; font-weight:800; background:#e6efe0; color:#1d5132; padding:8px 14px; border-radius:999px; }
.conn-title { font-size:clamp(26px,3vw,37px); letter-spacing:-.04em; margin:16px 0 8px; }
.conn-grid { display:grid; grid-template-columns:minmax(0,608px) 1fr; gap:22px; margin-top:24px; align-items:start; }
.conn-side { display:grid; gap:16px; }
.conn-grid .panel h3 { font-size:24px; letter-spacing:-.03em; margin:0 0 8px; }
fieldset.checks.tiles { border:0; padding:0; grid-template-columns:repeat(3,1fr); gap:8px; }
fieldset.checks.tiles legend { font-size:12px; font-weight:800; margin-bottom:8px; }
label.check.tile { border:1px solid var(--line); border-radius:12px; background:#f7f8f4; padding:10px 12px; margin:0; font-weight:700; }
label.check.tile:has(input:checked) { border-color:var(--leaf); background:var(--okbg); }
:root[data-theme="dark"] label.check.tile { background:var(--soft); }
.lead-list { padding-inline-start:18px; margin:0; display:grid; gap:8px; color:var(--muted); line-height:1.7; }
.num-steps { list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.num-steps li { display:flex; gap:14px; align-items:flex-start; border:1px solid var(--line); border-radius:12px; padding:14px; }
.num-steps b { flex:none; width:34px; height:34px; display:grid; place-items:center; border-radius:9px; background:#1b432f; color:#fff; }
.num-steps strong { display:block; font-size:14px; color:var(--ink); }
.num-steps span { font-size:12.5px; color:var(--muted); line-height:1.6; }
.dir-title { font-size:24px; margin:34px 0 6px; }
.dir-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.dir-grid > .card { margin:0; }
.dir-grid > .empty-dashed { grid-column:1/-1; }
#matchOut { margin-top:6px; }

/* Trợ lý AI: khung dạng ứng dụng chat */
.ai-grid { align-items:start; }
.ai-copy h2 { font-size:clamp(34px,4.2vw,52px); font-weight:800; }
.ai-card { padding:22px; border-radius:20px; display:flex; flex-direction:column; gap:12px; }
.ai-card > h1, .ai-card > p.muted { display:none; }
.ai-card-head { display:flex; gap:12px; align-items:center; border-bottom:1px solid var(--line); padding-bottom:14px; }
.ai-avatar { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:#e6efe0; color:#1d5132; font-size:20px; }
.ai-card-head strong { display:block; font-size:15px; color:var(--ink); }
.ai-card-head small { font-size:11px; color:var(--muted); display:flex; align-items:center; gap:6px; }
.ai-card .chat { border:0; box-shadow:none; background:transparent; padding:0; margin:0; min-height:240px; max-height:430px; overflow-y:auto; }
.ai-card .bubble.assistant { background:#e6efe0; }
.ai-card button.chip.ask-ex { font-size:12px; padding:6px 10px; margin:4px 4px 0 0; }
.ai-card .chat-form { border:0; box-shadow:none; padding:0; margin:0; display:grid; grid-template-columns:1fr auto; gap:8px; align-items:end; background:transparent; }
.ai-card .chat-form label { font-size:0; gap:0; }
.ai-card .chat-form textarea { font-size:14px; font-weight:500; min-height:46px; height:46px; resize:none; }
.ai-card .chat-form .actions { margin:0; flex-wrap:nowrap; }
.ai-card .chat-form button[type=submit] { width:46px; height:46px; padding:0; font-size:0; border-radius:10px; background:#1c3d26; }
.ai-card .chat-form button[type=submit]::after { content:"➤"; font-size:16px; color:#fff; }
.ai-card #chatClear { padding:8px 10px; font-size:11px; }
.ai-foot { font-size:10.5px; color:var(--muted); margin:0; }
:root[data-theme="dark"] .ai-card .bubble.assistant, :root[data-theme="dark"] .ai-avatar { background:var(--soft); color:var(--text); }
@media (max-width: 1000px) { .market-grid, .conn-grid, .dir-grid { grid-template-columns:1fr; } fieldset.checks.tiles { grid-template-columns:repeat(2,1fr); } .filters.compact { grid-template-columns:1fr; } .comm-hero { min-height:0; } }
.hero-copy { max-width:780px; }
.comm-hero .pill-dark { align-self:flex-start; }
.ecostrip b { display:inline-flex; align-items:center; gap:8px; }
.eco-ico { width:22px; height:22px; fill:none; stroke:var(--leaf); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; }

/* ===== Đa ngôn ngữ (i18n.js) ===== */
.i18n-pending .top, .i18n-pending .foot, .i18n-pending .ecostrip, .i18n-pending .dock { visibility:hidden; }
:root[lang="zh-Hans"] body { font-family:Manrope, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif; }
:root[lang="ja"] body { font-family:Manrope, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans CJK JP", "Noto Sans JP", system-ui, sans-serif; }
:root[lang="ar"] body { font-family:"Noto Sans Arabic", Manrope, Tahoma, system-ui, sans-serif; }
:root[lang="ar"] .eyebrow, :root[lang="ar"] .num { letter-spacing:0; }
.lang-pick { position:relative; }
.lang-pick summary { list-style:none; cursor:pointer; font-size:13px; font-weight:800; display:flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:999px; padding:8px 12px; white-space:nowrap; }
.lang-pick summary::-webkit-details-marker { display:none; }
.lang-panel { position:absolute; inset-inline-end:0; top:calc(100% + 6px); min-width:160px; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-hover); padding:6px; display:grid; z-index:50; }
.lang-panel button { font:inherit; font-size:14px; font-weight:700; text-align:start; background:none; border:0; color:var(--ink); padding:9px 12px; border-radius:10px; cursor:pointer; }
.lang-panel button:hover, .lang-panel button[aria-current] { background:var(--okbg); }
@media (max-width:640px) { .lang-pick summary { padding:7px 9px; } }
/* Ả Rập: viết phải sang trái */
[dir="rtl"] .theme-btn .switch::after { transform:none; }
[dir="rtl"]:root[data-theme="dark"] .theme-btn .switch::after { transform:translateX(-12px); }
@media (prefers-color-scheme: dark) { [dir="rtl"]:root:not([data-theme="light"]) .theme-btn .switch::after { transform:translateX(-12px); } }

/* ===== Header một hàng: logo · menu · ngôn ngữ / đăng nhập / sáng tối ===== */
.top .wrap.brandrow { width:min(1360px, calc(100% - 48px)); }
.brandrow { padding:10px 0; gap:14px; }
.brandrow .mainnav { flex:1; justify-content:center; gap:2px; min-width:0; }
.brandrow .mainnav > a, .brandrow .more summary { padding:10px 10px; }
.brandrow .mainnav > a.active::after { left:10px; right:10px; bottom:5px; }
.top-tools { gap:8px; flex:none; }
.top-tools .theme-label { display:none; }
.top-tools .theme-btn { padding:8px 9px; }
.logo-sym { width:46px; height:42px; }
.logo-text b { font-size:22px; }
@media (max-width: 1320px) { .brandrow .logo-text small { display:none; } }
@media (max-width: 1180px) { .brandrow .mainnav { justify-content:flex-start; } .brandrow .mainnav > a, .brandrow .more summary { padding:12px 14px; } .brandrow .logo-text small { display:block; } }
@media (max-width: 640px) { .brandrow .logo-text small { display:none; } }
.theme-btn { width:38px; height:38px; padding:0 !important; justify-content:center; font-size:17px; }
.theme-btn .switch, .theme-btn .theme-label { display:none; }
.theme-btn .ico-sun { display:none; }
:root[data-theme="dark"] .theme-btn .ico-sun { display:inline; } :root[data-theme="dark"] .theme-btn .ico-moon { display:none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .ico-sun { display:inline; } :root:not([data-theme="light"]) .theme-btn .ico-moon { display:none; } }
.lang-pick .globe { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; }
@media (max-width: 420px) { .brandrow { gap:8px; } .top-tools { gap:6px; } .logo { gap:7px; } .logo-sym { width:40px; height:36px; } .logo-text b { font-size:19px; } .lang-pick summary { padding:7px 8px; gap:4px; } .theme-btn { width:34px; height:34px; } }

/* ===== Bộ chọn ngày dùng chung (datepicker.js) ===== */
.dp-field { position:relative; display:block; width:100%; }
.dp-field .dp-text { width:100%; padding-inline-end:46px; font-variant-numeric:tabular-nums; cursor:pointer; }
.dp-btn { position:absolute; inset-inline-end:6px; top:50%; transform:translateY(-50%); width:34px; height:34px; display:grid; place-items:center; border:0; border-radius:10px; background:transparent; color:var(--leaf); cursor:pointer; padding:0; }
.dp-btn svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
.dp-btn:hover, .dp-field.open .dp-btn { background:var(--okbg); }
.dp-field.open .dp-text { border-color:var(--leaf); box-shadow:0 0 0 3px color-mix(in srgb, var(--leaf) 18%, transparent); }
.dp-pop { position:absolute; z-index:60; width:312px; background:var(--surface); color:var(--text); border:1px solid var(--line); border-radius:18px; box-shadow:0 18px 48px rgba(16,40,28,.18), 0 2px 6px rgba(16,40,28,.06); padding:14px 14px 12px; font-family:inherit; animation:dp-in .14s ease-out; }
@keyframes dp-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.dp-pop button { font-family:inherit; line-height:1.2; cursor:pointer; }
.dp-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.dp-title { display:flex; align-items:center; gap:6px; border:0; background:none; color:var(--ink); font-size:15px !important; font-weight:800; padding:6px 8px; border-radius:10px; text-transform:capitalize; }
.dp-title span { color:var(--muted); font-size:13px; }
.dp-title:hover { background:var(--okbg); }
.dp-nav { display:flex; gap:4px; }
.dp-arrow { width:34px; height:34px; display:grid; place-items:center; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:10px; padding:0; }
.dp-arrow:hover { background:var(--okbg); border-color:transparent; }
.dp-arrow svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
[dir="rtl"] .dp-arrow svg { transform:scaleX(-1); }
.dp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.dp-week { margin-bottom:4px; }
.dp-week span { text-align:center; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:6px 0; }
.dp-day { height:38px; border:0; border-radius:11px; background:none; color:var(--ink); font-size:14px !important; font-weight:600; font-variant-numeric:tabular-nums; position:relative; }
.dp-day:hover:not([disabled]) { background:var(--okbg); }
.dp-day.out { color:color-mix(in srgb, var(--muted) 55%, transparent); font-weight:500; }
.dp-day.today { color:var(--leaf); font-weight:800; box-shadow:inset 0 0 0 1.5px var(--leaf); }
.dp-day.sel, .dp-month.sel { background:var(--forest); color:var(--on-accent); font-weight:800; box-shadow:none; }
:root[data-theme="dark"] .dp-day.sel, :root[data-theme="dark"] .dp-month.sel { color:#132a1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dp-day.sel, :root:not([data-theme="light"]) .dp-month.sel { color:#132a1c; } }
.dp-day[disabled] { opacity:.3; cursor:not-allowed; }
.dp-day:focus-visible, .dp-month:focus-visible, .dp-arrow:focus-visible, .dp-title:focus-visible { outline:2px solid var(--leaf); outline-offset:1px; }
.dp-months { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding:4px 0 2px; }
.dp-month { height:46px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--ink); font-size:14px !important; font-weight:700; text-transform:capitalize; }
.dp-month:hover:not(.sel) { background:var(--okbg); border-color:transparent; }
.dp-foot { display:flex; justify-content:space-between; align-items:center; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.dp-link { border:0; background:none; color:var(--muted); font-size:13px !important; font-weight:700; padding:8px 10px; border-radius:10px; }
.dp-link:hover { color:var(--danger); background:color-mix(in srgb, var(--danger) 8%, transparent); }
.dp-today { border:0; background:var(--okbg); color:var(--leaf); font-size:13px !important; font-weight:800; padding:8px 14px; border-radius:999px; }
.dp-today:hover:not([disabled]) { background:var(--forest); color:var(--on-accent); }
.dp-today[disabled] { opacity:.4; cursor:not-allowed; }
/* Điện thoại: tấm trượt từ dưới lên */
.dp-backdrop { position:fixed; inset:0; z-index:59; background:rgba(10,25,18,.35); animation:dp-fade .15s; }
@keyframes dp-fade { from { opacity:0; } }
.dp-pop.sheet { position:fixed; left:0 !important; right:0; bottom:0; top:auto !important; width:auto; border-radius:22px 22px 0 0; padding:10px 18px calc(16px + env(safe-area-inset-bottom)); animation:dp-up .2s ease-out; }
.dp-pop.sheet::before { content:""; display:block; width:40px; height:4px; border-radius:4px; background:var(--line); margin:0 auto 12px; }
.dp-pop.sheet .dp-day { height:44px; font-size:15px !important; }
@keyframes dp-up { from { transform:translateY(100%); } to { transform:none; } }
@media (prefers-reduced-motion: reduce) { .dp-pop, .dp-pop.sheet, .dp-backdrop { animation:none; } }
:root[data-theme="dark"] .more summary { background:var(--soft); border-color:var(--line); color:var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .more summary { background:var(--soft); border-color:var(--line); color:var(--text); } }

/* ===== Góc nhìn theo vai trò (audience.js) ===== */
.aud-ico svg, .aud-switch svg, .aud-note svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.aud-pick { position:relative; }
.aud-pick summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:6px; white-space:nowrap; }
.aud-pick summary::-webkit-details-marker { display:none; }
.aud-pick summary::after { content:"⌄"; font-size:11px; opacity:.8; }
.aud-pick summary b { font-weight:800; }
.aud-pick.dark summary { color:#e5f2da; font-size:11.5px; padding:2px 10px; border:1px solid rgba(229,242,218,.28); border-radius:999px; }
.aud-pick.dark summary b { color:#d5e68d; }
.aud-pick.dark summary:hover { background:rgba(229,242,218,.1); }
.aud-panel { position:absolute; inset-inline-end:0; top:calc(100% + 8px); z-index:70; width:290px; background:var(--surface); color:var(--text); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-hover); padding:8px; display:grid; gap:2px; }
.aud-title { font-size:10px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); padding:6px 10px 6px; }
.aud-panel button { font:inherit; display:flex; align-items:center; gap:12px; text-align:start; border:0; background:none; color:var(--ink); padding:10px; border-radius:12px; cursor:pointer; }
.aud-panel button .aud-ico { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; background:var(--okbg); color:var(--leaf); }
.aud-panel button .aud-ico svg { width:19px; height:19px; }
.aud-panel button b { display:block; font-size:14px; font-weight:800; }
.aud-panel button small { display:block; font-size:12px; color:var(--muted); font-weight:500; }
.aud-panel button:hover { background:var(--okbg); }
.aud-panel button[aria-current] { background:var(--okbg); box-shadow:inset 0 0 0 1.5px var(--leaf); }
.aud-panel button[aria-current] .aud-ico { background:var(--forest); color:var(--on-accent); }
.aud-mobile { display:none; }
@media (max-width: 1180px) {
  .aud-mobile { display:block; padding:4px 0 10px; margin-bottom:6px; border-bottom:1px solid var(--line); }
  .aud-mobile .aud-pick summary { font-size:14px; color:var(--text); padding:10px 14px; border:1px solid var(--line); border-radius:12px; background:var(--soft); }
  .aud-mobile .aud-panel { position:static; width:auto; box-shadow:none; border:0; padding:6px 0 0; }
}
/* Trang chủ: chọn "Bạn là" */
.aud-switch { display:inline-flex; align-items:center; gap:4px; flex-wrap:wrap; padding:5px; margin-bottom:22px; border-radius:999px; background:rgba(10,30,20,.38); border:1px solid rgba(255,255,255,.18); backdrop-filter:blur(6px); }
.aud-switch > span { color:#e5f2da; font-size:12px; font-weight:700; padding:0 8px 0 10px; }
.aud-switch button { font:inherit; font-size:13px; font-weight:800; display:flex; align-items:center; gap:7px; border:0; border-radius:999px; padding:8px 14px; background:transparent; color:#f3f8ee; cursor:pointer; }
.aud-switch button:hover { background:rgba(255,255,255,.12); }
.aud-switch button[aria-pressed="true"] { background:#d5e68d; color:#132a1c; }
/* Đầu trang: gợi ý trang phù hợp hơn */
.aud-note { display:flex; align-items:flex-start; gap:10px; margin-top:16px; padding:11px 14px; border-radius:12px; background:var(--surface); border:1px dashed color-mix(in srgb, var(--leaf) 45%, var(--line)); font-size:13px; color:var(--muted); }
.aud-note > span { color:var(--leaf); padding-top:2px; }
.aud-note p { margin:0; }
.aud-note a { font-weight:800; color:var(--leaf); }
@media (max-width: 640px) { .aud-switch { margin-bottom:16px; } .aud-switch > span { display:none; } .aud-switch button { padding:7px 11px; font-size:12.5px; } }
.aud-switch { display:flex; width:fit-content; }
.aud-panel span:not(.aud-ico) { display:block; }
.topline-in .aud-panel .aud-ico { display:grid; }

/* ===== Trang chủ: "Bạn cần gì hôm nay?" ===== */
.band.hub-band { padding:0; background:transparent; position:relative; z-index:3; }
.hub { margin-top:-56px; background:var(--surface); border:1px solid var(--line); border-radius:22px; box-shadow:0 22px 60px rgba(16,40,28,.14); padding:26px 28px 22px; }
.hub-head { display:flex; justify-content:space-between; align-items:flex-end; gap:18px; flex-wrap:wrap; margin-bottom:18px; }
.hub-head h2 { margin:6px 0 0; font-size:28px; letter-spacing:-.03em; color:var(--ink); }
.hub-tabs { display:flex; gap:4px; padding:4px; background:var(--soft); border-radius:14px; flex-wrap:wrap; }
.hub-tabs button { font:inherit; font-size:13.5px; font-weight:800; border:0; background:none; color:var(--muted); padding:10px 16px; border-radius:11px; cursor:pointer; }
.hub-tabs button:hover { color:var(--ink); }
.hub-tabs button[aria-selected="true"] { background:var(--surface); color:var(--ink); box-shadow:0 2px 8px rgba(16,40,28,.1); }
.hub-form { display:grid; grid-template-columns:2fr 1.4fr 1fr 1fr auto; gap:12px; align-items:end; }
.hub-form label { display:grid; gap:6px; font-size:12px; font-weight:800; color:var(--ink); margin:0; }
.hub-form .hub-go { height:46px; white-space:nowrap; padding:0 22px; }
.hub-hint { grid-column:1 / -1; margin:2px 0 0; font-size:12.5px; color:var(--muted); }
.hub[data-intent="hoi"] .hub-deal, .hub[data-intent="gia"] .hub-deal { display:none; }
.hub[data-intent="ban"] .hub-q, .hub[data-intent="mua"] .hub-q, .hub[data-intent="gia"] .hub-q { display:none; }
.hub[data-intent="hoi"] .hub-form { grid-template-columns:3fr 1.4fr auto; }
.hub[data-intent="gia"] .hub-form { grid-template-columns:2fr auto; }
.hub[data-intent="ban"] .hub-form, .hub[data-intent="mua"] .hub-form { grid-template-columns:1.6fr 1.2fr 1fr 1fr auto; }
@media (max-width: 900px) {
  .hub { margin-top:-36px; padding:20px 18px; border-radius:18px; }
  .hub-form, .hub[data-intent] .hub-form { grid-template-columns:1fr 1fr; }
  .hub-form .hub-q, .hub-form .hub-go { grid-column:1 / -1; }
  .hub-tabs { width:100%; } .hub-tabs button { flex:1; padding:9px 8px; font-size:12.5px; }
}
@media (max-width: 520px) { .hub-form label:first-of-type, .hub-form label:nth-of-type(2) { grid-column:1 / -1; } .hub-form label:nth-of-type(5) { grid-column:1 / -1; } .hub-head h2 { font-size:24px; } .hub-tabs button { font-size:12px; } }

/* ===== Trang chủ: ba vai trò + dòng dữ liệu ===== */
.chain { display:grid; grid-template-columns:1fr auto 1fr auto 1fr; gap:12px; align-items:stretch; }
.chain-arrow { align-self:center; font-size:22px; color:var(--leaf); }
.chain-card { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:22px; display:flex; flex-direction:column; gap:12px; }
.chain-card.me { border-color:var(--leaf); box-shadow:0 0 0 2px color-mix(in srgb, var(--leaf) 25%, transparent), 0 12px 30px rgba(16,40,28,.08); }
.chain-top { display:flex; align-items:center; gap:10px; }
.chain-top b { font-size:18px; color:var(--ink); }
.chain-top em { margin-inline-start:auto; font-style:normal; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; background:var(--forest); color:var(--on-accent); padding:4px 9px; border-radius:999px; }
.chain-ico { width:38px; height:38px; display:grid; place-items:center; border-radius:11px; background:var(--okbg); color:var(--leaf); }
.chain-ico svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.chain-card dl { margin:0; display:grid; gap:4px; flex:1; }
.chain-card dt { font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-top:6px; }
.chain-card dd { margin:0; font-size:14px; line-height:1.6; color:var(--text); }
.chain-go { font:inherit; font-size:13px; font-weight:800; color:var(--leaf); background:none; border:0; padding:0; text-align:start; cursor:pointer; text-decoration:none; }
.flow { list-style:none; padding:0; margin:22px 0 0; display:grid; grid-template-columns:repeat(5,1fr); gap:0; counter-reset:f; }
.flow li a { display:flex; flex-direction:column; gap:2px; padding:16px 18px; text-decoration:none; border-top:3px solid var(--line); position:relative; }
.flow li a:hover { border-top-color:var(--leaf); }
.flow b { font-size:11px; color:var(--leaf); font-weight:800; letter-spacing:.1em; }
.flow strong { color:var(--ink); font-size:15px; }
.flow small { color:var(--muted); font-size:12.5px; }
@media (max-width: 900px) { .chain { grid-template-columns:1fr; } .chain-arrow { justify-self:center; transform:rotate(90deg); } .flow { grid-template-columns:1fr 1fr; } }
.kchips-who { margin-bottom:8px; }
.kchips-who .kchip.active { background:var(--forest); color:var(--on-accent); border-color:var(--forest); }
.hero:has(+ .hub-band) .hero-note { bottom:86px; } @media (max-width:900px) { .hero:has(+ .hub-band) { padding-bottom:70px; } }
.hub-form > * { min-width:0; } .hub-form select, .hub-form input { width:100%; min-width:0; box-sizing:border-box; }

/* ===== Trang đọc bài /kien-thuc/<slug> ===== */
.art-hero { position:relative; color:#fff; background:linear-gradient(0deg, rgba(14,36,25,.92), rgba(14,36,25,.55) 60%, rgba(14,36,25,.35)), var(--cover, url('/img/k-soil.jpg')) center/cover; }
.art-hero-in { padding:56px 0 46px; max-width:900px; margin-inline-start:max(24px, calc((100% - 1200px)/2)); }
.art-hero .eyebrow { color:#d5e68d; }
.art-hero h1 { font-size:clamp(30px,4.4vw,50px); line-height:1.08; letter-spacing:-.04em; margin:12px 0 14px; color:#fff; }
.art-hero p { font-size:17px; line-height:1.7; color:#e3ede0; max-width:720px; margin:0; }
.art-back { display:table; color:#e3ede0; font-size:13px; font-weight:700; text-decoration:none; margin-bottom:18px; }
.art-back:hover { color:#fff; }
.art-meta { display:flex; flex-wrap:wrap; gap:8px 18px; margin-top:20px; font-size:13px; color:#cfdcca; }
.art-meta b { color:#fff; }
.art-ai { background:rgba(213,230,141,.16); border:1px solid rgba(213,230,141,.4); color:#e8f2bd; padding:2px 10px; border-radius:999px; }
.art-grid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:48px; align-items:start; }
.art-body-md { font-size:17px; line-height:1.85; color:var(--text); max-width:720px; }
.art-body-md h2 { font-size:24px; letter-spacing:-.02em; margin:34px 0 10px; color:var(--ink); }
.art-body-md h3 { font-size:19px; margin:26px 0 8px; color:var(--ink); }
.art-body-md p { margin:0 0 16px; }
.art-body-md ul, .art-body-md ol { padding-inline-start:22px; margin:0 0 18px; display:grid; gap:6px; }
.art-body-md blockquote { margin:0 0 16px; padding:10px 16px; border-inline-start:4px solid var(--leaf); background:var(--okbg); border-radius:8px; }
.art-body-md a { color:var(--leaf); font-weight:700; }
.art-sources { margin-top:30px; padding-top:18px; border-top:1px solid var(--line); font-size:14px; }
.art-sources h3 { font-size:15px; margin:0 0 8px; }
.art-note { margin-top:26px; font-size:13px; color:var(--muted); background:var(--soft); border-radius:12px; padding:12px 14px; line-height:1.6; }
.art-side { position:sticky; top:110px; display:grid; gap:14px; }
.art-side .panel { padding:20px; }
.art-cta .btn { width:100%; justify-content:center; margin-top:10px; }
@media (max-width: 900px) { .art-grid { grid-template-columns:1fr; gap:24px; } .art-side { position:static; } .art-hero-in { padding:36px 0 32px; margin-inline:16px; } .art-body-md { font-size:16px; } }

/* ===== Quản trị → Bài viết ===== */
.art-adm-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.art-adm-head h2 { margin:6px 0 2px; }
.tag.st-published { background:var(--okbg); color:var(--ok); }
.tag.st-draft { background:var(--warnbg); color:var(--warn); }
.tag.st-hidden { background:var(--soft); color:var(--muted); }
.nowrap { white-space:nowrap; }
.ai-box { border:1px dashed color-mix(in srgb, var(--leaf) 50%, var(--line)); background:color-mix(in srgb, var(--okbg) 55%, var(--surface)); border-radius:14px; padding:12px 16px; margin:4px 0 14px; }
.ai-box summary { cursor:pointer; font-weight:800; color:var(--ink); }
.ai-box label { display:grid; gap:6px; margin-top:10px; font-weight:700; font-size:13px; }
.ai-notes ul { margin:6px 0 0; padding-inline-start:20px; }
.art-ed-grid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:24px; align-items:start; }
.art-preview { position:sticky; top:110px; max-height:calc(100vh - 130px); overflow:auto; border:1px solid var(--line); border-radius:14px; padding:18px 22px; background:var(--surface); }
.art-preview h1 { font-size:26px; line-height:1.15; margin:8px 0; color:var(--ink); }
.art-preview .lead { color:var(--muted); }
.art-preview .art-body-md { font-size:15px; }
.lbl { display:block; font-size:12px; font-weight:800; color:var(--ink); margin-bottom:6px; }
.md-input { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px !important; line-height:1.6; }
.slug-row { display:flex; align-items:center; gap:6px; }
.slug-row input { flex:1; }
.cover-box { margin:6px 0 14px; }
.cover-row { display:flex; gap:14px; align-items:flex-start; }
.cover-row img { width:180px; aspect-ratio:16/10; object-fit:cover; border-radius:10px; border:1px solid var(--line); flex:none; }
.cover-row .btn { margin:0 6px 6px 0; }
.media-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(110px,1fr)); gap:8px; margin-top:10px; max-height:280px; overflow:auto; }
.media-grid button { padding:0; border:2px solid transparent; border-radius:8px; overflow:hidden; cursor:pointer; background:none; }
.media-grid button:hover { border-color:var(--leaf); }
.media-grid img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; }
.src-row { display:grid; grid-template-columns:2fr 2fr 1fr auto; gap:6px; margin-bottom:6px; }
details.mini { margin:4px 0 10px; } details.mini summary { cursor:pointer; font-size:13px; font-weight:700; }
.spin-inline { display:inline-block; width:12px; height:12px; border:2px solid var(--line); border-top-color:var(--leaf); border-radius:50%; animation:spin 1s linear infinite; vertical-align:-2px; }
@media (max-width: 1000px) { .art-ed-grid { grid-template-columns:1fr; } .art-preview { position:static; max-height:none; } .src-row { grid-template-columns:1fr; } .cover-row { flex-direction:column; } }

/* ===== Mua bán /mua-ban (market.js) ===== */
.badge { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:#d8452f; color:#fff; font-size:11px; font-weight:800; line-height:1; vertical-align:1px; }
.mk-tabs { display:flex; gap:4px; padding:4px; background:var(--soft); border-radius:14px; width:fit-content; margin:0 0 20px; flex-wrap:wrap; }
.mk-tabs a { padding:10px 18px; border-radius:11px; font-weight:800; font-size:14px; color:var(--muted); text-decoration:none; }
.mk-tabs a[aria-selected="true"] { background:var(--surface); color:var(--ink); box-shadow:0 2px 8px rgba(16,40,28,.1); }
.mk-filter { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:18px; }
.mk-filter select { min-width:180px; }
.mk-filter .btn { margin-inline-start:auto; }
.seg { display:inline-flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.seg label { margin:0; cursor:pointer; }
.seg input { position:absolute; opacity:0; pointer-events:none; }
.seg span { display:block; padding:8px 14px; border-radius:9px; font-size:13px; font-weight:800; color:var(--muted); }
.seg input:checked + span { background:var(--forest); color:var(--on-accent); }
.seg input:focus-visible + span { outline:2px solid var(--leaf); }
.mk-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:14px; }
.mk-grid.small { grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); }
.mk-card { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:18px; display:flex; flex-direction:column; gap:10px; border-top:4px solid var(--leaf); }
.mk-card.buy { border-top-color:var(--gold); }
.mk-top { display:flex; gap:12px; align-items:flex-start; }
.mk-ico { width:40px; height:40px; flex:none; border-radius:10px; background:var(--okbg); padding:6px; }
.mk-top h3 { margin:4px 0 2px; font-size:18px; color:var(--ink); }
.mk-top p { margin:0; }
.mk-kind { font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; padding:3px 8px; border-radius:999px; background:var(--okbg); color:var(--ok); }
.mk-kind.buy { background:color-mix(in srgb, var(--gold) 22%, var(--surface)); color:var(--soil); }
.mk-note { margin:0; font-size:14px; color:var(--text); background:var(--soft); border-radius:10px; padding:8px 10px; }
.mk-farm { margin:0; font-size:13px; color:var(--leaf); font-weight:700; }
.mk-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:auto; padding-top:8px; border-top:1px dashed var(--line); flex-wrap:wrap; }
.mk-int { display:grid; gap:8px; padding-top:8px; border-top:1px solid var(--line); }
.mk-int label { display:grid; gap:4px; font-size:12px; font-weight:700; }
.mk-mine { display:grid; grid-template-columns:360px minmax(0,1fr); gap:22px; align-items:start; }
.mk-mine form { position:sticky; top:110px; }
#mkMine { display:grid; gap:14px; }
.mk-stats { display:flex; gap:14px; flex-wrap:wrap; font-size:13px; color:var(--muted); }
.mk-stats b { color:var(--ink); font-size:15px; }
.mk-matches:not(:empty) { border-top:1px solid var(--line); padding-top:12px; }
.mk-matches h4 { margin:6px 0 10px; font-size:14px; }
.mk-members { margin:0 0 6px; padding-inline-start:18px; display:grid; gap:8px; font-size:14px; }
.mk-intcols { display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.mk-intcols h3 { margin:0 0 10px; }
.mk-intitem { display:flex; justify-content:space-between; gap:12px; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin-bottom:10px; flex-wrap:wrap; }
.mk-intitem.pending { border-color:color-mix(in srgb, var(--gold) 60%, var(--line)); }
.mk-intitem.accepted { border-color:var(--leaf); }
.mk-intitem p { margin:4px 0; }
.mk-contact { margin-top:6px; font-weight:800; color:var(--leaf); }
.tag.ok { background:var(--okbg); color:var(--ok); } .tag.warn { background:var(--warnbg); color:var(--warn); }
@media (max-width: 900px) { .mk-mine, .mk-intcols { grid-template-columns:1fr; } .mk-mine form { position:static; } .mk-filter select { min-width:0; flex:1; } .mk-filter .btn { margin-inline-start:0; } }

/* ===== Khu quản trị riêng (/quan-tri/<mục>) ===== */
.admin-mode .top, .admin-mode .foot, .admin-mode .ecostrip, .admin-mode .dock { display:none !important; }
.admin-mode body { background:#f3f5f1; }
:root.admin-mode[data-theme="dark"] body { background:var(--page); }
.admin-mode #app { padding:0; width:100%; max-width:none; }
.adm { display:grid; grid-template-columns:250px minmax(0,1fr); min-height:100vh; }
.adm-side { position:sticky; top:0; height:100vh; overflow-y:auto; background:#132a1c; color:#d9e7d6; display:flex; flex-direction:column; padding:18px 14px; gap:14px; }
.adm-brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; padding:4px 8px 12px; border-bottom:1px solid rgba(255,255,255,.08); }
.adm-brand span { font-size:13px; color:#a9c3a6; } .adm-brand b { display:block; font-size:18px; color:#fff; }
.adm-nav { display:flex; flex-direction:column; gap:2px; flex:1; }
.adm-group { font-size:10.5px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:#7f9a83; padding:14px 10px 6px; }
.adm-nav a { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; color:#d9e7d6; text-decoration:none; font-size:14px; font-weight:700; }
.adm-nav a span { width:20px; text-align:center; opacity:.9; }
.adm-nav a:hover { background:rgba(255,255,255,.07); color:#fff; }
.adm-nav a[aria-current="page"] { background:#d5e68d; color:#132a1c; }
.adm-user { display:grid; gap:8px; font-size:13px; padding:12px 8px 4px; border-top:1px solid rgba(255,255,255,.08); }
.adm-user em { font-style:normal; font-size:10px; font-weight:800; background:#d5e68d; color:#132a1c; padding:1px 6px; border-radius:6px; }
.adm-user a { color:#a9c3a6; text-decoration:none; } .adm-user a:hover { color:#fff; }
.adm-user .btn { justify-self:start; color:#d9e7d6; border-color:rgba(255,255,255,.25); background:transparent; }
.adm-main { padding:28px 36px 60px; min-width:0; }
.adm-head { margin-bottom:18px; }
.adm-head h1 { font-size:28px; letter-spacing:-.03em; margin:0 0 4px; color:var(--ink); }
.adm-head p { margin:0; color:var(--muted); }
.adm-auth { min-height:100vh; display:grid; place-content:center; justify-items:center; gap:18px; padding:24px; }
.adm-auth .adm-brand { border:0; color:var(--ink); } .adm-auth .adm-brand b { color:var(--ink); } .adm-auth .adm-brand span { color:var(--muted); }
.adm-auth form { width:min(420px, calc(100vw - 32px)); }
.adm-auth h1 { font-size:22px; margin:0 0 6px; }
.adm-back { color:var(--muted); font-size:13px; }
@media (max-width: 900px) {
  .adm { grid-template-columns:1fr; }
  .adm-side { position:sticky; top:0; z-index:20; height:auto; flex-direction:row; align-items:center; padding:8px 10px; gap:8px; overflow-x:auto; }
  .adm-brand { border:0; padding:0 6px 0 0; flex:none; } .adm-brand span { display:none; }
  .adm-nav { flex-direction:row; gap:4px; flex:none; } .adm-group { display:none; }
  .adm-nav a { white-space:nowrap; padding:8px 10px; font-size:13px; }
  .adm-user { display:flex; border:0; padding:0; flex:none; white-space:nowrap; } .adm-user > span, .adm-user a { display:none; }
  .adm-main { padding:18px 14px 40px; }
}
