/*
Theme Name: VDSC Add-in Docs
Theme URI: https://vdsc.com.vn
Author: Trung tam Du lieu (TTDL) - Chung khoan Rong Viet
Author URI: https://vdsc.com.vn
Description: Theme tai lieu (Documentation) phong cach Mintlify cho website huong dan su dung VDSC Add-in. Su dung bo nhan dien thuong hieu Rong Viet: xanh la #01A54E, xanh dam #01823C, vang #DCAB27, do #ED342E, font Segoe UI.
Version: 1.23.1
Requires at least: 5.9
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vdsc-addin-docs
Tags: documentation, two-columns, custom-menu, sticky-post
*/

:root {
  --green: #01a54e;
  --green-dark: #01823c;
  --green-soft: rgba(1, 165, 78, 0.1);
  --green-softer: rgba(1, 165, 78, 0.06);
  --gold: #dcab27;
  --red: #ed342e;

  /* Vàng dùng cho CHỮ. Brand gold #dcab27 trên nền trắng chỉ đạt contrast 2.12:1
     (AA cần 4.5:1 cho text nhỏ) → light mode dùng tông đậm hơn (5.07:1);
     dark mode dùng đúng brand gold (8.87:1 trên nền tối). */
  --gold-text: #8a6a00;
  /* Màu accent cho H2: light #01823c (4.93:1) — xem html.dark cho bản sáng hơn. */
  --heading-accent: var(--green-dark);

  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-panel: #ffffff;
  --border: #e5e7eb;
  --border-soft: #eef1f4;
  --text: #1e293b;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);

  --topbar-h: 64px;
  --tabbar-h: 46px; /* Navigation bar dưới topbar (mọi calc() offset đã tính biến này) */
  --sidebar-w: 280px;
  --toc-w: 220px;
  --content-max: 46rem;
  --radius: 12px;
  --radius-lg: 16px;

  --font: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
}

html.dark {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --bg-panel: #101827;
  --border: #1f2b3e;
  --border-soft: #182236;
  --text: #cbd5e1;
  --text-strong: #f1f5f9;
  --text-muted: #8fa1b8;
  --text-faint: #64748b;
  --green-soft: rgba(1, 165, 78, 0.16);
  --green-softer: rgba(1, 165, 78, 0.09);
  --gold-text: #dcab27;        /* brand gold, 8.87:1 trên nền tối */
  --heading-accent: #35d183;   /* xanh sáng, 9.50:1 trên nền tối */
  --code-bg: #0a0f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.45);
  /* Nền tối: bóng ít tác dụng → viền sáng mép rất nhẹ, glare ngả xanh lạnh. */
  --edge-hi: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --glare: rgba(160, 210, 255, 0.16);
}

/* ============ Token bổ sung (E-0 · P-4 · P-14) ============ */
:root {
  /* Nhịp chuyển động chung — mọi hiệu ứng mới dùng các token này. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);   /* enter — nảy nhẹ */
  --ease-in: cubic-bezier(0.55, 0, 0.55, 0.2);  /* exit */
  --dur-1: 150ms;   /* hover / press */
  --dur-2: 250ms;   /* mở/đóng thành phần nhỏ */
  --dur-3: 450ms;   /* entrance khối lớn */

  /* Accent 4 nhóm Ribbon — CHỈ dùng cho nền/viền/vòng sáng, KHÔNG dùng làm
     màu chữ nhỏ (chữ vẫn đi qua các token đã cân AA). Publish = phương án A
     (indigo "gửi đi") vì brand chỉ có 3 màu cho 4 nhóm. */
  --acc-product: var(--green);
  --acc-data: var(--gold);
  --acc-publish: #4f6bd8;
  --acc-help: var(--red);

  /* Chiều sâu (D-1·D-2·D-4): viền sáng mép trên (một nguồn sáng từ trên) +
     vệt specular chạy theo con trỏ. KHÔNG dùng cho màu chữ — chỉ nền/bóng. */
  --edge-hi: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --glare: rgba(255, 255, 255, 0.55);

  /* Win11 có cắt "Display" nét hơn ở cỡ lớn; máy khác fallback Segoe UI. */
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;

  /* Cho phép transition tới block-size:auto (accordion mở mượt — E-7). */
  interpolate-size: allow-keywords;
}

* { box-sizing: border-box; }
/* Chỉ cuộn mượt khi người dùng KHÔNG bật "giảm chuyển động" (WCAG 2.3.3). */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Hyperlink: vàng mặc định → xanh khi hover.
   Dùng token --gold-text / --heading-accent (đã cân contrast AA cho cả 2 chế độ);
   KHÔNG dùng --gold trực tiếp (#dcab27 trên nền trắng chỉ 2.12:1).
   Sidebar / TOC / tabbar / .card / .sm-item tự đặt màu riêng nên không ảnh hưởng. */
a { color: var(--gold-text); text-decoration: none; }
a:hover { color: var(--heading-accent); }

/* Skip-link: phần tử focus ĐẦU TIÊN của trang — Tab một phát là nhảy được
   qua ~25 mục điều hướng xuống thẳng nội dung (WCAG 2.4.1 Bypass Blocks). */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 300;
  transform: translateY(-220%);
  padding: 10px 18px; border-radius: 10px;
  background: var(--green-dark); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { transform: none; color: #fff; outline: 2px solid var(--green); outline-offset: 2px; }
/* Đích của skip-link (main tabindex="-1") không cần vòng focus riêng. */
main.content:focus { outline: none; }

/* Icon ngoại-link inline (thay ký tự ↗ — wp-emoji đã bị tắt). */
.ext-ic { vertical-align: -1px; margin-left: 1px; }

/* Khóa cuộn nền khi mở modal / sidebar mobile. */
body.no-scroll { overflow: hidden; }

/* Bôi đen văn bản mang màu brand (P-9). */
::selection { background: rgba(1, 165, 78, 0.22); }
html.dark ::selection { background: rgba(53, 209, 131, 0.30); }

/* Thanh cuộn mảnh đúng màu hệ thống cho các vùng cuộn phụ (P-9). */
.sm-results, .toc, .codeblock pre, .table-wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ============ Topbar ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  transition: box-shadow var(--dur-2) ease;
}
/* Thanh tiến độ đọc 3 màu cờ Rồng Việt (P-3) — scaleX theo --scroll-p do JS set.
   Scroll-linked (không tự chạy) nên không cần gate reduced-motion. */
.topbar::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2.5px; width: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold) 38%, var(--green) 75%);
  transform: scaleX(var(--scroll-p, 0)); transform-origin: 0 50%;
  pointer-events: none;
}
/* Đổ bóng khi bắt đầu cuộn (E-5): nội dung "chui xuống dưới" thanh. */
.topbar.scrolled { box-shadow: 0 4px 18px -8px rgba(15, 23, 42, 0.12); }
html.dark .topbar.scrolled { box-shadow: 0 4px 18px -6px rgba(0, 0, 0, 0.5); }
.topbar .brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* Logo nền trong suốt, KHÔNG bọc nền trắng ở dark mode: các màu trong logo đều
   đủ tương phản trên nền tối (đỏ 4.60:1 · xanh 5.82:1 · vàng 8.87:1). */
.topbar .brand img { height: 34px; width: auto; display: block; }
.topbar .brand .divider { width: 1px; height: 22px; background: var(--border); }
.topbar .brand .product-name { font-weight: 600; color: var(--text-strong); font-size: 15px; white-space: nowrap; }
.topbar .brand .product-name .badge {
  margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--green-dark);
  background: var(--green-soft); border-radius: 999px; padding: 2px 8px; vertical-align: 2px;
}
html.dark .topbar .brand .product-name .badge { color: #35d183; }

/* Searchbar là <button> thật (không phải div role=button): Enter/Space mở
   được modal miễn phí — đường vào tìm kiếm chính không được chặn bàn phím. */
.searchbar {
  flex: 1; max-width: 420px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 8px 0 12px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-faint);
  font-family: var(--font); font-size: 14px; text-align: left;
  cursor: pointer; transition: border-color 0.15s;
}
.searchbar:hover { border-color: var(--green); }
.searchbar:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-color: var(--green); }
.searchbar svg { flex-shrink: 0; }
.searchbar .searchbar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchbar .kbd { flex-shrink: 0; }
.kbd {
  font-family: var(--font); font-size: 11px; color: var(--text-muted);
  background: var(--bg-panel); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}

