/* docs.nextcoreops.com — #540 D1 (design-critic SHIP vòng 2, .agent/design-previews/docs-site-540).
   Chỉ token var(--ds-*) của tokens.css (có bản tối). Lớp nc-doc-*. Mobile-first không cần: bố cục 3 cột co dần ở @media. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

.nc-doc {
  --nc-quang: color-mix(in srgb, var(--ds-primary) 16%, transparent);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ds-cream);
  color: var(--ds-ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.nc-doc a {
  color: inherit;
}

.nc-ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nc-doc code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--ds-bg-muted);
  border: 1px solid var(--ds-hairline);
  padding: 1px 6px;
  border-radius: 5px;
}

.nc-doc kbd {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--ds-border-strong);
  border-bottom-width: 2px;
  background: var(--ds-bg);
  color: var(--ds-ink-soft);
}

.nc-doc button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.nc-doc :focus-visible {
  outline: 2px solid var(--ds-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* #1710 a.… (0,1,1) để thắng .nc-doc a { color: inherit } khai trước — trước đây chữ ink trên nền primary, tối 1.82 */
a.nc-doc-skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 20;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ds-primary);
  color: var(--ds-primary-fg);
}

a.nc-doc-skip:focus {
  left: 8px;
}

/* ── thanh trên ── */
.nc-doc-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--ds-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ds-hairline);
}

.nc-doc-top__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
  text-decoration: none;
}

.nc-doc-top__brand img {
  width: 28px;
  height: 28px;
}

.nc-doc-top__sp {
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--ds-bg-muted);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ds-ink-soft);
  white-space: nowrap;
  text-decoration: none;
}

.nc-doc-tim {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 14px;
  border-radius: 10px;
  background: var(--ds-bg-muted);
  border: 1px solid var(--ds-hairline);
  color: var(--ds-ink-muted);
  font-size: 14px;
  text-align: left;
  transition: border-color var(--ds-duration-fast) var(--ds-ease-out), box-shadow var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-tim:hover {
  border-color: var(--ds-border-strong);
  box-shadow: var(--ds-elevation-1);
}

.nc-doc-tim span {
  flex: 1;
}

.nc-doc-top__phai {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--ds-ink-soft);
  white-space: nowrap;
}

.nc-doc-top__web {
  text-decoration: none;
}

.nc-doc-top__web:hover {
  color: var(--ds-primary-ink);
}

/* #1221 nút đổi ngôn ngữ vi↔en: luôn hiện kể cả màn hẹp (khác .nc-doc-top__web) */
.nc-doc-top__ngon {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
  text-decoration: none;
}

.nc-doc-top__ngon:hover {
  color: var(--ds-primary-ink);
}

.nc-doc-top__ngon-ngan {
  display: none;
  font-weight: 600;
}

.nc-doc-nut-ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--ds-hairline);
  background: var(--ds-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-ink-soft);
  transition: background var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-nut-ic:hover {
  background: var(--ds-bg-muted);
}

.nc-doc-top__menu,
.nc-doc-top__tim-nho {
  display: none;
}

/* nút đổi sáng/tối: hiện icon của chế độ SẮP chuyển tới */
.nc-doc-ic-sang {
  display: none;
}

:root[data-theme='dark'] .nc-doc-ic-toi {
  display: none;
}

:root[data-theme='dark'] .nc-doc-ic-sang {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .nc-doc-ic-toi {
    display: none;
  }

  :root[data-theme='auto'] .nc-doc-ic-sang {
    display: block;
  }
}

/* ── chip, nút ── */
.nc-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ds-bg-muted);
  border: 1px solid var(--ds-hairline);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ds-ink-soft);
  white-space: nowrap;
}

