/* ctv/assets/css/pages/guide.css — Hướng dẫn dùng cổng CTV (/ctv/huong-dan, 19/10/2026).
   Thân bài do help_render() dựng (class .hc-*, chung với Hướng dẫn sử dụng của người học) — ở đây chỉ đổi sang token --pt-*
   của cổng CTV. Phần riêng của trang: .gd-*. */

.hc-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Dải: ô tìm + 6 bước làm quen ─────────────────────────────────────────── */
.gd-search { position: relative; display: flex; align-items: center; width: min(560px, 100%); margin-top: var(--pt-s-2); }
.gd-search > svg { position: absolute; left: 16px; color: var(--pt-muted); pointer-events: none; }
.gd-search input {
  width: 100%; height: 52px; padding: 0 18px 0 46px; border: 0; border-radius: var(--pt-r-lg);
  background: var(--pt-surface); color: var(--pt-ink); font: 500 var(--pt-fs-15)/1.4 var(--pt-font);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, black 60%, transparent);
}
.gd-search input::placeholder { color: var(--pt-muted); }
.gd-search input:focus { outline: none; box-shadow: var(--pt-focus-d), 0 18px 40px -22px color-mix(in srgb, black 60%, transparent); }

.gd-start {
  display: grid; gap: var(--pt-s-3); padding: var(--pt-s-5); border-radius: var(--pt-r-xl);
  background: var(--pt-glass); border: 1px solid var(--pt-line-d);
}
.gd-start__h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--pt-s-3); }
.gd-start__h b { font-size: var(--pt-fs-15); font-weight: 700; color: var(--pt-on); line-height: 1.35; }
.gd-start__h span { flex: none; font-size: var(--pt-fs-13); color: var(--pt-on-3); }
.gd-start__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.gd-start__list li { display: flex; align-items: center; gap: var(--pt-s-3); min-height: 34px; font-size: var(--pt-fs-14); color: var(--pt-on-2); }
.gd-start__list li.is-done { color: var(--pt-on-3); }
.gd-start__dot {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--pt-on-3); color: var(--pt-deep);
}
.gd-start__list li.is-done .gd-start__dot { background: var(--pt-mint); border-color: var(--pt-mint); }
.gd-start__t { flex: 1; min-width: 0; }
.gd-start__list a { flex: none; font-size: var(--pt-fs-13); font-weight: 600; color: var(--pt-mint); }
.gd-start__list a:hover { color: var(--pt-on); text-decoration: underline; text-underline-offset: 3px; }

/* ── Trang chính: kết quả tìm + nhóm bài ─────────────────────────────────── */
.gd-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--pt-s-5); align-items: start; }
.gd-group__list { margin: 0; padding: var(--pt-s-2) 0; list-style: none; }
.gd-group__list a, .gd-res {
  display: flex; align-items: center; justify-content: space-between; gap: var(--pt-s-4);
  padding: var(--pt-s-3) var(--pt-s-6); color: var(--pt-text);
}
.gd-group__list li + li a { border-top: 1px solid var(--pt-hair); }
.gd-group__list a > span, .gd-res > span { display: grid; gap: 3px; min-width: 0; }
.gd-group__list b, .gd-res b { font-size: var(--pt-fs-15); font-weight: 600; line-height: 1.4; color: var(--pt-ink); }
.gd-group__list small, .gd-res small { font-size: var(--pt-fs-13); line-height: 1.5; color: var(--pt-muted); }
.gd-group__list a > svg, .gd-res > svg { flex: none; color: var(--pt-faint); }
.gd-group__list a:hover b, .gd-res:hover b { color: var(--pt-brand-deep); }
.gd-group__list a:hover { background: var(--pt-tint); }
.gd-results .pt-card__body { padding: var(--pt-s-2) 0; }
.gd-res + .gd-res { border-top: 1px solid var(--pt-hair); }
.gd-res:hover { background: var(--pt-tint); }
.gd-res em { font-style: normal; font-size: var(--pt-fs-12); font-weight: 600; color: var(--pt-brand-strong); }
.gd-empty { padding: var(--pt-s-4) var(--pt-s-6); font-size: var(--pt-fs-14); line-height: 1.6; color: var(--pt-muted); }