.topbar .actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }
.topbar .actions .link { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.topbar .actions .link:hover { color: var(--text-strong); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  /* 44×44 = chuẩn touch target tối thiểu (Apple HIG / Material) — topbar 64px đủ chỗ.
     flex-shrink:0: không cho flexbox bóp nhỏ nút khi topbar chật (menu-btn từng bị
     bóp còn 32px trên mobile vì thiếu dòng này). */
  flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-muted);
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--border); color: var(--text-strong); }
.icon-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* Nút kính lúp thay thế searchbar trên màn hẹp — desktop ẩn. */
.search-btn-mobile { display: none; }
html.dark .theme-toggle .sun { display: inline; }
html.dark .theme-toggle .moon { display: none; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline; }

/* ============ Navigation bar ============ */
.tabbar {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 55;
  height: var(--tabbar-h);
  display: flex; align-items: stretch; justify-content: flex-start; gap: 26px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  /* KHÔNG dùng overflow-x:auto ở đây — sẽ cắt mất .nav-dropdown (xổ ra ngoài tabbar). */
  overflow: visible;
}
.tabbar .nav-item { position: relative; display: flex; align-items: stretch; }
.tabbar .nav-link {
  position: relative; display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
/* Hover → chữ đen đậm (--text-strong; dark mode tự thành gần-trắng). */
.tabbar .nav-link:hover,
.tabbar .nav-item:focus-within > .nav-link { color: var(--text-strong); }
/* Trang đang xem vẫn giữ dấu xanh để phân biệt với hover. */
.tabbar .nav-link.active { color: var(--heading-accent); border-bottom-color: var(--green); }

/* Dropdown nội dung bên trong mỗi trang */
.tabbar .nav-dropdown {
  position: absolute; top: 100%; left: -14px; z-index: 70;
  min-width: 232px; padding: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}
.tabbar .nav-item:hover > .nav-dropdown,
.tabbar .nav-item:focus-within > .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.tabbar .nav-dropdown a {
  display: block; padding: 7px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  color: var(--text-muted);
}
.tabbar .nav-dropdown a:hover,
.tabbar .nav-dropdown a:focus-visible {
  color: var(--heading-accent); background: var(--green-softer);
}

/* ============ Layout ============ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
  max-width: 1440px; margin: 0 auto;
  padding-top: calc(var(--topbar-h) + var(--tabbar-h));
}

/* ============ Sidebar ============ */
.sidebar {
  position: sticky; top: calc(var(--topbar-h) + var(--tabbar-h));
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h));
  overflow-y: auto; padding: 28px 16px 48px 24px;
  border-right: 1px solid var(--border-soft);
  scrollbar-width: none; /* ẩn thanh cuộn (vẫn cuộn được) */
}
.sidebar::-webkit-scrollbar { display: none; }

