/* PMS-143B — trang Hướng dẫn sử dụng (/huong-dan). Tiền tố hd-. Màu theo token styles.css (sáng; [data-theme="night"] tối).
   Bố cục: ≥ 1180 px 3 cột (mục lục · bài · "Trên trang này") · 860–1179 px 2 cột · < 860 px 1 cột, mục lục trượt từ trái. */
.hd-trang {
  --hd-navy: #0b1f33;
  --hd-nhan: var(--teal);
  --hd-vang-nen: #fff8e6; --hd-vang-vien: #f5c451; --hd-vang-chu: #7a4b00;
  --hd-do-nen: #fdecec; --hd-do-vien: #f19c97; --hd-do-chu: #8f1d16;
  --hd-xanh-nen: #e8f6ef; --hd-xanh-vien: #8fd3b2; --hd-xanh-chu: #0f5d3c;
  --hd-dau-cao: 68px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
}
:root[data-theme="night"] .hd-trang {
  --hd-vang-nen: rgba(245, 158, 11, 0.12); --hd-vang-vien: rgba(245, 196, 81, 0.45); --hd-vang-chu: #ffd88a;
  --hd-do-nen: rgba(217, 45, 32, 0.14); --hd-do-vien: rgba(241, 156, 151, 0.45); --hd-do-chu: #ffb4ae;
  --hd-xanh-nen: rgba(34, 160, 107, 0.14); --hd-xanh-vien: rgba(143, 211, 178, 0.4); --hd-xanh-chu: #9fe6c3;
}
.hd-trang a { color: var(--blue); }
:root[data-theme="night"] .hd-trang a { color: #8ab8ff; }
.hd-bo-qua { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.hd-bo-qua:focus { left: 12px; }

/* ---- Đầu trang ---- */
.hd-dau { position: sticky; top: 0; z-index: 30; background: var(--hd-navy); color: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.hd-dau-trong { max-width: 1440px; margin: 0 auto; height: var(--hd-dau-cao); display: flex; align-items: center; gap: 20px; padding: 0 20px; }
.hd-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff !important; flex: 0 0 auto; }
.hd-logo img { height: 34px; width: auto; background: #fff; border-radius: 8px; padding: 4px 8px; }
.hd-logo-chu { display: flex; flex-direction: column; line-height: 1.2; }
.hd-logo-chu strong { font-size: 16px; }
.hd-logo-chu small { font-size: 11px; color: #a9bdd2; }
.hd-tim { position: relative; flex: 1 1 auto; max-width: 620px; margin: 0 auto; }
.hd-tim input {
  width: 100%; height: 42px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1); color: #fff; padding: 0 44px 0 42px; font: inherit; font-size: 14px;
}
.hd-tim input::placeholder { color: #b6c6d7; }
.hd-tim input:focus { outline: none; background: #fff; color: var(--hd-navy); border-color: #fff; box-shadow: 0 0 0 3px rgba(227, 27, 35, 0.35); }
.hd-tim input:focus::placeholder { color: #6b7a8c; }
.hd-tim-ic { position: absolute; left: 13px; top: 11px; width: 20px; height: 20px; fill: none; stroke: #b6c6d7; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.hd-tim-phim { position: absolute; right: 12px; top: 10px; font: 600 12px/20px inherit; padding: 0 7px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.3); color: #c9d6e3; }
.hd-tim input:focus ~ .hd-tim-phim { display: none; }
.hd-goi-y {
  position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18); overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.hd-goi-y a { display: block; padding: 10px 14px; color: var(--ink) !important; text-decoration: none; border-bottom: 1px solid var(--line); }
.hd-goi-y a:last-child { border-bottom: 0; }
.hd-goi-y a:hover, .hd-goi-y a.on { background: var(--surface-2); }
.hd-goi-y strong { display: block; font-size: 14px; }
.hd-goi-y small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.hd-goi-y .hd-goi-y-het { padding: 12px 14px; color: var(--muted); font-size: 13px; }
.hd-dau-nut { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.hd-nut-tron { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.hd-nut-tron svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.hd-nut-tron:hover { background: rgba(255, 255, 255, 0.1); }
.hd-nut-chinh { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--teal); color: #fff !important; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; border: 0; cursor: pointer; font-family: inherit; }
.hd-nut-chinh:hover { background: var(--teal-dark); }
:root[data-theme="night"] .hd-nut-chinh:hover { background: #c9161d; }
.hd-nut-phu { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink) !important; font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.hd-nut-phu:hover { border-color: var(--muted); }
.hd-nut-phu.nguy { color: var(--red) !important; }
.hd-nut-phu[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---- Khung 3 cột ---- */
.hd-khung { flex: 1 0 auto; width: 100%; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 272px minmax(0, 1fr) 220px; gap: 32px; padding: 24px 20px 48px; }
.hd-muc-luc { position: sticky; top: calc(var(--hd-dau-cao) + 24px); align-self: start; max-height: calc(100vh - var(--hd-dau-cao) - 48px); overflow-y: auto; padding-right: 4px; font-size: 14px; }
.hd-ml-dau { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hd-ml-dau strong { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hd-ml-dong { display: none; }
.hd-cong-tac { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 12px; cursor: pointer; }
.hd-cong-tac input { width: 16px; height: 16px; accent-color: var(--teal); }
.hd-ml-nhom { margin: 14px 0 4px; }
.hd-ml-nhom > a { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink) !important; text-decoration: none; padding: 4px 8px; font-size: 13.5px; }
.hd-ml-nhom > a small { color: var(--muted); font-weight: 500; }
.hd-ml-bai { display: block; padding: 7px 8px 7px 14px; margin: 1px 0; border-left: 2px solid var(--line); color: var(--ink) !important; text-decoration: none; line-height: 1.35; border-radius: 0 8px 8px 0; }
.hd-ml-bai:hover { background: var(--surface-2); }
.hd-ml-bai.on { border-left-color: var(--teal); background: rgba(227, 27, 35, 0.07); color: var(--teal) !important; font-weight: 600; }
:root[data-theme="night"] .hd-ml-bai.on { color: #ff8a8e !important; background: rgba(227, 27, 35, 0.14); }
.hd-ml-bai.ngoai { color: var(--muted) !important; }
.hd-the-nho { display: inline-block; font-size: 10.5px; font-weight: 600; line-height: 16px; padding: 0 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.hd-the-nho.an { background: var(--hd-do-nen); color: var(--hd-do-chu); border-color: var(--hd-do-vien); }
.hd-the-nho.chinh { background: var(--hd-vang-nen); color: var(--hd-vang-chu); border-color: var(--hd-vang-vien); }
.hd-the-nho.them { background: var(--hd-xanh-nen); color: var(--hd-xanh-chu); border-color: var(--hd-xanh-vien); }
.hd-ml-soan { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.hd-mo-muc-luc { display: none; }
.hd-man-nen { position: fixed; inset: 0; background: rgba(5, 15, 25, 0.45); z-index: 39; }

.hd-giua { min-width: 0; max-width: 820px; outline: none; }
.hd-tren-trang { position: sticky; top: calc(var(--hd-dau-cao) + 24px); align-self: start; font-size: 13px; max-height: calc(100vh - var(--hd-dau-cao) - 48px); overflow-y: auto; }
.hd-tren-trang strong { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hd-tren-trang a { display: block; padding: 4px 0 4px 10px; border-left: 2px solid var(--line); color: var(--muted) !important; text-decoration: none; line-height: 1.35; }
.hd-tren-trang a.cap-3 { padding-left: 22px; font-size: 12.5px; }
.hd-tren-trang a.on { color: var(--ink) !important; border-left-color: var(--teal); font-weight: 600; }
.hd-mo-nhat { color: var(--muted); }

/* ---- Trang chủ hướng dẫn ---- */
.hd-anh-dau { border-radius: 18px; padding: 28px 28px 24px; background: linear-gradient(135deg, #0b1f33 0%, #12304a 60%, #1d4366 100%); color: #fff; position: relative; overflow: hidden; }
.hd-anh-dau::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(227, 27, 35, 0.22); }
.hd-anh-dau h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.hd-anh-dau p { margin: 0; color: #c9d6e3; max-width: 560px; }
.hd-anh-dau .hd-xin-chao { color: #fff; font-weight: 600; margin-bottom: 4px; }
.hd-loi-nhac { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--hd-vang-nen); border: 1px solid var(--hd-vang-vien); color: var(--hd-vang-chu); font-size: 14px; }
.hd-loi-nhac a { color: inherit !important; font-weight: 600; }
.hd-luoi-nhom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0 8px; }
.hd-the-nhom { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink) !important; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.hd-the-nhom:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--teal); }
.hd-the-nhom .hd-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(227, 27, 35, 0.1); color: var(--teal); }
.hd-the-nhom .hd-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hd-the-nhom strong { font-size: 15px; }
.hd-the-nhom small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.hd-muc { margin-top: 28px; }
.hd-muc > h2 { font-size: 18px; margin: 0 0 12px; }
.hd-luoi-bai { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hd-the-bai { display: block; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink) !important; }
.hd-the-bai:hover { border-color: var(--teal); }
.hd-the-bai strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.hd-the-bai small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.hd-the-bai .hd-doan { margin-top: 6px; font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; }

/* ---- Bài ---- */
.hd-duong { font-size: 13px; color: var(--muted); margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.hd-duong a { color: var(--muted) !important; text-decoration: none; }
.hd-duong a:hover { color: var(--ink) !important; text-decoration: underline; }
.hd-bai-dau h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
.hd-bai-tom { font-size: 16px; color: var(--muted); margin: 0 0 10px; line-height: 1.55; }
.hd-bai-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 12.5px; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.hd-bai-cong-cu { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.hd-bai-than { font-size: 15.5px; line-height: 1.7; color: var(--ink); padding-top: 6px; }
.hd-bai-than h2 { font-size: 20px; margin: 30px 0 10px; scroll-margin-top: calc(var(--hd-dau-cao) + 16px); }
.hd-bai-than h3 { font-size: 16.5px; margin: 22px 0 8px; scroll-margin-top: calc(var(--hd-dau-cao) + 16px); }
.hd-bai-than p { margin: 10px 0; }
.hd-bai-than code { font-size: 0.9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.hd-bai-than .hd-ds { padding-left: 22px; margin: 8px 0; }
.hd-bai-than .hd-ds li { margin: 4px 0; }
.hd-nut { display: inline-block; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); font-weight: 600; font-size: 0.9em; line-height: 1.6; white-space: nowrap; color: var(--ink); }
.hd-mo { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; background: rgba(227, 27, 35, 0.09); color: var(--teal) !important; font-weight: 600; font-size: 0.9em; text-decoration: none; }
.hd-mo::after { content: "→"; }
:root[data-theme="night"] .hd-mo { color: #ff9a9e !important; background: rgba(227, 27, 35, 0.18); }
.hd-buoc { list-style: none; padding: 0; margin: 16px 0; counter-reset: none; }
.hd-buoc-the { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 0 0 18px; }
.hd-buoc-the::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.hd-buoc-the:last-child::before { display: none; }
.hd-buoc-so { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hd-navy); color: #fff; font-weight: 700; font-size: 15px; position: relative; z-index: 1; }
:root[data-theme="night"] .hd-buoc-so { background: #24507a; }
.hd-buoc-noi { padding: 6px 16px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.hd-buoc-noi > p:first-child { margin-top: 2px; }
.hd-buoc-tieu { font-weight: 500; }
.hd-khoi { margin: 16px 0; padding: 12px 16px; border-radius: 12px; border: 1px solid; border-left-width: 4px; }
.hd-khoi > :last-child { margin-bottom: 2px; }
.hd-khoi-tieu { margin: 0 0 4px !important; font-weight: 700; font-size: 14px; }
.hd-luu-y { background: var(--hd-vang-nen); border-color: var(--hd-vang-vien); color: var(--hd-vang-chu); }
.hd-canh-bao { background: var(--hd-do-nen); border-color: var(--hd-do-vien); color: var(--hd-do-chu); }
.hd-meo { background: var(--hd-xanh-nen); border-color: var(--hd-xanh-vien); color: var(--hd-xanh-chu); }
.hd-khoi .hd-nut { color: var(--ink); }
.hd-anh { margin: 14px 0; }
.hd-anh img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); cursor: zoom-in; background: var(--surface); }
.hd-anh figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; text-align: center; }
.hd-bang-boc { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hd-bang { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.hd-bang th { text-align: left; background: var(--hd-navy); color: #fff; padding: 10px 12px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.hd-bang td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.hd-bang tbody tr:nth-child(even) td { background: var(--surface-2); }
.hd-bang tr.hd-khop td { background: var(--hd-vang-nen) !important; }
.hd-loc-su-co { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.hd-loc-su-co input { flex: 1 1 240px; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }

.hd-bai-chan { margin-top: 32px; display: grid; gap: 16px; }
.hd-giup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.hd-giup > span { font-weight: 600; margin-right: 4px; }
.hd-giup .on { border-color: var(--teal); color: var(--teal) !important; }
.hd-giup textarea { flex: 1 1 100%; }
.hd-truoc-sau { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hd-truoc-sau a { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink) !important; }
.hd-truoc-sau a small { display: block; color: var(--muted); font-size: 12px; }
.hd-truoc-sau a.sau { text-align: right; grid-column: 2; }
.hd-truoc-sau a:hover { border-color: var(--teal); }
.hd-lien-quan { font-size: 14px; }
.hd-lien-quan strong { display: block; margin-bottom: 6px; }
.hd-ho-tro { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.hd-ho-tro > span { flex: 1 1 260px; }

/* ---- Hộp ---- */
.hd-hop { border: 0; padding: 0; border-radius: 16px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); }
.hd-hop::backdrop { background: rgba(5, 15, 25, 0.55); }
.hd-hop-nho { width: min(440px, calc(100vw - 24px)); }
.hd-hop-than { padding: 18px 20px 20px; }
.hd-hop-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hd-hop-dau h2 { margin: 0; font-size: 18px; }
.hd-hop-x { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.hd-truong { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.hd-truong small { font-weight: 400; color: var(--muted); }
.hd-truong input, .hd-truong select, .hd-truong textarea, .hd-giup textarea { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 400; }
.hd-truong textarea { min-height: 96px; resize: vertical; }
.hd-hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hd-hang-nut { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.hd-loi { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0; }
.hd-tu-dong { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin: 0 0 12px; line-height: 1.5; }
.hd-hop-soan { width: min(1280px, calc(100vw - 24px)); height: calc(100vh - 32px); }
.hd-hop-soan .hd-hop-than { height: 100%; display: flex; flex-direction: column; }
.hd-soan-luoi { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hd-soan-trai { display: flex; flex-direction: column; min-height: 0; }
.hd-soan-thanh { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hd-soan-thanh button { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.hd-soan-trai textarea { flex: 1 1 auto; min-height: 220px; width: 100%; resize: none; font: 13px/1.6 Consolas, "Cascadia Mono", monospace; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.hd-soan-xem { overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 18px; background: var(--bg); }
.hd-soan-meta { display: grid; grid-template-columns: 2fr 1fr 1fr 80px; gap: 0 10px; }
.hd-soan-meta .rong { grid-column: span 2; }
.hd-soan-co { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; margin: -2px 0 10px; }
.hd-soan-co label { display: flex; align-items: center; gap: 6px; }
.hd-canh-bao-ds { font-size: 12.5px; color: var(--hd-vang-chu); background: var(--hd-vang-nen); border: 1px solid var(--hd-vang-vien); border-radius: 9px; padding: 6px 10px; margin: 6px 0 0; }
.hd-ls { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow-y: auto; }
.hd-ls li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hd-ls-xem { margin-top: 12px; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px; background: var(--bg); }
.hd-anh-to { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.hd-anh-to::backdrop { background: rgba(0, 0, 0, 0.82); }
.hd-anh-to img { display: block; max-width: 96vw; max-height: 88vh; border-radius: 10px; cursor: zoom-out; }
.hd-anh-to p { color: #e7edf4; text-align: center; margin: 8px 0 0; font-size: 13px; }
.hd-thong-bao { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--hd-navy); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); }
.hd-thong-bao.hien { opacity: 1; transform: translateX(-50%) translateY(0); }
.hd-thong-bao.loi { background: var(--red); }
.hd-bang-ph { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hd-bang-ph th, .hd-bang-ph td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hd-bang-ph th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.hd-chan { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; max-width: 1440px; width: 100%; margin: 0 auto; padding: 18px 20px 28px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---- Màn vừa / hẹp ---- */
@media (max-width: 1179px) {
  .hd-khung { grid-template-columns: 248px minmax(0, 1fr); }
  .hd-tren-trang { display: none !important; }
}
@media (max-width: 859px) {
  .hd-trang { --hd-dau-cao: 112px; }
  .hd-dau-trong { height: auto; flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px; }
  .hd-logo img { height: 30px; }
  .hd-logo-chu small { display: none; }
  .hd-dau-nut { margin-left: auto; }
  .hd-nut-chinh { height: 38px; padding: 0 12px; font-size: 13px; }
  .hd-tim { order: 3; flex: 1 1 100%; max-width: none; }
  .hd-tim-phim { display: none; }
  .hd-khung { display: block; padding: 12px 16px 40px; }
  .hd-mo-muc-luc { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; margin: 0 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .hd-mo-muc-luc svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .hd-muc-luc { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; z-index: 40; background: var(--surface); padding: 16px; box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25); transform: translateX(-105%); transition: transform 0.22s ease; }
  .hd-muc-luc.mo { transform: none; }
  .hd-ml-dong { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 20px; }
  .hd-ml-bai, .hd-ml-nhom > a { min-height: 44px; display: flex; align-items: center; }
  .hd-luoi-nhom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-luoi-bai { grid-template-columns: 1fr; }
  .hd-anh-dau { padding: 20px 18px; border-radius: 14px; }
  .hd-anh-dau h1 { font-size: 21px; }
  .hd-bai-dau h1 { font-size: 22px; }
  .hd-bai-than { font-size: 15px; }
  .hd-bai-cong-cu { margin-left: 0; width: 100%; }
  .hd-buoc-the { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .hd-buoc-so { width: 30px; height: 30px; font-size: 13px; }
  .hd-buoc-the::before { left: 14px; top: 30px; }
  .hd-buoc-noi { padding: 4px 12px 8px; }
  /* bảng (sự cố) thành thẻ: mỗi dòng một khối, nhãn cột đứng trước ô */
  .hd-bang-boc { border: 0; background: transparent; overflow: visible; }
  .hd-bang thead { display: none; }
  .hd-bang, .hd-bang-ph { min-width: 0; }   /* luật chung styles.css table { min-width: 680px } làm thẻ tràn ngang */
  .hd-bang td { overflow-wrap: anywhere; }
  .hd-bang, .hd-bang tbody, .hd-bang tr, .hd-bang td { display: block; width: 100%; }
  .hd-bang tr { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
  .hd-bang td { border-top: 1px solid var(--line); background: transparent !important; padding: 8px 12px; }
  .hd-bang td:first-child { border-top: 0; background: var(--surface-2) !important; font-weight: 600; }
  .hd-bang td::before { content: attr(data-cot); display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }
  .hd-truoc-sau { grid-template-columns: 1fr; }
  .hd-truoc-sau a.sau { grid-column: auto; }
  .hd-hai-cot { grid-template-columns: 1fr; }
  .hd-hop { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; margin: 0; }
  .hd-hop-nho { height: auto; border-radius: 16px 16px 0 0; margin: auto 0 0; }
  .hd-soan-luoi { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 1fr) minmax(200px, 1fr); }
  .hd-soan-meta { grid-template-columns: 1fr 1fr; }
  .hd-soan-meta .rong { grid-column: span 2; }
  .hd-nut-phu, .hd-nut-chinh { min-height: 44px; }
}
@media (max-width: 420px) {
  .hd-luoi-nhom { grid-template-columns: 1fr; }
  .hd-logo-chu strong { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-the-nhom, .hd-muc-luc, .hd-thong-bao { transition: none; }
}
@media print {
  .hd-dau, .hd-muc-luc, .hd-tren-trang, .hd-mo-muc-luc, .hd-bai-cong-cu, .hd-bai-chan, .hd-chan, .hd-thong-bao, .hd-loc-su-co { display: none !important; }
  .hd-khung { display: block; padding: 0; }
  .hd-giua { max-width: none; }
  .hd-trang, .hd-bai-than { background: #fff; color: #000; }
  .hd-buoc-the, .hd-khoi, .hd-anh, .hd-bang tr { break-inside: avoid; }
  .hd-mo::after { content: ""; }
}
/* PMS-143D-1: nút xem lại giới thiệu nhanh ở trang chủ hướng dẫn */
.hd-anh-dau .hd-tour { margin: 14px 0 0; position: relative; z-index: 1; }
.hd-tour-nut { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; font-weight: 600; text-decoration: none; }
.hd-tour-nut:hover, .hd-tour-nut:focus-visible { background: rgba(255, 255, 255, 0.24); }
