/* Trang hỗ trợ Posmi. Màu và chữ theo landing-posmi (navy #0C2650, xanh #0052FD, Be Vietnam Pro). */
:root {
  --navy: #0C2650;
  --blue: #0052FD;
  --blue-hover: #0042CC;
  --text: #33415C;
  --muted: #5B6A82;
  --line: #E3E9F4;
  --bg: #F3F5F9;
  --tint: #E8EFFF;
  --soft: #F3F6FC;
  --white: #fff;
  --amber-bg: #FFF7E8;
  --amber-line: #F2DDB0;
  --r: 20px;
  --r-md: 16px;
  --shadow: 0 1px 2px rgba(12, 38, 80, .04), 0 12px 32px -18px rgba(12, 38, 80, .18);
  --shadow-pop: 0 18px 48px -16px rgba(12, 38, 80, .28);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: var(--font); font-size: 16.5px; line-height: 1.65; color: var(--text); background: var(--bg); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0; }
h1 { font-size: clamp(1.625rem, 3.2vw, 2.125rem); font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-lg { width: 24px; height: 24px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--navy); color: #fff; border-radius: 10px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 20px; border-radius: 14px; border: 1.5px solid transparent; font: 600 .9375rem/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer; transition: background-color .15s; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -10px rgba(0, 82, 253, .6); }
.btn-primary:hover { background: var(--blue-hover); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--navy); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }

/* Thanh trên */
.topbar { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1440px; margin: 0 auto; padding: 10px 16px; display: grid; grid-template-columns: auto auto 1fr auto; grid-template-areas: "nav brand search actions"; align-items: center; gap: 8px 16px; min-height: var(--top); }
.nav-toggle { grid-area: nav; margin-left: -8px; }
.nav-toggle[hidden] { display: none; }
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 88px; height: auto; }
.brand-sub { padding-left: 10px; border-left: 1px solid var(--line); font-weight: 700; color: var(--navy); font-size: .9375rem; }
.top-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }
.top-link { padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: .9375rem; color: var(--navy); text-decoration: none; }
.top-link:hover { background: var(--soft); }
.search { grid-area: search; position: relative; width: 100%; max-width: 680px; justify-self: center; }
.search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.search-input { width: 100%; height: 48px; padding: 0 18px 0 46px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--soft); font: 500 1rem var(--font); color: var(--navy); appearance: none; -webkit-appearance: none; }
.search-input::placeholder { color: var(--muted); opacity: 1; }
.search-input::-webkit-search-cancel-button { appearance: none; }
.search-input:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 82, 253, .14); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; margin: 0; padding: 8px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); max-height: min(70vh, 520px); overflow: auto; text-align: left; }
.results[hidden] { display: none; }
.results li a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--navy); }
.results li[aria-selected="true"] a, .results li a:hover { background: var(--tint); }
.r-title { display: block; font-weight: 600; line-height: 1.4; }
.r-meta { display: block; font-size: .8125rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.r-empty { padding: 14px 12px; color: var(--muted); font-size: .9375rem; }
.r-empty a { font-weight: 600; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .75rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }

/* Ba cột */
.layout { max-width: 1440px; margin: 0 auto; padding: 20px 16px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.main-card, .nav-card, .toc-card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); }
.main-card { padding: 24px 20px 32px; min-width: 0; }
.toc-card { display: none; }
.nav-card { position: fixed; z-index: 80; left: 0; top: 0; bottom: 0; width: min(88vw, 340px); border-radius: 0 var(--r) var(--r) 0; display: flex; flex-direction: column; transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
body.nav-open .nav-card { transform: none; visibility: visible; transition: transform .22s ease; }
.nav-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(12, 38, 80, .45); }
.nav-overlay[hidden] { display: none; }
body.nav-open { overflow: hidden; }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--navy); }
.nav-scroll { flex: 1; overflow: auto; padding: 10px; overscroll-behavior: contain; }
.nav-foot { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.nav-foot a { flex: 1; text-align: center; padding: 10px; border-radius: 12px; background: var(--soft); font-weight: 600; text-decoration: none; font-size: .9375rem; }
@media (prefers-reduced-motion: reduce) { .nav-card { transition: none; } }

.ng { border-radius: 14px; }
.ng summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; list-style: none; color: var(--navy); font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.ng summary::-webkit-details-marker { display: none; }
.ng summary:hover { background: var(--soft); }
.ng summary > .ico:first-child { color: var(--blue); }
.ng-name { flex: 1; min-width: 0; }
.ng-count { font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 1px 8px; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.ng[open] > summary .chev { transform: rotate(90deg); }
.ng ul { list-style: none; padding: 2px 0 8px 12px; margin-left: 21px; border-left: 2px solid var(--line); }
.ng li a, .group-list a, .first-list a { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 10px; text-decoration: none; font-size: .875rem; line-height: 1.45; }
.aid { flex: none; min-width: 28px; font-size: .75rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.is-written { color: var(--navy); font-weight: 600; }
.is-soon { color: var(--muted); font-weight: 400; }
.ng li a:hover, .group-list a:hover, .first-list a:hover { background: var(--soft); }
.ng li a.is-current { background: var(--tint); color: var(--blue); font-weight: 700; }
.ng li a.is-current .aid { color: var(--blue); }

/* Nội dung bài */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .875rem; color: var(--muted); margin-bottom: 14px; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs [aria-current] { color: var(--navy); font-weight: 600; }
.intro { margin-top: 10px; font-style: italic; color: var(--muted); font-size: 1.0625rem; }
.prose { margin-top: 24px; }
.prose > p, .prose > ul, .prose > ol:not(.steps) { margin-bottom: 14px; }
.prose h2 { font-size: 1.375rem; font-weight: 800; margin: 36px 0 16px; letter-spacing: -.005em; }
.prose h3 { font-size: 1.125rem; font-weight: 700; margin: 24px 0 10px; }
.prose strong { color: var(--navy); font-weight: 600; }
.prose a { font-weight: 500; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--blue); }

.steps { list-style: none; counter-reset: none; margin: 0 0 8px; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; margin-bottom: 22px; }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: .9375rem; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--tint); }
.step-body { min-width: 0; padding-top: 3px; }
.step-body > p { margin: 0 0 8px; }
.step-body > p:last-child { margin-bottom: 0; }
.shot { margin: 12px 0 4px; }
.shot img { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); background: var(--soft); height: auto; max-width: 100%; }

