/* =========================================================================
   TruePOS Help Center — design system
   Khung navy hình chữ L (header + sidebar) lấy từ giao diện phần mềm TruePOS.
   Cột đọc giữ nền sáng, yên tĩnh. Bài đang đọc là một tab nối liền vào cột đọc.
   Màu đỏ chỉ dùng cho ô đánh dấu, khớp với ô số (1)(2)(3) trên ảnh chụp màn hình.
   ========================================================================= */

:root {
  /* Khung thương hiệu */
  --frame:       #0a4572;   /* màu thanh tiêu đề và menu của TruePOS */
  --frame-ink:   #ffffff;
  --frame-ink-2: #d5e3ef;
  --frame-line:  rgba(255, 255, 255, .2);
  --frame-hover: rgba(255, 255, 255, .1);
  --navy-900: #062f4f;
  --navy-600: #135a90;
  --navy-100: #e3edf6;
  --navy-50:  #f1f6fb;
  --marker:   #e03a3e;

  /* Nền và chữ (xám lạnh, ngả theo navy) */
  --bg:        #ffffff;
  --surface:   #f3f6f9;
  --surface-2: #e9eef3;
  --line:      #d9e1e8;
  --line-soft: #e8edf2;
  --ink:       #15202b;
  --ink-2:     #3d4b59;
  --ink-3:     #5c6b7e;

  /* Ngữ nghĩa */
  --link:      var(--navy-600);
  --accent:    var(--frame);
  --accent-hover: var(--navy-900);
  --accent-ink:#ffffff;
  --ui-ink:    var(--navy-900);
  --mark-bg:   #fff1a8;
  --note-bg: #eef4fb; --note-line: #b9d2ea; --note-ink: #135a90;
  --tip-bg:  #ecf7f1; --tip-line:  #b4dfc9; --tip-ink:  #17734a;
  --warn-bg: #fdf5e7; --warn-line: #eed49f; --warn-ink: #8f5c10;
  --todo-bg: #f6f3fb; --todo-line: #b7a3dc; --todo-ink: #5f4399;

  /* Chữ */
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1.0625rem;   /* 17, thân bài */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: 1.625rem;    /* 26 */
  --fs-2xl: 2.25rem;    /* 36 */
  --fs-3xl: 3rem;       /* 48 */

  /* Khoảng cách và hình khối */
  --r-sm: 6px;
  --r-md: 8px;
  --header-h: 64px;
  --bar-h: 60px;
  --sidebar-w: 288px;
  --toc-w: 248px;
  --column: 780px;
  --measure: 72ch;
  --shadow-pop: 0 14px 36px -12px rgba(6, 47, 79, .3);

  color-scheme: light;
}