/* ── Một bài ──────────────────────────────────────────────────────────────── */
.gd-art { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--pt-s-5); align-items: start; }
@media (min-width: 1180px) {
  .gd-art { grid-template-columns: minmax(0, 1fr) 280px; }
  .gd-art--guest { grid-template-columns: minmax(0, 1fr); }
  .gd-aside { position: sticky; top: calc(var(--pt-top-h) + var(--pt-s-4)); }
  .gd-toc--top { display: none !important; }
}
@media (max-width: 1179px) { .gd-toc--side { display: none !important; } }
.gd-aside { display: grid; gap: var(--pt-s-4); align-content: start; }
.gd-doc { min-width: 0; padding: var(--pt-s-7) var(--pt-s-8) var(--pt-s-7); }

.gd-toc { display: grid; gap: var(--pt-s-2); }
.gd-toc > b { font-size: var(--pt-fs-14); font-weight: 700; color: var(--pt-ink); }
.gd-toc--top { margin-bottom: var(--pt-s-6); padding: var(--pt-s-4); border-radius: var(--pt-r-lg); background: var(--pt-sunken); }
.gd-toc--side { padding: var(--pt-s-4) var(--pt-s-3); }
.gd-toc--side > b { padding: 0 var(--pt-s-2); }
.gd-toc__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.gd-toc__list a { display: flex; align-items: flex-start; gap: var(--pt-s-2); padding: 7px var(--pt-s-2); border-radius: var(--pt-r-sm); font-size: var(--pt-fs-14); line-height: 1.45; color: var(--pt-text); }
.gd-toc__n {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: -1px;
  background: var(--pt-surface); border: 1px solid var(--pt-border); font-size: var(--pt-fs-12); font-weight: 700; color: var(--pt-brand-deep);
}
.gd-toc__list a:hover { background: var(--pt-tint); color: var(--pt-ink); }
.gd-toc__list a.is-on { background: var(--pt-wash); color: var(--pt-brand-deep); font-weight: 600; }
.gd-toc__list a.is-on .gd-toc__n { background: var(--pt-brand-strong); border-color: transparent; color: var(--pt-on); }
.gd-gnav { display: grid; gap: 2px; padding: var(--pt-s-4) var(--pt-s-3); }
.gd-gnav > b { padding: 0 var(--pt-s-2) var(--pt-s-2); font-size: var(--pt-fs-14); font-weight: 700; color: var(--pt-ink); }
.gd-gnav a { padding: 8px var(--pt-s-2); border-radius: var(--pt-r-sm); font-size: var(--pt-fs-14); line-height: 1.45; color: var(--pt-text); }
.gd-gnav a:hover { background: var(--pt-tint); color: var(--pt-ink); }