.box { border-radius: var(--r-md); padding: 16px 18px; margin: 0 0 20px; }
.box-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.box > p:not(.box-title), .box ul { margin: 0; }
.box ul { padding-left: 22px; }
.box p + p { margin-top: 8px; }
.box.before { background: #F0F5FF; border: 1px solid #D5E2FF; }
.box.before .box-title .ico { color: var(--blue); }
.box.note { background: var(--amber-bg); border: 1px solid var(--amber-line); }
.box.note .box-title .ico { color: #B26A00; }
.steps + .box, .step-body + .box { margin-top: 4px; }
.prose > .box.note { margin-left: 48px; }

#bai-lien-quan + ul { list-style: none; padding: 0; display: grid; gap: 8px; }
#bai-lien-quan + ul li { margin: 0; }
#bai-lien-quan + ul a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-weight: 600; color: var(--navy); background: #fff; }
#bai-lien-quan + ul a:hover { border-color: var(--blue); color: var(--blue); }

.help-cta { display: flex; gap: 12px; align-items: flex-start; margin-top: 32px; padding: 16px 18px; border-radius: var(--r-md); background: var(--soft); color: var(--navy); }
.help-cta .ico { color: var(--blue); margin-top: 2px; }
.soon-card { display: flex; gap: 16px; margin-top: 20px; padding: 22px; border-radius: var(--r-md); background: var(--soft); border: 1px solid var(--line); }
.soon-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--tint); color: var(--blue); }
.soon-card h2 { font-size: 1.25rem; margin-bottom: 6px; }
.soon-card p + p { margin-top: 14px; }
.related { margin: 10px 0 0 20px; }
#doc-truoc { font-size: 1.125rem; margin-top: 28px; }

