/* ==========================================================================
   Mepo9 — sách hướng dẫn sử dụng
   Đắp lên site.css, KHÔNG sửa site.css: tệp đó dùng chung với 6 trang đang
   chạy, mà cache Cloudflare 4 giờ và không có khoá purge — sai ở đó là hồi quy
   6 trang trong một cửa sổ không sửa được.
   Dùng lại biến của site.css (--brand #1f7a0c — xanh logo từ 25/09/2026, --surface, --border, Inter).
   ========================================================================== */

/* Token RIÊNG của sách — tất cả đo từ --brand đã có, không bịa màu mới. Dải
   tối (footer) cố tình dùng --text (gần đen, đã trung tính) chứ KHÔNG nhuộm
   theo --brand: dải tối mang màu brand là chỗ đã đo hỏng ở nơi khác (mockup
   TMĐT lệch hue trung vị 119,5° khi làm vậy) — trung tính mới là chỗ mắt
   nghỉ và làm nền cho accent bật lên. */
:root {
  --m9-tint: #eef7ea;
  --m9-tint-border: #d5ebcb;
  --m9-ink: #0b1020;
  --m9-ink-2: #1a2140;
  --m9-shadow: 0 1px 2px rgba(11, 16, 32, 0.05), 0 10px 26px -16px rgba(11, 16, 32, 0.24);
  --m9-shadow-lift: 0 20px 40px -18px rgba(11, 16, 32, 0.34);
}

/* site.css KHÔNG có .sr-only — sách cần nó cho chú thích trên ảnh. */
.m9-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- vỏ trang */

.m9-header .wrap { display: flex; align-items: center; gap: 16px; }
.m9-header { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.1) blur(6px); background: rgba(255, 255, 255, 0.92); }
.m9-header-title {
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border-inline-start: 1px solid var(--border);
  padding-inline-start: 16px;
}
.m9-header-title:hover { color: var(--brand); }
.m9-header-right {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 12px;
}
.m9-langpick select {
  font: inherit;
  font-size: 14px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  max-width: 190px;
}

.m9-main { padding: 40px 0 96px; max-width: 860px; }
.m9-crumbs {
  display: flex; gap: 8px; align-items: center;
  font-size: 14px; color: var(--muted); margin-bottom: 20px;
}
.m9-crumbs a { color: var(--muted); text-decoration: none; }
.m9-crumbs a:hover { color: var(--brand); text-decoration: underline; }
.m9-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 10px;
}
.m9-article h1 { font-size: 2.3rem; line-height: 1.18; margin-bottom: 14px; letter-spacing: -0.01em; }
.m9-lede { font-size: 1.12rem; color: var(--text-2); margin-bottom: 32px; line-height: 1.6; }
.m9-article h3 {
  font-size: 1.32rem; margin: 48px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: 90px;
  letter-spacing: -0.005em;
}
.m9-article > :first-child h3:first-child,
.m9-article h3:first-of-type { border-top: none; padding-top: 0; }
.m9-article p { margin: 0 0 16px; line-height: 1.72; }
.m9-article ul, .m9-article ol { margin: 0 0 18px; padding-inline-start: 4px; line-height: 1.72; list-style: none; }
.m9-article li { margin: 0 0 9px; padding-inline-start: 22px; position: relative; }
.m9-article ul > li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 0.68em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: 0.55;
}
.m9-article ol { counter-reset: m9ol; }
.m9-article ol > li { counter-increment: m9ol; }
.m9-article ol > li::before {
  content: counter(m9ol); position: absolute; inset-inline-start: 0; top: 0;
  font-size: 12.5px; font-weight: 700; color: var(--brand); direction: ltr;
}

/* Nhãn nút lấy từ chính catalog app — in khác chữ thường để người đọc biết
   đây là thứ họ phải tìm trên màn hình, không phải lời văn. */
.m9-ui {
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}
.m9-term { font-style: italic; }

/* -------------------------------------------------------------- hero — mục lục */

.m9-hero {
  background: linear-gradient(165deg, var(--m9-tint) 0%, #fff 78%);
  border: 1px solid var(--m9-tint-border);
  border-radius: 20px;
  padding: 44px 40px 38px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}
.m9-hero::after {
  content: ""; position: absolute; inset-inline-end: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 122, 12, 0.14), transparent 70%);
  pointer-events: none;
}
.m9-hero h1 { margin-bottom: 10px; }
.m9-hero .m9-lede { margin-bottom: 6px; max-width: 620px; }
.m9-hero-stats { display: flex; align-items: baseline; gap: 14px; margin: 18px 0 0; font-size: 14.5px; color: var(--muted); }
.m9-stat b { color: var(--brand); font-size: 1.15em; font-weight: 800; margin-inline-end: 4px; }
.m9-hero-dot { opacity: 0.5; }
@media (max-width: 760px) and (pointer: coarse) {
  .m9-hero { padding: 30px 22px 26px; border-radius: 16px; }
}

