/* TradeSync Guide — giao diện tài liệu: thanh trên, cây mục lục trái, nội dung giữa, "Trong trang" phải. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: #dde3ec;
  --text: #16202b;
  --text-2: #546173;
  --muted: #8a96a6;
  --primary: #0a84ff;
  --primary-ink: #0057c8;
  --primary-soft: #e3f0ff;
  --brand-sync: #1f6fe5;
  --ok: #16a34a;     --ok-soft: #e3f6ea;
  --warn: #b26b00;   --warn-soft: #fff4dc;
  --bad: #d62f3f;    --bad-soft: #fde7e9;
  --violet: #6d3fd8; --violet-soft: #efe8ff;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 6px 22px rgba(16, 32, 64, .06);
  --radius: 14px;
  --top-h: 64px;
  --side-w: 290px;
  --toc-w: 230px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1218; --surface: #141b24; --surface-2: #1b2430; --border: #263142;
    --text: #e8edf4; --text-2: #a7b3c2; --muted: #75839a;
    --primary: #3d9bff; --primary-ink: #7cbcff; --primary-soft: #14263d; --brand-sync: #4c9bff;
    --ok: #3ccf74; --ok-soft: #12291c; --warn: #f0b04a; --warn-soft: #2c230f;
    --bad: #ff6b78; --bad-soft: #2f161a; --violet: #a98bff; --violet-soft: #221a3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .28);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1218; --surface: #141b24; --surface-2: #1b2430; --border: #263142;
  --text: #e8edf4; --text-2: #a7b3c2; --muted: #75839a;
  --primary: #3d9bff; --primary-ink: #7cbcff; --primary-soft: #14263d; --brand-sync: #4c9bff;
  --ok: #3ccf74; --ok-soft: #12291c; --warn: #f0b04a; --warn-soft: #2c230f;
  --bad: #ff6b78; --bad-soft: #2f161a; --violet: #a98bff; --violet-soft: #221a3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15.5px/1.65 var(--font); -webkit-font-smoothing: antialiased;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }

/* ── Thanh trên ───────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.icon-btn { display: none; border: 0; background: none; padding: 8px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand-logo { height: 32px; width: auto; }
.brand-text { font-size: 20px; font-weight: 800; letter-spacing: -.4px; white-space: nowrap; }
.brand-text b { font-weight: 800; } .brand-text i { font-style: normal; color: var(--brand-sync); }
.brand-sub {
  font-size: 12px; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft);
  padding: 3px 9px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap;
}
.top-search {
  flex: 1; max-width: 460px; margin-left: 18px; position: relative; display: flex; align-items: center;
}
.top-search svg, .side-search svg { position: absolute; left: 12px; color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.top-search input, .side-search input {
  width: 100%; height: 40px; padding: 0 40px 0 38px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14.5px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.top-search input:focus, .side-search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--primary-soft); }
.top-search kbd {
  position: absolute; right: 10px; font: 600 11px var(--font); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: var(--surface);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-pick {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 11px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-2); cursor: pointer;
}
.lang-pick svg { width: 18px; height: 18px; }
.lang-pick select { border: 0; background: transparent; color: var(--text); font: 600 14px var(--font); cursor: pointer; outline: none; padding: 6px 2px; }
.lang-pick select option { color: #16202b; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px;
  background: linear-gradient(135deg, #2f8bff, #0a66e0); color: #fff !important; font-weight: 700; font-size: 14.5px;
  text-decoration: none !important; box-shadow: 0 6px 16px rgba(10, 102, 224, .28); white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.06); }

/* ── Bố cục ───────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); max-width: 1480px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 18px 12px 30px 16px; border-right: 1px solid var(--border); scrollbar-width: thin;
}
.side-search { display: none; position: relative; align-items: center; margin-bottom: 12px; }

/* Cây mục lục */
.tree { font-size: 14.5px; }
.t-sec { margin-bottom: 4px; }
.t-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none;
  border-radius: 10px; cursor: pointer; color: var(--text); font-weight: 700; text-align: left;
}
.t-head:hover { background: var(--surface-2); }
.t-ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink); flex: none;
}
.t-ico svg { width: 16px; height: 16px; }
.t-num { color: var(--muted); font-weight: 700; font-size: 12.5px; min-width: 16px; }
.t-caret { margin-left: auto; color: var(--muted); transition: transform .2s; width: 16px; height: 16px; }
.t-sec.open .t-caret { transform: rotate(90deg); }
.t-items { display: none; margin: 2px 0 8px 23px; padding-left: 14px; border-left: 1.5px solid var(--border); }
.t-sec.open .t-items { display: block; }
.t-item {
  display: block; padding: 6px 10px; margin: 1px 0; border-radius: 8px; color: var(--text-2);
  text-decoration: none !important; line-height: 1.4; position: relative;
}
.t-item:hover { background: var(--surface-2); color: var(--text); }
.t-item.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 650; }
.t-item.active::before {
  content: ''; position: absolute; left: -16px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--primary);
}
.side-foot { margin-top: 18px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.side-foot b { color: var(--text); }
.side-foot .btn-primary { width: 100%; justify-content: center; margin-top: 10px; }

/* ── Nội dung ─────────────────────────────────────────────────── */
.content { min-width: 0; padding: 34px 48px 60px; }
.page { max-width: 800px; margin: 0 auto; }
.crumb { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.crumb .dot { opacity: .5; }
.page h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.8px; margin: 0 0 10px; font-weight: 800; }
.page .lead { font-size: 17.5px; color: var(--text-2); margin: 0 0 26px; }
.page h2 {
  font-size: 22px; letter-spacing: -.3px; margin: 38px 0 12px; padding-top: 6px; font-weight: 750;
  display: flex; align-items: center; gap: 10px;
}
.page h2 .anchor, .page h3 .anchor { opacity: 0; color: var(--muted); font-weight: 500; text-decoration: none !important; }
.page h2:hover .anchor, .page h3:hover .anchor { opacity: 1; }
.page h3 { font-size: 17.5px; margin: 26px 0 8px; font-weight: 700; }
.page p { margin: 0 0 14px; }
.page ul, .page ol { margin: 0 0 16px; padding-left: 24px; }
.page li { margin: 5px 0; }
.page li::marker { color: var(--muted); }
.page strong { font-weight: 700; color: var(--text); }
.page code, .page kbd {
  font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
.page .ui {   /* tên nút / mục trong app */
  font-weight: 650; color: var(--primary-ink); background: var(--primary-soft); padding: 1px 7px; border-radius: 6px; white-space: nowrap;
}
.page hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
.page table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 6px 0 20px; font-size: 14.5px;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.page th, .page td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.page th { background: var(--surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-2); }
.page tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }

/* Hộp ghi chú */
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; margin: 16px 0 20px; border: 1px solid; font-size: 15px; }
.note svg { margin-top: 2px; width: 20px; height: 20px; }
.note > div > :last-child { margin-bottom: 0; }
.note b.nt { display: block; margin-bottom: 2px; }   /* tiêu đề hộp: chỉ khi nội dung MỞ ĐẦU bằng <b> */
.note.tip { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--text); }
.note.tip svg { color: var(--primary); }
.note.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.note.ok svg { color: var(--ok); }
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.note.warn svg { color: var(--warn); }
.note.danger { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.note.danger svg { color: var(--bad); }

/* Các bước */
.steps { counter-reset: st; list-style: none; padding: 0 !important; margin: 8px 0 22px; }
.steps > li {
  counter-increment: st; position: relative; padding: 2px 0 18px 52px; margin: 0;
}
.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, #2f8bff, #0a66e0); box-shadow: 0 4px 12px rgba(10, 102, 224, .28);
}
.steps > li::after { content: ''; position: absolute; left: 16.5px; top: 40px; bottom: 4px; width: 1.5px; background: var(--border); }
.steps > li:last-child::after { display: none; }
.steps > li > b:first-child { display: block; font-size: 16px; margin-bottom: 2px; }