.nc-doc-chip--nut {
  min-height: 32px;
  padding: 4px 12px;
  transition: background var(--ds-duration-fast) var(--ds-ease-out), border-color var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-chip--nut:hover {
  border-color: var(--ds-primary);
  background: var(--ds-primary-tint);
  color: var(--ds-primary-ink);
}

.nc-doc-nut {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--ds-primary);
  color: var(--ds-primary-fg);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background var(--ds-duration-fast) var(--ds-ease-out), transform var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-nut:hover {
  background: var(--ds-primary-hover);
}

.nc-doc-nut:active {
  transform: translateY(1px);
}

.nc-doc .nc-doc-nut {
  color: var(--ds-primary-fg);
}

.nc-doc-a,
.nc-doc-main a:not([class]),
.nc-doc-buoc a {
  color: var(--ds-primary-ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--ds-primary-ink) 40%, transparent);
}

/* ── trang chủ: cổng sản phẩm ── */
.nc-doc-home {
  flex: 1;
  padding: 72px max(32px, calc((100vw - 1200px) / 2)) 96px;
  display: flex;
  flex-direction: column;
  gap: 64px;
  background: radial-gradient(760px 480px at 90% 0%, var(--nc-quang), transparent 70%), var(--ds-cream);
}

.nc-doc-home__dau {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  animation: nc-doc-vao var(--ds-duration) var(--ds-ease-out) both;
}

.nc-doc-home__dau h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.nc-doc-home__dau p {
  margin: 0;
  font-size: 19px;
  color: var(--ds-ink-soft);
}

.nc-doc-home__tim {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 12px 0 18px;
  border-radius: 14px;
  background: var(--ds-bg);
  border: 1px solid var(--ds-border-strong);
  box-shadow: var(--ds-elevation-2);
  font-size: 16px;
  color: var(--ds-ink-muted);
  max-width: 640px;
  text-align: left;
  transition: box-shadow var(--ds-duration-fast) var(--ds-ease-out), border-color var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-home__tim:hover {
  border-color: var(--ds-primary);
  box-shadow: var(--ds-elevation-3);
}

.nc-doc-home__tim span {
  flex: 1;
}

.nc-doc-home__pho {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13.5px;
  color: var(--ds-ink-muted);
}

.nc-doc-cong {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.nc-doc-cong__the {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: 20px;
  padding: 28px;
  border-radius: 22px;
  background: var(--ds-bg);
  border: 1px solid var(--ds-hairline);
  box-shadow: var(--ds-elevation-1);
  overflow: hidden;
  min-height: 300px;
  animation: nc-doc-vao var(--ds-duration-slow, 400ms) var(--ds-ease-out) both;
  transition: transform var(--ds-duration-fast) var(--ds-ease-out), box-shadow var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-cong__the:nth-child(2) { animation-delay: 60ms; }
.nc-doc-cong__the:nth-child(3) { animation-delay: 120ms; }
.nc-doc-cong__the:nth-child(4) { animation-delay: 180ms; }

.nc-doc-cong__the:hover {
  transform: translateY(-2px);
  box-shadow: var(--ds-elevation-3);
}

.nc-doc-cong__chu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.nc-doc-cong__chu .nc-doc-chip {
  align-self: flex-start;
}

.nc-doc-cong__chu h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
}

.nc-doc-cong__chu h2 a {
  text-decoration: none;
}

.nc-doc-cong__chu > p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ds-ink-soft);
}

.nc-doc-cong__lk {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding-top: 8px;
}

.nc-doc-cong__lk a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ds-primary-ink);
  text-decoration: none;
}

.nc-doc-cong__lk a:hover {
  text-decoration: underline;
}

.nc-doc-cong__lk .nc-ic {
  width: 14px;
  height: 14px;
}

.nc-doc-cong__lk small {
  font-size: 13.5px;
  color: var(--ds-ink-muted);
}

.nc-doc-cong__san {
  display: flex;
  align-items: center;
  border-radius: 16px;
  background: radial-gradient(ellipse 42% 38% at 50% 50%, var(--nc-quang), transparent 100%), var(--ds-bg-muted);
  overflow: hidden;
}