/* ------------------------------------------------------------ mục lục bài */

.m9-toc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 20px 24px;
  margin: 0 0 34px;
}
.m9-toc b { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.m9-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: m9toc; }
.m9-toc li { counter-increment: m9toc; margin-bottom: 3px; padding-inline-start: 0; }
.m9-toc li::before { display: none; }
.m9-toc a {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none; padding: 5px 6px; margin: 0 -6px; border-radius: 8px;
  color: var(--text-2);
  transition: background-color 0.12s, color 0.12s;
}
.m9-toc a::before {
  content: counter(m9toc); flex: none;
  font-size: 12px; font-weight: 700; color: var(--brand);
  direction: ltr;
}
.m9-toc a:hover { background: var(--m9-tint); color: var(--text); }

/* --------------------------------------------------------------- các bước */

.m9-steps { counter-reset: m9step; list-style: none; padding-inline-start: 0; margin: 0 0 22px; }
.m9-steps > li {
  counter-increment: m9step;
  position: relative;
  padding-inline-start: 44px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.m9-steps > li::before {
  content: counter(m9step);
  position: absolute;
  inset-inline-start: 0; top: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border-radius: 50%;
  font-size: 14px; font-weight: 700;
  direction: ltr;
}
.m9-steps-fig { font-size: 13px; margin-inline-start: 8px; white-space: nowrap; }

/* ------------------------------------------------------------ khung chú ý */

.m9-callout {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 4px 10px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--m9-tint);
  padding: 16px 18px;
  margin: 0 0 22px;
  line-height: 1.68;
}
.m9-callout > div { grid-column: 1 / -1; }
.m9-callout-icon {
  grid-column: 1; grid-row: 1;
  color: var(--brand);
  width: 18px; height: 18px; flex: none;
}
.m9-callout-icon svg { width: 100%; height: 100%; display: block; }
.m9-callout-label {
  grid-column: 2; grid-row: 1;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--brand);
  white-space: nowrap;
}
.m9-callout.is-note    { border-inline-start-color: var(--muted); background: var(--surface); }
.m9-callout.is-note    .m9-callout-label,
.m9-callout.is-note    .m9-callout-icon { color: var(--muted); }
.m9-callout.is-warning { border-inline-start-color: var(--warn); background: #fdf8ef; }
.m9-callout.is-warning .m9-callout-label,
.m9-callout.is-warning .m9-callout-icon { color: var(--warn); }
/* "Nói thẳng" — chỗ app không làm được việc người dùng tưởng nó làm được.
   Cố tình cho nó nổi nhất: đây là phần dễ bị bỏ nhất khi dịch. */
.m9-callout.is-honest  { border-inline-start-color: var(--danger); background: #fdf4f4; }
.m9-callout.is-honest  .m9-callout-label,
.m9-callout.is-honest  .m9-callout-icon { color: var(--danger); }

/* ------------------------------------------------------- hình có chú thích */

.m9-fig { margin: 0 0 34px; }
.m9-fig-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--m9-shadow);
  /* Toạ độ chú thích đo trong không gian ảnh LTR. Khoá chiều ở đây để ngữ
     cảnh RTL của trang không kéo lệch phần trăm --x. */
  direction: ltr;
}
.m9-fig-box img { display: block; width: 100%; height: auto; }

/* Khung vùng MỜ mặc định. Sáu khung xanh đậm hiện cùng lúc trên một ảnh chụp
   giao diện là nhiễu tới mức không nhìn ra chính giao diện — thứ mà người đọc
   đến đây để xem. Chỉ khung đang được hỏi tới mới nổi lên. */
.m9-rect {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  border: 2px solid rgba(31, 122, 12, 0.28);
  border-radius: 6px;
  pointer-events: none;
  transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
}
.m9-rect.is-lit {
  border-color: var(--brand);
  background: rgba(31, 122, 12, 0.10);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}
@media (prefers-reduced-motion: reduce) {
  .m9-rect { transition: none; }
}
.m9-dot {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-45%, -45%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 13px; font-weight: 700; line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.35);
}
.m9-dot:hover, .m9-dot:focus-visible { background: var(--brand-hover); outline: none; transform: translate(-45%, -45%) scale(1.14); }