/* Nhóm dropdown: nút tiêu đề + mũi tên xổ xuống bên phải */
.sidebar .group + .group { margin-top: 10px; }
.sidebar .group-title {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-strong); text-align: left;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  padding: 8px 10px; margin: 0;
}
.sidebar .group-title:hover { background: var(--bg-soft); }
/* Section Header kiêm link tới trang (nhóm chỉ có 1 trang → không cần dropdown). */
.sidebar a.group-link { text-decoration: none; border-left: 0; }
.sidebar a.group-link.active { color: var(--green-dark); background: var(--green-softer); }
html.dark .sidebar a.group-link.active { color: #35d183; }
.sidebar .group-title .chev { margin-left: auto; flex-shrink: 0; color: var(--text-faint); transition: transform 0.2s ease; }
.sidebar .group.open .group-title .chev { transform: rotate(180deg); }
.sidebar .group-body { display: none; padding-top: 2px; }
.sidebar .group.open .group-body { display: block; }
.sidebar a {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; margin: 1px 0;
  font-size: 14px; color: var(--text-muted);
  border-radius: 8px; border-left: 2px solid transparent;
}
.sidebar a:hover { color: var(--text-strong); background: var(--bg-soft); }
.sidebar a.active {
  color: var(--green-dark); font-weight: 600; background: var(--green-softer);
}
html.dark .sidebar a.active { color: #35d183; }
.sidebar a.sub { padding-left: 26px; font-size: 13.5px; }
.sidebar a img.nav-ic { width: 17px; height: 17px; object-fit: contain; }
.sidebar a .ext { margin-left: auto; opacity: 0.5; font-size: 12px; }

/* ============ Content ============ */
.content { padding: 44px 48px 80px; min-width: 0; }
.content-inner { max-width: var(--content-max); margin: 0 auto; }

.breadcrumb { font-size: 13.5px; font-weight: 600; color: var(--green); margin-bottom: 10px; }

/* Hero title: gradient xanh đậm → xanh nhạt → vàng nhạt (color là fallback) */
h1 {
  font-family: var(--font-display);
  font-size: 34px; line-height: 1.25; font-weight: 700;
  color: var(--green-dark); margin: 0 0 10px; padding-bottom: 0.08em; letter-spacing: -0.01em;
  background-image: linear-gradient(92deg, #014f28 0%, #01823c 30%, #01a54e 58%, #3ecf82 80%, #dfb94e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
}
html.dark h1 {
  background-image: linear-gradient(92deg, #1ca35c 0%, #2fc477 40%, #6fe3a5 72%, #f0d488 100%);
}
.lead { font-size: 17px; color: var(--text-muted); margin: 0 0 32px; }

[id] { scroll-margin-top: calc(var(--topbar-h) + var(--tabbar-h) + 20px); }

h2 {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 700; color: var(--heading-accent);
  margin: 52px 0 14px; padding-top: 8px; letter-spacing: -0.01em;
}
h3 {
  font-size: 18px; font-weight: 650; color: var(--text-strong); margin: 36px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + var(--tabbar-h) + 20px);
}
h4 { font-size: 15.5px; font-weight: 650; color: var(--text-strong); margin: 24px 0 8px; }

p { margin: 0 0 14px; }
ul, ol { padding-left: 24px; margin: 0 0 14px; }
li { margin: 4px 0; }
strong { color: var(--text-strong); }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 40px 0; }

code:not(pre code) {
  font-family: var(--mono); font-size: 0.85em;
  color: var(--green-dark); background: var(--green-softer);
  border: 1px solid color-mix(in srgb, var(--green) 18%, transparent);
  border-radius: 6px; padding: 1.5px 6px;
}
html.dark code:not(pre code) { color: #35d183; }

/* Code block */
.codeblock {
  border-radius: var(--radius); overflow: hidden; margin: 18px 0 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.codeblock .cb-head {
  display: flex; align-items: center; gap: 8px;
  background: #1e293b; color: #94a3b8;
  font-size: 12.5px; font-family: var(--mono);
  padding: 9px 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.codeblock .cb-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.codeblock pre {
  margin: 0; padding: 16px 18px; background: var(--code-bg);
  color: var(--code-text); font-family: var(--mono);
  font-size: 13.5px; line-height: 1.7; overflow-x: auto;
}
.codeblock .cm { color: #64748b; }
.codeblock .hl { color: #4ade80; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); }
/* tabular-nums: số thẳng cột — site tài chính nên có (P-8). */
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th {
  text-align: left; font-weight: 650; color: var(--text-strong);
  background: var(--bg-soft); padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
/* Dòng đang đọc được "soi đèn" nhẹ (P-8). */
tbody tr { transition: background var(--dur-1) ease; }
tbody tr:hover td { background: var(--green-softer); }

/* ============ Callouts ============ */
/* Callout: đã bỏ icon chú thích (💡 ⚠ ✕) — phân biệt loại bằng nền + viền trái đậm. */
.callout {
  display: flex; gap: 12px; padding: 14px 16px; margin: 18px 0 24px;
  border: 1px solid; border-left-width: 3px;
  border-radius: var(--radius); font-size: 14.5px;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout.info    { background: var(--green-softer); border-color: color-mix(in srgb, var(--green) 25%, transparent); border-left-color: var(--green); }
.callout.warn    { background: rgba(220, 171, 39, 0.09); border-color: rgba(220, 171, 39, 0.4); border-left-color: var(--gold); }
.callout.danger  { background: rgba(237, 52, 46, 0.07); border-color: rgba(237, 52, 46, 0.35); border-left-color: var(--red); }

/* ============ Download box (Hướng dẫn · Bước 1) ============ */
.dl-box {
  margin: 14px 0 4px; padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
  background: var(--green-softer); border-radius: var(--radius);
}
.dl-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--green-dark); margin-bottom: 10px;
}
html.dark .dl-label { color: #35d183; }
.dl-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: 10px;
  color: #fff !important; background: var(--green-dark); font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dl-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff !important; }
.dl-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.dl-btn svg { flex: 0 0 auto; }
.dl-btn .dl-size { font-weight: 500; font-size: 13px; opacity: 0.82; }
.dl-note { font-size: 13px; color: var(--text-muted); margin: 11px 0 0; }
.dl-note code { font-size: 0.92em; }

/* ============ Cards ============ */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 28px; }
.cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  display: block; padding: 20px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--bg-panel);
  color: inherit; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.card:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.card .card-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--green-soft); margin-bottom: 12px; font-size: 19px;
}
.card .card-ico img { width: 22px; height: 22px; object-fit: contain; }
.card h3, .card h4 { margin: 0 0 6px; font-size: 15.5px; }
.card p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

/* ============ Steps (Mintlify style) ============ */
.steps { margin: 22px 0 30px; }
.step { display: flex; gap: 16px; position: relative; padding-bottom: 26px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px;
  width: 1.5px; background: var(--border);
}
.step:last-child::before { display: none; }
.step .num {
  flex-shrink: 0; width: 29px; height: 29px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-soft); color: var(--green-dark);
  font-size: 13.5px; font-weight: 700; z-index: 1;
}
html.dark .step .num { color: #35d183; }
.step .step-body { min-width: 0; padding-top: 3px; }
.step .step-body h4 { margin: 0 0 6px; font-size: 15.5px; }
.step .step-body p { font-size: 14.5px; color: var(--text-muted); margin-bottom: 8px; }
.step .step-body p:last-child { margin-bottom: 0; }

/* ============ Timeline (Bắt đầu từ đâu?) ============
   Timeline thay vì flip-card: nội dung luôn hiển thị, không giấu sau hover
   (flip-card hỏng trên thiết bị cảm ứng và với trình đọc màn hình). */
.timeline {
  list-style: none; margin: 24px 0 28px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.timeline .tl-step { position: relative; padding-top: 46px; margin: 0; }
/* Đường nối ngang chạy qua tâm các node */
.timeline .tl-step::before {
  content: ""; position: absolute; top: 17px; left: 0; right: 0;
  height: 2px; background: var(--border);
}
.timeline .tl-step:first-child::before { left: 50%; border-radius: 2px 0 0 2px; }
.timeline .tl-step:last-child::before { right: 50%; border-radius: 0 2px 2px 0; }
.timeline .tl-node {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  /* Nền --green-dark chứ không phải --green: chữ số trắng trên #01A54E chỉ đạt
     contrast 3.23:1 (text nhỏ cần 4.5:1); #01823C đạt 4.93:1. */
  color: #fff; background: var(--green-dark);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--green-soft);
}
.timeline .tl-card {
  height: 100%; padding: 16px 18px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-panel);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.timeline .tl-step:hover .tl-card {
  border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-2px);
}
.timeline .tl-tag {
  display: inline-block; margin-bottom: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--heading-accent); background: var(--green-softer);
  border-radius: 999px; padding: 3px 9px;
}
.timeline .tl-card h4 { margin: 0 0 6px; font-size: 15.5px; }
.timeline .tl-card p { margin: 0 0 8px; font-size: 14px; color: var(--text-muted); }
.timeline .tl-card p:last-child { margin-bottom: 0; }
.timeline .tl-card a { font-weight: 600; }

@media (max-width: 900px) {
  /* Dọc: node bên trái, đường nối chạy dưới node */
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline .tl-step { padding: 0 0 22px 52px; }
  .timeline .tl-step:last-child { padding-bottom: 0; }
  .timeline .tl-step::before {
    top: 36px; bottom: 0; left: 17px; right: auto; width: 2px; height: auto;
  }
  .timeline .tl-step:first-child::before { left: 17px; }
  .timeline .tl-step:last-child::before { display: none; }
  .timeline .tl-node { top: 0; left: 0; transform: none; }
}

/* ===== Zigzag steps — "Bật add-in trong Excel" (Cài đặt VDSC · Bước 2) =====
   Thẻ so le trái/phải, số lớn ở mép ngoài, icon + chữ. Màu xanh lá theo brand. */
.zigzag { list-style: none; margin: 22px 0 28px; padding: 0; }
.zz-step { display: flex; align-items: stretch; margin-bottom: 20px; }
.zz-step:last-child { margin-bottom: 0; }
.zz-step:nth-child(odd) { padding-left: 14%; }
.zz-step:nth-child(even) { flex-direction: row-reverse; padding-right: 14%; }
.zz-card {
  flex: 1; display: flex; align-items: center; gap: 18px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 22px; padding: 16px 22px;
  box-shadow: 0 18px 34px -22px color-mix(in srgb, var(--c2) 55%, transparent), var(--shadow);
}
.zz-step:nth-child(even) .zz-card { flex-direction: row-reverse; text-align: right; }
.zz-num {
  flex: 0 0 84px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: #fff;
  border-radius: 20px; background: linear-gradient(135deg, var(--c), var(--c2));
}
.zz-ico { flex: 0 0 auto; width: 46px; height: 46px; color: var(--heading-accent); }
.zz-ico svg { width: 100%; height: 100%; display: block; }
.zz-body { flex: 1; min-width: 0; }
.zz-label {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--heading-accent);
}
.zz-body h4 { margin: 3px 0 5px; font-size: 16px; }
.zz-body p { margin: 0; font-size: 14px; color: var(--text-muted); }
@media (max-width: 760px) {
  .zz-step, .zz-step:nth-child(odd), .zz-step:nth-child(even) {
    flex-direction: row; padding-left: 0; padding-right: 0;
  }
  .zz-step:nth-child(even) .zz-card { flex-direction: row; text-align: left; }
  .zz-num { flex-basis: 58px; font-size: 26px; border-radius: 16px; }
  .zz-card { gap: 12px; padding: 14px 16px; }
}

/* ============ D-1 · Tilt thẻ theo con trỏ + vệt sáng + tách lớp thị sai ============
   Class .tilt3d + phần tử .tilt-glare do JS gắn (bindTilt) — chỉ trên thiết bị
   trỏ chính xác (hover:hover + pointer:fine) và khi KHÔNG bật giảm chuyển động.
   Thẻ nghiêng ≤8° theo vị trí chuột; icon/tiêu đề/mô tả tách 3 lớp translateZ. */
@media (hover: hover) and (pointer: fine) {
  @media (prefers-reduced-motion: no-preference) {
    .tilt3d {
      --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%;
      --tilt-t: perspective(950px) rotateX(var(--rx)) rotateY(var(--ry));
      position: relative;
      transform: var(--tilt-t);
      transform-style: preserve-3d;
      transition: box-shadow 0.25s ease;
    }
    /* Rê chuột: bám TỨC THÌ. Đè transition:transform sẵn có của .card/.tl-card
       (specificity cao hơn .tilt3d) để tilt không bị trễ 150ms theo con trỏ. */
    .card.tilt3d, .timeline .tl-card.tilt3d, .zigzag .zz-card.tilt3d {
      transition: box-shadow 0.25s ease;
    }
    /* Khi buông chuột: thả về phẳng mượt. */
    .tilt3d.tilt-ease,
    .card.tilt3d.tilt-ease, .timeline .tl-card.tilt3d.tilt-ease, .zigzag .zz-card.tilt3d.tilt-ease {
      transition: transform 0.5s var(--ease-out), box-shadow 0.3s ease;
    }
    .tilt3d.tilt-on { box-shadow: var(--shadow-lg), var(--edge-hi); }
    /* Ghi đè các transform hover phẳng sẵn có (specificity cao hơn) để tilt thắng. */
    a.card.tilt3d, a.card.tilt3d:hover,
    .timeline .tl-card.tilt3d, .timeline .tl-step:hover .tl-card.tilt3d,
    .zigzag .zz-card.tilt3d { transform: var(--tilt-t); }

    .tilt-glare {
      position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
      background: radial-gradient(360px 240px at var(--gx) var(--gy), var(--glare), transparent 62%);
      opacity: 0; transition: opacity 0.25s ease; z-index: 1;
    }
    .tilt3d.tilt-on .tilt-glare { opacity: 1; }

    /* Tách lớp thị sai — icon nổi nhất, mô tả gần mặt phẳng nhất. */
    .card.tilt3d .card-ico { transform: translateZ(26px); }
    .card.tilt3d h3, .card.tilt3d h4 { transform: translateZ(18px); }
    .card.tilt3d p { transform: translateZ(10px); }
    .timeline .tl-card.tilt3d .tl-tag { transform: translateZ(24px); }
    .timeline .tl-card.tilt3d h4 { transform: translateZ(18px); }
    .timeline .tl-card.tilt3d p, .timeline .tl-card.tilt3d a { transform: translateZ(10px); }
    .zigzag .zz-card.tilt3d .zz-num { transform: translateZ(30px); }
    .zigzag .zz-card.tilt3d .zz-ico { transform: translateZ(24px); }
    .zigzag .zz-card.tilt3d .zz-body { transform-style: preserve-3d; } /* để h4/p (cháu) tách lớp */
    .zigzag .zz-card.tilt3d .zz-body h4 { transform: translateZ(16px); }
    .zigzag .zz-card.tilt3d .zz-body p { transform: translateZ(8px); }
  }
}

/* ===== Flow line — "Hướng dẫn thao tác" (timeline ngang 5 bước) =====
   5 nút tròn trên một đường ngang + tiêu đề & mô tả ngắn bên dưới. Dọc ở mobile. */
.flowline {
  list-style: none; margin: 24px 0 26px; padding: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 14px;
}
.fl-step { position: relative; padding-top: 60px; text-align: center; }
.fl-step::before {
  content: ""; position: absolute; top: 25px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
}
.fl-step:first-child::before { left: 50%; }
.fl-step:last-child::before { right: 50%; }
.fl-node {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; background: var(--green-dark);
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 7px var(--green-soft);
}
.fl-title { margin: 0 0 5px; font-size: 14.5px; font-weight: 700; color: var(--text-strong); }
.fl-desc { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.fl-desc a { font-weight: 600; }
@media (max-width: 820px) {
  .flowline { display: block; }
  .fl-step { padding: 0 0 22px 64px; text-align: left; }
  .fl-step:last-child { padding-bottom: 0; }
  .fl-step::before {
    top: 50px; bottom: 0; left: 24px; right: auto; width: 3px; height: auto;
    background: linear-gradient(180deg, var(--green-dark), var(--green));
  }
  .fl-step:first-child::before { left: 24px; }
  .fl-step:last-child::before { display: none; }
  .fl-node { top: 0; left: 0; transform: none; }
}

/* ============ Deck thẻ chồng (Cách hoạt động — 3 bước) ============
   Thẻ Bước 1 nằm trên, Bước 2–3 xếp chồng phía sau. Bấm/nhấn "Lật sang bước tiếp"
   để thẻ trên bay đi, thẻ kế tiếp trồi lên. Toàn bộ nội dung 3 thẻ nằm trong DOM
   thật nên trình đọc màn hình đọc được đủ, không phụ thuộc vào việc đã lật hay chưa.

   Progressive enhancement: mặc định (JS chưa chạy / bị chặn) 3 thẻ xếp DỌC như
   card thường — đọc đủ cả 3 bước, không chồng đè; JS gắn class .deck--ready mới
   bật chế độ chồng thẻ + nút lật. */
.deck { margin: 24px 0 28px; }
.deck-stack { display: grid; gap: 16px; }
.deck-card {
  display: flex; flex-direction: column; overflow: hidden;
  padding: 16px 18px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-panel);
}
.deck:not(.deck--ready) .deck-nav { display: none; }
/* D-2: stack nhận phối cảnh; chiều cao = thẻ CAO NHẤT (JS đo, set --deck-card-h)
   + 64px chừa dải thò của thẻ sau → bỏ magic-number 586/522, hết cuộn-trong-thẻ. */
.deck--ready .deck-stack {
  display: block; position: relative; perspective: 1150px;
  height: calc(var(--deck-card-h, 560px) + 64px);
}
.deck--ready .deck-card {
  position: absolute; top: 0; left: 0; right: 0; height: var(--deck-card-h, 560px);
  transform-origin: top center;
  transition: transform 0.5s var(--ease-out), opacity 0.34s ease, box-shadow 0.3s ease, filter 0.4s ease;
  will-change: transform;
}
/* Tắt transition tạm thời khi cần "dịch chuyển tức thì" (animation nút Trước). */
.deck-card.no-anim { transition: none !important; }
/* Thẻ trên cùng */
.deck-card[data-pos="0"] { transform: translateZ(0); z-index: 3; box-shadow: var(--shadow-lg), var(--edge-hi); cursor: pointer; }
.deck-card[data-pos="0"]:hover { border-color: var(--green); }
/* Các thẻ sau LÙI theo trục sâu (translateZ) + ngửa nhẹ (rotateX) + tối dần
   (filter brightness — như bị thẻ trước che sáng). Từ thẻ thứ 3 (pos ≥ 2) dùng
   chung một mức lùi để deck 4–5 thẻ vẫn gọn "3 lớp sâu". */
.deck-card[data-pos="1"] { transform: translateY(40px) translateZ(-64px) rotateX(5deg); z-index: 2; box-shadow: var(--shadow); filter: brightness(0.955) saturate(0.94); }
.deck-card[data-pos="2"],
.deck-card[data-pos="3"],
.deck-card[data-pos="4"] { transform: translateY(80px) translateZ(-128px) rotateX(7deg); z-index: 1; box-shadow: var(--shadow); filter: brightness(0.9) saturate(0.88); }
.deck-card[data-pos="1"] > *,
.deck-card[data-pos="2"] > *,
.deck-card[data-pos="3"] > *,
.deck-card[data-pos="4"] > * { opacity: 0.32; }
.deck-card[data-pos="1"],
.deck-card[data-pos="2"],
.deck-card[data-pos="3"],
.deck-card[data-pos="4"] { pointer-events: none; }
/* Thẻ đang bay đi */
/* Thẻ rời deck bay theo CUNG XOAY (rotateY) thay vì trượt phẳng. */
.deck-card.leaving { transform: translateX(-108%) translateZ(60px) rotateY(-16deg) rotateZ(-3deg); opacity: 0; z-index: 4; }

.dc-step {
  align-self: flex-start; margin-bottom: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff; background: var(--green-dark);
  border-radius: 999px; padding: 3px 10px;
}
.dc-img {
  margin-bottom: 12px; border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; background: var(--bg-soft);
  height: 190px; flex-shrink: 0;
}
.dc-img img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }

/* Dải 3 hộp thoại (Bước 2) — mỗi ảnh kèm chú thích 1/3 · 2/3 · 3/3 */
.dc-shots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px; flex-shrink: 0;
}
.dc-shots figure { margin: 0; }
.dc-shots img {
  display: block; width: 100%; height: 168px;
  object-fit: contain; object-position: top center;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--bg-soft);
}
.dc-shots figcaption {
  margin-top: 5px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
}