/* Thân bài (help_render) */
.hc-prose { font-size: var(--pt-fs-16); line-height: 1.7; color: var(--pt-text); }
.hc-prose > * + * { margin-top: var(--pt-s-4); }
.hc-prose p { margin: 0; }
.hc-prose p, .hc-prose .hc-list, .hc-prose .hc-quote { max-width: 72ch; }
.hc-prose strong { font-weight: 650; color: var(--pt-ink); }
.hc-prose a:not(.pt-btn):not(.lv-btn):not(.hc-see__it):not(.hc-shot__img) { color: var(--pt-brand-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hc-h2 { margin-top: var(--pt-s-8) !important; font-size: 22px; line-height: 1.3; font-weight: 800; letter-spacing: -.02em; color: var(--pt-ink); scroll-margin-top: 96px; }
.hc-prose > .hc-h2:first-child { margin-top: 0 !important; }
.hc-h3 { margin-top: var(--pt-s-6) !important; font-size: var(--pt-fs-18); line-height: 1.4; font-weight: 700; color: var(--pt-ink); }
.hc-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.hc-list li::marker { color: var(--pt-brand-strong); font-weight: 700; }
.hc-ui { padding: 1px 7px; border-radius: 6px; background: var(--pt-sunken); border: 1px solid var(--pt-hair); font-size: .94em; font-weight: 600; color: var(--pt-ink); white-space: nowrap; }
.hc-quote { margin: 0; padding: 2px 0 2px var(--pt-s-4); border-left: 3px solid var(--pt-border); color: var(--pt-muted); }

.hc-qa { display: grid; gap: 6px; padding-top: var(--pt-s-4); border-top: 1px solid var(--pt-hair); scroll-margin-top: 96px; }
.hc-h2 + .hc-qa { padding-top: 2px; border-top: 0; }
.hc-qa__q { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 700; color: var(--pt-ink); }
.hc-qa__a { display: grid; gap: 10px; }
.hc-qa__a > * { margin: 0; max-width: 72ch; }

.hc-step { display: grid; gap: 14px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--pt-hair); scroll-margin-top: 96px; }
.hc-prose > .hc-step:first-child, .hc-h2 + .hc-step { margin-top: 18px; padding-top: 0; border-top: 0; }
.hc-prose > .hc-step:first-child { margin-top: 0; }
.hc-step__h { display: flex; align-items: center; gap: 14px; }
.hc-step__n {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pt-brand-strong); color: var(--pt-on); font-size: var(--pt-fs-16); font-weight: 800;
}
.hc-step__h h3 { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; color: var(--pt-ink); }
.hc-step__b { display: grid; gap: 14px; padding-left: 50px; min-width: 0; }
.hc-step__b > * { min-width: 0; margin: 0; }
.hc-step__b > :is(.hc-shot, .hc-table, .hc-see) { margin-left: -50px; }

.hc-shot { display: grid; gap: 14px; margin: 4px 0 0; }
.hc-shot__img {
  display: block; justify-self: center; width: min(100%, var(--w, 100%)); overflow: hidden; border-radius: var(--pt-r-lg);
  border: 1px solid var(--pt-border); background: var(--pt-sunken); box-shadow: var(--pt-sh-2); cursor: zoom-in;
}
.hc-shot__img img { display: block; width: 100%; height: auto; }
.hc-shot--m .hc-shot__img { width: min(100%, var(--w, 360px), 360px); border-radius: 24px; }
@media (max-width: 640px) { .hc-shot--both .hc-shot__img { width: 100%; } }
.hc-shot__none { padding: 36px 16px; border-radius: var(--pt-r-lg); border: 1px dashed var(--pt-border); text-align: center; font-size: var(--pt-fs-14); color: var(--pt-muted); }
.hc-legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.hc-legend li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 11px; font-size: var(--pt-fs-15); line-height: 1.6; }
.hc-legend__n { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; border: 2px solid var(--pt-brand-strong); color: var(--pt-brand-deep); font-size: var(--pt-fs-13); font-weight: 800; }

.hc-call { display: grid; gap: 4px; max-width: 78ch; padding: 14px 18px 15px; border-radius: var(--pt-r-lg); border: 1px solid transparent; }
.hc-call__l { font-size: var(--pt-fs-14); font-weight: 700; }
.hc-call p, .hc-call .hc-list { margin: 0; font-size: var(--pt-fs-15); line-height: 1.65; }
.hc-call--tip { background: var(--pt-wash); border-color: color-mix(in srgb, var(--color-primary) 20%, transparent); }
.hc-call--tip .hc-call__l { color: var(--pt-brand-deep); }
.hc-call--note { background: var(--pt-sunken); border-color: var(--pt-hair); }
.hc-call--note .hc-call__l { color: var(--pt-ink); }
.hc-call--warn { background: color-mix(in srgb, var(--color-warning) 9%, var(--color-surface)); border-color: color-mix(in srgb, var(--color-warning) 30%, transparent); }
.hc-call--warn .hc-call__l { color: var(--pt-warn-deep); }