.m9-fig figcaption { font-size: 14.5px; color: var(--text-2); padding-top: 12px; line-height: 1.6; }

/* ------------------------------------------------------- video quay màn hình */

.m9-video-fig { margin: 0 0 38px; }
.m9-video-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 10px;
}
.m9-video-eyebrow svg { width: 15px; height: 15px; flex: none; }
.m9-video-frame {
  max-width: 420px;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--m9-shadow);
  border: 1px solid var(--border);
}
.m9-video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--m9-ink);
}
.m9-video-fig figcaption { font-size: 14.5px; color: var(--text-2); padding-top: 12px; line-height: 1.6; max-width: 420px; }
@media print {
  .m9-video-fig { break-inside: avoid; }
}
.m9-legend { list-style: none; padding-inline-start: 0; margin: 12px 0 0; }
.m9-legend li { display: flex; gap: 10px; margin-bottom: 6px; align-items: baseline; padding-inline-start: 0; }
.m9-legend li::before { display: none; }
/* Số in tường minh trong <span dir="ltr">, KHÔNG dùng marker của <ol>: trong
   ngữ cảnh Ả Rập marker vẽ thành ٤, không khớp số Latin nung trên badge. */
.m9-num {
  flex: none;
  width: 21px; height: 21px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
}
.m9-legend li:target { background: var(--m9-tint); border-radius: 6px; }
.m9-legend li.is-lit { background: var(--m9-tint); border-radius: 6px; }

/* ------------------------------------------------------------------ bảng */

.m9-table-wrap { overflow-x: auto; margin: 0 0 24px; border-radius: var(--r-sm); border: 1px solid var(--border-soft); }
.m9-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.m9-table th, .m9-table td {
  border-bottom: 1px solid var(--border-soft);
  padding: 11px 14px;
  text-align: start;
  vertical-align: top;
}
.m9-table tr:last-child td { border-bottom: none; }
.m9-table th { background: var(--surface); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }

/* ------------------------------------------------------------- phím tắt */

.m9-kbd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
.m9-kbd kbd {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 8px;
  box-shadow: 0 1px 0 rgba(11, 16, 32, 0.04);
}
.m9-kbd-plus { color: var(--muted); }
.m9-kbd > span:last-child { color: var(--text-2); }

.m9-example {
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  margin: 0 0 22px;
  background: var(--surface);
}
.m9-example-result { margin-top: 10px; color: var(--text-2); font-size: 14.5px; }

/* -------------------------------------------------------- điều hướng bài */