/* ---------- Chế độ tối ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --frame: #0b2a44; --frame-ink-2: #c3d3e1; --frame-line: rgba(255, 255, 255, .14); --frame-hover: rgba(255, 255, 255, .08);
    --bg: #0e1620; --surface: #141f2b; --surface-2: #1b2836;
    --line: #2a3a4b; --line-soft: #213040;
    --ink: #e6edf3; --ink-2: #b4c2cf; --ink-3: #93a3b3;
    --navy-100: #1a3550; --navy-50: #15283c;
    --link: #7cb6ea; --accent: #4f9ad8; --accent-hover: #74b1e4; --accent-ink: #06121e; --ui-ink: #cfe2f3;
    --mark-bg: #5c4b0f;
    --note-bg: #142a40; --note-line: #2b4f70; --note-ink: #7cb6ea;
    --tip-bg: #12302a;  --tip-line: #2a5a4a;  --tip-ink: #63cd9b;
    --warn-bg: #33280f; --warn-line: #5f4c1d; --warn-ink: #e8b65f;
    --todo-bg: #261f38; --todo-line: #58477f; --todo-ink: #b9a2e6;
    --marker: #ff5a5e;
    --shadow-pop: 0 14px 36px -12px rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --frame: #0b2a44; --frame-ink-2: #c3d3e1; --frame-line: rgba(255, 255, 255, .14); --frame-hover: rgba(255, 255, 255, .08);
  --bg: #0e1620; --surface: #141f2b; --surface-2: #1b2836;
  --line: #2a3a4b; --line-soft: #213040;
  --ink: #e6edf3; --ink-2: #b4c2cf; --ink-3: #93a3b3;
  --navy-100: #1a3550; --navy-50: #15283c;
  --link: #7cb6ea; --accent: #4f9ad8; --accent-hover: #74b1e4; --accent-ink: #06121e; --ui-ink: #cfe2f3;
  --mark-bg: #5c4b0f;
  --note-bg: #142a40; --note-line: #2b4f70; --note-ink: #7cb6ea;
  --tip-bg: #12302a;  --tip-line: #2a5a4a;  --tip-ink: #63cd9b;
  --warn-bg: #33280f; --warn-line: #5f4c1d; --warn-ink: #e8b65f;
  --todo-bg: #261f38; --todo-line: #58477f; --todo-ink: #b9a2e6;
  --marker: #ff5a5e;
  --shadow-pop: 0 14px 36px -12px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

/* ---------- Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); scrollbar-color: var(--line) transparent; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--navy-100); color: var(--ink); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.site-header :focus-visible, .sidebar :focus-visible, .hero :focus-visible { outline-color: #fff; }
button { font: inherit; color: inherit; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: #fff; color: var(--navy-900); padding: 8px 14px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
#site-header { height: var(--header-h); background: var(--frame); } /* giữ chỗ trước khi JS dựng header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--frame);
  color: var(--frame-ink);
}
.site-header__inner { height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.brand__logo { display: block; width: auto; height: 26px; filter: brightness(0) invert(1); }
.brand__label { font-size: var(--fs-xs); font-weight: 500; color: var(--frame-ink-2); padding-left: 12px; border-left: 1px solid var(--frame-line); line-height: 1.3; }
.header-search { flex: 1; max-width: 520px; margin-left: calc(var(--sidebar-w) - 240px); }
.search-trigger {
  width: 100%; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  background: var(--frame-hover); border: 1px solid var(--frame-line); border-radius: var(--r-md);
  color: var(--frame-ink-2); cursor: pointer; text-align: left; font-size: var(--fs-sm);
}
.search-trigger:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.search-trigger span { flex: 1; }
.search-trigger kbd { background: rgba(255, 255, 255, .14); border-color: var(--frame-line); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--r-md); background: transparent; color: inherit; cursor: pointer;
}
.site-header .icon-btn:hover { background: var(--frame-hover); }
.header-support {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  color: #fff; text-decoration: none; font-size: var(--fs-sm); font-weight: 500; border-radius: var(--r-md);
}
.header-support:hover { background: var(--frame-hover); }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }

/* ---------- Phím, ô đánh dấu, tên nút ---------- */
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .4em;
  font-family: var(--font); font-size: .8em; font-weight: 600; line-height: 1.6; text-align: center;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  vertical-align: .08em;
}
code {
  font-family: ui-monospace, Consolas, monospace; font-size: .88em;
  padding: .1em .35em; border-radius: 4px; background: var(--surface-2);
}
/* Số đánh dấu, khớp với ô số đỏ trên ảnh chụp màn hình */
.mk {
  display: inline-grid; place-items: center;
  min-width: 1.35em; height: 1.35em; padding: 0 .25em;
  font-size: .78em; font-weight: 700; line-height: 1; color: #fff;
  background: var(--marker); border-radius: 3px;
  vertical-align: .12em; margin: 0 .1em;
}
/* Icon nhỏ cắt từ giao diện phần mềm, đặt cùng dòng chữ */
img.ui-icon {
  display: inline-block; height: 1.5em; width: auto; vertical-align: -.4em;
  border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 1px;
}
.ui { font-weight: 600; color: var(--ui-ink); } /* tên nút / mục menu trong phần mềm */

/* ---------- Trang chủ: phần đầu ---------- */
.hero { background: var(--frame); color: var(--frame-ink); }
.hero__inner {
  position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 48px 20px 64px;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 64px; align-items: start;
}
.hero h1 {
  margin: 0; max-width: 21ch;
  font-size: clamp(2.125rem, 1.3rem + 2.8vw, var(--fs-3xl)); line-height: 1.14; font-weight: 700; letter-spacing: -0.025em;
}
.hero__intro { margin: 16px 0 0; max-width: 54ch; font-size: var(--fs-lg); line-height: 1.55; color: var(--frame-ink-2); }

