/* Sổ tay hướng dẫn DUYNAM Construction — ecoparkvinh-sop.duynam.vn */

:root {
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --surface-2: #F9FBFA;
  --ink: #16202A;
  --ink-soft: #46525E;
  --ink-faint: #7A8591;
  --line: #E1E7E4;
  --line-strong: #CBD5D1;
  --accent: #0E8F7E;
  --accent-strong: #0A7465;
  --accent-soft: #E2F4F0;
  --accent-ink: #FFFFFF;
  --warn: #A16207;
  --warn-soft: #FDF4E1;
  --badge: #E11D48;
  --badge-soft: #FDE7EC;
  --hero-1: #0E8F7E;
  --hero-2: #0B5F70;
  --shadow-sm: 0 1px 2px rgba(22, 32, 42, .05);
  --shadow: 0 1px 2px rgba(22, 32, 42, .05), 0 10px 30px -14px rgba(22, 32, 42, .22);
  --shadow-lg: 0 24px 60px -20px rgba(22, 32, 42, .35);
  --radius: 14px;
  --sans: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --top: 64px;
  --sidebar: 296px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1418; --surface: #161D23; --surface-2: #1A222A; --ink: #E8EDF0; --ink-soft: #A3AEB7;
    --ink-faint: #6E7983; --line: #26313A; --line-strong: #34414C; --accent: #3FD5C0; --accent-strong: #62E0CE;
    --accent-soft: rgba(63, 213, 192, .12); --accent-ink: #062A25; --warn: #F2B04A; --warn-soft: rgba(242, 176, 74, .12);
    --badge: #FB5678; --badge-soft: rgba(251, 86, 120, .16); --hero-1: #0C6F62; --hero-2: #0A3F4B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 32px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1418; --surface: #161D23; --surface-2: #1A222A; --ink: #E8EDF0; --ink-soft: #A3AEB7;
  --ink-faint: #6E7983; --line: #26313A; --line-strong: #34414C; --accent: #3FD5C0; --accent-strong: #62E0CE;
  --accent-soft: rgba(63, 213, 192, .12); --accent-ink: #062A25; --warn: #F2B04A; --warn-soft: rgba(242, 176, 74, .12);
  --badge: #FB5678; --badge-soft: rgba(251, 86, 120, .16); --hero-1: #0C6F62; --hero-2: #0A3F4B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 32px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 15.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; }
code {
  font-family: var(--mono); font-size: .88em; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.eyebrow {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent);
}

/* ---------- Reading progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #38BDF8); transition: width .1s linear; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--top);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 14px; padding: 0 20px; max-width: 1480px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 14.5px; font-weight: 800; white-space: nowrap; }
.brand-text small { font-size: 11.5px; color: var(--ink-faint); font-weight: 500; white-space: nowrap; }
.segs {
  margin-left: auto; display: flex; padding: 3px; gap: 2px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.seg {
  text-decoration: none; color: var(--ink-soft); font-size: 13.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; white-space: nowrap; transition: background .15s, color .15s;
}
.seg:hover { color: var(--ink); }
.seg.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.top-actions { display: flex; gap: 4px; }
.iconbtn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--ink-soft); cursor: pointer; transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
.menu-btn { display: none; }

/* ---------- Layout ---------- */
.layout { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 0; }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top));
  display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg);
}
.sb-head { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.sb-role { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.sb-role .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 11px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-faint); box-shadow: var(--shadow-sm);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); width: 100%; min-width: 0; }
.toc { overflow-y: auto; padding: 4px 10px 32px; flex: 1; overscroll-behavior: contain; scrollbar-width: thin; }
.toc-empty { padding: 0 20px; color: var(--ink-faint); font-size: 13.5px; }
.toc-group { margin-top: 2px; }
.toc-row { display: flex; align-items: center; gap: 2px; }
.toc-caret {
  width: 24px; height: 28px; flex: none; border: 0; background: none; cursor: pointer; color: var(--ink-faint);
  display: grid; place-items: center; border-radius: 6px; transition: transform .18s;
}
.toc-caret svg { width: 12px; height: 12px; }
.toc-group.open .toc-caret { transform: rotate(90deg); }
.toc a { text-decoration: none; display: block; border-radius: 8px; color: var(--ink-soft); line-height: 1.35; }
.toc a.toc-ch {
  flex: 1; display: flex; gap: 10px; align-items: baseline; padding: 7px 10px 7px 4px; font-weight: 600; font-size: 14px; color: var(--ink);
}
.toc a.toc-ch .n { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); font-weight: 600; min-width: 18px; }
.toc a.toc-ch:hover, .toc a.toc-sub:hover { background: var(--surface-2); }
.toc-group.current > .toc-row a.toc-ch { color: var(--accent); }
.toc-group.current > .toc-row a.toc-ch .n { color: var(--accent); }
.toc-subs { display: none; margin: 2px 0 8px 37px; border-left: 1.5px solid var(--line); }
.toc-group.open .toc-subs { display: block; }
.toc a.toc-sub { padding: 5px 10px 5px 12px; margin-left: -1.5px; border-left: 1.5px solid transparent; border-radius: 0 8px 8px 0; font-size: 13.2px; }
.toc a.on { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.toc mark { background: color-mix(in srgb, var(--warn) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.scrim { display: none; }

/* ---------- Content ---------- */
.part-wrap { min-width: 0; max-width: 920px; width: 100%; margin: 0 auto; padding: 32px 40px 80px; }

/* Hero / intro */
.intro {
  position: relative; overflow: hidden; border-radius: 20px; padding: 40px 40px 34px; color: #fff;
  background:
    radial-gradient(1000px 300px at 100% 0%, rgba(56, 189, 248, .35), transparent 60%),
    radial-gradient(600px 300px at 0% 100%, rgba(255, 255, 255, .10), transparent 60%),
    linear-gradient(135deg, var(--hero-1), var(--hero-2));
  box-shadow: var(--shadow);
}
.intro::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: linear-gradient(120deg, transparent 35%, #000); mask-image: linear-gradient(120deg, transparent 35%, #000);
}
.intro > * { position: relative; z-index: 1; }
.intro .eyebrow { color: rgba(255, 255, 255, .8); }
.intro h1 { margin-top: 12px; font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -.015em; }
.intro p.purpose { margin: 14px 0 0; max-width: 64ch; font-size: 16px; color: rgba(255, 255, 255, .88); }
.intro p.purpose b { color: #fff; }
.intro-meta { margin-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 5px 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: rgba(255,255,255,.92);
}
.chip b { color: #fff; font-weight: 700; }

/* Chapter grid (secnav) */
.secnav {
  margin: 26px 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
}
.secnav a {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .15s, box-shadow .15s; line-height: 1.3;
}
.secnav a:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.secnav span.n {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
}

/* Chapter */
.chapter { margin-top: 64px; scroll-margin-top: calc(var(--top) + 16px); }
.chapter > .eyebrow { display: inline-block; }
.chapter-head {
  margin-top: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.chapter h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(23px, 2.8vw, 30px); font-weight: 800; letter-spacing: -.01em; }
.ch-num {
  flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 17px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); box-shadow: var(--shadow-sm);
}
.routechip {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); padding: 5px 11px; border-radius: 8px;
}
.chapter p.purpose { font-size: 16px; color: var(--ink-soft); margin: 18px 0 0; max-width: 72ch; }
.chapter p, .chapter li { color: var(--ink-soft); }
.chapter b, .chapter strong { color: var(--ink); font-weight: 650; }
.chapter ul, .chapter ol { padding-left: 22px; }
.chapter li { margin: 6px 0; }
.chapter li::marker { color: var(--accent); }

.rolematrix { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.rolepill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px 4px 9px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
}
.rolepill.yes { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.rolepill.yes::before { content: "✓"; font-weight: 800; font-size: 11px; }
.rolepill.no { color: var(--ink-faint); }
.rolepill.no::before { content: "✕"; font-size: 10px; }

h3.sub {
  position: relative; font-size: 19px; font-weight: 750; margin: 46px 0 12px; color: var(--ink);
  padding-left: 16px; scroll-margin-top: calc(var(--top) + 16px);
}
h3.sub::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: var(--accent); }
h3.sub .anchor {
  position: absolute; left: -22px; top: 0; text-decoration: none; color: var(--ink-faint); opacity: 0; font-weight: 500; transition: opacity .15s;
}
h3.sub:hover .anchor { opacity: 1; }

/* Screenshot */
.shotcard {
  margin: 18px auto 6px; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.shotcard img { width: 100%; cursor: zoom-in; background: var(--surface-2); transition: filter .2s; }
.shotcard img:hover { filter: brightness(1.02); }
.shotcard.narrow img { max-width: 380px; margin: 0 auto; }
.shotcard.mid img { max-width: 580px; margin: 0 auto; }
.shotcaption {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 14px;
  border-top: 1px solid var(--line); background: var(--surface-2);
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
}
.shotcaption span:first-child { color: var(--ink-soft); font-weight: 600; }
.shotrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; align-items: start; margin: 18px 0 6px; }
.shotrow .shotcard { margin: 0 auto; width: 100%; }

/* Legend */
.legend {
  margin: 18px 0 6px; padding: 6px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.legend-item { display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.legend-item:first-child { border-top: 0; }
.legend-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  background: var(--badge); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: 0 0 0 4px var(--badge-soft);
}
.legend-text b { font-size: 15px; font-weight: 700; color: var(--ink); }
.legend-text p { margin: 4px 0 0; font-size: 14.5px; }
.numdot {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; margin-right: 6px; vertical-align: 1px;
  background: var(--badge); color: #fff; font-size: 11px; font-weight: 700;
}

/* Tables */
.tablewrap {
  margin: 18px 0 8px; overflow-x: auto; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
table.btntable { width: 100%; border-collapse: collapse; font-size: 14px; }
.btntable th, .btntable td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.btntable th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint);
  background: var(--surface-2); white-space: nowrap;
}
.btntable tbody tr:last-child td { border-bottom: 0; }
.btntable tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.btntable td { color: var(--ink-soft); }
.btntable td:first-child { font-weight: 650; color: var(--ink); width: 28%; }

.msg {
  font-weight: 600; font-size: .94em; background: var(--badge-soft); color: var(--badge);
  padding: 1px 7px; border-radius: 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* Notes */
.note {
  position: relative; margin: 20px 0 6px; padding: 14px 16px 14px 50px; border-radius: 12px; line-height: 1.6;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); color: var(--ink); font-size: 14.5px;
}
.note::before {
  content: "!"; position: absolute; left: 15px; top: 14px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: var(--warn);
}
.note b { color: var(--warn); }
.note.tip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.note.tip::before { content: "i"; font-family: Georgia, serif; font-style: italic; background: var(--accent); color: var(--accent-ink); }
.note.tip b { color: var(--accent); }

.faq dt { font-weight: 700; color: var(--ink); margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--ink-soft); }
/* Tạm ẩn "Câu hỏi thường gặp / Tình huống thường gặp" (giữ như bản gốc, user 2026-10-07). */
.faq-section { display: none !important; }

/* Lọc theo vai trò: body[data-role] ẩn khối không dành cho vai trò đó */
body[data-role="admin"] [data-roles]:not([data-roles~="admin"]),
body[data-role="manager"] [data-roles]:not([data-roles~="manager"]),
body[data-role="investor"] [data-roles]:not([data-roles~="investor"]) { display: none !important; }
.roletag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); margin-left: 6px; vertical-align: 2px; }
body[data-role] .roletag { display: none; }