.group-list { list-style: none; margin-top: 18px; }
.group-list a { font-size: 1rem; padding: 10px 12px; }
.group-list .gl-t { flex: 1; }

/* TOC trong bài (điện thoại) */
.toc-inline { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.toc-inline summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; color: var(--navy); cursor: pointer; list-style: none; min-height: 48px; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary .chev { margin-left: auto; }
.toc-inline[open] .chev { transform: rotate(90deg); }
.toc-inline ul, .toc-card ul { list-style: none; padding: 0 12px 12px; }
.toc-inline a, .toc-card a { display: block; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: .9375rem; line-height: 1.45; border-left: 3px solid transparent; }
.toc-inline .d3 a, .toc-card .d3 a { padding-left: 24px; font-size: .875rem; }
.toc-inline a:hover, .toc-card a:hover { background: var(--soft); }
.toc-card a.is-active { color: var(--blue); font-weight: 600; background: var(--tint); border-left-color: var(--blue); }
.toc-title { padding: 16px 20px 8px; font-weight: 700; color: var(--navy); }
.toc-card ul { padding-bottom: 14px; }

/* Trang chủ */
.hero { padding: 28px 0 8px; }
.hero-in { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 44px 20px 48px; text-align: center; }
.hero h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
.hero-sub { margin: 12px auto 28px; max-width: 560px; color: var(--muted); font-size: 1.0625rem; }
.search-hero { max-width: 720px; margin: 0 auto; }
.search-hero .search-input { height: 58px; font-size: 1.0625rem; border-radius: 18px; padding-left: 52px; }
.search-hero .search-ico { left: 18px; }
.is-home .topbar .search { display: none; }
.is-home .topbar-in { grid-template-columns: auto 1fr auto; grid-template-areas: "brand . actions"; }
.sec { padding-top: 36px; padding-bottom: 8px; }
.first-list { list-style: none; margin-top: 18px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); columns: 1; column-gap: 12px; }
.first-list li { break-inside: avoid; }
.first-list a { font-size: .9375rem; }

.site-footer { margin-top: 32px; padding: 28px 0 40px; text-align: center; font-size: .9375rem; }
.site-footer p + p { margin-top: 6px; font-size: .875rem; }

/* Điện thoại nhỏ */
@media (max-width: 1023px) {
  .topbar-in { grid-template-columns: auto 1fr auto; grid-template-areas: "nav brand actions" "search search search"; padding-bottom: 12px; }
  .search { max-width: none; }
  .is-home .topbar-in { grid-template-areas: "brand . actions"; padding-bottom: 10px; }
  .top-link { display: none; }
  .btn.btn-primary { padding: 8px 14px; font-size: .875rem; min-height: 40px; }
  .prose > .box.note { margin-left: 0; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .step { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .step-n { width: 30px; height: 30px; font-size: .875rem; }
  .main-card { padding: 20px 16px 28px; }
}
@media (min-width: 640px) {
    .first-list { columns: 2; }
  .main-card { padding: 28px 32px 36px; }
}
@media (min-width: 1024px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); padding: 20px 24px 8px; }
  .is-article .layout { grid-template-columns: 300px minmax(0, 1fr) 270px; }
  .nav-toggle, .nav-head, .nav-foot, .nav-overlay, .toc-inline { display: none !important; }
  .nav-card { position: sticky; top: calc(var(--top) + 20px); left: auto; bottom: auto; width: auto; max-height: calc(100vh - var(--top) - 40px); border-radius: var(--r); transform: none; visibility: visible; z-index: 1; }
  .toc-card { display: block; position: sticky; top: calc(var(--top) + 20px); max-height: calc(100vh - var(--top) - 40px); overflow: auto; }
  .topbar-in { padding: 10px 24px; }
    .main-card { padding: 32px 40px 40px; }
}
.zoom { display: inline-block; max-width: 100%; border-radius: 14px; cursor: zoom-in; }
@media (max-width: 420px) {
  .search-input { font-size: .875rem; padding-left: 40px; padding-right: 10px; }
  .search-ico { left: 12px; }
  .search-hero .search-input { font-size: .875rem; padding-left: 44px; }
}

