@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/inter-latin.3100e775.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/inter-latin-ext.34b9c504.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/inter-vietnamese.5c66f9e0.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}
/* docs.wandura.ai — khuôn trang kiểu Mintlify. Màu trong :root, tối trong [data-theme="dark"]. */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-mute: #f4f4f5;
  --text: #0f0f12;
  --text-2: #3f3f46;
  --muted: #66666f;
  --line: #e7e7ea;
  --line-2: #d9d9de;
  --accent: #d6337a;
  --accent-ink: #b0245f;
  --accent-soft: #fdeaf3;
  --accent-line: rgb(214 51 122 / 0.35);
  --code-bg: #f4f4f5;
  --code-text: #27272a;
  --card: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  --scrim: rgb(9 9 11 / 0.45);
  --top-h: 64px;
  --tabs-h: 0px;
  --head-h: calc(var(--top-h) + var(--tabs-h));
  --side-w: 272px;
  --toc-w: 232px;
  --content-w: 760px;
  --content-wide: 1100px;
  --radius: 12px;
  --font: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0b0f;
  --bg-soft: #0f0f14;
  --bg-mute: #17171d;
  --text: #ececf1;
  --text-2: #c9c9d1;
  --muted: #9a9aa6;
  --line: #22222a;
  --line-2: #2e2e37;
  --accent: #f062a0;
  --accent-ink: #f58ab9;
  --accent-soft: rgb(240 98 160 / 0.12);
  --accent-line: rgb(240 98 160 / 0.45);
  --code-bg: #16161c;
  --code-text: #e4e4ea;
  --card: #111116;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
  --scrim: rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body.has-tabs { --tabs-h: 44px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #b0245f; color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }
.i { width: 18px; height: 18px; flex: none; }
.i.sm { width: 15px; height: 15px; }
.i.xs { width: 12px; height: 12px; margin-left: 2px; vertical-align: -1px; }
.kbd, kbd {
  font: 500 11.5px/1 var(--font);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--bg);
}