/* Ô tìm kiếm lớn */
.hero-search { position: relative; margin-top: 32px; }
.hero-search__field {
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 14px 0 20px;
  background: #fff; color: #15202b; border-radius: var(--r-md);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .16);
  cursor: text;
}
.hero-search__field:focus-within { box-shadow: 0 0 0 4px rgba(255, 255, 255, .5); }
.hero-search__field .icon { width: 24px; height: 24px; color: #5c6b7e; }
.hero-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: var(--fs-lg); color: #15202b; caret-color: #0a4572;
}
.hero-search input::placeholder { color: #5c6b7e; opacity: 1; }
.hero-search kbd { color: #3d4b59; background: #f3f6f9; border-color: #d9e1e8; }
.hero-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: var(--fs-sm); color: var(--frame-ink-2); }
.hero-quick a {
  color: #fff; text-decoration: none; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--frame-line);
}
.hero-quick a:hover { background: var(--frame-hover); border-color: rgba(255, 255, 255, .45); }

/* Lộ trình bắt đầu: đúng là một chuỗi bước nên được đánh số */
.hero__start h2 { margin: 0; font-size: var(--fs-lg); line-height: 1.35; }
.hero__start > p { margin: 4px 0 16px; font-size: var(--fs-sm); color: var(--frame-ink-2); }
.path { list-style: none; margin: 0; padding: 0; }
.path li { border-top: 1px solid var(--frame-line); }
.path li:last-child { border-bottom: 1px solid var(--frame-line); }
.path a {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 14px;
  padding: 14px 10px; color: inherit; text-decoration: none;
}
.path a:hover { background: var(--frame-hover); }
.path__num {
  grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-sm); background: #fff; color: #0a4572; font-weight: 700; font-size: var(--fs-sm);
}
.path h3 { margin: 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
.path p { margin: 2px 0 0; color: var(--frame-ink-2); font-size: var(--fs-xs); line-height: 1.55; }

/* ---------- Trang chủ: các phần dưới ---------- */
.home-section { max-width: 1240px; margin: 0 auto; padding: 72px 20px 0; }
.section-head { margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: var(--fs-xl); line-height: 1.3; letter-spacing: -0.015em; }
.section-head p { margin: 4px 0 0; color: var(--ink-3); font-size: var(--fs-sm); }

/* Bảng chỉ dẫn: mỗi hàng là một nhóm nghiệp vụ, thấy ngay tất cả bài viết */
.directory { border-top: 2px solid var(--accent); }
.dir-row { display: block; border-bottom: 1px solid var(--line); }
.dir-row > summary {
  list-style: none; display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 16px 22px 0; cursor: pointer;
}
.dir-row > summary::-webkit-details-marker { display: none; }
.cat-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-md); background: var(--navy-100); color: var(--accent);
}
.dir-row__head { flex: 1; min-width: 0; }
.dir-row__head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; line-height: 1.4; }
.dir-row__desc { display: block; margin-top: 2px; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }
.dir-row__count { flex: none; margin-top: 2px; color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dir-row__chev { display: none; color: var(--ink-3); transition: transform .15s ease-out; }
.dir-row[open] .dir-row__chev { transform: rotate(90deg); }
.dir-row__list { list-style: none; margin: 0; padding: 0 0 18px; }
.dir-row__list a { display: block; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink); font-size: var(--fs-sm); line-height: 1.5; text-decoration: none; }
.dir-row__list a:hover { background: var(--navy-50); color: var(--link); text-decoration: underline; }
@media (min-width: 901px) {
  /* Trình duyệt không cho <details> xếp lưới ổn định, nên đặt tên nhóm vào lề trái của hàng */
  .dir-row { position: relative; min-height: 84px; padding-left: 372px; }
  .dir-row > summary { position: absolute; left: 0; top: 0; width: 348px; cursor: default; }
  .dir-row__list { columns: 2; column-gap: 32px; padding: 16px 0; }
  .dir-row__list li { break-inside: avoid; }
}

/* Danh sách bài viết chung */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.5;
}
.article-list li:first-child a { border-top: 0; }
.article-list a:hover { color: var(--link); }
.article-list.two-col { columns: 2; column-gap: 56px; }
.article-list.two-col li { break-inside: avoid; }
.article-list.two-col a { border-top: 0; border-bottom: 1px solid var(--line); }

