/* ============================================================================
   web.css — Giao diện web khách (trang Home + trang đăng nhập)

   CHÂN LÝ: WA-09 (quy chuẩn giao diện, mục 3.1 màu / 3.2 cỡ chữ / 4.x phần tử)
            WU-00 mục 6 (quy ước riêng web khách: QT-15 thanh trên + 980px)
            WU-00 QT-17 + WU-07 4.2.2 (cấu trúc thẻ gói `.plan`)

   ⚠️ WA-09 QT-1: CHỈ dùng màu qua biến, KHÔNG viết mã màu trực tiếp trong
      phần tử. ⚠️ WA-09 QT-45: không thêm cỡ chữ / bán kính góc mới.
   ⚠️ WU-10 QT-13 + mục 5: KHÔNG tải phông chữ từ bên thứ ba. Vì vậy chỉ khai
      TÊN phông (Be Vietnam Pro / IBM Plex Mono — WA-09 QT-6) để dùng bản đã
      cài trên máy khách, còn lại rơi về phông hệ thống. Không @import.
   ============================================================================ */

/* WU-14 mục 3 (QT-6 → QT-8): thứ tự lớp. Với khai báo thường, lớp khai SAU
   thắng lớp trước BẤT KỂ độ ưu tiên selector ⇒ luật di-dong luôn thắng
   thanh-phan. KHÔNG luật nào được nằm ngoài @layer (QT-7). */
@layer nen, thanh-phan, di-dong;

/* ==========================================================================
   LỚP nen — token (:root + theme sáng/tối), reset, [hidden]
   ========================================================================== */
@layer nen {
/* ---------------------------------------------------------------------------
   1. Biến — WA-09 mục 3.1
   QT-4: khai ĐỦ bộ ở :root (bản sáng), rồi định nghĩa lại CHỈ các biến trong
   @media (bọc :root:not([data-theme="light"])) và trong :root[data-theme="dark"].
   --------------------------------------------------------------------------- */
/* ==========================================================================
   0b. THUỘC TÍNH `hidden` PHẢI LUÔN THẮNG — WA-09 QT-40
   --------------------------------------------------------------------------
   🔴 Lỗi thật gặp ngày 2026-10-10: thanh trên hiện CÙNG LÚC "Đăng nhập" và
   "Đăng xuất" dù JS đã đặt `hidden`. Nguyên nhân: luật `[hidden]{display:none}`
   của trình duyệt là luật mặc định, **thua** bất kỳ selector lớp nào — mà
   `.btn` lại khai `display: inline-flex`. Hệ quả nặng hơn vẻ ngoài: nút
   "Trang quản trị" cũng hiện với người CHƯA đăng nhập.
   ⇒ Mọi phần tử có `hidden` phải biến mất, bất kể lớp của nó khai `display` gì.
   `!important` ở đây là đúng chỗ: `hidden` là ý định tuyệt đối của HTML,
   không phải một gợi ý trình bày.
   ========================================================================== */
[hidden] {
  display: none !important;
}

:root {
  --ground: #f5f7f5;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --line: #d9e0db;
  --line-soft: #e8ede9;
  --ink: #17211d;
  --ink-2: #435049;
  --muted: #6b7a72;
  --accent: #0d6e5e;
  --accent-ink: #ffffff;
  --accent-soft: #e2efeb;
  --ok: #2f7d4f;
  --ok-soft: #e6f2ea;
  --warn: #9a6207;
  --warn-soft: #f8eedb;
  --crit: #a3342a;
  --crit-soft: #f8e6e3;
  --line-strong: #7f8d86;

  /* WA-09 QT-5 — chỉ 4 bán kính này */
  --radius: 10px;
  --radius-ctl: 7px;
  --radius-pill: 999px;
  --radius-modal: 12px;

  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  /* WU-14 mục 4 — token bố cục dùng chung. Khối TB/DD (lớp di-dong) CHỈ đổi
     giá trị các biến này; thành phần đọc qua var(--…). */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --pad-trang: 24px;
  --fs-body: 14px;
  --tap: 32px;
  --nav-duoi-h: 0px;
  --vh-khung: 100vh;
  /* --muted ở bố cục di động (WU-14 QT-23) — khai theo TỪNG theme */
  --muted-dd: #5f6e66;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101613;
    --surface: #182220;
    --surface-2: #1f2b28;
    --line: #2c3a35;
    --line-soft: #243230;
    --ink: #e8eeea;
    --ink-2: #bcc9c3;
    --muted: #8b9a93;
    --accent: #4fbfa5;
    --accent-ink: #06211c;
    --accent-soft: #1d332e;
    --ok: #6cc98c;
    --ok-soft: #1a2f23;
    --warn: #e0ad5c;
    --warn-soft: #302714;
    --crit: #ef8b7d;
    --crit-soft: #35201d;
    --line-strong: #5d6e67;
    --muted-dd: #8b9a93;
  }
}

:root[data-theme="dark"] {
  --ground: #101613;
  --surface: #182220;
  --surface-2: #1f2b28;
  --line: #2c3a35;
  --line-soft: #243230;
  --ink: #e8eeea;
  --ink-2: #bcc9c3;
  --muted: #8b9a93;
  --accent: #4fbfa5;
  --accent-ink: #06211c;
  --accent-soft: #1d332e;
  --ok: #6cc98c;
  --ok-soft: #1a2f23;
  --warn: #e0ad5c;
  --warn-soft: #302714;
  --crit: #ef8b7d;
  --crit-soft: #35201d;
  --line-strong: #5d6e67;
  --muted-dd: #8b9a93;
}

/* ---------------------------------------------------------------------------
   2. Nền trang — WA-09 mục 3.2 (body 14px/400), mục 3.3 (khoảng cách)
   --------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  /* Chặn trang cuộn ngang trên điện thoại — WA-09 QT-11 */
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* WU-14 QT-9 — màn cảm ứng: vùng chạm 44px ở MỌI bề rộng (chỉ đổi token,
   KHÔNG dùng pointer để chọn bố cục — QT-4) */
@media (pointer: coarse) {
  :root {
    --tap: 44px;
  }
}
}

/* ==========================================================================
   LỚP thanh-phan — toàn bộ CSS bố cục máy tính (gốc). KHÔNG @media theo bề
   rộng ở đây (trừ mục lục pháp lý min-width: 1024px) — WU-14 QT-1.
   ========================================================================== */
@layer thanh-phan {
/* WA-09 QT-42 — viền focus luôn thấy rõ, KHÔNG outline: none */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mono {
  font-family: var(--font-mono);
}

/* WA-09 QT-7 — số xếp cột không được nhảy so le */
.num {
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: 11.5px;
  color: var(--muted);
}

.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;
}

/* ---------------------------------------------------------------------------
   3. Thanh trên — WU-00 QT-15 (thanh trên, KHÔNG thanh bên 236px)
   WU-00 QT-16: bộ chọn ngôn ngữ LUÔN hiện, kể cả khi chưa đăng nhập
   --------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  /* WU-00 QT-15 — bề rộng nội dung web khách là 980px */
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-ctl);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 700;
}

/* ID người dùng ở thanh trên — WU-00 mục 6c QT-39 → QT-43 */
.nav-user {
  font-size: 13px;
  color: var(--muted);
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Bộ chọn ngôn ngữ — 3 nút, WA-09 QT-41 (dùng <button>, không <div onclick>) */
.langs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-ctl);
}

.lang {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
}

.lang:hover {
  color: var(--ink);
}