/* Thẻ tính năng */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 10px 0 26px; }
.card {
  display: block; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  color: var(--text) !important; text-decoration: none !important; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
a.card:hover { transform: translateY(-2px); border-color: var(--primary); }
.card .c-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--primary-soft); color: var(--primary-ink); }
.card b { display: block; font-size: 15.5px; margin-bottom: 3px; }
.card span { font-size: 14px; color: var(--text-2); line-height: 1.5; display: block; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 34px 34px 30px; margin: 0 0 30px;
  background: radial-gradient(700px 300px at 100% 0%, rgba(61, 165, 255, .28), transparent 60%),
              linear-gradient(135deg, #0a66e0, #0b3a8c);
  color: #fff;
}
.hero h1 { color: #fff; font-size: 36px; margin-bottom: 8px; }
.hero p { color: #d7e7ff; font-size: 17px; max-width: 560px; margin-bottom: 20px; }
.hero .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-light {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px;
  background: #fff; color: #0a4fb8 !important; font-weight: 700; text-decoration: none !important;
}
.hero .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px;
  background: rgba(255, 255, 255, .14); color: #fff !important; font-weight: 700; text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, .3);
}
.hero-art { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); width: 190px; opacity: .95; pointer-events: none; }
.hero > :not(.hero-art) { position: relative; z-index: 1; max-width: calc(100% - 210px); }

/* Sơ đồ luồng */
.flow { display: flex; align-items: stretch; gap: 0; margin: 14px 0 24px; flex-wrap: wrap; }
.flow .node {
  flex: 1; min-width: 150px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  text-align: center; box-shadow: var(--shadow);
}
.flow .node .c-ico { margin: 0 auto 8px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.flow .node b { display: block; font-size: 15px; }
.flow .node span { display: block; font-size: 13px; color: var(--text-2); line-height: 1.45; margin-top: 3px; }
.flow .arrow { display: grid; place-items: center; width: 34px; color: var(--muted); }

/* Ảnh minh hoạ */
.fig { margin: 18px 0 26px; }
.fig figcaption { margin-top: 10px; font-size: 13.5px; color: var(--text-2); text-align: center; }
.fig.wide img {
  width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); cursor: zoom-in; background: #fff;
}
.phones { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; margin: 18px 0 26px; }
.phone {
  width: 300px; flex: none; margin: 0; text-align: center;
}
.phone .frame {
  position: relative; border-radius: 34px; padding: 9px; background: linear-gradient(145deg, #3a404a, #0e1014 45%, #2a2e35);
  box-shadow: 0 18px 40px rgba(20, 50, 110, .22), 0 0 0 1.5px #8d97a6 inset;
}
.phone .frame::before {   /* tai thỏ */
  content: ''; position: absolute; top: 15px; left: 50%; transform: translateX(-50%); width: 64px; height: 18px;
  border-radius: 12px; background: #050608; z-index: 2;
}
/* Ảnh chụp app không có thanh trạng thái -> chừa một dải cho "tai thỏ" khỏi đè tiêu đề.
   Ảnh giữ NGUYÊN tỉ lệ (không cắt) để số chú thích đặt theo % trùng đúng vị trí nút. */
.phone .screen { border-radius: 26px; overflow: hidden; background: #f3f5f9; padding-top: 26px; }
.phone .shotbox { position: relative; aspect-ratio: 780 / 1688; overflow: hidden; }
.phone .screen img { width: 100%; height: auto; display: block; cursor: zoom-in; }
/* Ảnh đã cắt (G.shot): khung giữ đúng phần trên của ảnh, mép dưới mờ dần = "còn tiếp". */
.annot .shotbox { overflow: hidden; }
.annot .shotbox img { height: auto; }
.annot .shotbox.cut::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 42px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(243, 245, 249, 0), #f3f5f9);
}

/* ── Ảnh có chú thích số: điện thoại + danh sách nút ─────────────── */
.annot { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 30px; align-items: start; margin: 18px 0 30px; }
.annot .phone { width: 300px; }
.pin {
  position: absolute; transform: translate(-50%, -50%); width: 19px; height: 19px; border-radius: 50%;
  background: #ff3b5c; color: #fff; font: 800 10.5px/19px var(--font); text-align: center; opacity: .93;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, .35); z-index: 3; transition: transform .15s;
}
.pin.on { transform: translate(-50%, -50%) scale(1.45); background: #0a84ff; opacity: 1; }
.legend { list-style: none; padding: 0 !important; margin: 0; counter-reset: lg; }
.legend li {
  counter-increment: lg; position: relative; padding: 9px 12px 9px 46px; margin: 0 0 6px !important;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14.5px; line-height: 1.45; cursor: default;
}
.legend li::before {
  content: counter(lg); position: absolute; left: 11px; top: 9px; width: 24px; height: 24px; border-radius: 50%;
  background: #ff3b5c; color: #fff; font: 800 12.5px/24px var(--font); text-align: center;
}
.legend li.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.legend li.on::before { background: #0a84ff; }
.legend li b { color: var(--text); }
.legend li span { color: var(--text-2); }
.annot .side > :first-child { margin-top: 0; }

/* Nút tải app (cửa hàng) */
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 18px 0 14px; border-radius: 12px;
  background: #0b0f14; color: #fff !important; text-decoration: none !important; border: 1px solid rgba(255, 255, 255, .22);
}
.store svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.store svg path[fill] { stroke: none; }
.store small { display: block; font-size: 10.5px; opacity: .8; line-height: 1.1; letter-spacing: .3px; }
.store b { display: block; font-size: 16px; line-height: 1.15; }
.store:hover { filter: brightness(1.25); }
.phone figcaption { margin-top: 12px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.phone figcaption b { color: var(--text); display: block; font-size: 14px; }

/* Ảnh còn thiếu (chờ chụp) */
.ph {
  border: 2px dashed color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); border-radius: 14px;
  padding: 22px; text-align: center; color: var(--text-2); margin: 18px 0 26px;
}
.ph .ph-ico { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--warn); }
.ph b { color: var(--text); display: block; font-size: 15px; }
.ph code { font-weight: 700; }
.phone .ph { margin: 0; aspect-ratio: 390 / 844; display: flex; flex-direction: column; justify-content: center; border-radius: 26px; padding: 18px; }

/* Bảng so sánh gói */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 12px 0 24px; }
.plan { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.plan h4 { margin: 0 0 4px; font-size: 16px; }
.plan .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 10px; }
.plan ul { padding-left: 18px; margin: 0; font-size: 14px; }
.plan.pro { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }

/* FAQ */
details.faq { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin: 10px 0; overflow: hidden; }
details.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 650; list-style: none; display: flex; gap: 10px; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; margin-left: auto; font-size: 20px; color: var(--muted); font-weight: 400; }
details.faq[open] summary::after { content: '−'; }
details.faq > div { padding: 0 16px 14px; color: var(--text-2); }
details.faq > div > :last-child { margin-bottom: 0; }