/* Hỗ trợ khách hàng */
.home-section--last { padding-bottom: 80px; }
.support {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: start;
  padding: 36px; border-radius: var(--r-md); background: var(--surface);
}
.support h2 { margin: 0 0 8px; font-size: var(--fs-xl); line-height: 1.3; letter-spacing: -0.015em; }
.support__intro > p { margin: 0; max-width: 48ch; color: var(--ink-2); }
.support__hotline { display: block; margin-top: 24px; }
.support__hotline small { display: block; color: var(--ink-3); font-size: var(--fs-sm); }
.support__hotline a { display: inline-block; font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--accent); text-decoration: none; font-variant-numeric: tabular-nums; }
.support__hotline a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.55; }
.contact-list li:first-child { padding-top: 0; }
.contact-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.contact-list .icon { margin-top: 2px; color: var(--accent); }
.contact-list small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.contact-list__links { display: flex; flex-wrap: wrap; gap: 0 16px; }

/* ---------- Bố cục bài viết ---------- */
.docs {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: calc(100vh - var(--header-h));
}
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 0 40px 12px;
  background: var(--frame); color: var(--frame-ink);
  font-size: var(--fs-sm);
  scrollbar-color: var(--frame-line) transparent; scrollbar-width: thin;
}
.docs::before { /* nền khung kéo hết chiều cao cột, kể cả khi bài dài hơn màn hình */
  content: ""; grid-column: 1; grid-row: 1; background: var(--frame);
}
.sidebar { grid-column: 1; grid-row: 1; }
.content { grid-column: 2; grid-row: 1; }
.toc { grid-column: 3; grid-row: 1; }
.sidebar__close { display: none; }
.nav-group { margin-bottom: 2px; }
.nav-group > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 40px;
  margin-right: 12px; padding: 7px 10px; border-radius: var(--r-sm);
  cursor: pointer; font-weight: 600; line-height: 1.4;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--frame-hover); }
.nav-group > summary .icon { width: 18px; height: 18px; color: var(--frame-ink-2); }
.nav-group > summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s ease-out; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group ul { list-style: none; margin: 2px 0 12px 19px; padding: 0; border-left: 1px solid var(--frame-line); }
.nav-group li { padding-left: 8px; }
.nav-group li a {
  position: relative; display: block; margin: 1px 12px 1px 0; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--frame-ink-2); text-decoration: none; line-height: 1.45;
}
.nav-group li a:hover { color: #fff; background: var(--frame-hover); }
/* Bài đang đọc: một tab cùng màu nền cột đọc, nối liền vào nội dung */
.nav-group li a[aria-current="page"] {
  margin-right: 0; padding-right: 22px; border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--bg); color: var(--ui-ink); font-weight: 600;
}
.nav-group li a[aria-current="page"]::before,
.nav-group li a[aria-current="page"]::after {
  content: ""; position: absolute; right: 0; width: 10px; height: 10px; pointer-events: none;
}
.nav-group li a[aria-current="page"]::before { top: -10px; background: radial-gradient(circle at 0 0, transparent 9.5px, var(--bg) 10px); }
.nav-group li a[aria-current="page"]::after { bottom: -10px; background: radial-gradient(circle at 0 100%, transparent 9.5px, var(--bg) 10px); }
.sidebar a[aria-current="page"]:focus-visible { outline-color: var(--accent); outline-offset: -3px; }

.content { min-width: 0; padding: 28px clamp(24px, 4vw, 56px) 88px; }
.content > * { max-width: var(--column); margin-inline: auto; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; padding: 0; font-size: var(--fs-xs); color: var(--ink-3); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--ink-3); opacity: .6; }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); text-decoration: underline; }

.article h1 { margin: 0 0 12px; font-size: clamp(1.875rem, 1.4rem + 1.7vw, var(--fs-2xl)); line-height: 1.18; letter-spacing: -0.025em; }
.article .lead { margin: 0 0 20px; max-width: 62ch; font-size: var(--fs-lg); line-height: 1.55; color: var(--ink-2); }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 8px; font-size: var(--fs-xs); color: var(--ink-3); }
.article h2 {
  margin: 56px 0 14px; padding-top: 32px; border-top: 1px solid var(--line);
  font-size: var(--fs-xl); line-height: 1.28; letter-spacing: -0.015em;
}
.article h3 { margin: 36px 0 8px; font-size: var(--fs-lg); line-height: 1.4; letter-spacing: -0.005em; }
.article h4 { margin: 28px 0 4px; font-size: var(--fs-md); line-height: 1.5; }
.article p { margin: 0 0 14px; max-width: var(--measure); }
.article ul, .article ol { margin: 0 0 16px; padding-left: 1.4em; max-width: var(--measure); }
.article li { margin-bottom: 6px; }
.article li > ul { margin: 6px 0 0; }
.article li::marker { color: var(--ink-3); }
.anchor { margin-left: 8px; color: var(--ink-3); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }

/* Danh sách các bước: ô số cùng hình dáng ô đánh dấu trên ảnh, nhưng mang màu thương hiệu */
.article .steps { list-style: none; counter-reset: step; padding: 0; margin: 18px 0 28px; max-width: none; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 12px 46px; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line);
}
.steps > li > p:first-child { margin-top: 1px; }
.steps > li > strong:first-child { display: block; margin-top: 1px; }

/* Bảng tùy chọn bật/tắt */
.options { margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.option { padding: 16px 18px; }
.option + .option { border-top: 1px solid var(--line); }
.article .option h4 { margin: 0 0 8px; font-size: var(--fs-md); }
.option dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--fs-sm); line-height: 1.6; }
.option dt { font-weight: 600; white-space: nowrap; }
.option dt.on { color: var(--tip-ink); }
.option dt.off { color: var(--ink-3); }
.option dd { margin: 0; color: var(--ink-2); }

/* Bảng */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.6; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Khung lưu ý */
.callout {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  margin: 20px 0 24px; padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid var(--note-line); background: var(--note-bg); font-size: var(--fs-sm); line-height: 1.65;
  --callout-ink: var(--note-ink);
}
.callout > .icon { margin-top: 2px; color: var(--callout-ink); }
.article .callout p { margin: 0 0 6px; max-width: none; }
.article .callout p:last-child, .article .callout ul:last-child { margin-bottom: 0; }
.article .callout ul { margin: 0; padding-left: 1.2em; max-width: none; }
.callout__title { display: block; font-weight: 700; margin-bottom: 2px; color: var(--callout-ink); }
.callout--tip { border-color: var(--tip-line); background: var(--tip-bg); --callout-ink: var(--tip-ink); }
.callout--warn { border-color: var(--warn-line); background: var(--warn-bg); --callout-ink: var(--warn-ink); }
/* Nội dung chờ xác nhận: viền nét đứt để phân biệt với lưu ý chính thức */
.callout--todo { border: 1px dashed var(--todo-line); background: var(--todo-bg); --callout-ink: var(--todo-ink); }

/* Ảnh chụp màn hình */
.shot { margin: 16px 0 28px; }
.shot__btn {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: zoom-in; overflow: hidden; line-height: 0;
}
.shot__btn:hover { border-color: var(--ink-3); }
.shot img { display: block; width: 100%; }
.shot__zoom {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-sm); background: rgba(6, 47, 79, .86); color: #fff; opacity: 0;
}
.shot__btn:hover .shot__zoom, .shot__btn:focus-visible .shot__zoom { opacity: 1; }
.shot__zoom .icon { width: 18px; height: 18px; }
.shot figcaption { margin-top: 8px; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }
.shot--phone { display: flex; gap: 16px; flex-wrap: wrap; }
.shot--phone .shot__btn { width: auto; max-width: 240px; }
.shot--phone figcaption { flex-basis: 100%; }
.shot--narrow .shot__btn { max-width: 560px; }
.media-placeholder {
  display: grid; place-items: center; gap: 6px; min-height: 140px; margin: 16px 0 28px;
  border: 1px dashed var(--todo-line); border-radius: var(--r-md); background: var(--todo-bg);
  color: var(--todo-ink); font-size: var(--fs-sm); text-align: center; padding: 16px;
}
/* Tạm ẩn các khung chờ video/ảnh chưa có nội dung. Xóa dòng dưới để hiện lại. */
.media-placeholder { display: none; }