.lang[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   4. Bố cục — WA-09 QT-10 (flex/grid + gap, KHÔNG margin từng khối)
   --------------------------------------------------------------------------- */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   5. Khối — WA-09 mục 4.2 (.panel)
   --------------------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel > header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.panel > header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel > header .sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.panel-body {
  padding: 15px;
}

/* WA-09 QT-15 — chia nhỏ trong một khối bằng vạch, không lồng khối trong khối */
.divide {
  border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------------------------
   6. Nút — WA-09 mục 4.5
   --------------------------------------------------------------------------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover:not([disabled]) {
  background: var(--surface-2);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover:not([disabled]) {
  /* Không có biến màu "accent đậm hơn" trong WA-09 ⇒ dùng độ mờ, không thêm màu */
  opacity: 0.9;
  background: var(--accent);
}

/* WA-09 QT-23 — nút không dùng được thì mờ 45%, con trỏ thường */
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

/* WA-09 4.5 — hành động PHÁ / KHÔNG LÙI ĐƯỢC (thu hồi mã mời, khoá tài
   khoản). Thêm 2026-10-10 cho màn quản trị WA-10; phần tử này đã được khai
   trong WA-09 từ trước, chỉ là web khách chưa có việc nào cần tới. */
.btn.danger {
  border-color: var(--crit);
  color: var(--crit);
}

.btn.danger:hover:not([disabled]) {
  background: var(--crit-soft);
}

.btn.sm,
.btn.small {
  font-size: 11.5px;
  padding: 6px 10px;
}

.btn.wide {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   7. Nhãn trạng thái — WA-09 mục 4.4 (.pill)
   QT-21: nhãn LUÔN có chữ + chấm tròn; .nodot khi dùng như thẻ phân loại
   --------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.pill.nodot::before {
  display: none;
}

.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.crit {
  background: var(--crit-soft);
  color: var(--crit);
}

.pill.mute {
  background: var(--surface-2);
  color: var(--muted);
}

.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   8. Chú thích / ghi chú — WA-09 mục 4.13
   .note = khung cảnh báo CẦN ĐỌC (demo gọi là .demo-note)
   --------------------------------------------------------------------------- */
.note {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 13px;
}

.note.info {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.note .ico {
  flex: none;
  font-size: 13px;
  line-height: 1.45;
}

.note p {
  margin: 0;
}

.note p + p {
  margin-top: 4px;
}

/* ---------------------------------------------------------------------------
   9. Ô nhập — WA-09 mục 4.9 (label.field)
   QT-28: MỌI ô nhập bọc trong <label class="field">, nhãn 12px --muted ở TRÊN
   --------------------------------------------------------------------------- */
.field {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.field > input,
.field > textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  padding: 8px 10px;
}

/* ---------------------------------------------------------------------------
   10. Bảng — WA-09 mục 4.3
   QT-16: bảng LUÔN bọc trong .tbl-wrap, nếu không trang cuộn ngang
   --------------------------------------------------------------------------- */
.tbl-wrap {
  overflow-x: auto;
}

.tbl-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl-wrap th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
  text-align: left;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.tbl-wrap td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.tbl-wrap tr:last-child td {
  border-bottom: 0;
}

/* WA-09 QT-19 — mọi bảng phải có trạng thái rỗng, cấm bảng trắng */
.tbl-wrap td.empty {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 20px 15px;
}

/* ---------------------------------------------------------------------------
   11. Hộp thoại — WA-09 mục 4.10 (.modal)
   --------------------------------------------------------------------------- */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  /* Lớp phủ: không có biến màu nào cho nền mờ trong WA-09 ⇒ dùng --ink + alpha
     qua color-mix để không sinh mã màu mới */
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  overscroll-behavior: contain;
}

.modal-back[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-modal);
}

.modal > header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.modal > header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal > header .sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.modal-body {
  padding: 15px;
}

.modal-body.flush {
  padding: 0;
}

/* WA-09 QT-32 — nút bên phải, thứ tự Huỷ rồi mới hành động chính */
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 15px;
  border-top: 1px solid var(--line-soft);
}

/* Chú thích trong chân hộp thoại đứng bên trái, nút vẫn ở bên phải (QT-32) */
.modal-foot .hint {
  margin-right: auto;
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   12. Trang Home — các khối riêng (WU-10 mục 4.1)
   --------------------------------------------------------------------------- */

/* Khối 2 — Mở đầu */
.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hero h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.hero .lead {
  margin: 0;
  max-width: 62ch;
  font-size: 14px;
  color: var(--ink-2);
}

/* Ảnh minh hoạ — WU-10 QT-14: ít nhất 1 ảnh phụ đề dịch đè lên video.
   🔴 Ảnh phải TỰ QUAY (không dùng khung hình có bản quyền) ⇒ chưa có file nào,
   đây là khung chừa chỗ, KHÔNG tải ảnh từ mạng. */
.shot {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 15px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* Khối 3 + 4 — lưới ý / lưới bước */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}

.card {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* Khối 6 — một câu hỏi thường gặp */
.q + .q {
  padding-top: 15px;
}

.q h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.q p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.step-n {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

/* Khối 5 — hàng chọn chu kỳ (WU-10 4.2) */
.cyc {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-ctl);
}

.cyc button,
.cyc a {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cyc button[aria-pressed="true"],
.cyc a[aria-current="page"] {
  background: var(--surface);
  color: var(--accent);
}

#pl-khu {
  display: none;
}

/* ---------------------------------------------------------------------------
   13. Thẻ gói — `.plan`
   ⚠️ Phần tử RIÊNG của web khách, CHƯA có trong WA-09 mục 4 (WU-00 QT-17 ghi
   rõ "phải thêm vào WA-09 trước khi code" — `TODO.md` 0b mục 21 còn treo).
   Dựng bằng ĐÚNG biến màu + cỡ chữ + bán kính sẵn có của WA-09, KHÔNG thêm màu
   mới (WU-00 QT-21). Thứ tự bên trong theo WU-00 QT-17 + WU-07 4.2.2.
   --------------------------------------------------------------------------- */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  container-type: inline-size;
}

#bang-gia .panel-body,
#pl-body {
  container-type: inline-size;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* WU-07 QT-16 — gói đang dùng nhận ra bằng HAI dấu hiệu: viền + nhãn chữ.
   Không dùng màu một mình để truyền thông tin (WA-09 QT-3, mục 7) */
.plan.now {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.plan .code {
  font-size: 11.5px;
  color: var(--muted);
}

.plan .price {
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
}

.plan .price small {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

.plan ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--ink-2);
}

.plan .feats {
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}

.plan .feats li {
  display: flex;
  gap: 6px;
}

.plan .feats .tick {
  flex: none;
  color: var(--ok);
  font-weight: 700;
}

.plan .foot {
  margin-top: auto;
  padding-top: 3px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Khung xám giữ chỗ — WU-10 QT-8: đúng kích thước thẻ gói, trang KHÔNG nhảy
   khi dữ liệu về (WA-09 mục 6 "Đang tải") */
.plan.skeleton {
  min-height: 268px;
  background: var(--surface-2);
  border-style: dashed;
  color: var(--muted);
  font-size: 11.5px;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: no-preference) {
  .plan.skeleton {
    animation: plan-pulse 1.4s ease-in-out infinite;
  }
}

@keyframes plan-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ---------------------------------------------------------------------------
   14. Trang đăng nhập — WU-02 mục 4.1
   --------------------------------------------------------------------------- */
/* Thẻ đăng nhập nằm GIỮA phần dưới thanh trên (WU-02 1.9 mục 4.1):
   body của riêng trang này thành cột cao tối thiểu bằng khung nhìn, main
   giãn (flex: 1) rồi căn giữa dọc — không cứng chiều cao thanh trên.
   Màn thấp hơn thẻ thì main tự cao ra và trang cuộn bình thường.
   Chỉ áp cho trang có .login-wrap, các trang khác không đổi. */
body:has(.login-wrap) {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.login-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.login-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card .brand {
  margin: 0 auto;
}

.login-card h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  text-align: center;
}

.login-card .lgsub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* Nút Google — WU-02 QT-1: Google Ở TRÊN, email/mật khẩu ở dưới.
   Logo Google vẽ bằng SVG nội tuyến, KHÔNG tải ảnh từ mạng (WU-10 QT-13) */
.gbtn {
  width: 100%;
}

.gbtn svg {
  flex: none;
  width: 16px;
  height: 16px;
}

/* Vạch "hoặc" */
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.login-links a {
  color: var(--accent);
}

/* Khung thông báo lỗi / trạng thái của biểu mẫu.
   ⚠️ WU-00 QT-13/QT-14 + WA-09 QT-38: chữ cho khách, KHÔNG mã lỗi kỹ thuật */
.formmsg {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--crit);
  background: var(--crit-soft);
  color: var(--ink);
}

.formmsg[hidden] {
  display: none;
}

.formmsg.warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.formmsg.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.formmsg p {
  margin: 0;
}

/* Khối điều kiện mật khẩu tự tick — `.pw-req` (WU-01 4.1b, WU-03 4.3), dựng
   theo bản demo v2 anh đã duyệt. CHỈ dùng biến màu/cỡ chữ sẵn có: 11.5px như
   `.hint`, chưa đạt = `--muted` (KHÔNG `--crit`), đạt = `--ok`, các dòng cách
   nhau 4px. Dấu ✓/✗ là ký tự thật trong DOM (WA-09 QT-3).
   ⚠️ WU-01 4.1b ghi `.pw-req` phải được thêm vào WA-09 mục 4 — WA-09 CHƯA có
   (đã báo trưởng nhóm). */
.pw-req {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.pw-req li {
  display: flex;
  gap: 7px;
  align-items: baseline;
}

.pw-req li .mk {
  width: 1em;
  text-align: center;
  flex-shrink: 0;
}

.pw-req li.ok {
  color: var(--ok);
}

/* Nút hiện/ẩn mật khẩu (WU-01 QT-3) — đè lên mép phải ô nhập; chỉ dùng biến sẵn có */
.pw-wrap {
  position: relative;
}

.pw-wrap .field > input {
  padding-right: 40px;
}

.pw-eye {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-ctl);
  cursor: pointer;
}

/* Ô tick đồng ý Điều khoản (WU-01 4.1 dòng 9, UA-11 6.5) */
.tick-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-2);
}

.tick-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.tick-row a {
  color: var(--accent);
}

/* Dòng tick đồng ý trong hộp thoại (hộp "Điều khoản đã được cập nhật" WU-12 7c,
   hộp xác nhận chuyển gói free): ô tick cỡ cố định + chữ CÙNG MỘT HÀNG.
   Phải đè `.field > input` (width:100%, viền ô nhập) vì checkbox nằm trong .field. */
.field.row.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}