/* minh hoạ nhỏ trên thẻ cổng — vẽ bằng HTML, không ảnh chụp */
.nc-doc-mini {
  width: 100%;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nc-doc-mini__hang {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ds-bg);
  border: 1px solid var(--ds-hairline);
  box-shadow: var(--ds-elevation-1);
}

.nc-doc-mini__av {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ds-primary-tint);
  color: var(--ds-primary-ink);
  font-size: 11px;
  font-weight: 700;
}

.nc-doc-mini__ten {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.nc-doc-mini__ten b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-doc-mini__ten small {
  font-size: 11.5px;
  color: var(--ds-ink-muted);
  white-space: nowrap;
}

.nc-doc-mini__ma {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nc-doc-mini__tt,
.nc-doc-mini__cham {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ds-ink-muted);
}

.nc-doc-mini__tt--chay {
  background: var(--ds-success);
  animation: nc-doc-tho 2.4s var(--ds-ease-in-out) infinite;
}

.nc-doc-mini__cham--info { background: var(--ds-info); }
.nc-doc-mini__cham--warning { background: var(--ds-warning); }
.nc-doc-mini__cham--success { background: var(--ds-success); }

.nc-doc-mini__nhan {
  font-size: 11px;
  color: var(--ds-ink-muted);
  white-space: nowrap;
}

.nc-doc-mini__so {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ds-fg-3);
}

.nc-doc-mini__buoc--xong .nc-doc-mini__so { border-color: var(--ds-success); background: var(--ds-success); }
.nc-doc-mini__buoc--dang .nc-doc-mini__so { border-color: var(--ds-primary); animation: nc-doc-tho 1.6s var(--ds-ease-in-out) infinite; }
.nc-doc-mini__buoc--cho { opacity: 0.6; }

.nc-doc-home__hai {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
}

.nc-doc-o {
  padding: 28px;
  border-radius: 22px;
  background: var(--ds-bg);
  border: 1px solid var(--ds-hairline);
}

.nc-doc-o h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.nc-doc-buoc {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nc-doc-buoc li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ds-ink-soft);
}

.nc-doc-buoc li > b {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ds-primary-soft);
  color: var(--ds-primary-ink);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nc-doc-o--toi {
  background: var(--ds-forest);
  color: var(--ds-forest-fg);
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nc-doc-o--toi h2 {
  margin: 0;
}

.nc-doc-o--toi p {
  margin: 0;
  color: color-mix(in srgb, var(--ds-forest-fg) 78%, transparent);
  font-size: 15px;
}

/* ── chân ── */
.nc-doc-chan {
  padding: 28px 32px;
  border-top: 1px solid var(--ds-hairline);
  background: var(--ds-bg);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--ds-ink-muted);
}

/* ── trang bài 3 cột ── */
.nc-doc-mlbar {
  display: none;
}

.nc-doc-bai {
  flex: 1;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 232px;
  background: var(--ds-bg);
}

.nc-doc-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nc-doc-nav--cot {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 28px 20px 40px 32px;
  border-right: 1px solid var(--ds-hairline);
  background: var(--ds-cream);
  /* #1710 sếp 14:29: ẩn thanh cuộn thừa — vẫn cuộn bằng chuột / trackpad / bàn phím; mục đang mở tự cuộn vào giữa (docs.js) */
  scrollbar-width: none;
}

.nc-doc-nav--cot::-webkit-scrollbar,
.nc-doc-ngan .nc-doc-nav::-webkit-scrollbar {
  display: none;
}

.nc-doc-nav__nhom b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-primary-ink);
  margin-bottom: 6px;
  padding: 0 10px;
}

.nc-doc-nav__nhom a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ds-ink);
  text-decoration: none;
  transition: background var(--ds-duration-fast) var(--ds-ease-out);
}

/* #1710 mục con: thụt + đường dẫn dọc, chữ nhẹ hơn mục cha */
.nc-doc-nav__con {
  display: flex;
  flex-direction: column;
  margin: 2px 0 4px 12px;
  padding-left: 12px;
  border-left: 1px solid var(--ds-hairline);
}