/* Xem ảnh phóng to */
.lightbox {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: rgba(6, 18, 30, .9);
}
.lightbox::backdrop { background: transparent; }
.lightbox__inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 60px 16px 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); width: auto; border-radius: var(--r-sm); background: #fff; }
.lightbox__close { position: absolute; top: 8px; right: 10px; color: #fff; }
.lightbox__close:hover { background: rgba(255, 255, 255, .14); }

/* Cuối bài */
.related { margin-top: 56px; }
.feedback {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin-top: 56px; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface);
}
.feedback p { margin: 0; font-weight: 600; }
.feedback__btns { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg);
  color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
.btn:hover { border-color: var(--ink-3); }
.btn[aria-pressed="true"] { border-color: var(--accent); background: var(--navy-50); color: var(--ui-ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.feedback__thanks { margin: 0; flex-basis: 100%; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 400 !important; }
.feedback__thanks:empty { display: none; }
.feedback .btn--primary { margin-left: auto; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.pager a {
  display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); text-decoration: none;
}
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.pager strong { color: var(--link); font-weight: 600; font-size: var(--fs-sm); line-height: 1.45; }
.pager .next { text-align: right; grid-column: 2; }

/* Mục lục bên phải */
.toc {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 32px 20px 40px 0; font-size: var(--fs-xs);
  scrollbar-width: thin;
}
.toc h2 { margin: 0 0 10px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-3); text-decoration: none; line-height: 1.45; }
.toc li.lvl-3 a { padding-left: 26px; }
.toc li a:hover { color: var(--ink); }
.toc li a.is-active { color: var(--ui-ink); border-left-color: var(--accent); font-weight: 600; }
.toc-mobile { display: none; margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--fs-sm); }
.toc-mobile summary { cursor: pointer; font-weight: 600; }
.toc-mobile ul { list-style: none; margin: 8px 0 0; padding: 0; }
.toc-mobile li { margin: 0; }
.toc-mobile a { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; }
.toc-mobile li.lvl-3 a { padding-left: 16px; }
.toc-mobile a:hover { color: var(--link); }