.field.row.agree > input[type="checkbox"] {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  background: none;
  border: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.field.row.agree > input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field.row.agree > span {
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Liên kết văn bản: a:visited cùng màu với a (dùng --accent), không tím mặc định (WU-14 QT-20c)
   Dùng a:not(.btn):visited để không đè màu của các nút .btn/.btn.primary */
a:not(.btn):visited {
  color: var(--accent);
}

/* Liên kết trong dòng đồng ý: luôn gạch chân, không tím mặc định (cả :visited) */
.field.row.agree a,
.field.row.agree a:visited,
.tick-row a:visited {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.field.row.agree a:hover,
.tick-row a:hover {
  text-decoration-thickness: 2px;
}

.field.row.agree a:focus-visible,
.tick-row a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Danh sách nhãn–giá trị — WA-09 mục 4.8 (.kv) */
.kv {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 15px;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
  font-size: 12px;
}

.kv dd {
  margin: 0;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------------------
   14b. MÀN QUẢN TRỊ — WA-10 (trang `/admin`)
   Chỉ là BỐ CỤC cho các phần tử đã có của WA-09 (`.panel`, `.cyc`, bảng,
   `.btn`) — KHÔNG thêm màu, cỡ chữ hay bán kính mới (WA-09 QT-1, QT-45).

   ⚠️ Hai chỗ WA-09 chưa khai, đã báo trưởng nhóm:
     · `.panel > header .right` — WA-09 4.2 CÓ nói header khối gồm `h2` +
       `.sub` + `.right` (nút, ô lọc) nhưng chưa cho giá trị nào ⇒ dựng bằng
       flex + `gap` đúng QT-10.
     · `<details>`/`<summary>` cho mục gập "Đã hết hiệu lực" mà WA-10 4.2 yêu
       cầu — WA-09 mục 4 KHÔNG có phần tử gập nào. Dùng thẻ gốc của HTML để
       bàn phím và trình đọc màn hình chạy được sẵn (WA-09 QT-41).
   --------------------------------------------------------------------------- */

/* Header khối có nút bên phải */
.panel > header.head-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.panel > header .right {
  margin-left: auto;
  flex-shrink: 0;
}

/* Nhóm "thời gian sống" + hàng nút cấp mã: cách phần trên bằng vạch chia
   (WA-09 QT-15 — không lồng khối trong khối) */
.ttl {
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.ttl .cyc {
  flex-wrap: wrap;
}

/* Hàng nút dùng chung `.row` nên cần ghi đè hướng xếp */
.row.ttl {
  flex-direction: row;
  align-items: center;
}

/* Mục gập */
.panel > details > summary {
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.panel > details[open] > summary {
  border-bottom: 1px solid var(--line-soft);
}

/* Trong ô bảng: mã + nút Copy, hoặc ngày + nhãn "còn n ngày" xếp DỌC trong
   CÙNG một ô thay vì thêm cột mới (WA-09 QT-20).
   ⚠️ Phải bọc trong `.cell` chứ không đặt `display: flex` lên chính `td` —
   `td` mất `display: table-cell` là vỡ hết chiều rộng cột.
   QT-10: xếp bằng `gap`, không bằng margin từng phần tử. */
.tbl-wrap td .cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.tbl-wrap td .row {
  gap: 6px;
}

/* Mã mời hiện ĐẦY ĐỦ (WA-10 QT-6) nên khá dài — cho phép ngắt dòng để bảng
   không đẩy trang cuộn ngang */
.tbl-wrap td .mono {
  word-break: break-all;
}

/* ---------------------------------------------------------------------------
   15. Chân trang — WU-10 mục 4.1 khối 8
   --------------------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.foot-in {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  display: flex;
  gap: 10px 20px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.foot-in a {
  color: var(--accent);
}

.foot-in .spacer {
  margin-left: auto;
}

/* Nút Google (WU-02 3.2, bản 1.5): nút thật của Google Identity Services vẽ
   trong .grender, đè TRONG SUỐT lên nút .gbtn để giữ giao diện sẵn có mà vẫn
   là nút GIS (GIS bắt buộc renderButton cho đăng nhập qua cửa sổ popup). */
.gwrap {
  position: relative;
}

.grender {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  overflow: hidden;
  opacity: 0.01;
}
.grender[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------------
   14. KHU VỰC TÀI KHOẢN — trang /tai-khoan (WU-00 mục 4.1/6, WU-07, WU-06 1.2)
   Dựng bằng ĐÚNG biến màu/cỡ chữ/bán kính sẵn có, KHÔNG thêm màu mới. Các lớp
   dưới đây theo bản demo v2 (`.nav` → `.acc-nav` để khỏi trùng tên chung).
   --------------------------------------------------------------------------- */

/* Thanh tab ngang dưới thanh trên (WU-00 QT-15): cuộn ngang được trên điện thoại */
.acc-nav {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 2px;
  display: flex;
  gap: 3px;
  overflow-x: auto;
}

.acc-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 8px 11px;
  border-radius: var(--radius-ctl) var(--radius-ctl) 0 0;
  border-bottom: 2px solid transparent;
}

.acc-nav button:hover {
  background: var(--surface-2);
}

/* Tab đang mở: màu + gạch chân + chữ đậm (không dùng màu một mình — WA-09 mục 7) */
.acc-nav button[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.nhan-ngan {
  display: none;
}

.back-acc {
  display: none;
}

.page-head h1 {
  margin: 0 0 2px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.page-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.between {
  justify-content: space-between;
}

.cols {
  display: grid;
  gap: 14px;
}

.cols.lead {
  grid-template-columns: 1.35fr 1fr;
}

.cols.two {
  grid-template-columns: 1fr 1fr;
}

.cols > * {
  min-width: 0;
}

/* Thanh quota — WA-09 QT-27: ≥ 80% đã dùng `.warn`, ≥ 95% `.crit`; luôn kèm số thật */
.bar {
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.bar > i.warn {
  background: var(--warn);
}

.bar > i.crit {
  background: var(--crit);
}

/* Khối chữ "đang tải" giữ chỗ — trang không nhảy giật (WA-09 mục 6) */
.acc-skel {
  min-height: 150px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px dashed var(--line);
}

@media (prefers-reduced-motion: no-preference) {
  .acc-skel {
    animation: plan-pulse 1.4s ease-in-out infinite;
  }
}

/* Danh sách tính năng ở Tổng quan (WU-07 4.1.3) */
.feat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
}

.feat-list li.off {
  color: var(--muted);
}

.feat-list .tick {
  color: var(--ok);
}

/* Lịch sử xem — khung CAO CỐ ĐỊNH đúng 10 dòng, header dính (WU-06 4.4) */
.hist-box {
  --row-h: 48px;
  height: calc(var(--row-h) * 10 + 37px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.hist-box table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

/* Độ rộng cột Lịch sử (trước đây là style= nội tuyến trên <col> trong
   tai-khoan.html — chuyển vào CSS để luật di động thắng được mà không cần
   !important, WU-14 QT-8) */
.hist-box col:nth-child(1) {
  width: 46%;
}

.hist-box col:nth-child(2),
.hist-box col:nth-child(3),
.hist-box col:nth-child(4) {
  width: 18%;
}

.hist-box th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 37px;
  padding: 0 15px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.hist-box td {
  height: var(--row-h);
  padding: 4px 15px;
  vertical-align: middle;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

/* Tên video: tối đa 2 dòng rồi cắt bằng "…" (WU-06 4.2) */
.hist-box td.vid .t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hist-box td.vid a.t {
  color: inherit;
  text-decoration: none;
}

.hist-box td.vid a.t:hover {
  text-decoration: underline;
}

.hist-box .dom-m {
  display: none;
}

.hist-box td.dom {
  font-size: 12px;
  color: var(--muted);
}

.hist-box td.when {
  white-space: nowrap;
}

/* Trạng thái rỗng / lỗi căn giữa TRONG khung (WU-06 4.4) */
.hist-box .centered {
  position: absolute;
  inset: 37px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.hist-box tr.skelrow td > i {
  display: block;
  height: 12px;
  background: var(--surface-2);
  border-radius: 4px;
}

.hist-box tr.more td {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.hs-search {
  width: 170px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  padding: 6px 10px;
}

/* Hàng Mã kích hoạt (WU-07 4.1.1b) */
.ov-act-box {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ov-act-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ov-act-code {
  font-size: 14px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ---- Thanh toán — WU-08 & WA-09 4.14, 4.15 ---- */
/* Hàng chọn ảnh minh chứng: ô xem trước + nút chọn, căn trái (UX: bố cục ổn định, không nhảy) */
.proof-pick {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.proof-pick > .stack {
  gap: 8px;
  min-width: 0;
}

.field > textarea {
  resize: vertical;
  line-height: 1.55;
  min-height: 72px;
}

.field > textarea:focus-visible,
.field > input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.qr-box {
  width: 76px;
  height: 76px;
  background: var(--surface-2, #f5f5f7);
  border: 1px dashed var(--line);
  border-radius: var(--radius-ctl, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  flex-shrink: 0;
  padding: 4px;
}
.qr-box.lg {
  width: 128px;
  height: 128px;
}
.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pay-acc {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft, #ececf0);
  cursor: pointer;
  border-radius: var(--radius-ctl, 6px);
  transition: background 0.15s, border-color 0.15s;
}
.pay-acc:last-child {
  border-bottom: none;
}
.pay-acc:hover {
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
}
.pay-acc.sel {
  background: var(--accent-soft, rgba(0, 102, 204, 0.08));
  outline: 1px solid var(--accent, #0066cc);
}
.pay-acc .meta {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pay-acc .meta-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.pay-acc .meta-desc {
  font-size: 12.5px;
  color: var(--ink-2, var(--ink));
  white-space: pre-line;
  line-height: 1.45;
}
.pay-acc .meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pay-acc .acts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.approx-price {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   Trang pháp lý (/dieu-khoan, /quyen-rieng-tu) — WU-12 mục 7b (1.9)
   Theo demo/demo-dieu-khoan-2026-11-09.html. Chỉ dùng token của :root ở trên.
   --------------------------------------------------------------------------- */
.doc-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.doc-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin-bottom: 24px;
}

.doc-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.doc-nav {
  display: flex;
  align-items: center;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.doc-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
  cursor: pointer;
}

.doc-link:hover {
  text-decoration: underline;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-back[hidden] {
  display: none;
}

.btn-back:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

/* Khung BẢN TẠM (dùng .note có sẵn) — chữ 14px, icon cảnh báo màu warn */
.doc-draft {
  font-size: 14px;
}

.doc-draft .ico {
  color: var(--warn);
  margin-top: 2px;
}

/* Khung BẢN TẠM nhắc lại ở cuối trang (đầy đủ, không thu nhỏ — WU-12 mục 0 quy tắc 2) */
.doc-draft-end {
  max-width: 720px;
  margin-top: 32px;
}

.doc-layout {
  display: block;
}

.doc-toc {
  margin: 0 0 24px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 720px;
}

.doc-toc summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.doc-toc summary::-webkit-details-marker {
  display: none;
}

.doc-toc summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform 0.18s;
  margin-right: 4px;
}

.doc-toc[open] summary::after {
  transform: rotate(-135deg);
}

.doc-toc h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.doc-toc ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-toc a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-ctl);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.doc-toc a:hover {
  background: var(--surface);
  color: var(--accent);
}

.doc-body {
  max-width: 720px;
  font-size: 16px;
}

/* scroll-margin-top 72px: thanh trên dính cao ~50px không che tiêu đề mục */
.doc-sec {
  scroll-margin-top: 72px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.doc-sec:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-sec h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.35;
}

.doc-sec p {
  margin: 0 0 14px;
  line-height: 1.7;
}

.doc-sec p:last-child {
  margin-bottom: 0;
}

.doc-sec ul {
  margin: 0 0 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-sec li {
  line-height: 1.7;
}

.doc-foot {
  max-width: 720px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.doc-foot p {
  margin: 0 0 8px;
}

/* G29d (UA-23 4.2) — dòng "Phiên bản · Cập nhật gần nhất" khi không phải bản tạm, và thanh chọn
   ngôn ngữ (chỉ liệt kê ngôn ngữ có nội dung). Chỉ dùng token có sẵn. */
.doc-ver {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.doc-langs {
  font-size: 14px;
  color: var(--ink-2);
}

.doc-lang-cur {
  font-weight: 600;
  color: var(--ink);
}

/* G29d (WU-12 7c, UA-23 mục 7) — khối "Thay đổi lần này" trong hộp tick lại điều khoản */
.terms-sum {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.terms-sum h4 {
  margin: 0 0 6px;
  font-size: 13.5px;
}

.terms-sum p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-line;
}

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: border-color 0.15s, background 0.15s;
}

.to-top:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

/* Màn rộng: mục lục dính bên cạnh, luôn mở */
@media (min-width: 1024px) {
  .doc-page {
    max-width: 1080px;
  }
  .doc-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 720px);
    gap: 48px;
    align-items: start;
  }
  .doc-toc {
    position: sticky;
    top: 72px;
    margin: 0;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow: auto;
  }
  .doc-toc summary {
    pointer-events: none;
    cursor: default;
  }
  .doc-toc summary::after {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.doc-page) {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-back,
  .doc-toc summary::after,
  .doc-toc a,
  .to-top {
    transition: none;
  }
}

/* Nội dung chuyển khoản bắt buộc (WU-08 4.3) — dòng nổi bật */
.pay-ref {
  border: 1px solid var(--warn, #d9a441);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pay-ref-warn { margin: 0 0 8px; font-weight: 700; color: var(--warn, #d9a441); }
.pay-ref-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pay-ref-text { font-size: 1.1rem; word-break: break-all; }

/* Khối "Đơn của bạn" (WU-08 4.2): tiêu đề + số tiền, nội dung gói, thời hạn, ghi chú — dọc, thoáng */
.order-card { display: flex; flex-direction: column; gap: 16px; }
.order-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.order-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.order-amount { text-align: right; }
.order-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.order-block { padding-top: 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.order-value { font-size: 14px; font-weight: 600; color: var(--ink); }
.order-quota { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.order-quota .feat { display: flex; gap: 6px; }
.order-quota .tick { flex: none; color: var(--ok); font-weight: 700; }
.order-approx-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.order-approx-row .approx-price { margin-top: 0; font-size: 13px; color: var(--muted); }
.order-cur-select {
  max-width: 240px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12.5px;
  cursor: pointer;
}
.order-cur-select:focus-visible { border-color: var(--accent); }
.order-disp-note { max-width: 420px; margin-left: auto; margin-top: 4px; }

/* Ảnh QR bấm được ở màn Thanh toán: kính lúp + xem lớn */
.qr-box.zoomable { cursor: zoom-in; }
.qr-box.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-body.img-zoom { text-align: center; }
.modal-body.img-zoom img { max-width: 100%; max-height: 70vh; max-height: 70dvh; object-fit: contain; background: #fff; border-radius: var(--radius-ctl, 6px); }

/* Hộp xem ảnh lớn: cùng khoảng đệm với hộp xem ảnh ở trang quản trị (đầu 15/18, thân 18, chân 13/18) */
.modal.img-modal > header { padding: 15px 18px; }
.modal.img-modal .modal-body.img-zoom { padding: 18px; }
.modal.img-modal .modal-foot { padding: 13px 18px; }

/* Tab Thanh toán: chấm số trên menu + tiêu đề phân đoạn + dòng lịch sử mở rộng (WU-08 4.1, 4.6) */
.acc-nav .nav-badge {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 9px; background: var(--warn); color: #1a1a1a;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.seg-title { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.pending-note { align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px; }
.pending-note p { margin: 0; }
tr.ls-row { cursor: pointer; }
tr.ls-row:hover { background: var(--surface-2); }
tr.ls-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.ls-detail td { background: var(--surface-2); padding: 10px 14px; }
.ls-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 12.5px; }
.ls-kv .k { color: var(--muted); }
.ls-kv .v { color: var(--ink); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.pdf-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------------------
   G28d1: Phần tử di động chỉ hiện trên điện thoại (WU-11 QT-17, WU-00 QT-34)
   Ngoài bố cục di động DD (WU-14 mục 2) các phần tử này ẩn
   --------------------------------------------------------------------------- */
.desk-only-mobile,
.langbtn,
.btn-lang-sheet,
.sheet-lang-back,
#hs-more-wrap,
.hs-more-wrap {
  display: none;
}

/* ---------------------------------------------------------------------------
   Màn Hồ sơ v2 — WU-05 1.8 mục 4.1, 4.1b (chân lý hình dạng: demo-ho-so-v2)
   Bố cục theo BỀ RỘNG KHUNG CHỨA (container query), không theo viewport.
   --------------------------------------------------------------------------- */
#pf-body {
  container-type: inline-size;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}

#pf-body svg.i {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-h {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 18px;
}

.page-h h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.page-h p {
  margin: 0;
  color: var(--muted);
}

.page-h .avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  flex: none;
  border: 1px solid var(--line);
}

.pf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pf-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.thiet-bi-entry {
  display: none;
}

@container (max-width: 760px) {
  .pf-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#pf-body .panel {
  overflow: hidden;
}

#pf-body .panel > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

#pf-body .panel > header .i {
  color: var(--accent);
}

#pf-body .panel > header h2 {
  font-size: 15px;
  line-height: 1.3;
}

#pf-body .panel > header .count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
}

#pf-body .panel-body {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

@container (max-width: 480px) {
  #pf-body .panel > header {
    padding: 12px 14px;
  }

  #pf-body .panel-body {
    padding: 14px;
  }
}

.pf-tight {
  display: grid;
  gap: 6px;
}

.pf-tight2 {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.pf-subh {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
}

.inline-save {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-save input {
  min-height: 44px;
  width: 100%;
}

.inline-save .btn {
  min-height: 44px;
}

@container (max-width: 380px) {
  .inline-save {
    grid-template-columns: minmax(0, 1fr);
  }

  .inline-save .btn {
    width: 100%;
  }
}

.pf-lockrow {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pf-lockrow input {
  flex: 1;
  min-height: 44px;
}

.pf-lockrow .i {
  color: var(--muted);
}

.inline-save input,
.pf-lockrow input {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  padding: 9px 12px;
}

.inline-save input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.inline-save input[aria-invalid="true"] {
  border-color: var(--crit);
}

.pf-lockrow input[readonly] {
  background: var(--surface-2);
  color: var(--ink-2);
  border-style: dashed;
  cursor: not-allowed;
}

.pf-msg:empty {
  display: none;
}

.pf-msg.err,
.pf-msg.okt {
  font-size: 12.5px;
}

.pf-msg.okt {
  color: var(--ok);
}

/* Hàng phương thức đăng nhập */
.pf-method {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 0;
}

.pf-method + .pf-method {
  border-top: 1px solid var(--line-soft);
}

.pf-method:first-child {
  padding-top: 0;
}

.pf-method:last-child {
  padding-bottom: 0;
}

.pf-method .m-ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.pf-method .m-name {
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.pf-method .m-sub {
  grid-column: 2;
  color: var(--muted);
  font-size: 12.5px;
}

.pf-method .m-act {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}

.pf-method .m-block {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.pf-method .btn,
.pf-ce-actions .btn {
  min-height: 44px;
}

@container (max-width: 480px) {
  .pf-method {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .pf-method .m-act {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 8px;
  }

  .pf-method .m-act .btn {
    width: 100%;
  }
}

/* Công tắc — WU-05 4.1b (dùng chung cho Tin tức và Lưu transcript) */
.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}

.switch-row .tx {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: none;
}

.switch input {
  position: absolute;
  inset: -7px -4px;
  width: calc(100% + 8px);
  height: calc(100% + 14px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1.5px solid var(--line-strong);
  transition: background 0.15s, border-color 0.15s;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--ink-2);
  display: grid;
  place-items: center;
  transition: transform 0.15s, background 0.15s;
  color: var(--surface);
}

.switch-thumb svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.switch-thumb .on {
  display: none;
}

.switch input:checked ~ .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked ~ .switch-thumb {
  transform: translateX(22px);
  background: var(--accent-ink);
  color: var(--accent);
}

.switch input:checked ~ .switch-thumb .on {
  display: block;
}

.switch input:checked ~ .switch-thumb .off {
  display: none;
}

.switch input:focus-visible ~ .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.switch input:disabled {
  cursor: progress;
}

.switch:has(input:disabled) {
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .switch-track,
  .switch-thumb {
    transition: none;
  }
}

/* Danh sách trang đang lưu transcript — WU-05 3.5b2 */
.dom-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  overflow: hidden;
}

.dom-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 8px 8px 8px 14px;
  min-height: 56px;
}

.dom-list li + li {
  border-top: 1px solid var(--line-soft);
}

.dom-list .d {
  font-family: var(--font-mono);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.dom-list .dt {
  color: var(--muted);
  font-size: 12px;
}

.dom-list .rm {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.dom-list .rm .btn {
  min-height: 44px;
  font-weight: 500;
  font-size: 12.5px;
  padding: 0 10px;
  color: var(--ink-2);
}

@container (max-width: 480px) {
  .dom-list li {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px;
  }

  .dom-list .rm {
    grid-column: 1;
    grid-row: auto;
    margin-top: 6px;
  }

  .dom-list .rm .btn {
    width: 100%;
  }
}

/* Khối Thông báo ở Hồ sơ (WU-05 3.5c, G62d) */
.pf-notice {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pf-notice + .pf-notice {
  margin-top: 10px;
}

.pf-notice-h {
  font-weight: 600;
  font-size: 13.5px;
}

.pf-notice-d,
.pf-notice-r,
.pf-notice-more {
  color: var(--ink-2);
  margin-top: 2px;
}

.pf-notice-list {
  margin: 8px 0 4px;
  padding-left: 18px;
}

.pf-notice-list li {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

.pf-notice-list a {
  word-break: break-all;
}

.pf-notice-b {
  margin-top: 6px;
  font-weight: 500;
}

.pf-notice-err {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.dom-empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-ctl);
  color: var(--ink-2);
  text-align: center;
  font-size: 13px;
}

.dom-loading {
  min-height: 56px;
  border-radius: var(--radius-ctl);
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%;
}

/* Vùng nguy hiểm riêng (ngoài .pf-grid, không phải .panel) — WU-05 4.1 */
.danger-zone {
  margin-top: 16px;
  border: 1px solid var(--crit);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 24px;
  align-items: center;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.danger-zone::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--crit);
}

.danger-zone h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--crit);
  display: flex;
  gap: 8px;
  align-items: center;
}

.danger-zone p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  max-width: 62ch;
}

.btn.danger-o {
  border-color: var(--crit);
  color: var(--crit);
  background: transparent;
  min-height: 44px;
}

.btn.danger-o:hover:not([disabled]) {
  background: var(--crit-soft);
}

@container (max-width: 640px) {
  .danger-zone {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 14px 14px 18px;
  }

  .danger-zone .btn {
    width: 100%;
  }
}

/* Hộp xoá tài khoản bước 1 — WU-05 4.4 */
.lose {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  overflow: hidden;
}

.lose li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
}

.lose li + li {
  border-top: 1px solid var(--line-soft);
}

.lose .i {
  width: 16px;
  height: 16px;
  color: var(--crit);
  margin-top: 2px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note.warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.pf-dlg-step {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.pf-mono-line {
  margin: 0;
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

}

/* ==========================================================================
   LỚP di-dong — BỘ NGƯỠNG DUY NHẤT (WU-14 mục 2). Chuỗi @media chép NGUYÊN
   VĂN từ bảng QT-1 (test khoá). Thứ tự: TB → DD → DD-NHO → DD-NGANG (QT-4b).
   ========================================================================== */
@layer di-dong {
/* TB — tablet dọc / cửa sổ hẹp: bố cục máy tính + vùng chạm 44px + lề 24px */
@media (min-width: 744px) and (max-width: 1023px) {
  :root {
    --pad-trang: 24px;
    --tap: 44px;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  button,
  .btn {
    min-height: var(--tap);
  }

  button.lang {
    min-width: var(--tap);
    min-height: var(--tap);
    padding: 6px 12px;
  }

  .gbtn {
    min-height: var(--tap);
  }

  input,
  select,
  textarea {
    min-height: var(--tap);
  }

  .pw-eye {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .pw-wrap .field > input {
    padding-right: 48px;
  }

  a.brand {
    min-height: var(--tap);
    min-width: var(--tap);
    display: inline-flex;
    align-items: center;
  }

  .login-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
  }

  .doc-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
  }

  .doc-toc summary {
    min-height: var(--tap);
  }

  /* Vùng chạm >= --tap (44px) cho liên kết tiêu đề video Lịch sử ở TB (WU-14 QT-9, G67g) */
  .hist-box td.vid a.t,
  #hs-box td.vid a.t {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    min-width: var(--tap);
    max-width: 100%;
  }
}

/* DD — di động (điện thoại dọc ≤743px hoặc điện thoại xoay ngang) */
@media (max-width: 743px), (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  /* Token bố cục di động (WU-14 mục 4, QT-23). Đặt lại MỌI biến mà TB đổi
     (QT-4b) vì DD đứng sau TB và hai khối có thể cùng khớp. */
  :root {
    --pad-trang: 16px;
    --fs-body: 16px;
    --fs-nho: 12px;
    --tap: 44px;
    --tap-chinh: 48px;
    --topbar-h: 56px;
    --nav-duoi-h: 56px;
    --vh-khung: 100dvh;
    --muted: var(--muted-dd);
  }

  /* --- Lề trang, .kv một cột (trước: ≤860px) --- */
  .topbar-in,
  .wrap,
  .foot-in {
    padding-left: 16px;
    padding-right: 16px;
  }

  .login-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .login-card {
    width: 100%;
    box-sizing: border-box;
  }

  .login-card .btn,
  .gbtn {
    min-height: 48px;
    width: 100%;
  }

  .pw-eye {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .pw-wrap .field > input {
    padding-right: 48px;
  }

  a.brand {
    min-height: var(--tap);
    min-width: var(--tap);
    display: inline-flex;
    align-items: center;
  }

  .login-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
  }

  .doc-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
  }

  .doc-toc summary {
    min-height: var(--tap);
  }

  .hero {
    padding: 20px 16px;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .kv dd {
    margin-bottom: 8px;
  }

  .foot-in .spacer {
    margin-left: 0;
  }

  /* --- Hàng nút kích hoạt, Lịch sử gộp cột (trước: ≤720px). Bậc `.nav-user`
     12ch cũ đã bỏ — WU-14 QT-24: DD chỉ còn một mức 6.5rem (bên dưới). --- */
  .ov-act-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .ov-act-code {
    grid-column: 1 / -1;
  }
  .ov-act-row .btn {
    width: 100%;
    min-height: 44px;
  }
  .cols.lead,
  .cols.two {
    grid-template-columns: 1fr;
  }

  .acc-nav {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Lịch sử: gộp "Nơi xem"/"Dịch sang" xuống dưới tên video — không cuộn ngang trang */
  .hist-box th:nth-child(2),
  .hist-box td:nth-child(2),
  .hist-box th:nth-child(3),
  .hist-box td:nth-child(3),
  .hist-box col:nth-child(2),
  .hist-box col:nth-child(3) {
    display: none;
  }

  .hist-box col:nth-child(1) {
    width: 62%;
  }

  .hist-box col:nth-child(4) {
    width: 38%;
  }

  .hist-box .dom-m {
    display: block;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hist-box td.vid .t {
    -webkit-line-clamp: 1;
  }

  /* --- #nav-user hẹp (trước: ≤479px) — WU-14 QT-24 --- */
  .nav-user {
    max-width: 6.5rem;
  }

  /* --- Trang pháp lý (trước: ≤420px) --- */
  .doc-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .doc-head h1 {
    font-size: 24px;
  }

  /* --- Khối "Đơn của bạn" xếp dọc (trước: ≤640px) --- */
  .order-head { flex-direction: column; align-items: stretch; }
  .order-amount { text-align: left; }
  .order-approx-row { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .order-cur-select { width: 100%; max-width: 100%; min-height: 44px; font-size: 16px; border: 1px solid var(--line-strong); }
  .order-disp-note { max-width: none; margin-left: 0; text-align: left; }

  /* --- Giao diện di động web khách G28d1/G28d2 (trước: ≤480px) — WU-00 6b QT-27→38, WU-11 QT-17.
     Các selector không khớp phần tử nào (selector chết) đã xoá — WU-14 I5. --- */
  body {
    font-size: 16px;
  }

  /* Chữ nhỏ nhất: 12px (QT-37) */
  small,
  .hint,
  .sub,
  .meta,
  .date,
  .why,
  .order-label,
  .card p,
  .q p,
  .brand-mark,
  .pill,
  .acc-nav .nav-badge {
    font-size: 12px;
  }

  /* Không cuộn ngang trang (QT-27) */
  body,
  .wrap,
  .hero,
  .panel,
  .container,
  main {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Safe-area (QT-33) */
  .wrap,
  .topbar,
  footer,
  .foot-in {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .wrap,
  footer,
  .foot-in {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  /* Thanh trên & Bộ chọn ngôn ngữ (QT-34, WU-14 QT-22c, QT-24) */
  .topbar-in {
    min-height: 56px;
    gap: 8px;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: nowrap;
  }

  .brand,
  a.brand {
    flex-shrink: 1;
    min-width: var(--tap);
  }

  #nav-user,
  .nav-user {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-in #nav-admin {
    flex: none;
    min-height: var(--tap);
    white-space: nowrap;
  }

  .topbar-in #nav-logout,
  .topbar-in #nav-login {
    flex: none;
    min-height: var(--tap);
    white-space: nowrap;
  }

  /* Ẩn cụm 3 nút .langs button trực tiếp, hiện 1 nút .langbtn (QT-34) */
  .langs button {
    display: none;
  }

  .langs {
    background: transparent;
    padding: 0;
  }

  .langbtn,
  .btn-lang-sheet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: var(--radius-ctl);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex: none;
    box-sizing: border-box;
  }

  /* Sheet ngôn ngữ: bottom-sheet bám đáy, max-height 88%, bo góc trên 12px (QT-34) */
  .sheet-lang-back,
  .sheet-back {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
  }

  .sheet-lang,
  .bottom-sheet,
  .sheet {
    width: 100%;
    max-height: 88%;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 12px 12px 0 0;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
  }

  .sheet-lang button,
  .bottom-sheet button,
  .sheet button,
  .sheet-lang .btn,
  .sheet .btn {
    min-height: 44px;
    width: 100%;
  }

  /* Ô nhập & Form (QT-29) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px;
    min-height: 48px;
    width: 100%;
    border: 1px solid var(--line-strong);
    box-sizing: border-box;
  }

  /* Ô nhiều dòng trong .field giữ cao tối thiểu 72px như máy tính. Trước khi bọc
     lớp (WU-14 QT-6), `.field > textarea` có độ ưu tiên cao hơn nên thắng luật
     chung ở trên — giữ nguyên hành vi đó. */
  .field > textarea {
    min-height: 72px;
  }

  /* Trừ dòng tick đồng ý (`label.field.row.agree` — flex) và hàng công tắc
     (`label.switch-row` — grid): trước khi bọc lớp, luật riêng của chúng có độ
     ưu tiên cao hơn nên thắng; giữ nguyên hành vi đó (WU-14 QT-6). */
  label:not(.switch-row):not(.agree),
  .field:not(.agree) {
    display: block;
  }

  /* Nút bấm (QT-28, QT-30) */
  button,
  .btn {
    min-height: var(--tap);
  }

  .btn.primary {
    min-height: var(--tap-chinh);
    width: 100%;
    font-size: 16px;
  }

  .gbtn,
  #google-btn {
    min-height: var(--tap-chinh);
    width: 100%;
  }

  /* Trang chủ & Gói cước */
  .grid-3,
  .features {
    grid-template-columns: 1fr;
  }

  @container (min-width: 640px) {
    .grid-3,
    .features {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .plans {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
  }

  @container (min-width: 480px) {
    .plans {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .plan {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .plan .price {
    font-size: 25px;
  }

  .plan .btn,
  .plan a.btn,
  .plan button.btn {
    min-height: 48px;
    width: 100%;
  }

  .plan .foot {
    margin-top: auto;
    width: 100%;
  }

  .cyc {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }

  .cyc::-webkit-scrollbar {
    display: none;
  }

  .cyc button,
  input[type="radio"] + label {
    min-height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Màn Cài tiện ích (WU-11 QT-17) */
  .desk-only-mobile {
    display: block;
    margin-bottom: 16px;
  }

  #btn-copy-install-link {
    width: 100%;
    min-height: 44px;
  }

  /* -------------------------------------------------------------------------
     G28d2: 6 tab tài khoản ở bố cục di động DD (WU-00 6b QT-27→38, WU-06 4.8)
     ------------------------------------------------------------------------- */

  /* Thanh tab tài khoản (#acc-nav, .acc-nav) — Thanh dưới 5 mục ở DD (WU-14 mục 5.1, QT-13→15c) */
  #acc-nav,
  .acc-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    overflow: visible;
    overflow-x: visible;
    max-width: none;
    margin: 0;
    height: calc(var(--nav-duoi-h) + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-left) env(safe-area-inset-bottom) env(safe-area-inset-right);
  }

  #acc-nav button,
  .acc-nav button {
    min-height: var(--tap);
    height: var(--nav-duoi-h);
    padding: 0;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    flex: none;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    border-radius: 0;
    color: var(--ink-2);
    border: 0;
    background: none;
  }

  #acc-nav button[data-tab="thiet-bi"],
  .acc-nav button[data-tab="thiet-bi"] {
    display: none;
  }

  .nhan-day {
    display: none;
  }

  .nhan-ngan {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
  }
  .nhan-ngan::after {
    content: attr(data-nhan-ngan);
  }

  #acc-nav button[aria-current="page"],
  .acc-nav button[aria-current="page"] {
    border-bottom: 3px solid var(--accent);
    background: none;
    color: var(--accent);
  }

  #acc-nav button[aria-current="page"]::before,
  .acc-nav button[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
  }

  .nav-badge,
  .acc-nav .nav-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
  }

  .back-acc {
    display: inline-flex;
    margin-bottom: 12px;
  }

  /* main đệm đáy không bị thanh dưới che (QT-15c) */
  #acc-page {
    padding-bottom: calc(var(--nav-duoi-h) + env(safe-area-inset-bottom) + 16px);
  }

  /* Tab Tổng quan (#v-tong-quan) */
  #v-tong-quan .bar,
  #v-tong-quan .row.between,
  #v-tong-quan .row {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #v-tong-quan .panel-body .row:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  #v-tong-quan .panel-body .row:last-child .btn.primary,
  #v-tong-quan .panel-body .row:last-child .btn:only-child {
    grid-column: 1 / -1;
  }

  #v-tong-quan .btn {
    min-height: 44px;
    width: 100%;
  }

  /* Tab Gói cước (#v-goi-cuoc) */
  #pl-khu {
    display: flex;
    width: 100%;
    min-height: var(--tap);
    box-sizing: border-box;
  }

  #pl-khu a {
    flex: 1 1 0;
    min-width: 0;
    min-height: var(--tap);
  }

  #v-goi-cuoc[data-khu="nap"] .pl-khu-goi {
    display: none;
  }

  #v-goi-cuoc:not([data-khu="nap"]) .pl-khu-nap {
    display: none;
  }

  #v-goi-cuoc .plans {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    width: 100%;
  }

  @container (min-width: 480px) {
    #v-goi-cuoc .plans {
      grid-template-columns: repeat(2, 1fr);
      grid-auto-rows: 1fr;
    }
  }

  #v-goi-cuoc .plan {
    width: 100%;
    box-sizing: border-box;
  }

  /* Tab Thanh toán (#s-thanh-toan) */
  #s-thanh-toan .order-card,
  .order-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .qr-box.zoomable {
    max-width: 100%;
  }

  .modal.img-modal {
    width: 100%;
    max-width: 100%;
    max-height: 88%;
    border-radius: 12px 12px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal.img-modal .modal-foot button,
  .modal.img-modal .btn {
    min-height: 48px;
    width: 100%;
  }

  #s-thanh-toan table,
  #s-thanh-toan tbody,
  #s-thanh-toan tr.ls-row,
  #s-thanh-toan tr.ls-detail,
  #s-thanh-toan tr.ls-row td,
  #s-thanh-toan tr.ls-detail td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  #s-thanh-toan thead {
    display: none;
  }

  #s-thanh-toan tr.ls-row {
    padding: 12px;
    border-bottom: 1px solid var(--line-soft);
  }

  #s-thanh-toan tr.ls-detail td {
    padding: 12px;
  }

  #s-thanh-toan .ls-kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #s-thanh-toan .ls-kv .k {
    margin-top: 6px;
    font-size: 11.5px;
  }

  #s-thanh-toan .ls-kv .v {
    font-size: 13.5px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #s-thanh-toan .ls-kv .v .btn {
    width: 100%;
    min-height: 44px;
  }

  #s-thanh-toan .btn,
  #s-thanh-toan button {
    min-height: 44px;
  }

  /* Tab Lịch sử xem (#v-lich-su) */
  #v-lich-su .hist-box,
  #hs-box {
    height: auto;
    max-height: none;
    overflow-y: visible;
  }

  #hs-box table,
  #hs-box tbody,
  #hs-box tr,
  #hs-box td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  #hs-box td {
    height: auto;
    overflow: visible;
  }

  #hs-box thead {
    display: none;
  }

  #hs-box tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  #hs-box td.vid .t {
    font-size: 15px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Vùng chạm >= --tap (44px) cho liên kết tiêu đề video ở DD (WU-14 B2, G67f) */
  #hs-box td.vid a.t {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    min-width: var(--tap);
    max-width: 100%;
  }

  #hs-box td.dom,
  #hs-box td.when {
    font-size: 12px;
    color: var(--muted);
  }

  #hs-more-wrap,
  .hs-more-wrap {
    display: block;
    padding: 12px 0;
  }

  #hs-more-btn {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
  }

  /* Tab Thiết bị (#v-thiet-bi) */
  #dm-table,
  #dm-table tbody,
  #dm-table tr,
  #dm-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  #dm-table thead {
    display: none;
  }

  #dm-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  #dm-btn-logout-others {
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
  }

  #dm-table td button,
  #dm-table .btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Bảng nạp thêm (Gói cước) & Bảng thiết bị đăng nhập (WU-14 QT-17) */
  .topup-table,
  .topup-table tbody,
  .topup-table tr,
  .topup-table td,
  #dv-table,
  #dv-table tbody,
  #dv-table tr,
  #dv-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .topup-table thead,
  #dv-table thead {
    display: none;
  }

  .topup-table tr,
  #dv-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  .topup-table td button,
  .topup-table .btn,
  #dv-table td button,
  #dv-table .btn {
    min-height: 44px;
    width: 100%;
    margin-top: 8px;
  }

  /* Nhãn cột phụ trên thẻ ở di động (WU-14 QT-17) */
  #hs-box td[data-nhan]:not(.vid)::before,
  #dm-table td[data-nhan]:not(:first-child):not(.acts-col)::before,
  #s-thanh-toan tr.ls-row td[data-nhan]:not(:first-child)::before,
  .topup-table td[data-nhan]:not(:first-child):not(:last-child)::before,
  #dv-table td[data-nhan]:not(:first-child):not(:last-child)::before {
    content: attr(data-nhan) ": ";
    color: var(--muted);
    font-size: var(--fs-nho);
  }

  /* Tiêu đề thẻ 15px/600 */
  #dm-table tr td:first-child > div > span:first-child,
  #dv-table tr td:first-child,
  .topup-table tr td:first-child {
    font-size: 15px;
    font-weight: 600;
  }

  /* Phụ 12px muted */
  #dm-table td.mono,
  #dm-table td.nowrap,
  #dv-table td.mono,
  #dv-table td:nth-child(3),
  .topup-table td.num {
    font-size: var(--fs-nho);
    color: var(--muted);
  }

  /* Tab Hồ sơ (#v-ho-so) & Các hộp thoại */
  #v-ho-so .cols.two,
  .cols.two {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sw {
    min-height: var(--tap);
    min-width: var(--tap);
    display: inline-flex;
    align-items: center;
  }

  /* Hộp thoại = sheet (WU-14 mục 5.2 QT-16): MỘT luật chung cho mọi .modal-back > .modal */
  .modal-back {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    overscroll-behavior: contain;
  }

  .modal-back > .modal,
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 88%;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 12px 12px 0 0;
    padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
  }

  /* Tay nắm trang trí (aria-hidden) chèn bằng CSS ::before */
  .modal-back > .modal::before,
  .modal::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--line-strong);
    margin: 10px auto 4px;
    flex-shrink: 0;
  }

  /* .modal-foot dùng flex-direction: column-reverse ⇒ nút chính TRÊN, Huỷ DƯỚI */
  .modal-foot {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--sp-2);
    align-items: stretch;
    padding: 12px 15px;
  }

  .modal-foot button,
  .modal-foot .btn {
    width: 100%;
    min-height: var(--tap);
    box-sizing: border-box;
  }

  .modal-foot .btn.primary,
  .modal-foot .btn.danger,
  .modal-foot button.primary,
  .modal-foot button.danger {
    min-height: var(--tap-chinh);
  }

  .modal-foot .hint {
    margin: 0;
    text-align: center;
  }

  /* --- Thông báo Hồ sơ (trước: ≤480px) --- */
  .pf-notice {
    padding: 10px;
  }

  /* --- Thanh toán + gửi minh chứng (WU-14 mục 5.6 QT-20, QT-20b, QT-20c) --- */
  /* G66c / WU-14 QT-20b: Header khối Chọn cách trả chuyển thành cột, không bẻ dọc chữ */
  .py-head-cach-tra {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .py-head-cach-tra .right {
    margin-left: 0;
    width: 100%;
  }
  #py-region.cyc {
    display: flex;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
  }
  #py-region.cyc button {
    flex: 1 0 auto;
    min-height: var(--tap);
    white-space: nowrap;
    justify-content: center;
    text-align: center;
    padding: 6px 12px;
    font-size: 13px;
  }

  /* ① Đơn của bạn: số tiền to mono */
  .order-amount .num.lg {
    font-size: 24px;
    font-weight: 700;
  }

  /* ② Cách trả: bung/thu mở MỘT cách một lúc; QR rộng min(240px, 70%) giữa thẻ */
  .pay-acc {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .pay-acc .qr-box {
    width: min(240px, 70%);
    height: auto;
    aspect-ratio: 1;
    max-width: 240px;
    margin: 8px auto 12px;
  }
  .pay-acc .meta {
    width: 100%;
    min-width: 0;
    align-items: center;
    text-align: center;
  }
  .pay-acc .meta-desc {
    text-align: left;
    width: 100%;
    background: var(--surface-2);
    padding: 10px 12px;
    border-radius: var(--radius-ctl, 6px);
    box-sizing: border-box;
  }
  .pay-acc:not(.sel) .qr-box,
  .pay-acc:not(.sel) .meta-desc {
    display: none;
  }

  /* ③ Gửi minh chứng: ô nét đứt cao 160px, ảnh xem trước full ngang; nút 48px inline cuối form */
  .proof-pick {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }
  .proof-pick > .qr-box.lg {
    width: 100%;
    height: 160px;
    max-width: 100%;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius-ctl, 8px);
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
  }
  .proof-pick > .qr-box.lg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .proof-pick > .stack {
    width: 100%;
  }
  .proof-pick .btn {
    width: 100%;
    min-height: var(--tap);
  }
  .proof-pick ~ .row .btn.primary {
    min-height: var(--tap-chinh);
    width: 100%;
    position: static;
  }

  /* --- Tab Hồ sơ / Tài khoản (WU-14 mục 5.7 QT-21) --- */
  .pf-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .pf-col {
    display: contents;
  }
  #pf-panel-info { order: 1; }
  #pf-notice-panel { order: 2; }
  #pf-panel-sec { order: 3; }
  .thiet-bi-entry {
    order: 4;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: var(--radius-ctl, 8px);
  }
  .thiet-bi-entry .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .thiet-bi-entry .btn {
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #pf-panel-ce { order: 5; }
  #pf-panel-mk { order: 6; }
  #pf-panel-tr { order: 7; }
  .danger-zone { order: 8; }

  /* Transcript domains thẻ di động */
  .dom-list li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .dom-list .d {
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 600;
  }
  .dom-list .dt {
    font-size: 12px;
    color: var(--muted);
  }
  .dom-list .tr-dom-status {
    align-self: flex-start;
  }
  .dom-list .rm {
    width: 100%;
    margin-top: 4px;
  }
  .dom-list .rm .btn {
    width: 100%;
    min-height: var(--tap);
  }
}

/* DD-NHO — tinh chỉnh trong DD cho điện thoại hẹp (≤390px) */
@media (max-width: 390px) {
  .brand span.full,
  .brand .full {
    display: none;
  }

  .login-links {
    flex-direction: column;
  }

  /* G66a / WU-14 QT-22c, QT-24: ≤390px Quản trị ẩn chữ nếu có, nav-user co/ẩn chữ giữ title nếu tổng vẫn vượt */
  #nav-admin {
    font-size: 11px;
    padding: 0 6px;
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-in #nav-user {
    max-width: 4.5rem;
  }
}

/* DD-NGANG — tinh chỉnh trong DD khi điện thoại xoay ngang */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023px) {
  :root {
    --nav-duoi-h: 48px;
  }
  .topbar {
    position: static;
  }
  #acc-nav button,
  .acc-nav button {
    flex-direction: row;
    gap: 6px;
  }
  .modal-back > .modal,
  .modal {
    max-width: 560px;
    margin-inline: auto;
  }
}
}