.nc-doc-nav__nhom .nc-doc-nav__con a {
  min-height: 30px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ds-ink-soft);
}

.nc-doc-nav__nhom a:focus-visible {
  outline: 2px solid var(--ds-primary);
  outline-offset: -2px;
}

.nc-doc-nav__nhom a:hover {
  background: var(--ds-bg-muted);
}

.nc-doc-nav__nhom a[aria-current='page'],
.nc-doc-nav__nhom .nc-doc-nav__con a[aria-current='page'] {
  background: var(--ds-primary-tint);
  color: var(--ds-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ds-primary);
}

.nc-doc-main {
  /* #1746 (D2 11.1-02): MỘT cột đọc ≤ 960 px căn giữa cột giữa — chữ, bảng, ảnh, mã chung mép trái; khổ rộng chia đều khoảng trống hai bên */
  padding: 36px max(64px, calc((100% - 960px) / 2)) 72px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  animation: nc-doc-vao var(--ds-duration) var(--ds-ease-out) both;
}

/* #1710 (D2) + #1746: đoạn văn ≤ 64ch (≈ 88 ký tự tiếng Việt/dòng; 72ch đo ra 99); bảng, ảnh, sơ đồ, khối mã dùng hết cột đọc */
.nc-doc-main > :where(h1, h2, h3, h4, p, ul, ol, dl, blockquote, .nc-doc-dan) {
  max-width: 64ch;
}

.nc-doc-main--mot {
  flex: 1;
  margin: 0 auto;
  max-width: 840px;
}

.nc-doc-main > * {
  margin: 0;
}

.nc-doc-vet {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ds-ink-muted);
}

.nc-doc-vet a {
  text-decoration: none;
}

.nc-doc-vet a:hover {
  color: var(--ds-primary-ink);
}

.nc-doc-vet .nc-ic {
  width: 13px;
  height: 13px;
}

.nc-doc-main h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.nc-doc-dan {
  font-size: 18px;
  color: var(--ds-ink-soft);
}

.nc-doc-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ds-ink-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ds-hairline);
}

.nc-doc-main h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 20px;
  letter-spacing: -0.005em;
}

.nc-doc-main h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 8px;
}

.nc-doc-anchor {
  margin-left: -20px;
  width: 20px;
  display: inline-block;
  color: var(--ds-ink-muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-main :is(h2, h3):hover .nc-doc-anchor,
.nc-doc-anchor:focus-visible {
  opacity: 1;
}

.nc-doc-main p,
.nc-doc-main li {
  font-size: 16px;
  color: var(--ds-ink-soft);
}

.nc-doc-main :is(ul, ol) {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nc-doc-main strong {
  color: var(--ds-ink);
}

.nc-doc-main img {
  max-width: 100%;
  height: auto;
}

/* thẻ tự viết bằng HTML trong index.md (giữ cho trang /index nếu có) */
.nc-doc-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nc-doc-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--ds-hairline);
  text-decoration: none;
  color: var(--ds-ink-soft);
  font-size: 14px;
}

.nc-doc-card strong {
  color: var(--ds-ink);
  font-size: 16px;
}

/* lưu ý / gợi ý */
.nc-doc-luu {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.55;
}

.nc-doc-luu > .nc-ic {
  width: 19px;
  height: 19px;
  margin-top: 2px;
}

.nc-doc-luu p {
  margin: 0;
  color: inherit;
  font-size: 15px;
}

.nc-doc-luu p + p {
  margin-top: 6px;
}

.nc-doc-luu strong {
  color: inherit;
}

.nc-doc-luu--goi {
  background: var(--ds-info-soft);
  color: var(--ds-info-ink);
}

.nc-doc-luu--canh {
  background: var(--ds-warning-soft);
  color: var(--ds-warning-ink);
}

/* ảnh trong khung cửa sổ */
.nc-doc-anh {
  margin: 4px 0;
  border-radius: 14px;
  border: 1px solid var(--ds-hairline);
  background: var(--ds-bg-muted);
  padding: 8px;
  box-shadow: var(--ds-elevation-2);
}

.nc-doc-anh__thanh {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 6px 8px;
  font-size: 12px;
  color: var(--ds-ink-muted);
}

.nc-doc-anh__thanh i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ds-border-strong);
}