/* D-2: height khớp thẻ cao nhất → nội dung vừa khít, không cần cuộn-trong-thẻ. */
.dc-body { min-height: 0; }
.dc-body h4 { margin: 0 0 6px; font-size: 16px; }
.dc-body p { margin: 0 0 8px; font-size: 14px; color: var(--text-muted); }
.dc-body p:last-child { margin-bottom: 0; }
/* Câu "làm gì ngay" — đậm hơn phần diễn giải */
.dc-body .dc-do { color: var(--text-strong); font-weight: 500; }
.dc-body .dc-note { font-size: 13px; }
.dc-body .dc-steps {
  margin: 0 0 8px; padding-left: 20px;
  font-size: 14px; color: var(--text-strong);
}
.dc-body .dc-steps li { margin: 3px 0; }

.deck-nav { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
/* Desktop: thanh điều khiển nằm TRONG đáy thẻ trên cùng (yêu cầu chủ site 1.23.1)
   — neo tuyệt đối vào .deck; đáy stack 586 − đáy thẻ 522 + đệm 14 = 78px,
   thẻ chừa sẵn padding-bottom để nội dung không chui dưới nút. Mobile giữ
   nav dưới stack như cũ (thẻ hẹp, nút primary full-width). */
@media (min-width: 901px) {
  .deck--ready { position: relative; }
  .deck--ready .deck-nav {
    position: absolute; left: 18px; right: 18px; bottom: 78px;
    margin-top: 0; z-index: 5;
  }
  .deck--ready .deck-card { padding-bottom: 66px; }
}
.deck-status { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.deck-btn {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: var(--text-strong); background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.deck-btn:hover { border-color: var(--green); background: var(--green-softer); }
.deck-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.deck-btn-primary { margin-left: auto; color: #fff; background: var(--green-dark); border-color: var(--green-dark); }
.deck-btn-primary:hover { background: var(--green); border-color: var(--green); color: #fff; }

@media (max-width: 900px) {
  /* Chiều cao do JS đo lại theo bề rộng hiện tại (không còn magic-number). */
  .dc-img { height: 150px; }
  /* Giữ 3 cột (xếp dọc sẽ tràn chiều cao thẻ và che mất phần chữ), chỉ thu nhỏ ảnh */
  .dc-shots img { height: 120px; }
  .dc-shots figcaption { font-size: 10.5px; }
  .deck-nav { flex-wrap: wrap; }
  .deck-btn-primary { margin-left: 0; width: 100%; }
}
/* Tắt hiệu ứng chuyển động: đổi thẻ tức thì, không bay/xoay. */
@media (prefers-reduced-motion: reduce) {
  .deck--ready .deck-card { transition: none; }
  .deck-card.leaving { transform: none; opacity: 0; }
}

/* Screenshot frame */
.screenshot {
  margin: 14px 0 6px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: #1a1a1a;
}
.screenshot img { display: block; width: 100%; height: auto; }
/* Chú thích ảnh — vàng để nhấn (dùng --gold-text, đã cân contrast cho 2 chế độ). */
.screenshot-caption { font-size: 12.5px; font-weight: 600; color: var(--gold-text); margin: 6px 2px 16px; }
.screenshot-caption strong { color: inherit; }
/* Cặp ảnh hộp thoại cạnh nhau (dùng ở Ribbon Query) — desktop 2 cột, mobile 1 cột */
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.shot-pair > div { min-width: 0; }
@media (max-width: 700px) { .shot-pair { grid-template-columns: 1fr; gap: 4px; } }

/* ============ Feature/ribbon section ============ */
.ribbon-head { display: flex; align-items: center; gap: 14px; margin: 0 0 4px; }
.ribbon-head h2 { margin: 0; }
.ribbon-head .ribbon-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 20%, transparent);
}
.ribbon-head .ribbon-ico img { width: 26px; height: 26px; object-fit: contain; }
/* Chip nhóm Ribbon — mỗi nhóm một màu qua MODIFIER CLASS dùng token đã cân
   contrast, KHÔNG inline style (inline từng làm chip rớt xuống 1.95:1 và phá
   cơ chế dark mode). Chữ nhỏ 11.5px → mọi biến thể phải đạt ≥4.5:1. */
.group-chip {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em;
  /* #01703a chứ không phải --green-dark: trên nền --green-soft (pha 10% xanh)
     #01823C chỉ đạt 4.4:1 — tông đậm hơn này đạt 5.5:1. */
  text-transform: uppercase; color: #01703a;
  background: var(--green-soft); border-radius: 999px; padding: 3px 10px; margin-bottom: 6px;
}
html.dark .group-chip { color: #35d183; }
.group-chip--data { background: rgba(220, 171, 39, 0.12); color: var(--gold-text); } /* 4.7:1 light · 8.5:1 dark */
html.dark .group-chip--data { background: rgba(220, 171, 39, 0.14); }
.group-chip--help { background: rgba(237, 52, 46, 0.08); color: #c22823; }           /* 5.2:1 trên nền hồng nhạt */
html.dark .group-chip--help { background: rgba(237, 52, 46, 0.14); color: #ff7b76; } /* ~7:1 trên nền tối */
.group-chip--publish { background: rgba(79, 107, 216, 0.10); color: #3d55b8; }       /* 5.8:1 trên nền tím nhạt */
html.dark .group-chip--publish { background: rgba(79, 107, 216, 0.18); color: #9db1f5; } /* ~7:1 trên nền tối */

/* Accordion (product detail) */
details.acc {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0 0 10px; background: var(--bg-panel); overflow: hidden;
}
details.acc summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; font-weight: 600; font-size: 14.5px; color: var(--text-strong);
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary .chev { margin-left: auto; transition: transform 0.2s; color: var(--text-faint); }
details.acc[open] summary .chev { transform: rotate(90deg); }
details.acc summary .tag {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
/* Nút chép liên kết tới đúng mục (JS chèn vào summary của details[id]) —
   để TTDL gửi được link thẳng tới một sản phẩm khi hỗ trợ qua Teams. */
details.acc summary .acc-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-left: auto; flex-shrink: 0;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--text-faint); transition: color 0.15s, background 0.15s;
}
details.acc summary .acc-link:hover { color: var(--green-dark); background: var(--green-softer); }
html.dark details.acc summary .acc-link:hover { color: #35d183; }
details.acc summary .acc-link:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
details.acc summary .acc-link.copied { color: var(--green-dark); }
html.dark details.acc summary .acc-link.copied { color: #35d183; }
/* Có nút copy đứng trước thì chevron thôi tự đẩy về mép phải. */
details.acc summary .acc-link + .chev { margin-left: 0; }

/* Anchor hiện khi hover heading (P-7) — chuẩn docs GitHub/MDN, cùng hành vi
   với nút copy của accordion (JS chèn cho h2/h3 có id hoặc trong section[id]). */
.hx-anchor {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: 6px; vertical-align: -3px;
  border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--text-faint); opacity: 0;
  transition: opacity var(--dur-1) ease, color var(--dur-1) ease, background var(--dur-1) ease;
}
h1:hover .hx-anchor, h2:hover .hx-anchor, h3:hover .hx-anchor,
.hx-anchor:focus-visible { opacity: 1; }
.hx-anchor:hover { color: var(--green-dark); background: var(--green-softer); }
html.dark .hx-anchor:hover { color: #35d183; }
.hx-anchor:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.hx-anchor.copied { color: var(--green-dark); opacity: 1; }
html.dark .hx-anchor.copied { color: #35d183; }
/* Cảm ứng không có hover → hiện mờ thường trực. */
@media (hover: none) { .hx-anchor { opacity: 0.5; } }
details.acc .acc-body { padding: 2px 16px 14px; font-size: 14px; border-top: 1px solid var(--border-soft); }
details.acc .acc-body p { margin: 10px 0; }
details.acc .kv { margin: 10px 0; }
details.acc .kv .k { font-weight: 650; color: var(--text-strong); }

/* ============ Ribbon section (trang Tính năng) ============
   Mỗi Ribbon là MỘT panel độc lập — ranh giới nhìn thấy được thay cho dòng
   chảy liền mạch + <hr> giữa các nhóm. id đặt trên <section> nên deep-link
   (#excel-template…) trỏ vào trọn panel và [id]{scroll-margin-top} vẫn áp dụng. */
.ribbon-section {
  --sec-acc: var(--acc-product);
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  padding: 22px 24px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}
/* D-4: vạch accent nhóm → DẢI ĐÈN tỏa sáng nhẹ xuống panel (drop-shadow cùng màu). */
.ribbon-section::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 3px;
  border-radius: 0 0 6px 6px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--sec-acc) 20%, var(--sec-acc) 80%, transparent);
  filter: drop-shadow(0 3px 7px color-mix(in srgb, var(--sec-acc) 55%, transparent));
}
.ribbon-section--data { --sec-acc: var(--acc-data); }
.ribbon-section--publish { --sec-acc: var(--acc-publish); }
.ribbon-section--help { --sec-acc: var(--acc-help); }
/* D-4: ô icon nhóm = "gạch men" bevel 2 chiều (sáng mép trên · bóng trong mép dưới
   · glow màu nhóm), nhuộm nhẹ theo --sec-acc. */
.ribbon-section .ribbon-ico {
  background: linear-gradient(160deg, color-mix(in srgb, var(--sec-acc) 20%, var(--bg-panel)), color-mix(in srgb, var(--sec-acc) 6%, var(--bg-panel)));
  border-color: color-mix(in srgb, var(--sec-acc) 34%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5),
              inset 0 -3px 6px color-mix(in srgb, var(--sec-acc) 16%, transparent),
              0 3px 8px -4px color-mix(in srgb, var(--sec-acc) 45%, transparent);
}
html.dark .ribbon-section .ribbon-ico {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1),
              inset 0 -3px 6px rgba(0, 0, 0, 0.4),
              0 3px 10px -4px color-mix(in srgb, var(--sec-acc) 50%, transparent);
}
/* Cả panel nâng 1 bậc cao độ khi hover (chỉ bóng, KHÔNG transform — để không
   đụng animation scroll-rise D-6 đang chạy trên chính section này). */
@media (hover: hover) and (pointer: fine) {
  .ribbon-section:hover { box-shadow: var(--shadow-lg); }
}
.ribbon-section > :last-child { margin-bottom: 0; }
/* h2 trong panel đã có .ribbon-head căn giữa hàng — chỉ nắn nhịp dọc nội bộ. */
.ribbon-section .ribbon-head { margin-top: 2px; }
.ribbon-section h3 { margin-top: 28px; }
/* Tách lớp hộp con trong panel (P-5): light lùi về xám nhạt, MỞ ra thì "sáng đèn";
   dark lùi về nền tối hơn panel (đối xứng hai chế độ). */
.ribbon-section details.acc { background: var(--bg-soft); border-color: var(--border-soft); }
.ribbon-section details.acc[open] { background: var(--bg-panel); border-color: var(--border); }
html.dark .ribbon-section details.acc { background: var(--bg); border-color: var(--border-soft); }
html.dark .ribbon-section details.acc[open] { background: var(--bg-panel); border-color: var(--border); }
@media (max-width: 900px) {
  .ribbon-section { padding: 18px 16px; margin: 22px 0; }
}

/* Chấm màu chú giải (trang trí). Ý nghĩa luôn diễn đạt bằng chữ đi kèm —
   không dùng riêng màu chữ để truyền tải thông tin (contrast của màu brand
   trên nền sáng không đạt AA cho body text). */
.dot {
  display: inline-block; width: 0.62em; height: 0.62em; border-radius: 50%;
  margin-right: 1px; vertical-align: baseline;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}
.dot-red { background: var(--red); }
.dot-green { background: var(--green); }

/* ============ Right TOC ============ */
.toc {
  position: sticky; top: calc(var(--topbar-h) + var(--tabbar-h));
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h));
  overflow-y: auto; padding: 28px 24px 48px 8px; /* padding-top khớp sidebar để 2 bên đối xứng */
  font-size: 13px; scrollbar-width: thin;
}
.toc .toc-title {
  display: flex; align-items: center; gap: 7px;
  font-weight: 700; color: var(--text-strong); font-size: 12.5px; margin-bottom: 10px;
}
.toc a {
  display: block; color: var(--text-muted); padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border-soft);
}
.toc a:hover { color: var(--text-strong); }
.toc a.active { color: var(--green); border-left-color: var(--green); font-weight: 600; }
.toc a.depth-3 { padding-left: 26px; }

.footer {
  border-top: 1px solid var(--border-soft); margin-top: 56px; padding-top: 24px;
  font-size: 13px; color: var(--text-faint);
  display: flex; flex-direction: column; gap: 14px;
}
/* Toàn bộ nội dung footer căn lề trái, xếp dọc. */
.footer .footer-top {
  display: flex; flex-direction: column; align-items: flex-start;
  justify-content: flex-start; gap: 12px;
}
.footer .footer-contact {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--text-muted); text-align: left;
}
.footer .footer-copy { color: var(--text-faint); text-align: left; }
/* Version in ở footer = cách rẻ nhất để phát hiện live lệch source (soi cùng ?ver= của asset). */
.footer .footer-version { color: var(--text-faint); font-size: 12px; }
.footer img { height: 26px; width: auto; }

/* ============ Hero (home) ============
   Giao diện tối giản theo quyết định chủ site (1.23.1): KHÔNG CTA/stat band/
   khung ảnh/glow nền ở hero — chỉ eyebrow + H1 + lead + marquee. */
.hero { padding: 26px 0 8px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--green-dark);
  background: var(--green-softer); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
  border-radius: 999px; padding: 5px 14px; margin-bottom: 18px;
}
html.dark .hero .eyebrow { color: #35d183; }
/* line-height & padding-bottom đủ rộng: gradient background-clip:text KHÔNG cắt đuôi chữ
   có descender (g/y/p) + dấu nặng ở dòng cuối. Xưa để 1.15 → cắt "g" trong "trong". */
.hero h1 { font-size: 42px; line-height: 1.2; margin-bottom: 16px; padding-bottom: 0.12em; }
.hero .lead { font-size: 18px; max-width: 40rem; }

/* --- Hero stagger khi tải trang (E-3) — CSS thuần, no-JS vẫn chạy, không FOUC. --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hero-in { from { opacity: 0; transform: translateY(14px); } }
  .hero > * { animation: hero-in var(--dur-3) var(--ease-out) backwards; }
  .hero h1 { animation-delay: 0.06s; }
  .hero .lead { animation-delay: 0.12s; }
  .hero .hero-marquee { animation-delay: 0.18s; }
}

/* ============ Hero Marquee (home) — dải icon Ribbon chạy ngang liên tục ============
   Không còn focal/panel/dots: icon cuộn vô hạn (render 2 lượt trong front-page.php để ghép
   liền mạch tại translateX(-50%)). Tự cuộn bằng CSS; dừng khi hover/focus; reduced-motion →
   đứng yên (giữ animation object). 2 mũi tên (data-hc-prev/next) nhảy currentTime đúng 1 icon
   qua app.js — bước nhảy tính ĐỘNG theo số icon trong DOM, thêm/bớt icon không phải sửa JS.
   Mỗi icon là <a> tới trang Tính năng; hover/focus dùng chung MÀU XANH brand. */
.hero-marquee { margin: 30px 0 14px; }
.hc-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px;
}

/* --- Hàng: [mũi tên] [dải icon] [mũi tên] --- */
.hc-row { display: flex; align-items: center; gap: 6px; }
/* Mũi tên KHÔNG vòng bao — chỉ chevron; hover đổi xanh brand + phóng nhẹ */
.hc-arrow {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; cursor: pointer; /* 44×44 chuẩn touch target */
  color: var(--text-muted); background: none; border: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.hc-arrow:hover { color: var(--green-dark); transform: scale(1.14); }
html.dark .hc-arrow:hover { color: #35d183; }
.hc-arrow:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.hc-arrow:active { transform: scale(0.92); }
.hc-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--green-dark); background: var(--green-softer);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  border-radius: 999px; padding: 4px 12px;
}
html.dark .hc-kicker { color: #35d183; }

/* --- Viewport: cửa sổ cắt + mờ dần 2 mép --- */
.hc-viewport {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
/* --- Track: hàng ngang cuộn vô hạn (2 lượt icon → -50% là liền mạch) --- */
.hc-track {
  display: flex; width: max-content;
  animation: hc-marquee 46s linear infinite;
}
.hc-viewport:hover .hc-track,
.hc-viewport:focus-within .hc-track { animation-play-state: paused; }
@keyframes hc-marquee { to { transform: translateX(-50%); } }

/* --- Item = link thật (margin-right đều → 2 lượt ghép khít ở -50%) --- */
.hc-item {
  flex: 0 0 auto; width: 118px; margin-right: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text-strong);
  /* D-5: trục sâu cho badge — perspective ở CHÍNH item (không đụng track cuộn). */
  perspective: 600px;
}
.hc-badge {
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%;
  background: var(--bg-panel); border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.hc-badge img { width: 46px; height: 46px; object-fit: contain; }
.hc-item-name {
  font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; white-space: nowrap;
  color: var(--text-muted); transition: color 0.25s ease;
}
/* Hover / focus: nổi lên + vòng sáng + tên — dùng chung MÀU XANH brand */
.hc-item:hover .hc-badge,
.hc-item:focus-visible .hc-badge {
  /* D-5: nổi lên + NGỬA nhẹ theo trục sâu (rotateX) + phóng nhẹ — như đồng xu bật ra. */
  transform: translateY(-5px) rotateX(10deg) scale(1.03); border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft), 0 10px 22px rgba(15, 23, 42, 0.16), var(--edge-hi);
}
/* Vòng badge nhuộm theo nhóm (P-4): 12 icon thành 4 "gia đình" màu — chỉ đổi
   viền/vòng sáng, tên vẫn dùng token chữ đã cân AA. Product = xanh mặc định. */
.hc-item--product .hc-badge { border-color: color-mix(in srgb, var(--acc-product) 45%, var(--border)); }
.hc-item--data .hc-badge { border-color: color-mix(in srgb, var(--acc-data) 50%, var(--border)); }
.hc-item--publish .hc-badge { border-color: color-mix(in srgb, var(--acc-publish) 45%, var(--border)); }
.hc-item--help .hc-badge { border-color: color-mix(in srgb, var(--acc-help) 40%, var(--border)); }
.hc-item--data:hover .hc-badge,
.hc-item--data:focus-visible .hc-badge {
  border-color: var(--acc-data);
  box-shadow: 0 0 0 4px rgba(220, 171, 39, 0.14), 0 10px 22px rgba(15, 23, 42, 0.16);
}
.hc-item--publish:hover .hc-badge,
.hc-item--publish:focus-visible .hc-badge {
  border-color: var(--acc-publish);
  box-shadow: 0 0 0 4px rgba(79, 107, 216, 0.14), 0 10px 22px rgba(15, 23, 42, 0.16);
}
.hc-item--help:hover .hc-badge,
.hc-item--help:focus-visible .hc-badge {
  border-color: var(--acc-help);
  box-shadow: 0 0 0 4px rgba(237, 52, 46, 0.12), 0 10px 22px rgba(15, 23, 42, 0.16);
}
.hc-item:hover .hc-item-name,
.hc-item:focus-visible .hc-item-name { color: var(--green-dark); font-weight: 700; }
html.dark .hc-item:hover .hc-item-name,
html.dark .hc-item:focus-visible .hc-item-name { color: #35d183; }
.hc-item:focus-visible { outline: none; }
.hc-item:focus-visible .hc-badge { outline: 2px solid var(--green); outline-offset: 3px; }

/* Giảm chuyển động: tắt tự cuộn (đứng yên) nhưng GIỮ animation object để mũi tên
   vẫn nhảy được currentTime → người dùng vẫn xem được từng icon. */
@media (prefers-reduced-motion: reduce) {
  .hc-track { animation-play-state: paused; }
  .hc-badge, .hc-item-name { transition: none; }
}

@media (max-width: 720px) {
  .hc-item { width: 96px; margin-right: 18px; }
  .hc-badge { width: 74px; height: 74px; }
  .hc-badge img { width: 40px; height: 40px; }
  .hc-track { animation-duration: 34s; }
}

/* ============ Contact bubble (Teams) ============
   Kích thước FAB chuẩn (64px — bản 112px cũ che mất góc đọc trên mobile);
   nhấp nhô 3 chu kỳ đầu để gây chú ý rồi ĐỨNG YÊN (chuyển động lặp vô hạn
   ở rìa mắt gây phân tâm khi đọc tài liệu dài). */
@keyframes vdsc-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
.contact-bubble {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: box-shadow 0.15s ease, filter 0.15s ease;
  animation: vdsc-float 3.2s ease-in-out 3;
  will-change: transform;
}
.contact-bubble img { width: 38px; height: 38px; object-fit: contain; }
.contact-bubble:hover { filter: brightness(1.04); box-shadow: 0 14px 40px rgba(15, 23, 42, 0.28); }
/* Hover: dừng nhịp nổi lại để dễ bấm trúng (không đổi transform giữa chừng). */
.contact-bubble:hover, .contact-bubble:focus-visible { animation-play-state: paused; }
html.dark .contact-bubble { background: var(--bg-panel); }
@media (prefers-reduced-motion: reduce) {
  .contact-bubble { animation: none; }
}

/* ============ Back-to-top (P-13) ============
   JS tạo nút; hiện sau ~1.6 màn hình cuộn; đặt NGAY TRÊN contact bubble. */
.btt {
  position: fixed; right: 34px; bottom: 100px; z-index: 89;
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--bg-panel);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease-out),
              color var(--dur-1) ease, border-color var(--dur-1) ease;
}
.btt.show { opacity: 1; pointer-events: auto; transform: none; }
.btt:hover { color: var(--green-dark); border-color: var(--green); }
html.dark .btt:hover { color: #35d183; }
.btt:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (max-width: 900px) { .btt { right: 22px; bottom: 84px; } }

/* Search modal */
.search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 15, 28, 0.55); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 0;
}
.search-overlay.open { display: flex; }
.search-modal {
  width: 100%; max-width: 560px; background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-modal .sm-input {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft); color: var(--text-faint);
}
.search-modal input {
  flex: 1; border: 0; outline: 0; background: none;
  font-family: var(--font); font-size: 16px; color: var(--text-strong);
}
.search-modal .sm-results { max-height: 46vh; overflow-y: auto; padding: 8px; }
.search-modal .sm-item { display: block; padding: 10px 12px; border-radius: 10px; color: inherit; }
.search-modal .sm-item:hover, .search-modal .sm-item.sel { background: var(--green-softer); }
.search-modal .sm-item .t { font-weight: 600; font-size: 14px; color: var(--text-strong); }
.search-modal .sm-item .c { font-size: 12.5px; color: var(--text-muted); }
/* Từ khớp được bọc <mark> để mắt bắt ngay vì sao kết quả này hiện ra. */
.search-modal .sm-item mark {
  background: rgba(220, 171, 39, 0.32); color: inherit;
  border-radius: 3px; padding: 0 1px;
}
html.dark .search-modal .sm-item mark { background: rgba(220, 171, 39, 0.26); }
/* Empty-state là lối rẽ chứ không phải ngõ cụt (P-11): icon mờ + gợi ý chips + Teams. */
.search-modal .sm-empty { padding: 20px 16px 8px; text-align: center; color: var(--text-faint); font-size: 14px; }
.search-modal .sm-empty p { margin: 6px 0; }
.search-modal .sm-empty .sm-empty-ic { opacity: 0.35; }
.search-modal .sm-empty .sm-label { padding: 10px 0 2px; }
.search-modal .sm-empty .sm-chips { justify-content: center; padding: 6px 0 4px; }
.search-modal .sm-empty .sm-empty-teams { padding-bottom: 10px; }
.search-modal .sm-empty a { font-weight: 600; }