/* Trang chủ: khối lớn dạng thẻ ảnh */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: center; position: relative; text-align: center; margin-bottom: 22px; }
.sec-head-text { max-width: 640px; padding: 0 56px; }
.sec-title { font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 800; letter-spacing: -.01em; }
.sec-sub { margin-top: 6px; color: var(--muted); font-size: 1.0625rem; }
.car-nav { position: absolute; right: 0; bottom: 0; display: flex; gap: 8px; }
.car-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.car-btn .ico { width: 20px; height: 20px; }
.car-btn[data-dir="-1"] .ico { transform: scaleX(-1); }
.car-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.car-btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.carousel { margin: 0 -16px; }
.track { list-style: none; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; padding: 4px 16px 20px; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #C9D5EA transparent; }
.track:focus-visible { outline-offset: -3px; border-radius: var(--r); }
.scard { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; }
.scard, .gcard { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.scard:focus-within, .gcard:focus-within { box-shadow: 0 0 0 3px var(--blue); }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.thumb-blue { background: var(--blue); }
.thumb-navy { background: var(--navy); }
.thumb-step { position: absolute; left: 18px; top: 14px; z-index: 1; color: #fff; font-weight: 700; font-size: 1.0625rem; }
.thumb-blue .thumb-img { position: absolute; left: 9%; right: 0; top: 28%; bottom: 0; width: 91%; height: 72%; object-fit: cover; object-position: left top; border-radius: 14px 0 0 0; box-shadow: -8px -8px 28px rgba(12, 38, 80, .3); background: #fff; }
.thumb-navy .thumb-img { position: absolute; left: 7%; right: 7%; top: 12%; bottom: 0; width: 86%; height: 88%; object-fit: cover; object-position: left top; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .28); background: #fff; }
.thumb.no-img { display: grid; place-items: center; }
.thumb-ico { width: 64px; height: 64px; padding: 16px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; stroke-width: 1.6; }
.scard-body, .gcard-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.scard-n { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.scard h3, .gcard h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; margin-top: 2px; }
.scard-desc, .gcard-desc { margin-top: 8px; color: var(--text); font-size: .9375rem; line-height: 1.55; flex: 1; }
.gcard-count { margin-top: 10px; font-size: .8125rem; color: var(--muted); font-weight: 600; }
.card-link { margin-top: 14px; font-weight: 600; font-size: .9375rem; text-decoration: none; color: var(--blue); align-self: flex-start; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.card-link:hover { text-decoration: underline; }
.card-link:focus-visible { outline: none; }
.see-more { text-align: center; margin-top: 4px; color: var(--muted); }
.see-more a { font-weight: 600; text-decoration: none; }
.see-more a:hover { text-decoration: underline; }
.gcards { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.first-list { margin-top: 0; }
@media (max-width: 639px) {
  .sec-head { flex-direction: column; align-items: center; gap: 14px; }
  .sec-head-text { padding: 0; }
  .car-nav { position: static; }
}
@media (min-width: 640px) {
  .carousel { margin: 0 -16px; }
  .gcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .gcards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .scard { flex-basis: 280px; }
}
@media (prefers-reduced-motion: reduce) { .track { scroll-behavior: auto; } }

/* Điện thoại: ảnh luôn vừa khung (không cuộn ngang), tràn ra mép thẻ để chữ trong ảnh lớn hết mức. Mỗi ảnh được chụp rộng tối đa 440px. */
.shot img { max-width: 100%; height: auto; }
@media (max-width: 639px) {
  .step-body .shot { margin-left: -68px; margin-right: -20px; }
  .step-body .shot .zoom { display: block; }
  .step-body .shot img { margin: 0 auto; }
}
@media (max-width: 420px) {
  .step-body .shot { margin-left: -56px; margin-right: -16px; }
}
