/* Trang hướng dẫn sử dụng /huong-dan (đặc tả bước 15, mục 3; quyết định 6, 8, 9, 13) — nạp sau trang-chu.css.
   Lấy từ Docs/mockup/huong-dan.mockup.html (chỉ chế độ sáng như các trang công khai khác).
   Bố cục: ≥ 1024px mục lục dính trái 260px + nội dung tối đa 720px; < 1024px nút "Mục lục ▾" dính dưới đầu trang (<details>). */
.hd { --dt: #0B8577; --dt-nen: #E3F3F0; --phu: #5B6B80; --vien: #CBD5E1; line-height: 1.6; }
.hd .b-xt-nho { background: #0B8577; border-color: #0B8577; color: #fff; }
.hd .b-xt-nho:hover { background: #0B6B60; color: #fff; }
.hd .nav a[aria-current="page"] { color: #0B8577; }
.hd-body { flex: 1; padding: 8px 0 48px; }
.hd-lay { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hd-main { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Mục lục ---------- */
/* < 1024px: cả khối dính (khối chỉ cao bằng nút), sát mép dưới đầu trang (64px), có dải nền đặc màu nền trang phủ cả bề ngang
   từ đầu trang tới hết nút → chữ nội dung không lộ ra ở khe giữa khi cuộn (sửa 29/10/2026). */
.hd-toc { min-width: 0; position: sticky; top: 64px; z-index: 4; padding: 8px 0; }
.hd-toc::before { content: ""; position: absolute; inset: 0 -16px; z-index: -1; background: #EEF2F7; } /* tràn ra đúng lề .wrap */
.toc-may { display: none; }
.hd-toc ul { list-style: none; margin: 0; padding: 0; }
.hd-toc li > a { display: block; padding: 6px 0; color: #1E293B; font-size: 15px; font-weight: 600; text-decoration: none; }
.hd-toc li li > a { padding: 4px 0 4px 12px; font-size: 14px; font-weight: 400; color: var(--phu); }
.hd-toc a:hover { color: var(--dt); }
.hd-toc a.dang-doc { color: var(--dt); }
.toc-dt { background: #fff; border: 1px solid var(--vien); border-radius: 12px; box-shadow: 0 2px 8px rgba(30, 41, 59, .06); }
.toc-dt summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; font-weight: 700; cursor: pointer; list-style: none; }
.toc-dt summary::-webkit-details-marker { display: none; }
.toc-dt summary::after { content: ""; width: 8px; height: 8px; border: solid var(--phu); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.toc-dt[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.toc-dt nav { max-height: 60vh; overflow: auto; padding: 0 14px 12px; border-top: 1px solid #E2E8F0; }
.toc-dt li > a { min-height: 40px; display: flex; align-items: center; }
.toc-dt li li > a { min-height: 36px; }

/* ---------- Đầu nội dung, ô tìm ---------- */
.hd-eye { margin: 8px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dt); }
.hd h1 { font-size: 28px; line-height: 1.25; margin: 4px 0 12px; font-weight: 800; }
.hd-dau p { margin: 0 0 10px; color: #475569; }
.hd-tim { position: relative; margin: 18px 0 0; }
.hd-tim svg { position: absolute; left: 14px; top: 15px; color: var(--phu); }
.hd-tim input { width: 100%; min-height: 48px; padding: 10px 14px 10px 42px; border: 1px solid var(--vien); border-radius: 12px; background: #fff; font: inherit; font-size: 16px; color: #1E293B; -webkit-appearance: none; appearance: none; }
.hd-tim input:focus { outline: 2px solid var(--dt); outline-offset: 1px; }
.hd-khong { margin: 12px 0 0; padding: 12px 14px; background: #E4EAF2; border-radius: 10px; }

/* ---------- Nội dung ---------- */
.hd-muc { background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(30, 41, 59, .06); padding: 20px 18px 8px; margin-top: 20px; }
.hd h2, .hd h3 { position: relative; scroll-margin-top: 64px; } /* + scroll-padding-top 76px của trang-chu.css = chừa đầu trang + nút Mục lục */
.hd h2 { font-size: 22px; line-height: 1.3; margin: 0 0 12px; font-weight: 700; }
.hd h3 { font-size: 18px; line-height: 1.35; margin: 20px 0 8px; padding-top: 20px; border-top: 1px solid #E2E8F0; font-weight: 700; }
.hd-hash { margin-left: 6px; color: var(--phu); text-decoration: none; font-weight: 400; opacity: 0; }
.hd h2:hover .hd-hash, .hd h3:hover .hd-hash, .hd-hash:focus-visible { opacity: 1; }
@media (hover: none) { .hd-hash { display: none; } }
.hd-muc p { margin: 0 0 12px; }
.hd-muc ul, .hd-muc ol { margin: 0 0 14px; padding-left: 22px; }
.hd-muc li { margin: 4px 0; }
.hd-muc ol li::marker { font-weight: 700; color: var(--dt); }
.hd-muc strong { font-weight: 700; }
.hd-ghi { margin: 0 0 14px; padding: 12px 14px; background: #EEF2F7; border-radius: 10px; }
.hd-ghi p { margin: 0; }
.hd-ghi p + p { margin-top: 8px; }
.hd-ghi.canh-bao { background: #FEF3C7; border-left: 4px solid #B45309; }
.hd-anh { margin: 4px 0 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hd-anh img { display: block; width: 100%; max-width: 320px; height: auto; border-radius: 16px; border: 1px solid var(--vien); background: #EEF2F7; }
.hd-anh figcaption { font-size: 13px; color: var(--phu); }
.hd-cuoi { margin-top: 20px; padding: 20px; border-radius: 16px; background: var(--dt-nen); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.hd-cuoi p { margin: 0; font-weight: 600; }

@media (max-width: 420px) {
  /* 390px: logo (ẩn chữ, vẫn đọc được bằng trình đọc màn hình) + Đăng nhập + Xem thử vừa một hàng. */
  .hd .topin { gap: 8px; }
  .hd .logo-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 760px) {
  .hd-toc::before { inset: 0 -32px; }
  .hd h1 { font-size: 34px; }
  .hd h2 { font-size: 22px; }
  .hd-muc { padding: 28px 32px 12px; }
}
@media (min-width: 1024px) {
  .hd-body { padding: 32px 0 64px; }
  .hd-lay { grid-template-columns: 260px minmax(0, 720px); justify-content: center; gap: 32px; }
  .hd-toc { position: static; padding: 0; }
  .hd-toc::before { content: none; }
  .toc-dt { display: none; }
  .toc-may { display: block; position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow: auto; }
  .toc-h { margin: 0 0 10px; font-weight: 700; }
  .toc-may li li > a { border-left: 2px solid var(--vien); }
  .toc-may li li > a.dang-doc { border-left-color: var(--dt); }
  .hd h2, .hd h3 { scroll-margin-top: 12px; }
}

/* ---------- In / Lưu PDF (quyết định 13) ---------- */
@media print {
  .hd .top, .hd-toc, .hd-tim, .hd .foot, .hd-cuoi, .hd-hash { display: none !important; }
  .hd, .hd-body { background: #fff; }
  .hd-body { padding: 0; }
  .hd-lay { display: block; padding: 0; }
  .hd-muc { box-shadow: none; padding: 0; margin-top: 12px; border-radius: 0; }
  .hd-anh img { max-width: 60mm; }
  .hd-anh, .hd-ghi { break-inside: avoid; }
  .hd h2, .hd h3 { break-after: avoid; }
  .hd a { color: inherit; text-decoration: none; }
}