/* ---------- thanh trên cùng ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in { height: var(--top-h); max-width: 1560px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; min-width: calc(var(--side-w) - 40px); }
.brand img { border-radius: 8px; }
.brand-s { font-weight: 500; color: var(--muted); }
.search-btn {
  flex: 0 1 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px 0 14px;
  background: var(--bg-soft); color: var(--muted);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left;
  transition: border-color .15s, background-color .15s;
}
.search-btn:hover { border-color: var(--line-2); background: var(--bg-mute); }
.search-ph { flex: 1; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid transparent; background: transparent; border-radius: 10px; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-mute); }
#themeBtn .moon { display: none; }
[data-theme="dark"] #themeBtn .sun { display: none; }
[data-theme="dark"] #themeBtn .moon { display: block; }
.menu-btn { display: none; }
.top-right { display: flex; align-items: center; gap: 4px; flex: none; }
.lang { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; border: 1px solid var(--line); }
.lang:hover { background: var(--bg-mute); }
.badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; color: var(--accent-ink); background: var(--accent-soft); }
.badge .i { margin: 0; }
.tabs { height: var(--tabs-h); }
.tabs-in { max-width: 1560px; margin: 0 auto; padding: 0 24px; height: 100%; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs-in::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; height: 100%; white-space: nowrap; font-size: 14px; font-weight: 550; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- khung 3 cột ---------- */
.shell {
  max-width: 1560px; margin: 0 auto;
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start;
}
body.has-toc:not(.wide) .shell { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); }
.side {
  position: sticky; top: var(--head-h);
  height: calc(100vh - var(--head-h)); height: calc(100dvh - var(--head-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 16px 40px 24px;
  scrollbar-width: thin;
}
.grp + .grp { margin-top: 26px; }
.grp-t { font-size: 13.5px; font-weight: 650; color: var(--text); padding: 0 12px 6px; }
.grp ul { list-style: none; margin: 0; padding: 0; }
.grp a {
  display: block; padding: 6px 12px; margin: 1px 0; border-radius: 10px;
  font-size: 14.5px; line-height: 1.45; color: var(--text-2); text-decoration: none;
  transition: background-color .12s, color .12s;
}
.grp a:hover { background: var(--bg-mute); color: var(--text); }
.grp a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.scrim { display: none; }

.main { min-width: 0; padding: 40px 56px 64px; outline: none; }
.doc { max-width: var(--content-w); margin: 0 auto; }
body.wide .doc { max-width: var(--content-wide); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.titlebar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.titlebar h1 { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 750; text-wrap: balance; }
.page-actions { display: flex; gap: 6px; flex: none; padding-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.btn:hover { background: var(--bg-mute); border-color: var(--line-2); }
.btn.ok { color: #15803d; border-color: #86efac; }
[data-theme="dark"] .btn.ok { color: #4ade80; border-color: #166534; }

/* ---------- nội dung ---------- */
.prose { color: var(--text-2); font-size: 16px; }
.prose > :first-child { margin-top: 20px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap, .prose figure, .prose .code { margin: 0 0 18px; }
.prose h2, .prose h3, .prose h4 { color: var(--text); position: relative; letter-spacing: -0.015em; }
.prose h2 { font-size: 24px; line-height: 1.3; margin: 44px 0 14px; font-weight: 700; }
.prose h3 { font-size: 19px; line-height: 1.4; margin: 32px 0 10px; font-weight: 650; }
.prose h4 { font-size: 16px; margin: 24px 0 8px; font-weight: 650; }
.anchor {
  margin-left: 0.35em; color: var(--muted); text-decoration: none !important; opacity: 0; font-weight: 500;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .anchor:focus-visible { opacity: 1; }
.prose strong { color: var(--text); font-weight: 650; }
.prose a:not(.card):not(.hot):not(.diagram a) {
  color: var(--text); font-weight: 550; text-decoration: underline;
  text-decoration-color: var(--accent-line); text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  transition: text-decoration-color .15s, color .15s;
}
.prose a:not(.card):not(.hot):not(.diagram a):hover { color: var(--accent-ink); text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--muted); }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose blockquote {
  padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; background: var(--bg-soft); color: var(--text-2);
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose code {
  font: 500 0.86em/1.5 var(--mono); color: var(--code-text);
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.12em 0.4em;
  overflow-wrap: anywhere;
}
.prose .code { position: relative; }
.prose pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  font: 13.5px/1.65 var(--mono);
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.code-copy {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); cursor: pointer; opacity: 0;
  transition: opacity .15s;
}
.code:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.lead { font-size: 18px; color: var(--muted); }
.internal { color: var(--text-2); }
.internal small { color: var(--muted); font-size: 0.82em; }
.ext .i { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text); font-weight: 650; background: var(--bg-soft); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td + td, .prose th + th { border-left: 1px solid var(--line); }
/* Mã/định danh trong ô bảng KHÔNG được ngắt giữa chừng: cột hẹp làm `CLE_01_E09` vỡ thành
   "AB / S_0 / 1_E / 01" — đọc không ra, mà `.table-wrap` vốn đã cuộn ngang được. */
.prose td code, .prose th code { white-space: nowrap; }

/* Bảng dài: tiêu đề mở bảng chọn lọc + sắp (kiểu Excel). Chỉ bảng có data-sortable. */
.prose table[data-sortable] th { padding: 0; position: relative; }
.prose table[data-sortable] th .tbl-btn {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 10px 14px; background: none; border: 0; border-radius: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.prose table[data-sortable] th .tbl-btn:hover { background: rgba(127,127,127,.1); }
.prose table[data-sortable] th .tbl-btn:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.tbl-ico { flex: none; opacity: .34; }
.tbl-ico path { fill: currentColor; }
.tbl-ico .ico-fn { display: none; }
.tbl-btn[data-dir="asc"] .tbl-ico, .tbl-btn[data-dir="desc"] .tbl-ico { opacity: 1; }
.tbl-btn[data-dir="asc"] .ico-dn, .tbl-btn[data-dir="desc"] .ico-up { opacity: .22; }
/* Đang lọc ⇒ đổi hẳn sang hình cái phễu, không chỉ đậm lên: người đọc phải thấy ngay bảng đang bị cắt bớt. */
.tbl-btn[data-filtered="1"] .tbl-ico { opacity: 1; }
.tbl-btn[data-filtered="1"] .ico-up, .tbl-btn[data-filtered="1"] .ico-dn { display: none; }
.tbl-btn[data-filtered="1"] .ico-fn { display: inline; }

.tbl-menu {
  position: absolute; z-index: 30; top: 100%; left: 0; min-width: 240px; max-width: 320px;
  padding: 8px; background: var(--bg, #fff); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.18); font-weight: 400; font-size: 14px;
}
.tbl-sort { display: flex; flex-direction: column; }
.tbl-sort button, .tbl-foot button {
  padding: 6px 8px; background: none; border: 0; border-radius: 6px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.tbl-sort button:hover, .tbl-foot button:hover { background: rgba(127,127,127,.12); }
.tbl-find {
  width: 100%; margin: 8px 0 6px; padding: 6px 8px; font: inherit;
  color: inherit; background: none; border: 1px solid var(--line); border-radius: 6px;
}
.tbl-all { display: block; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.tbl-vals { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.tbl-vals label { display: block; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.tbl-vals label:hover { background: rgba(127,127,127,.12); }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.tbl-count { font-size: 13px; opacity: .72; }
.prose tr.tbl-empty td { text-align: center; opacity: .7; }
/* Bảng chọn phải thoát khỏi vùng cuộn ngang của .table-wrap, nếu không nó bị cắt mất. */
.table-wrap:has(.tbl-menu:not([hidden])) { overflow: visible; }

/* hình: nền trắng cả khi tối (hình vẽ nền trắng) */
.prose figure { margin-left: 0; margin-right: 0; }
.img a, .hotmap-in { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.img img, .hotmap img { display: block; width: 100%; height: auto; }
.prose figcaption { margin-top: 8px; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prose figcaption a { font-weight: 500 !important; display: inline-flex; align-items: center; gap: 4px; }
.hotmap-in { position: relative; }
.hotmap-scroll { border-radius: var(--radius); }
.hot-list { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.hot-list span { margin-right: 4px; }
.diagram .edgeLabel text, .diagram .edgeLabel tspan { paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.toc-inline { display: none; margin: 16px 0 4px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--bg-soft); }
.toc-inline summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.toc-inline ul { list-style: none; margin: 8px 0 2px; padding: 0; }
.toc-inline li a { display: block; padding: 3px 0; font-size: 14px; color: var(--text-2); text-decoration: none; }
.toc-inline li.d3 a { padding-left: 14px; font-size: 13.5px; color: var(--muted); }
.hot { position: absolute; display: block; border-radius: 8px; transition: box-shadow .15s, background-color .15s; }
.hot:hover, .hot:focus-visible { box-shadow: 0 0 0 3px rgb(214 51 122 / 0.7); background: rgb(214 51 122 / 0.07); outline: none; }
.diagram { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow-x: auto; text-align: center; }
.diagram svg { height: auto; }
.diagram a { cursor: pointer; text-decoration: none; }
.diagram a text, .diagram a tspan { text-decoration: none; }
.diagram a .label-container, .diagram a rect, .diagram a polygon { transition: stroke .15s, stroke-width .15s; }
.diagram a:hover .label-container, .diagram a:hover rect, .diagram a:focus-visible rect { stroke: #d6337a !important; stroke-width: 2.5px !important; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 28px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 40px 16px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-t { color: var(--text); font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; }
.card-d { color: var(--muted); font-size: 14px; line-height: 1.5; }
.card-go { position: absolute; right: 14px; top: 16px; color: var(--muted); transition: transform .15s, color .15s; }
.card:hover .card-go { color: var(--accent); transform: translateX(2px); }

.updated { margin: 40px 0 0; font-size: 13.5px; color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s;
}
.pager a:hover { border-color: var(--accent-line); }
.pager span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pager strong { color: var(--text); font-weight: 600; }
.pager .next { text-align: right; align-items: flex-end; grid-column: 2; }
.foot { max-width: var(--content-w); margin: 56px auto 0; font-size: 13px; color: var(--muted); }
body.wide .foot { max-width: var(--content-wide); }

/* ---------- mục lục bên phải ---------- */
.toc { position: sticky; top: var(--head-h); height: calc(100vh - var(--head-h)); overflow-y: auto; padding: 40px 24px 40px 8px; }
.toc-t { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent;
  font-size: 13.5px; line-height: 1.45; color: var(--muted); text-decoration: none;
}
.toc li.d3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 550; }

/* ---------- ô tìm kiếm ---------- */
.search {
  width: min(680px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0;
  border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / 0.25);
  overflow: hidden;
}
.search[open] { display: flex; flex-direction: column; }
.search::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-box input { flex: 1; height: 56px; border: 0; outline: none; background: transparent; color: var(--text); font: 16px var(--font); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.search-list:empty { display: none; }
.search-list a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-list a:hover { background: var(--bg-mute); }
.search-list a[aria-selected="true"] { background: var(--accent-soft); }
.search-list a[aria-selected="true"] .s-crumb, .search-list a[aria-selected="true"] .s-snip { color: var(--text-2); }
.search-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.s-crumb { font-size: 12px; color: var(--muted); }
.s-title { font-weight: 600; color: var(--text); font-size: 15px; }
.s-snip { font-size: 13.5px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-list mark { background: rgb(214 51 122 / 0.18); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14.5px; }
.search-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.search-foot .kbd { margin-right: 3px; }

/* ---------- màn hẹp ---------- */
body.wide.has-toc .shell { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); }
@media (max-width: 1199px) {
  body.has-toc:not(.wide) .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  body.wide.has-toc .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none !important; }
  .toc-inline { display: block; }
  .main { padding: 36px 40px 56px; }
}
@media (max-width: 899px) {
  :root { --top-h: 58px; }
  .top-in { padding: 0 12px; gap: 8px; }
  .menu-btn { display: inline-grid; }
  .brand { min-width: 0; font-size: 17px; }
  .brand-s { display: none; }
  .search-btn { flex: 1 1 auto; height: 38px; margin: 0 0 0 auto; max-width: 260px; }
  .search-btn .kbd { display: none; }
  .shell, body.has-toc .shell, body.wide .shell { display: block; }
  .side {
    position: fixed; top: var(--head-h); left: 0; bottom: 0; z-index: 35; width: min(300px, 86vw); height: auto;
    background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .2s ease;
    padding: 20px 12px 40px;
  }
  body.nav-open .side { transform: none; box-shadow: var(--shadow); }
  body.nav-open { overflow: hidden; }
  .scrim { display: block; position: fixed; inset: var(--head-h) 0 0 0; z-index: 30; background: var(--scrim); }
  .scrim[hidden] { display: none; }
  .main { padding: 24px 16px 48px; }
  .titlebar { flex-direction: column; gap: 12px; }
  .titlebar h1 { font-size: 27px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .prose h2 { font-size: 21px; margin-top: 36px; }
  .anchor { display: none; }
  .tabs-in { padding: 0 16px; gap: 18px; }
  .hotmap-scroll { overflow-x: auto; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
  .hotmap-scroll .hotmap-in { min-width: 860px; border: 0; }
}
@media (max-width: 560px) {
  .search-btn { flex: none; width: 38px; padding: 0; justify-content: center; margin-left: auto; }
  .lang span { display: none; }
  .lang { padding: 0 9px; }
  .badge { display: none; }
  .search-ph { display: none; }
  .cards { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .prose th { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .side, .toc, .pager, .page-actions, .scrim { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
}

/* ---------- trang chờ đăng nhập nội bộ ---------- */
.auth-wait { max-width: 520px; margin: 16vh auto; padding: 0 20px; text-align: center; }
.auth-wait h1 { font-size: 22px; margin: 16px 0 8px; }
.auth-wait p { color: var(--muted); }
.auth-wait .btn { margin: 0 4px; }

/* ---------- phiên bản API, lịch sử, bản lưu ---------- */
.ver { position: relative; }
.ver > summary { list-style: none; display: inline-flex; align-items: center; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.ver > summary::-webkit-details-marker { display: none; }
.ver > summary::after { content: "▾"; margin-left: 6px; color: var(--muted); font-size: 11px; }
.ver[open] > summary, .ver > summary:hover { background: var(--bg-mute); }
.ver-menu { position: absolute; right: 0; top: 40px; min-width: 180px; padding: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); z-index: 50; }
.ver-menu a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.ver-menu a:hover { background: var(--bg-mute); }
.ver-menu a.on { color: var(--accent-ink); font-weight: 650; background: var(--accent-soft); }
.ver-banner, .snap-banner { margin: 0 auto 18px; max-width: var(--content-wide); padding: 10px 14px; border: 1px solid #f0d48a; background: #fff6dd; color: #6b4e00; border-radius: 10px; font-size: 14px; }
.snap-banner { margin: 0; max-width: none; border-radius: 0; border-width: 0 0 1px; text-align: center; position: relative; z-index: 45; }
.ver-banner a, .snap-banner a { color: inherit; font-weight: 650; }
[data-theme="dark"] .ver-banner, [data-theme="dark"] .snap-banner { background: #2a2210; border-color: #5c4a1c; color: #f3d98c; }
.hist { list-style: none; padding: 0; margin: 18px 0; }
.hist li { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; }
.hist-h { font-size: 14.5px; }
.hist details { margin-top: 8px; }
.hist summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.d-add { color: #15803d; font-weight: 650; } .d-del { color: #b42318; font-weight: 650; }
.prose pre.diff { font-size: 12.5px; line-height: 1.55; max-height: 520px; white-space: pre-wrap; word-break: break-word; }
.diff .d-a { background: rgb(21 128 61 / .12); display: block; }
.diff .d-r { background: rgb(180 35 24 / .10); display: block; text-decoration: line-through; text-decoration-color: rgb(180 35 24 / .4); }
.diff .d-c { color: var(--muted); display: block; }
.diff .d-gap { color: var(--muted); display: block; text-align: center; }
@media (max-width: 560px) { .ver > summary { padding: 0 8px; } }

/* ---------- bản beta + form góp ý ---------- */
.beta-badge { margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.beta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 20px; padding: 10px 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius); font-size: 13.5px; color: var(--text-2); }
.beta-bar > span:nth-child(2) { flex: 1 1 260px; }
.beta-tag { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.beta-fb, .foot-fb { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; }
.beta-fb { padding: 4px 10px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--bg); }
.beta-fb:hover, .foot-fb:hover { text-decoration: underline; }
.foot-fb { font-weight: 500; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
dialog.fb { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
dialog.fb::backdrop { background: rgb(0 0 0 / .45); }
dialog.fb form { padding: 18px 20px 20px; display: grid; gap: 8px; }
.fb-head { display: flex; align-items: center; justify-content: space-between; }
.fb-head h2 { margin: 0; font-size: 18px; }
.fb-lead { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }
.fb-kind { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.fb-kind label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; cursor: pointer; }
.fb-kind label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.fb-l { font-size: 13px; font-weight: 600; margin-top: 4px; }
dialog.fb textarea, dialog.fb input[type=email] { width: 100%; box-sizing: border-box; font: inherit; font-size: 14.5px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-soft); color: var(--text); resize: vertical; }
dialog.fb textarea:focus, dialog.fb input[type=email]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.fb-count { justify-self: end; font-size: 12px; color: var(--muted); }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-msg { margin: 4px 0 0; min-height: 1.2em; font-size: 13.5px; }
.fb-msg.ok { color: #16803c; } .fb-msg.err { color: #c0262d; }
:root[data-theme="dark"] .fb-msg.ok { color: #4ade80; } :root[data-theme="dark"] .fb-msg.err { color: #f87171; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
@media print { .beta-bar, dialog.fb, .foot-fb { display: none !important; } }