/* Thanh thao tác dưới đáy màn hình điện thoại và máy bảng */
.mobile-bar { display: none; }
.sheet {
  width: 100%; max-width: 560px; max-height: 72vh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 16px 16px 0 0; background: var(--bg); color: var(--ink); box-shadow: var(--shadow-pop);
}
.sheet::backdrop { background: rgba(6, 18, 30, .5); }
.sheet__head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sheet__head h2 { margin: 0; font-size: var(--fs-md); }
.sheet ul { list-style: none; margin: 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
.sheet li a { display: flex; align-items: center; min-height: 44px; padding: 8px; border-radius: var(--r-sm); color: var(--ink); font-size: var(--fs-sm); line-height: 1.45; text-decoration: none; }
.sheet li a:hover { background: var(--navy-50); }
.sheet li.lvl-3 a { padding-left: 24px; color: var(--ink-2); }

/* Chân trang: giữ theo khối "home__footer" của truepos.vn */
.home__footer {
  --ft-bg: #f7f9ff; --ft-ink: #00446d; --ft-accent: #005d8c; --ft-rule: #00446d; --ft-icon-filter: none;
  background: var(--ft-bg); color: var(--ft-ink); padding-top: 32px; font-size: 1rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home__footer { --ft-bg: var(--surface); --ft-ink: var(--ink-2); --ft-accent: var(--link); --ft-rule: var(--line); --ft-icon-filter: brightness(0) invert(.8); }
}
:root[data-theme="dark"] .home__footer { --ft-bg: var(--surface); --ft-ink: var(--ink-2); --ft-accent: var(--link); --ft-rule: var(--line); --ft-icon-filter: brightness(0) invert(.8); }
.home__footer-container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.home__footer a { color: inherit; text-decoration: none; }
.home__footer a:hover { text-decoration: underline; }
.home__footer .box-top { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 43px; margin-bottom: 32px; }
.home__footer .box-top .logo { display: flex; flex-direction: column; text-decoration: none; }
.home__footer .box-top .logo img { width: 176px; height: auto; margin-bottom: 4px; filter: var(--ft-icon-filter); }
.home__footer .box-top .logo span { font-weight: 600; font-size: 10px; color: var(--ft-ink); }
.home__footer .box-top .text { margin: 0; }
.home__footer .box-top .text span { font-weight: 600; font-size: 16px; color: var(--ft-accent); }
.home__footer .box-middle,
.home__footer .box-bottom {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 30px;
  padding-bottom: 16px; border-bottom: 1px solid var(--ft-rule); margin-bottom: 16px;
}
.home__footer .box-bottom { align-items: start; }
.home__footer .box-bottom .col { display: flex; flex-direction: column; gap: 30px; }
.home__footer .title { margin: 0 0 16px; font-weight: 700; font-size: 16px; color: var(--ft-ink); }
.home__footer .line { display: flex; gap: 8px; margin-bottom: 12px; }
.home__footer .line:last-child { margin-bottom: 0; }
.home__footer .content { padding: 0; min-width: 0; }   /* chặn .content của layout bài viết */
.home__footer .content > * { max-width: none; margin-inline: 0; }
.home__footer .line .icon { flex: none; display: flex; width: auto; height: auto; stroke: none; }
.home__footer .line .icon img { width: 24px; height: 24px; filter: var(--ft-icon-filter); }
.home__footer .line .text { font-size: 16px; color: var(--ft-ink); overflow-wrap: anywhere; }
.home__footer .line.title { margin-bottom: 12px; }
.home__footer .line.title .text { font-weight: 700; }
.home__footer .line strong { color: var(--ft-ink); }
.home__footer .list-social { display: flex; gap: 12px; margin-top: 16px; }
.home__footer .list-social .item { display: flex; border-radius: 8px; }
.home__footer .list-social img { width: 32px; height: 32px; }
.home__footer .nav { display: flex; flex-direction: column; gap: 12px; }
.home__footer .nav-link { font-size: 16px; color: var(--ft-ink); }
.home__footer .coppy-right { padding-bottom: 16px; font-size: 16px; text-align: center; color: var(--ft-ink); }
@media (max-width: 991px) {
  .home__footer .box-middle, .home__footer .box-bottom { grid-template-columns: 1fr; }
  .home__footer .box-bottom .col { gap: 16px; }
  .home__footer .box-top .text span { display: block; }
}
@media (max-width: 767px) {
  .home__footer .box-top { margin-bottom: 16px; }
  .home__footer .box-middle, .home__footer .box-bottom { padding-bottom: 16px; }
}

/* ---------- Hộp thoại tìm kiếm ---------- */
.search-dialog {
  width: min(680px, calc(100vw - 24px)); max-height: min(600px, calc(100vh - 48px)); margin: 72px auto auto;
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow-pop);
}
.search-dialog::backdrop { background: rgba(6, 18, 30, .5); }
.search-dialog__field { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 18px; height: 60px; border-bottom: 1px solid var(--line); }
.search-dialog__field .icon { color: var(--ink-3); }
.search-dialog__field .icon-btn:hover { background: var(--surface); }
.search-dialog input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--fs-lg); color: var(--ink); }
.search-dialog input::placeholder { color: var(--ink-3); opacity: 1; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; max-height: calc(min(600px, 100vh - 48px) - 61px); }
.search-results a { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a.is-selected { background: var(--navy-50); }
.search-results .r-title { display: block; font-weight: 600; font-size: var(--fs-sm); line-height: 1.45; }
.search-results .r-path { display: block; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }
.search-results .r-snippet { display: block; color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.5; margin-top: 2px; }
.search-results mark { background: var(--mark-bg); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-empty { padding: 24px 16px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.search-hint { padding: 8px 12px 4px; color: var(--ink-3); font-size: var(--fs-xs); }
/* Kết quả dạng thả xuống dưới ô tìm kiếm trang chủ */
.hero-search .search-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 420px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
}
.hero-search .search-results:empty { display: none; }

/* Trang 404 */
.notfound { max-width: 640px; margin: 0 auto; padding: 96px 20px; }
.notfound h1 { font-size: var(--fs-2xl); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
.notfound p { color: var(--ink-2); }
.notfound__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- Thích ứng màn hình ---------- */
@media (max-width: 1180px) {
  .docs { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 1040px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero h1 { max-width: 20ch; }
  .support { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --header-h: 56px; }
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .docs { display: block; min-height: 0; }
  .docs::before { display: none; }
  .site-header__inner { padding: 0 6px 0 16px; }
  .header-search, .header-support { display: none; }
  .brand__logo { height: 24px; }

  /* Sidebar thành ngăn kéo */
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(340px, 88vw); height: 100vh; height: 100dvh;
    box-shadow: var(--shadow-pop);
    transform: translateX(-102%); visibility: hidden; transition: transform .22s ease-out, visibility 0s linear .22s; padding-top: 8px;
  }
  /* Hiện ngay khi mở (không trễ) để chuyển được focus vào ngăn kéo */
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .22s ease-out, visibility 0s; }
  .sidebar__close { display: flex; justify-content: flex-end; margin: 0 8px 4px 0; }
  .sidebar__close .icon-btn:hover { background: var(--frame-hover); }
  .nav-group > summary { min-height: 44px; }
  .nav-group li a { padding-block: 10px; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(6, 18, 30, .5); }

  /* Thanh thao tác trong tầm ngón tay */
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg); border-top: 1px solid var(--line);
  }
  .mobile-bar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: var(--bar-h); padding: 0 4px; border: 0; background: transparent; color: var(--ink-2);
    font-size: 0.75rem; font-weight: 500; line-height: 1.25; text-decoration: none; cursor: pointer;
  }
  .mobile-bar__item:active { background: var(--surface); color: var(--ui-ink); }
  .mobile-bar__item .icon { width: 22px; height: 22px; }

  .toc-mobile { display: none; }
  .content { padding: 16px 20px 56px; }
  .breadcrumb ol { margin-bottom: 16px; }
  .home-section { padding-top: 56px; }

  /* Bảng chỉ dẫn thành danh sách mở/gọn */
  .dir-row > summary { align-items: center; padding: 14px 0; }
  .dir-row__chev { display: block; }
  .dir-row__list { padding: 0 0 12px 54px; }
  .dir-row__list a { display: flex; align-items: center; min-height: 44px; padding-inline: 8px; }
  .dir-row__count { margin: 0; }
}
@media (max-width: 640px) {
  :root { --fs-md: 1rem; --fs-xl: 1.4375rem; }
  .brand__label { font-size: 0.75rem; }
  .hero__inner { padding: 28px 16px 40px; gap: 32px; }
  .hero__intro { font-size: var(--fs-md); }
  .hero-search { margin-top: 24px; }
  .hero-search__field { height: 56px; padding: 0 10px 0 14px; }
  .hero-search input { font-size: var(--fs-md); }
  .hero-search kbd { display: none; }
  .hero-quick a { padding: 8px 12px; }
  .article h2 { margin-top: 40px; padding-top: 24px; }
  .home-section { padding: 48px 16px 0; }
  .home-section--last { padding-bottom: 48px; }
  .dir-row__desc { display: none; }
  .article-list.two-col { columns: 1; }
  .support { padding: 24px 20px; }

  /* Ảnh dùng hết bề ngang điện thoại để đọc được chữ trong ảnh */
  .content { padding-inline: 16px; }
  .shot { margin-inline: -16px; }
  .shot__btn { border-inline: 0; border-radius: 0; }
  .shot figcaption { padding-inline: 16px; }
  .steps > li { padding-left: 42px; }
  .steps > li .shot { position: relative; z-index: 1; margin-left: -58px; } /* nổi trên đường nối giữa các bước */
  .shot--phone { padding-inline: 16px; }
  .shot--phone .shot__btn { border-inline: 1px solid var(--line); border-radius: var(--r-md); }
  .table-wrap { margin-inline: -16px; border-inline: 0; border-radius: 0; }

  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .feedback .btn--primary { margin-left: 0; width: 100%; justify-content: center; }
  .option dl { grid-template-columns: 1fr; gap: 0; }
  .option dd { margin-bottom: 8px; }

  /* Tìm kiếm chiếm cả màn hình, cũng là chỗ bàn phím ảo chừa lại */
  .search-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .search-dialog .search-results { max-height: calc(100dvh - 61px); }
  .home__footer-container { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, #site-header, .sidebar, .docs::before, .toc, .toc-mobile, .feedback, .pager, .site-footer, .mobile-bar, .anchor, .shot__zoom { display: none !important; }
  body { padding: 0; }
  .docs { display: block; }
  .content { padding: 0; }
}

/* ---------- Cookie consent (assets/css/cookie-consent.css) ---------- */
/* Bảng màu --cc-* mặc định đã khớp token của site; chỉ dùng chung phông chữ */
:root { --cc-font: var(--font); }
.home__footer button.nav-link { padding: 0; border: 0; background: none; font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.home__footer button.nav-link:hover { text-decoration: underline; }