/* Từ khóa phổ biến trong search modal */
.search-modal .sm-label {
  padding: 10px 12px 6px; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint);
}
.search-modal .sm-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 12px 14px; }
.search-modal .sm-chip {
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--green-dark); background: var(--green-softer);
  border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.search-modal .sm-chip:hover { background: var(--green-soft); border-color: var(--green); }
html.dark .search-modal .sm-chip { color: #35d183; }

/* ============ Lightbox phóng to ảnh chụp màn hình ============
   Ảnh hộp thoại trên mobile chỉ ~92px — bấm/chạm để xem bản gốc full màn hình. */
.zoomable { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: none; align-items: center; justify-content: center;
  padding: 28px; background: rgba(8, 12, 24, 0.84);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-figure {
  margin: 0; max-width: min(1100px, 100%); max-height: 100%;
  display: flex; flex-direction: column; gap: 10px; cursor: default;
}
.lightbox-figure img {
  max-width: 100%; max-height: 82vh; width: auto; height: auto;
  margin: 0 auto; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-lg);
}
.lightbox-figure figcaption { text-align: center; font-size: 13px; color: #cbd5e1; min-height: 1em; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  color: #e2e8f0; background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
@media (max-width: 700px) {
  .lightbox-overlay { padding: 14px; }
  .lightbox-figure img { max-height: 76vh; }
}

/* Mobile */
.menu-btn { display: none; }
/* Scrim mờ sau sidebar off-canvas (JS bỏ [hidden] khi mở) — chạm để đóng. */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 49;
  background: rgba(10, 15, 28, 0.45);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
@media (min-width: 901px) {
  .sidebar-backdrop { display: none !important; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  /* 16px thay vì 15.5px: đọc dài trên màn nhỏ đỡ mỏi (input search vốn đã 16px). */
  body { font-size: 16px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: calc(var(--topbar-h) + var(--tabbar-h)); z-index: 50;
    width: min(320px, 85vw); background: var(--bg);
    transform: translateX(-105%); transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .content { padding: 32px 20px 64px; }
  .hero h1 { font-size: 32px; }
  .cards, .cards.cols-3 { grid-template-columns: 1fr; }
  /* Topbar chật trên mobile: thu padding/gap để menu + logo + 2 nút 44px
     (search, theme) cùng vừa 375px mà không tràn ngang. */
  .topbar { padding: 0 14px; gap: 12px; }
  /* Searchbar ẩn nhưng KHÔNG mất tìm kiếm: nút kính lúp thay thế (Ctrl+K
     không tồn tại trên cảm ứng nên đây là lối vào duy nhất). */
  .searchbar { display: none; }
  .search-btn-mobile { display: inline-flex; }
  /* Mobile: không có hover → bỏ dropdown, cho tabbar cuộn ngang như cũ. */
  .tabbar {
    padding: 0 20px; gap: 20px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar .nav-dropdown { display: none; }
  /* Mobile: nhỏ lại một chút để không che nội dung */
  .contact-bubble { right: 14px; bottom: 14px; width: 56px; height: 56px; }
  .contact-bubble img { width: 32px; height: 32px; }
}
@media (max-width: 480px) {
  /* Màn hẹp: logo Rồng Việt tự nói đủ thương hiệu — ẩn divider + tên sản phẩm
     để 2 nút hành động bên phải không bị đẩy ra ngoài viewport. */
  .topbar .brand .divider,
  .topbar .brand .product-name { display: none; }
}

/* ============ WordPress specifics ============ */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); word-wrap: normal !important;
}
img { max-width: 100%; height: auto; }

/* Admin bar offsets */
body.admin-bar .topbar { top: 32px; }
body.admin-bar .tabbar { top: calc(var(--topbar-h) + 32px); }
body.admin-bar .layout { padding-top: calc(var(--topbar-h) + var(--tabbar-h) + 32px); }
body.admin-bar .sidebar, body.admin-bar .toc {
  top: calc(var(--topbar-h) + var(--tabbar-h) + 32px);
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 32px);
}
body.admin-bar [id] { scroll-margin-top: calc(var(--topbar-h) + var(--tabbar-h) + 52px); }
@media (max-width: 782px) {
  body.admin-bar .topbar { top: 46px; }
  body.admin-bar .tabbar { top: calc(var(--topbar-h) + 46px); }
  body.admin-bar .layout { padding-top: calc(var(--topbar-h) + var(--tabbar-h) + 46px); }
  body.admin-bar .sidebar { top: calc(var(--topbar-h) + var(--tabbar-h) + 46px); }
}

/* ============ Hiệu ứng (catalog E — mọi thứ đều gate reduced-motion) ============ */

/* E-1 · Cross-fade chuyển trang (View Transitions, MPA). Chrome/Edge 126+;
   trình duyệt khác tự fallback về chuyển trang thường. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation-duration: 0.16s; }
  ::view-transition-new(root) { animation-duration: 0.24s; }
}

/* E-2 · Đổi theme lan tròn từ nút bấm: trong lúc wipe, tắt cross-fade mặc định
   để clip-path tự quản (scope bằng class .theme-wipe nên KHÔNG ảnh hưởng E-1). */
html.theme-wipe::view-transition-old(root),
html.theme-wipe::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* E-7 · Accordion mở/đóng mượt — CSS thuần (::details-content, Chrome/Edge 131+;
   trình duyệt cũ mở tức thì như trước, không vỡ). Chevron xoay sẵn cùng nhịp. */
@media (prefers-reduced-motion: no-preference) {
  details.acc::details-content {
    block-size: 0; overflow-y: clip;
    transition: block-size var(--dur-2) var(--ease-out), content-visibility var(--dur-2) allow-discrete;
  }
  details.acc[open]::details-content { block-size: auto; }
}

/* E-9 · Lightbox: ảnh "lớn lên" từ trang thay vì bật phụt. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes lb-fade { from { opacity: 0; } }
  @keyframes lb-zoom { from { opacity: 0; transform: scale(0.94); } }
  .lightbox-overlay.open { animation: lb-fade var(--dur-2) ease; }
  .lightbox-overlay.open .lightbox-figure { animation: lb-zoom 0.28s var(--ease-out); }
}

/* E-10 · Search modal trồi xuống từ topbar — CHỈ animate lần mở modal,
   không đụng danh sách kết quả (search-as-you-type sẽ nhấp nháy). */
@media (prefers-reduced-motion: no-preference) {
  @keyframes sm-in { from { opacity: 0; transform: translateY(-8px) scale(0.985); } }
  .search-overlay.open .search-modal { animation: sm-in 0.22s var(--ease-out); }
}

/* P-6 · Scroll-reveal có kiểm soát: fade-up 12px MỘT LẦN cho khối lớn.
   Chỉ giấu khi chắc chắn reveal được (html.js + không reduced-motion);
   JS chết → hiện đủ 100% như không có hiệu ứng. */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  }
  html.js .reveal.revealed { opacity: 1; transform: none; }
  /* Stagger nhẹ trong danh sách bước (anh em liền kề nhau). */
  html.js .timeline .reveal:nth-child(2), html.js .zigzag .reveal:nth-child(2) { transition-delay: 0.06s; }
  html.js .timeline .reveal:nth-child(3), html.js .zigzag .reveal:nth-child(3) { transition-delay: 0.12s; }
  html.js .zigzag .reveal:nth-child(4) { transition-delay: 0.18s; }
  html.js .zigzag .reveal:nth-child(5) { transition-delay: 0.24s; }
}