.m9-chapnav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--border-soft);
}
.m9-chapnav a {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: 16px 18px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.m9-chapnav a:hover { border-color: var(--brand); box-shadow: var(--m9-shadow); transform: translateY(-1px); }
.m9-chapnav a svg { flex: none; width: 16px; height: 16px; color: var(--brand); }
.m9-chapnav a span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m9-chapnav a small { font-size: 12px; color: var(--muted); }
.m9-chapnav a b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m9-chapnav-prev svg { order: -1; transform: scaleX(-1); }
.m9-chapnav-next { flex-direction: row-reverse; text-align: end; grid-column: 2; }
.m9-chapnav-next span { align-items: flex-end; }
[dir="rtl"] .m9-chapnav-prev svg,
[dir="rtl"] .m9-chapnav-next svg { transform: none; }
[dir="rtl"] .m9-chapnav-next svg { transform: scaleX(-1); }
@media (max-width: 640px) and (pointer: coarse) {
  .m9-chapnav { grid-template-columns: 1fr; }
  .m9-chapnav-next { grid-column: 1; }
}

/* ------------------------------------------------------------- mục lục */

.m9-part { margin-top: 44px; }
.m9-part h2 {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.4rem; margin-bottom: 18px;
}
.m9-part-n {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  background: var(--m9-ink); color: #fff;
  font-size: 14px; font-weight: 800;
  direction: ltr;
}
.m9-chapters { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.m9-chapters li { margin: 0; }
.m9-chapters a {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  text-decoration: none;
  background: var(--bg);
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.m9-chapters a:hover { border-color: var(--brand); box-shadow: var(--m9-shadow); transform: translateY(-1px); }
.m9-chapnum {
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--m9-tint); color: var(--brand);
  font-size: 13px; font-weight: 800;
  direction: ltr;
}
.m9-chaptext { display: grid; gap: 3px; min-width: 0; }
.m9-chapters b { color: var(--text); }
.m9-chapters span { color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.m9-chaptext span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m9-chapvideo {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  color: var(--brand);
  margin-inline-start: auto;
}
.m9-chapvideo svg { width: 100%; height: 100%; }

.m9-langgrid {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.m9-langgrid a {
  display: grid; gap: 2px;
  padding: 13px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.m9-langgrid a:hover { border-color: var(--brand); box-shadow: var(--m9-shadow); }
.m9-langgrid span { font-size: 13px; color: var(--muted); }

/* Dải tối thật — mỗi trang sách kết bằng một dải trung tính đậm (đo qua
   --text, không nhuộm brand) thay vì trôi tuột hết ra nền trắng. */
.m9-footer {
  background: var(--m9-ink);
  color: rgba(255, 255, 255, 0.68);
  padding: 44px 0 30px;
  margin-top: 8px;
}
.m9-footer .m9-footer-note { color: rgba(255, 255, 255, 0.88); font-size: 15px; margin-bottom: 6px; }
.m9-footer .muted { color: rgba(255, 255, 255, 0.5); }
.m9-footer .foot-bottom { border-top-color: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.55); }
.m9-footer .foot-bottom a { color: rgba(255, 255, 255, 0.82); }
.m9-footer .foot-bottom a:hover { color: #fff; }

/* ==========================================================================
   RTL — ar, fa, ur, he
   site.css KHÔNG có một dòng RTL nào và vỏ trang của nó dùng margin-left:auto.
   Không đắp lại ở đây thì bốn ngôn ngữ vỡ cùng lúc, và vỡ trong im lặng vì
   không ai trong nhóm đọc được chúng.
   ========================================================================== */

[dir="rtl"] .m9-header-right { margin-inline-start: auto; margin-left: 0; }
[dir="rtl"] .topbar .spacer { margin-left: 0; margin-inline-start: auto; }
[dir="rtl"] .site-header .nav { margin-left: 0; margin-inline-start: auto; }
[dir="rtl"] .float-contact { right: auto; left: 18px; }
[dir="rtl"] .m9-callout { border-inline-start-width: 4px; }
[dir="rtl"] .m9-article ol > li::before { direction: rtl; }

/* --------------------------------------------------------------- màn hẹp */

@media (max-width: 760px) and (pointer: coarse) {
  .m9-main { padding: 24px 0 64px; }
  .m9-article h1 { font-size: 1.75rem; }
  .m9-header-title { display: none; }
  .m9-dot { width: 22px; height: 22px; font-size: 11px; }
  .m9-langpick select { max-width: 120px; }
  .m9-video-frame, .m9-video-fig figcaption { max-width: none; }
  .m9-chapters a { padding: 14px; gap: 12px; }
  .m9-chapvideo { width: 24px; height: 24px; }
}

/* ------------------------------------------------------------------- in */

@media print {
  .m9-header, .m9-footer, .float-contact, .m9-chapnav, .m9-toc, .m9-hero-stats { display: none; }
  .m9-main { max-width: none; padding: 0; }
  .m9-hero { background: none; border: none; padding: 0; }
  /* Badge phải sống sót khi in — không có chúng thì chú giải trỏ vào hư không. */
  .m9-dot, .m9-num, .m9-rect { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .m9-fig { break-inside: avoid; }
}

/* ------------------------------------------------- ảnh CHỤP MÀN HÌNH DỌC
   (hướng dẫn di động, 22/09/2026). Ảnh gốc 720×1610 (9:20) — để full-width
   trong `.m9-main` (860px) là một cột cao gần 2000px, chữ chú thích khó đọc
   vì badge dồn sát nhau. `.is-portrait` giữ ảnh ở khổ điện thoại thật, hai
   ảnh xếp cạnh nhau ở màn rộng (`.m9-fig-row`) — cùng lối hai màn ảnh chụp
   trước/sau vẫn thấy trong bài này. */
.m9-fig-box.is-portrait { max-width: 300px; margin-inline: auto; }
.m9-fig-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  margin: 0 0 34px;
}
.m9-fig-row .m9-fig { margin-bottom: 0; flex: 1 1 260px; max-width: 320px; }
.m9-fig-row .m9-fig-box.is-portrait { max-width: none; margin-inline: 0; }
@media (max-width: 620px) {
  .m9-fig-row { flex-direction: column; }
  .m9-fig-row .m9-fig { max-width: 300px; margin-inline: auto; }
}