/* Phân trang + chân trang */
.pager { max-width: 800px; margin: 44px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a {
  display: block; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text) !important; text-decoration: none !important; transition: border-color .15s;
}
.pager a:hover { border-color: var(--primary); }
.pager small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pager b { font-size: 15.5px; }
.pager .next { text-align: right; grid-column: 2; }
.foot { max-width: 800px; margin: 36px auto 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* Mục lục trang (phải) */
.toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 34px 18px 30px 8px; font-size: 13.5px; }
.toc h5 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--text-2); border-left: 2px solid var(--border); text-decoration: none !important; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--primary-ink); border-left-color: var(--primary); font-weight: 600; }

/* Kết quả tìm */
.results { max-width: 800px; margin: 0 auto 30px; }
.results h4 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 600; }
.res {
  display: block; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 10px; color: var(--text) !important; text-decoration: none !important;
}
.res:hover { border-color: var(--primary); }
.res small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.res b { display: block; font-size: 15.5px; }
.res span { font-size: 14px; color: var(--text-2); }
.res mark, .page mark.hl { background: color-mix(in srgb, #ffd54a 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.lang-banner { max-width: 800px; margin: 0 auto 20px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(5, 10, 18, .86); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100% - 50px); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); background: #fff; }
.lb-cap { color: #dbe5f2; margin-top: 14px; font-size: 14px; text-align: center; }
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 20; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.scrim { display: none; }

/* ── Màn hình hẹp ─────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  :root { --top-h: 58px; }
  .icon-btn { display: inline-grid; }
  .layout { display: block; }
  .top-search { display: none; }
  .side-search { display: flex; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: 100%; width: min(86vw, 330px);
    background: var(--surface); transform: translateX(-102%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25);
    padding-top: 16px;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 18, .45); }
  .content { padding: 22px 16px 50px; }
  .page h1 { font-size: 27px; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 27px; }
  .hero-art { display: none; }
  .hero > :not(.hero-art) { max-width: none; }
  .annot { grid-template-columns: 1fr; gap: 18px; }
  .annot .phone { margin: 0 auto; width: min(260px, 100%); }
  .brand-sub { display: none; }
  .flow { flex-direction: column; }
  .flow .arrow { width: auto; height: 26px; transform: rotate(90deg); }
}
@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-logo { height: 26px; }
  .brand-text { font-size: 17px; }
  #dlText { display: none; }
  .btn-primary { padding: 0 11px; }
  .lang-pick { padding: 0 4px 0 8px; }
  .lang-pick svg { display: none; }
  .lang-pick select { max-width: 104px; text-overflow: ellipsis; }
  .brand { flex: none; }
  .phone { width: min(260px, 100%); }
  .phones { gap: 16px 12px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  body { font-size: 15px; }
}

/* ── Nhúng trong app (?embed=1): bỏ thương hiệu lớn, gọn hơn ───── */
html.embed .brand-logo { display: none; }
html.embed .brand-sub { display: none; }
html.embed .to-top { bottom: 16px; }
@media print {
  .topbar, .sidebar, .toc, .pager, .to-top { display: none !important; }
  .layout { display: block; } .content { padding: 0; }
}

/* Ảnh chú thích không khung điện thoại (bảng EA trên MT5…) */
.panelfig { margin: 0; width: 300px; text-align: center; }
.panelfig .shotbox { position: relative; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.panelfig img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.panelfig figcaption { margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 900px) { .panelfig { margin: 0 auto; width: min(290px, 100%); } }