/* D-6 · Scroll-rise: khối "dựng dậy" từ mặt giấy theo TIẾN ĐỘ cuộn THẬT
   (scroll-driven, chạy ngoài main thread — kéo ngược thì hạ xuống lại).
   Chỉ bật khi trình duyệt hỗ trợ animation-timeline (Chromium) + không giảm
   chuyển động; JS gắn html.sd và KHÔNG chạy IntersectionObserver. Trình duyệt
   cũ không có html.sd → rơi về reveal fade-up bằng IO ở trên. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html.sd .timeline .tl-step,
    html.sd .zigzag .zz-step,
    html.sd .ribbon-section {
      animation: vdsc-rise3d linear both;
      animation-timeline: view();
      animation-range: entry 2% entry 48%;
      transform-origin: center 130%;
    }
  }
}
@keyframes vdsc-rise3d {
  from { opacity: 0; transform: perspective(900px) translateY(24px) rotateX(9deg); }
  to   { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0); }
}

/* Generic page content (page.php / index.php) */
.wp-doc-content img { border-radius: var(--radius); }
.wp-doc-content blockquote {
  margin: 18px 0; padding: 10px 18px;
  border-left: 3px solid var(--green); background: var(--green-softer);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.wp-doc-content pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 16px 18px; border-radius: var(--radius); overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px;
}