.hc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hc-actions .lv-btn {
  display: inline-flex; align-items: center; gap: 8px; height: var(--pt-h-md); padding: 0 18px; border-radius: var(--pt-r-md);
  border: 1px solid var(--pt-border); background: var(--pt-surface); color: var(--pt-ink); font-size: var(--pt-fs-14); font-weight: 600;
}
.hc-actions .lv-btn--primary { background: var(--pt-brand-strong); border-color: transparent; color: var(--pt-on); }
.hc-see { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hc-see__it { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: var(--pt-r-lg); border: 1px solid var(--pt-hair); background: var(--pt-surface); }
.hc-see__it b { font-size: var(--pt-fs-15); line-height: 1.4; color: var(--pt-ink); }
.hc-see__it span { font-size: var(--pt-fs-13); line-height: 1.5; color: var(--pt-muted); }
.hc-see__it:hover { border-color: color-mix(in srgb, var(--color-primary) 40%, var(--pt-hair)); }
.hc-see__it:hover b { color: var(--pt-brand-deep); }

.hc-table { overflow-x: auto; border: 1px solid var(--pt-hair); border-radius: var(--pt-r-lg); }
.hc-table table { width: 100%; border-collapse: collapse; font-size: var(--pt-fs-14); line-height: 1.55; }
.hc-table th, .hc-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--pt-hair); }
.hc-table thead th { border-top: 0; background: var(--pt-sunken); font-size: var(--pt-fs-13); font-weight: 700; color: var(--pt-ink); }
.hc-table td { font-variant-numeric: tabular-nums; }

/* "Bài này có giúp bạn?" */
.gd-vote { margin-top: var(--pt-s-8); padding-top: var(--pt-s-6); border-top: 1px solid var(--pt-hair); }
.gd-vote__ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pt-s-3) var(--pt-s-5); }
.gd-vote__ask > b, .gd-vote__more > b { font-size: var(--pt-fs-16); font-weight: 700; color: var(--pt-ink); }
.gd-vote__btns { display: flex; gap: var(--pt-s-2); }
.gd-vote__btns .pt-btn { min-width: 92px; justify-content: center; }
.gd-vote__more { display: grid; gap: var(--pt-s-3); }
.gd-vote__more[hidden], .gd-vote__ask[hidden], .gd-vote__done[hidden] { display: none; }
.gd-vote__reasons { display: flex; flex-wrap: wrap; gap: var(--pt-s-2); }
.gd-vote__r { position: relative; display: inline-flex; cursor: pointer; }
.gd-vote__r input { position: absolute; opacity: 0; pointer-events: none; }
.gd-vote__r span { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: var(--pt-r-pill); border: 1px solid var(--pt-border); background: var(--pt-surface); font-size: var(--pt-fs-14); color: var(--pt-text); }
.gd-vote__r:hover span { background: var(--pt-tint); }
.gd-vote__r input:checked + span { background: var(--pt-wash); border-color: color-mix(in srgb, var(--color-primary) 55%, var(--pt-border)); color: var(--pt-brand-deep); font-weight: 600; }
.gd-vote__r input:focus-visible + span { box-shadow: var(--pt-focus); }
.gd-vote__foot { display: flex; justify-content: flex-end; }
.gd-vote__done { margin: 0; font-size: var(--pt-fs-15); font-weight: 600; color: var(--pt-brand-deep); }

.gd-next { display: grid; gap: 3px; margin-top: var(--pt-s-7); padding: var(--pt-s-4) var(--pt-s-5); border-radius: var(--pt-r-lg); border: 1px solid var(--pt-border); background: var(--pt-tint); }
.gd-next span { font-size: var(--pt-fs-13); color: var(--pt-muted); }
.gd-next b { font-size: 17px; line-height: 1.35; font-weight: 700; color: var(--pt-ink); }
.gd-next:hover { border-color: color-mix(in srgb, var(--color-primary) 45%, var(--pt-border)); }
.gd-next:hover b { color: var(--pt-brand-deep); }

/* Xem ảnh lớn */
.gd-zoom { position: fixed; inset: 0; z-index: var(--pt-z-modal); display: grid; place-items: center; padding: 64px 16px 20px; overflow: auto; background: color-mix(in srgb, var(--pt-night) 88%, transparent); overscroll-behavior: contain; }
.gd-zoom img { max-width: min(1600px, 100%); max-height: calc(100vh - 88px); width: auto; height: auto; border-radius: 12px; background: var(--pt-surface); }
.gd-zoom__x { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 13px; background: var(--pt-glass-2); color: var(--pt-on); cursor: pointer; }
.gd-zoom__x:focus-visible { outline: 2px solid var(--pt-on); outline-offset: 2px; }