.nc-doc-anh__thanh span {
  margin-left: 6px;
}

.nc-doc-anh img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.nc-doc-anh figcaption {
  font-size: 13px;
  color: var(--ds-ink-muted);
  padding: 8px 6px 2px;
}

/* khối mã — nền tối cả hai chế độ (forest + surface tối của token) */
.nc-doc-ma {
  border-radius: 12px;
  overflow: hidden;
  background: var(--ds-forest);
  color: var(--ds-forest-fg);
  border: 1px solid var(--ds-hairline);
}

.nc-doc-ma__thanh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  padding: 4px 6px 4px 14px;
  background: color-mix(in srgb, var(--ds-forest-fg) 8%, var(--ds-forest));
  font-size: 12px;
  color: color-mix(in srgb, var(--ds-forest-fg) 70%, transparent);
}

.nc-doc-chep {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: inherit;
  transition: background var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc .nc-doc-chep {
  color: color-mix(in srgb, var(--ds-forest-fg) 85%, transparent);
}

.nc-doc-chep:hover {
  background: color-mix(in srgb, var(--ds-forest-fg) 12%, transparent);
}

.nc-doc-chep .nc-ic {
  width: 14px;
  height: 14px;
}

.nc-doc-ma pre {
  margin: 0;
  padding: 14px 16px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nc-doc-ma code {
  all: unset;
  font: inherit;
}

.nc-doc-ma--nho pre {
  font-size: 11px;
  padding: 10px 12px;
}

/* bảng */
.nc-doc-table {
  overflow-x: auto;
  border: 1px solid var(--ds-hairline);
  border-radius: 12px;
}

.nc-doc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.nc-doc-table th,
.nc-doc-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--ds-hairline);
  color: var(--ds-ink-soft);
}

.nc-doc-table th {
  border-top: 0;
  background: var(--ds-bg-muted);
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-ink-muted);
}

/* bài trước / sau + góp ý */
.nc-doc-tiep {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 24px !important;
}

.nc-doc-tiep a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--ds-hairline);
  font-size: 13px;
  color: var(--ds-ink-muted);
  text-decoration: none;
  transition: border-color var(--ds-duration-fast) var(--ds-ease-out), background var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-tiep a:hover {
  border-color: var(--ds-primary);
  background: var(--ds-primary-tint);
}

.nc-doc-tiep b {
  font-size: 15.5px;
  color: var(--ds-primary-ink);
}

.nc-doc-tiep__sau {
  text-align: right;
}

.nc-doc-gop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ds-ink-muted);
  padding-top: 20px;
  border-top: 1px solid var(--ds-hairline);
}

.nc-doc-gop__cam {
  color: var(--ds-success-ink);
  font-weight: 600;
}

/* cột phải: trong trang */
.nc-doc-aside {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 36px 28px 40px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
}

.nc-doc-aside > b {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ds-ink-muted);
  margin-bottom: 8px;
}

.nc-doc-aside > a {
  color: var(--ds-ink-muted);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--ds-hairline);
  line-height: 1.4;
  transition: color var(--ds-duration-fast) var(--ds-ease-out), border-color var(--ds-duration-fast) var(--ds-ease-out);
}

.nc-doc-aside > a:hover {
  color: var(--ds-ink);
}

.nc-doc-aside > a.on {
  color: var(--ds-primary-ink);
  font-weight: 600;
  border-left-color: var(--ds-primary);
}

.nc-doc-aside > a.con {
  padding-left: 24px;
}