/* ============ Print ============
   In "Hướng dẫn cài đặt" ra giấy: bỏ toàn bộ chrome điều hướng, trải phẳng
   deck 3 thẻ; JS (beforeprint) tự mở mọi <details> trước khi in. */
@media print {
  .topbar, .tabbar, .sidebar, .sidebar-backdrop, .toc, .contact-bubble,
  .search-overlay, .lightbox-overlay, .skip-link, .deck-nav,
  .acc-link, .hx-anchor, .btt, .hc-arrow { display: none !important; }
  .layout { display: block; padding-top: 0; }
  .content { padding: 0; }
  body { background: #fff; color: #000; font-size: 12pt; }
  /* Gradient text in ra sẽ trong suốt → trả về màu đặc. */
  h1 { background: none; -webkit-text-fill-color: initial; color: #01502a; }
  .deck--ready .deck-stack { display: grid; gap: 14pt; height: auto; position: static; }
  .deck--ready .deck-card {
    position: static; height: auto;
    transform: none !important; box-shadow: none !important; filter: none !important;
  }
  .deck-card > * { opacity: 1 !important; }
  details.acc, .callout, .tl-card, .zz-card { break-inside: avoid; }
  .hc-track { animation: none; }
  /* Trung hòa hệ chiều sâu khi in: scroll-rise (from = ẩn) / tilt / glare. */
  .timeline .tl-step, .zigzag .zz-step, .ribbon-section {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  .tilt3d { transform: none !important; }
  .tilt-glare, .ribbon-section::before { display: none !important; }
}