/* ── Khung khách (bài đăng nhập, quên mật khẩu — chưa đăng nhập) ─────────── */
.gd-guest { background: var(--pt-bg); }
.gd-guest__top {
  position: absolute; inset: 0 0 auto 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--pt-s-4);
  padding: calc(var(--pt-s-4) + env(safe-area-inset-top, 0px)) max(var(--pt-s-5), env(safe-area-inset-right, 0px)) var(--pt-s-4) max(var(--pt-s-5), env(safe-area-inset-left, 0px));
}
.gd-guest__brand { display: inline-flex; align-items: center; gap: var(--pt-s-3); color: var(--pt-on); font-weight: 700; font-size: var(--pt-fs-15); text-decoration: none; }
.gd-guest__band { color: var(--pt-on); background: var(--pt-band-grad); padding: calc(88px + env(safe-area-inset-top, 0px)) var(--pt-s-5) 96px; }
.gd-guest__inner, .gd-guest__main > .gd-art { max-width: 920px; margin: 0 auto; }
.gd-guest__crumb { font-size: var(--pt-fs-13); font-weight: 600; color: var(--pt-on-2); }
.gd-guest__band h1 { margin: var(--pt-s-3) 0 0; font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; color: var(--pt-on); }
.gd-guest__band p { margin: var(--pt-s-3) 0 0; max-width: 64ch; font-size: var(--pt-fs-15); line-height: 1.6; color: var(--pt-on-2); }
.gd-guest__main { padding: 0 var(--pt-s-5) var(--pt-s-9); margin-top: -64px; position: relative; }

/* ── Khổ hẹp ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gd-groups { grid-template-columns: minmax(0, 1fr); }
  .gd-group__list a, .gd-res { padding: var(--pt-s-3) var(--pt-s-4); }
  .gd-doc { padding: var(--pt-s-5) var(--pt-s-4) var(--pt-s-6); }
  .hc-prose { font-size: 15.5px; }
  .hc-h2 { font-size: 20px; margin-top: var(--pt-s-7) !important; }
  .hc-step { margin-top: 22px; padding-top: 22px; }
  .hc-step__h { gap: 12px; }
  .hc-step__n { width: 32px; height: 32px; font-size: var(--pt-fs-15); }
  .hc-step__h h3 { font-size: 17.5px; }
  .hc-step__b { padding-left: 0; }
  .hc-step__b > :is(.hc-shot, .hc-table, .hc-see) { margin-left: 0; }
  .hc-table--stack { border: 0; border-radius: 0; overflow: visible; }
  .hc-table--stack :is(table, tbody, tr, td) { display: block; width: 100%; }
  .hc-table--stack thead { display: none; }
  .hc-table--stack tr { border: 1px solid var(--pt-hair); border-radius: var(--pt-r-lg); padding: 6px 0; }
  .hc-table--stack tr + tr { margin-top: 10px; }
  .hc-table--stack td { border-top: 0; padding: 6px 14px; }
  .hc-table--stack td:empty { display: none; }
  .hc-table--stack td::before { content: attr(data-th); display: block; margin-bottom: 2px; font-size: var(--pt-fs-12); font-weight: 700; color: var(--pt-muted); }
  .hc-table--stack td:first-child::before { content: none; }
  .gd-vote__btns { width: 100%; }
  .gd-vote__btns .pt-btn { flex: 1 1 0; height: 44px; }
  .gd-vote__foot .pt-btn { width: 100%; height: 44px; }
  .gd-guest__band { padding: calc(76px + env(safe-area-inset-top, 0px)) var(--pt-s-4) 84px; }
  .gd-guest__band h1 { font-size: 25px; }
  .gd-guest__main { padding: 0 var(--pt-s-4) var(--pt-s-8); }
}