.nc-doc-aside__phu {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ds-hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nc-doc-aside__phu a {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  color: var(--ds-ink-soft);
  text-decoration: none;
}

.nc-doc-aside__phu a:hover {
  color: var(--ds-primary-ink);
}

.nc-doc-aside__phu .nc-ic {
  width: 14px;
  height: 14px;
}

/* ── ngăn kéo mục lục (≤ 860px) ── */
.nc-doc-man {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--ds-forest) 45%, transparent);
  animation: nc-doc-mo var(--ds-duration-fast) var(--ds-ease-out) both;
}

.nc-doc-ngan {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 31;
  width: min(320px, 86vw);
  background: var(--ds-bg);
  box-shadow: var(--ds-elevation-4);
  display: flex;
  flex-direction: column;
  animation: nc-doc-trai var(--ds-duration) var(--ds-ease-out) both;
}

.nc-doc-ngan[hidden],
.nc-doc-man[hidden],
.nc-doc-k[hidden] {
  display: none;
}

.nc-doc-ngan__dau {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--ds-hairline);
  font-weight: 700;
}

.nc-doc-ngan .nc-doc-nav {
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: none;
}

/* ── tìm Ctrl+K ── */
.nc-doc-k {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 96px 16px 16px;
  background: color-mix(in srgb, var(--ds-forest) 40%, transparent);
  animation: nc-doc-mo var(--ds-duration-fast) var(--ds-ease-out) both;
}

.nc-doc-k__hop {
  width: min(640px, 100%);
  align-self: flex-start;
  max-height: calc(100vh - 128px);
  display: flex;
  flex-direction: column;
  background: var(--ds-bg);
  border-radius: 18px;
  box-shadow: var(--ds-elevation-4);
  overflow: hidden;
  border: 1px solid var(--ds-hairline);
  animation: nc-doc-vao var(--ds-duration-fast) var(--ds-ease-out) both;
}

.nc-doc-k__o {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ds-hairline);
}

.nc-doc-k__o .nc-ic {
  width: 20px;
  height: 20px;
  color: var(--ds-ink-muted);
}

.nc-doc-k__o input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: var(--ds-ink);
  outline: none;
}

.nc-doc-k__o input::-webkit-search-cancel-button {
  display: none;
}

/* hộp tìm đã là vùng nhập — viền focus ở cả HỘP, không chồng thêm viền trong ô */
.nc-doc-k__o input:focus-visible {
  outline: none;
}

.nc-doc-k__o:focus-within {
  box-shadow: inset 0 -2px 0 var(--ds-primary);
}

.nc-doc-k__than {
  overflow-y: auto;
  padding: 8px;
}

.nc-doc-k__nhom {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-ink-muted);
  padding: 10px 10px 4px;
}

.nc-doc-k__kq {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.nc-doc-k__kq[aria-selected='true'] {
  background: var(--ds-primary-tint);
  box-shadow: inset 3px 0 0 var(--ds-primary);
}

.nc-doc-k__kq > i {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ds-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--ds-ink-muted);
}

.nc-doc-k__kq > i .nc-ic {
  width: 16px;
  height: 16px;
}

.nc-doc-k__kq span {
  min-width: 0;
}

.nc-doc-k__kq b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
}

.nc-doc-k__kq small {
  display: block;
  font-size: 13px;
  color: var(--ds-ink-muted);
  line-height: 1.45;
}

.nc-doc-k__kq mark {
  background: var(--ds-warning-soft);
  color: var(--ds-ink);
  border-radius: 3px;
  padding: 0 2px;
}

.nc-doc-k__chan {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--ds-hairline);
  background: var(--ds-bg-muted);
  font-size: 12px;
  color: var(--ds-ink-muted);
}

.nc-doc-k__chan span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nc-doc-k__rong {
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.nc-doc-k__rong > i {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ds-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-ink-muted);
}

.nc-doc-k__rong b {
  font-size: 16px;
}