/* Footer */
.sitefoot {
  border-top: 1px solid var(--line); padding: 28px 24px 40px; text-align: center; color: var(--ink-faint);
  font-size: 13px; display: flex; flex-direction: column; gap: 4px; background: var(--surface);
}
.sitefoot b { color: var(--ink-soft); }

/* Back to top */
.totop {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { color: var(--accent); border-color: var(--accent); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 56px 72px;
  background: rgba(8, 12, 16, .88); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: lbIn .18s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); border-radius: 10px; box-shadow: var(--shadow-lg); background: #fff; }
.lightbox figcaption { color: rgba(255, 255, 255, .85); font-size: 13.5px; display: flex; gap: 14px; text-align: center; }
.lb-count { font-family: var(--mono); color: rgba(255, 255, 255, .55); }
.lb-btn {
  position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-close { top: 14px; right: 14px; font-size: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .part-wrap { padding: 28px 28px 72px; }
}
@media (max-width: 960px) {
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh; width: min(330px, 86vw);
    background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateX(-102%); transition: transform .24s ease; visibility: hidden;
  }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(8, 12, 16, .45); }
  .scrim[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 640px) {
  :root { --top: 58px; }
  body { font-size: 15px; }
  .topbar-inner { padding: 0 12px; gap: 8px; }
  .guide .brand-text { display: none; }
  .segs { margin-left: auto; }
  .brand-mark { width: 30px; height: 30px; font-size: 12px; border-radius: 9px; }
  .seg { padding: 5px 9px; font-size: 12.5px; }
  .top-actions [data-action="print"] { display: none; }
  .part-wrap { padding: 16px 16px 64px; }
  .intro { padding: 26px 20px 22px; border-radius: 16px; }
  .secnav { grid-template-columns: 1fr 1fr; gap: 8px; }
  .secnav a { padding: 10px; gap: 9px; font-size: 13px; }
  .secnav span.n { width: 28px; height: 28px; font-size: 11.5px; }
  .chapter { margin-top: 48px; }
  .ch-num { width: 38px; height: 38px; font-size: 14px; border-radius: 11px; }
  .chapter h2 { gap: 11px; }
  h3.sub { font-size: 17.5px; margin-top: 36px; }
  .legend { padding: 4px 14px; }
  .legend-item { grid-template-columns: 26px 1fr; gap: 11px; }
  /* Bảng → thẻ xếp chồng trên điện thoại */
  .tablewrap { overflow: visible; background: none; border: 0; box-shadow: none; }
  table.btntable, .btntable tbody, .btntable tr, .btntable td { display: block; width: 100%; }
  .btntable thead { display: none; }
  .btntable tbody tr {
    margin-bottom: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm); overflow: hidden;
  }
  .btntable tbody tr:hover td { background: none; }
  .btntable td { border-bottom: 1px solid var(--line); padding: 9px 14px; width: auto !important; }
  .btntable td:last-child { border-bottom: 0; }
  .btntable td:first-child { background: var(--surface-2); }
  .btntable td:not(:first-child)[data-label]::before {
    content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px;
  }
  .lightbox { padding: 56px 8px 70px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  .lb-prev { left: calc(50% - 56px); } .lb-next { right: calc(50% - 56px); }
  .totop { right: 14px; bottom: 14px; }
}

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; }
  .topbar, .sidebar, .scrim, .totop, .progress, .lightbox, .secnav, h3.sub .anchor { display: none !important; }
  .layout { display: block; }
  .part-wrap { max-width: none; padding: 0; }
  .intro { color: var(--ink); background: none; box-shadow: none; border: 1px solid var(--line); }
  .intro::after { display: none; }
  .intro .eyebrow, .intro p.purpose, .chip, .chip b, .intro p.purpose b { color: var(--ink); }
  .chapter { break-before: page; margin-top: 0; }
  .shotcard, .legend, .tablewrap { box-shadow: none; }
  .btntable tr, .shotcard, .legend-item, .note { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { margin: 14mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