.nc-doc-k__rong p {
  margin: 0;
  font-size: 14px;
  color: var(--ds-ink-muted);
  max-width: 420px;
}

.nc-doc-k__goiy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.nc-doc-k__dang {
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nc-doc-k__dang s {
  display: block;
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--ds-bg-muted), var(--ds-mist), var(--ds-bg-muted));
  background-size: 200% 100%;
  animation: nc-doc-vet 1.4s linear infinite;
}

/* ── hoạt ảnh ── */
@keyframes nc-doc-vao {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes nc-doc-mo {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes nc-doc-trai {
  from { transform: translateX(-100%); }
  to { transform: none; }
}

@keyframes nc-doc-tho {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes nc-doc-vet {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nc-doc *,
  .nc-doc *::before,
  .nc-doc *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── khổ máy ── */
@media (max-width: 1199px) {
  .nc-doc-bai {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .nc-doc-aside {
    display: none;
  }

  .nc-doc-main {
    padding: 32px 40px 64px;
  }

  .nc-doc-cong__the {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .nc-doc-top__web {
    display: none;
  }
}

@media (max-width: 860px) {
  .nc-doc-top {
    height: 56px;
    gap: 10px;
    padding: 0 16px;
  }

  .nc-doc-top__menu,
  .nc-doc-top__tim-nho {
    display: inline-flex;
  }

  .nc-doc-top__sp,
  .nc-doc-tim {
    display: none;
  }

  .nc-doc-top__brand {
    flex: 1;
    min-width: 0;
    min-height: 44px;
  }

  .nc-doc-top__phai {
    gap: 8px;
  }

  /* #1221 màn hẹp: «EN»/«VI» thay chữ đầy đủ, không đè tên trang; vùng chạm 44px */
  .nc-doc-top__ngon {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .nc-doc-top__ngon-dai {
    display: none;
  }

  .nc-doc-top__ngon-ngan {
    display: inline;
  }

  /* vùng chạm ≥ 44px trên điện thoại (design-critic vòng 2) */
  .nc-doc-nut-ic {
    width: 44px;
    height: 44px;
  }

  .nc-doc-nav__nhom a,
  .nc-doc-nav__nhom .nc-doc-nav__con a {
    min-height: 44px;
  }

  .nc-doc-mlbar {
    position: sticky;
    top: 56px;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 0 8px;
    background: var(--ds-bg);
    border-bottom: 1px solid var(--ds-hairline);
    font-size: 14px;
    font-weight: 600;
  }

  .nc-doc-mlbar > * {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    background: none;
    text-decoration: none;
  }

  .nc-doc-mlbar a {
    color: var(--ds-ink-muted);
    font-weight: 500;
  }

  .nc-doc-bai {
    grid-template-columns: minmax(0, 1fr);
  }

  .nc-doc-nav--cot {
    display: none;
  }

  .nc-doc-main {
    padding: 20px 16px 48px;
    gap: 16px;
  }

  .nc-doc-main h1 {
    font-size: 30px;
  }

  .nc-doc-dan {
    font-size: 16px;
  }

  .nc-doc-main h2 {
    font-size: 21px;
  }

  .nc-doc-home {
    padding: 40px 16px 64px;
    gap: 40px;
  }

  .nc-doc-home__dau p {
    font-size: 17px;
  }

  .nc-doc-cong,
  .nc-doc-home__hai,
  .nc-doc-cards,
  .nc-doc-tiep {
    grid-template-columns: minmax(0, 1fr);
  }

  .nc-doc-cong__the {
    padding: 20px;
  }

  .nc-doc-tiep__sau {
    text-align: left;
  }

  .nc-doc-chan {
    flex-direction: column;
    padding: 24px 16px;
  }

  .nc-doc-k {
    padding-top: 16px;
  }

  .nc-doc-k__hop {
    max-height: calc(100vh - 32px);
  }

  .nc-doc-k__chan {
    display: none;
  }
}
