/* ============================================================================
   mobile.css — GIAO DIỆN ĐIỆN THOẠI + TABLET CẢM ỨNG, lớp HỘP THOẠI (đợt 14/11/2026).
   Nạp bằng <link media="(max-width:640px), (max-width:1024px) and (pointer:coarse)"> sau modern-theme.css:
   desktop chuột KHÔNG tải và KHÔNG áp tệp này. Mọi luật còn nằm trong @media để cửa sổ máy tính kéo hẹp bằng chuột
   (khớp ≤640) và điện thoại/tablet cảm ứng (khớp coarse) cùng dùng một bộ.
   Điều kiện dùng lại:
     PHONE = (max-width:640px)
     TOUCH = (max-width:640px), (min-width:641px) and (max-width:1024px) and (pointer:coarse)
     LAND  = (min-width:641px) and (max-width:1024px) and (pointer:coarse) and (max-height:520px)  — điện thoại nằm ngang
   Quy ước: popup Swal tuỳ biến PHẢI viết `.swal2-popup.<lớp> …` (≥0,2,0) vì style.css/modern-theme.css đặt
   `.swal2-popup{padding:20px!important}` toàn cục. Mỗi mục ghi mã lỗi của báo cáo rà soát (C1-xx… = scratchpad ui2/out).
   ============================================================================ */

/* ───────── 0. Biến + lớp phủ ───────── */
@media (max-width: 640px) {
  /* chỗ đáy chừa cho thanh điều hướng dưới (CHỈ trang có thanh; iframe Cài đặt/trang khác không có → không hở 54px) */
  html { --fx-swal-bottom: 0px; }
  html:has(#header .nav-pills-container) { --fx-swal-bottom: calc(63px + env(safe-area-inset-bottom, 0px)); }
  :root {
    --fx-dlg-avail: calc(100vh - 24px - var(--fx-swal-bottom));
    --fx-dlg-avail: calc(100dvh - 24px - var(--fx-swal-bottom));
  }
  /* C1-07/C2-07: lớp mờ phủ KÍN màn (thanh dưới mờ + không chạm được khi hộp mở, kể cả hộp tiến trình allowOutsideClick:false);
     hộp thoại vẫn nằm TRÊN thanh nhờ padding-bottom. Thay luật `bottom:54px` ở style.css. */
  .swal2-container { padding: 12px 16px !important; }
  .swal2-container.swal2-center {
    bottom: 0 !important;
    height: auto !important;
    padding-bottom: calc(12px + var(--fx-swal-bottom)) !important;
  }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  :root {
    --fx-dlg-avail: calc(100vh - 20px);
    --fx-dlg-avail: calc(100dvh - 20px);
  }
}
@media (max-height: 520px) and (pointer: coarse) {
  .swal2-container {
    padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
  }
}

/* ───────── 1. Swal chung: nút, ×, ô nhập, màu ngữ nghĩa ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* C2-04/C5/C12: nút ≥44px, khe 8px (loại .swal2-loading: lúc đó nút xác nhận là vòng quay) */
  .swal2-popup .swal2-actions:not(.swal2-loading) { gap: 8px; }
  .swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled { margin: 0; min-height: 44px; }
  .swal2-popup .swal2-actions.swal2-loading .swal2-styled { min-height: 44px; }
  /* C1-05/C2-01: nút × giữ hình, vùng chạm nới ra ~46px; màu đủ tương phản (Swal mặc định #ccc = 1,6:1) */
  html body .swal2-container .swal2-popup .swal2-close { overflow: visible !important; color: #64748b; }
  /* × của Swal 11 mặc định position:static → ::after absolute bên dưới neo vào CẢ HỘP và nuốt mọi chạm (bấm nút nào trong hộp cũng thành bấm ×). Cho × tự làm khối chứa: :where() đặc hiệu 0 để các lớp riêng (position:absolute của .arl-pop, .sa-modal, .bmp-pop…) vẫn thắng */
  :where(.swal2-popup) .swal2-close { position: relative; }
  /* .ext-install-close chỉ có top/right !important (scripts.js) mà không có position → để absolute đúng chỗ top:10px/right:12px nó vốn muốn */
  html body .swal2-container .swal2-popup.ext-install-popup .swal2-close { position: absolute; }
  html body .swal2-container .swal2-popup .swal2-close::after { content: ""; position: absolute; inset: -8px; }
  .swal2-popup .swal2-close[style*="display: flex"] ~ .swal2-title { padding-left: 44px !important; padding-right: 44px !important; }
  /* C1-04/C5-01/C9: ô nhập ≥16px → iOS không tự phóng to khi chạm */
  .swal2-popup :is(.form-control, .form-select, textarea, select, .swal2-input, .swal2-textarea, .swal2-select,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"])) {
    font-size: 16px !important;
  }
  .swal2-popup .form-label { font-size: 14px; }
  .swal2-popup textarea { resize: none; }
  /* C2-08: vòng quay đúng màu thương hiệu */
  .swal2-popup .swal2-loader { border-color: #8b5cf6 transparent #8b5cf6 transparent; }
  /* C2-09/C6/C8: confirmButtonColor đỏ bị gradient tím của modern-theme.css:1332 nuốt → trả lại màu nguy hiểm */
  .swal2-popup.swal2-icon-warning .swal2-confirm.swal2-styled[style*="rgb(239, 68, 68)"],
  .swal2-popup .swal2-confirm.swal2-styled[style*="rgb(220, 53, 69)"] { background: #ef4444 !important; box-shadow: 0 6px 16px -4px rgba(239, 68, 68, .45) !important; }
  .swal2-popup .swal2-confirm.swal2-styled[style*="rgb(220, 38, 38)"] { background: #dc2626 !important; box-shadow: 0 4px 12px rgba(220, 38, 38, .3) !important; }
  .swal2-popup .swal2-confirm.swal2-styled[style*="rgb(16, 185, 129)"] { background: #10b981 !important; box-shadow: 0 4px 12px rgba(16, 185, 129, .3) !important; }
  /* thanh báo lỗi xác thực: chuỗi dài liền không bị cắt; tối không còn dải xám sáng #f0f0f0 */
  .swal2-popup:not(.swal2-toast) .swal2-validation-message { justify-content: flex-start; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  [data-bs-theme="dark"] .swal2-popup .swal2-validation-message { background: rgba(220, 38, 38, .18); color: #fca5a5; border: 1px solid rgba(248, 113, 113, .4); border-radius: 10px; }
  /* hộp tiến trình: bề rộng không nhảy theo chữ "Đang xóa 9/60…" */
  .swal2-popup.swal2-loading { min-width: 280px; }
}
@media (max-width: 640px) {
  /* C1-10: hộp đủ 3 nút (xác nhận/từ chối/huỷ) → xếp dọc, rộng hết hàng */
  .swal2-popup .swal2-actions:has(.swal2-deny[style*="inline-block"]):has(.swal2-cancel[style*="inline-block"]) { flex-direction: column; align-items: stretch; }
  .swal2-popup .swal2-actions:has(.swal2-deny[style*="inline-block"]):has(.swal2-cancel[style*="inline-block"]) .swal2-styled { width: 100%; }
}

/* ───────── 2. Swal "cảnh báo / xác nhận thường" (không customClass; icon chuẩn) ─────────
   Swal 11.7 sinh class: "swal2-popup swal2-modal swal2-icon-<loại> swal2-show"; popup tuỳ biến có icon thì lớp riêng nằm GIỮA
   (`swal2-modal <riêng> swal2-icon-…`) → [class*="swal2-modal swal2-icon-"] chỉ khớp alert thường, KHÔNG đụng .lgn-pop/.bmp-pop/.arl-pop/toast. */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (max-height: 480px) and (pointer: coarse) {
  .swal2-popup[class*="swal2-modal swal2-icon-"] { padding: 18px 16px 16px !important; }
  /* icon: đổi font-size của CHÍNH .swal2-icon (mọi chi tiết con tính bằng em) + bỏ lề trên 2.5em */
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-icon { font-size: 11px; margin: 0 auto 10px; }
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-title { font-size: 20px; line-height: 1.3; text-wrap: balance; padding: 0 0 6px !important; }
  /* nội dung dài cuộn TRONG hộp: tiêu đề + nút luôn thấy */
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-html-container {
    font-size: 15px; line-height: 1.45; text-wrap: pretty;
    max-height: 45vh; max-height: 45dvh;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-actions { width: 100%; gap: 8px; margin: 14px 0 0 !important; }
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-actions:not(.swal2-loading) .swal2-styled { flex: 1 1 auto; margin: 0; min-height: 44px; padding: 0 16px; font-size: 15px; }
}
@media (max-width: 640px) {
  /* mọi alert cùng một bề ngang (trước co theo nội dung 283–358px vì `.swal2-popup{width:auto!important}` ở style.css:9126) */
  .swal2-popup[class*="swal2-modal swal2-icon-"] { width: min(calc(100vw - 32px), 340px) !important; max-width: none !important; }
}
@media (max-height: 420px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup[class*="swal2-modal swal2-icon-"] { padding: 12px 16px !important; }
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-icon { font-size: 8px; margin: 0 auto 6px; }
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-title { font-size: 18px; padding-bottom: 4px !important; }
  .swal2-popup[class*="swal2-modal swal2-icon-"] .swal2-actions { margin-top: 10px !important; }
}

/* ───────── 3. Hộp "Tải dữ liệu" .fx-load-modal (Ads/BM/Page/Group/Pixel; scripts.js:3489/4359/5044, group.js, pixel.js:1044) — C1-01…04, 14, 15 ───────── */
@media (max-width: 640px) {
  .swal2-popup.fx-load-modal {
    display: flex !important; flex-direction: column; padding: 0 !important; overflow: hidden !important;
    max-height: var(--fx-dlg-avail) !important;
  }
  .swal2-popup.fx-load-modal .swal2-html-container {
    flex: 1 1 auto; min-height: 0; overflow-y: auto !important; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; padding: 0 14px !important; word-break: normal;
  }
  .swal2-popup.fx-load-modal .swal2-actions {
    flex: 0 0 auto; width: 100% !important; box-sizing: border-box; margin: 0 !important; gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid rgba(15, 23, 42, .08); background: inherit;
  }
  .swal2-popup.fx-load-modal .swal2-actions .swal2-styled { flex: 1 1 0; margin: 0 !important; font-size: 15px !important; }
  /* thẻ radio → 1 cột; chữ xuống dòng; thẻ đều chiều cao */
  .swal2-popup.fx-load-modal .ad-radio-group { flex-direction: column; gap: 8px; }
  .swal2-popup.fx-load-modal .ad-radio-card { flex: 0 0 auto; width: 100%; }
  .swal2-popup.fx-load-modal label.ad-radio-card,
  .swal2-popup.fx-load-modal label.bm-radio-card { align-items: stretch !important; }
  .swal2-popup.fx-load-modal .ad-radio-content,
  .swal2-popup.fx-load-modal .bm-radio-content { min-width: 0; min-height: 52px; }
  .swal2-popup.fx-load-modal .ad-radio-group-ico .ad-radio-text,
  .swal2-popup.fx-load-modal .bm-radio-group-ico .bm-radio-text { white-space: normal; overflow: visible; text-overflow: clip; }
  .swal2-popup.fx-load-modal .ad-radio-desc,
  .swal2-popup.fx-load-modal .bm-radio-desc,
  .swal2-popup.fx-load-modal .ad-limit-desc,
  .swal2-popup.fx-load-modal .bm-limit-desc,
  .swal2-popup.fx-load-modal .fx-cfg-s,
  .swal2-popup.fx-load-modal .bm-modal-header-sub,
  .swal2-popup.fx-load-modal .bm-section-title { font-size: 11.5px; }
  /* công tắc → 1 cột, đọc đủ nhãn + chú thích */
  .swal2-popup.fx-load-modal .ad-toggle-item,
  .swal2-popup.fx-load-modal .bm-toggle-item { flex: 1 1 100%; max-width: 100%; min-width: 100%; min-height: 52px; padding: 8px 12px; }
  .swal2-popup.fx-load-modal .ad-toggle-label,
  .swal2-popup.fx-load-modal .bm-toggle-label { font-size: 13.5px; }
  .swal2-popup.fx-load-modal .ad-toggle-desc,
  .swal2-popup.fx-load-modal .bm-toggle-desc { font-size: 11.5px; white-space: normal; overflow: visible; text-overflow: clip; }
  /* ô số/ID cao 44px; chừa chỗ cho huy hiệu đếm góc phải */
  .swal2-popup.fx-load-modal .ad-limit-input,
  .swal2-popup.fx-load-modal .bm-limit-input,
  .swal2-popup.fx-load-modal .fx-cfg-min { height: 44px !important; }
  .swal2-popup.fx-load-modal .fx-cfg-min { width: 64px !important; }
  .swal2-popup.fx-load-modal #adLoadIdInput textarea,
  .swal2-popup.fx-load-modal #bmLoadIdInput textarea,
  .swal2-popup.fx-load-modal #pageLoadIdInput textarea { padding-right: 44px; }
  .swal2-popup.fx-load-modal #pxAutoReloadMin { width: 64px !important; }
  /* tối: tiêu đề mục tím #8b5cf6 trên #232e3d chỉ 3,2:1 → #a78bfa (5:1) */
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal .ad-section-title,
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal .bm-section-title,
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal .ad-select-all-btn,
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal .bm-select-all-btn { color: #a78bfa; }
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal .swal2-actions { border-top-color: rgba(255, 255, 255, .08); }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup.fx-load-modal input:not([type="checkbox"]):not([type="radio"]),
  .swal2-popup.fx-load-modal textarea { font-size: 16px !important; }
  .swal2-popup.fx-load-modal .ad-select-all-btn,
  .swal2-popup.fx-load-modal .bm-select-all-btn { min-height: 44px; padding: 0 12px; }
  /* công tắc 36×20: nới VÙNG CHẠM (không đổi hình) lên ~52×44 */
  .swal2-popup.fx-load-modal .bm-switch::after { content: ""; position: absolute; inset: -12px -8px; }
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal #grpIdInput textarea { color: #e5e7eb; }
}

/* ───────── 4. Hộp "Xác nhận chạy" .fxa-confirm-popup, "Lọc theo ID" .id-popup, Đăng nhập .lgn-pop (scripts.js:2911, 5764, 6359) — C1-06, 09, 11, 12 ───────── */
@media (max-width: 640px) {
  .swal2-popup.fxa-confirm-popup { padding: 16px 14px !important; }
  .swal2-popup.fxa-confirm-popup .fxa-step { padding: 6px 6px 6px 2px; min-height: 56px; }
  .swal2-popup.fxa-confirm-popup .fxa-step-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .swal2-popup.fxa-confirm-popup .fxa-confirm-actions { width: 100%; gap: 10px; }
  .swal2-popup.fxa-confirm-popup .fxa-confirm-actions .swal2-styled { flex: 1 1 0; }
  .swal2-popup.lgn-pop { width: min(440px, calc(100vw - 32px)) !important; }
  .swal2-popup.lgn-pop .lgn-opt { min-height: 44px; font-size: 14px; }
  .swal2-popup.lgn-pop .swal2-actions { margin: 14px 16px 18px !important; }
  .swal2-popup.lgn-pop .swal2-styled { min-height: 48px; padding: 10px 8px !important; white-space: nowrap; }
  .lgn-body { padding: 16px 16px 4px; }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup.fxa-confirm-popup .fxa-drag { width: 36px; }
  .swal2-popup.fxa-confirm-popup .fxa-btn-remove { width: 44px; height: 44px; font-size: 18px; }
  .swal2-popup.fxa-confirm-popup .fxa-flow { overscroll-behavior: contain; }
  .swal2-popup.id-popup .id-clear-link { min-height: 44px; padding: 0 10px; }
}
/* dải trắng dưới sóng header Đăng nhập ở chế độ tối (lỗi cả desktop tối; ở đây chỉ phía điện thoại theo ràng buộc "desktop không đổi") */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  [data-bs-theme="dark"] .swal2-popup.lgn-pop .lgn-w3 path { fill: #232e3d; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  .swal2-popup.fx-load-modal,
  .swal2-popup.id-popup { display: flex !important; flex-direction: column; padding: 0 !important; overflow: hidden !important; max-height: var(--fx-dlg-avail) !important; }
  .swal2-popup.fx-load-modal .swal2-html-container,
  .swal2-popup.id-popup .swal2-html-container { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; overscroll-behavior: contain; padding: 0 14px !important; }
  .swal2-popup.fx-load-modal .swal2-actions,
  .swal2-popup.id-popup .swal2-actions {
    flex: 0 0 auto; width: 100% !important; box-sizing: border-box; margin: 0 !important; gap: 10px;
    padding: 8px 14px !important; border-top: 1px solid rgba(15, 23, 42, .08); background: inherit;
  }
  .swal2-popup.id-popup .swal2-close,
  .sp-modal .swal2-close { top: 6px !important; right: 6px !important; }
  .swal2-popup.id-popup .id-header { padding-right: 40px; }
  .swal2-popup.id-popup .id-textarea-wrap textarea { height: clamp(88px, 30dvh, 220px) !important; }
  .swal2-popup.fx-load-modal .ad-toggle-desc,
  .swal2-popup.fx-load-modal .bm-toggle-desc,
  .swal2-popup.fx-load-modal .ad-radio-desc,
  .swal2-popup.fx-load-modal .bm-radio-desc,
  .swal2-popup.fx-load-modal .ad-limit-desc,
  .swal2-popup.fx-load-modal .bm-limit-desc,
  .swal2-popup.fx-load-modal .fx-cfg-s { font-size: 11.5px; }
  .swal2-popup.fxa-confirm-popup { padding: 12px 16px !important; }
  .swal2-popup.fxa-confirm-popup .fxa-flow { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }
  .swal2-popup.fxa-confirm-popup .fxa-hd-sub,
  .swal2-popup.fxa-confirm-popup .fxa-toolbar { display: none; }
  [data-bs-theme="dark"] .swal2-popup.fx-load-modal .swal2-actions,
  [data-bs-theme="dark"] .swal2-popup.id-popup .swal2-actions { border-top-color: rgba(255, 255, 255, .08); }
}

/* ───────── 5. Bộ chọn danh tính .fx-ident-* (scripts.js:8957) — C2-02, C2-05 ───────── */
@media (max-width: 640px) {
  .swal2-popup .fx-ident-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; align-items: center; min-height: 64px; }
  .swal2-popup .fx-ident-opt > i { grid-row: 1; grid-column: 1; }
  .swal2-popup .fx-ident-opt-label { grid-row: 1; grid-column: 2; min-width: 0; word-break: normal; overflow-wrap: normal; }
  .swal2-popup .fx-ident-opt-num { white-space: nowrap; }
  .swal2-popup .fx-ident-opt-tag { grid-row: 2; grid-column: 2; justify-self: start; }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup .fx-ident-opt-num { color: #6b7280; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-desc { color: #94a3b8; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-opt { background: #1b2433; border-color: rgba(255, 255, 255, .12); }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-opt:not([disabled]):hover { background: #2a3548; border-color: var(--primary-end, #8b5cf6); }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-opt-active,
  [data-bs-theme="dark"] .swal2-popup .fx-ident-opt-active:not([disabled]):hover { background: rgba(34, 197, 94, .12); border-color: #22c55e; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-opt-label { color: #f1f5f9; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-opt-num { color: #94a3b8; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-tag-cur { background: rgba(34, 197, 94, .18); color: #4ade80; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-tag-switch { background: rgba(139, 92, 246, .22); color: #c4b5fd; }
  [data-bs-theme="dark"] .swal2-popup .fx-ident-tag-none { background: rgba(239, 68, 68, .18); color: #fca5a5; }
}

/* ───────── 6. Popup hướng dẫn ⓘ 3 phần .fx-guide-* (scripts.js:28–73) — C1-19, C3 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .fx-guide-modal { max-height: min(85vh, calc(100dvh - 40px)); }
  .fx-guide-close { width: 44px; height: 44px; }
  .fx-guide-foot .btn { min-height: 44px; }
  .fx-guide-body { overflow-wrap: anywhere; overscroll-behavior: contain; }
}
@media (max-width: 640px) {
  .fx-guide-h-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-height: 480px) and (max-width: 1024px) and (pointer: coarse) {
  .fx-guide-ov { padding: 8px; }
  .fx-guide-modal { max-height: calc(100dvh - 16px); }
  .fx-guide-head { padding: 8px 16px; }
  .fx-guide-h-icon { width: 32px; height: 32px; font-size: 16px; }
  .fx-guide-foot { padding: 8px 16px; }
}

/* ───────── 7. Chọn tài khoản .sa-modal, kiểm tra TKQC .ads-check-*, Ghi chú .fxnote-popup, ô Ghi chú trong lưới, trạng thái rỗng (scripts.js) — C3 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup .sa-list,
  .swal2-popup .ads-check-err-list-container,
  .swal2-popup .ads-check-live-err-box { overscroll-behavior: contain; }
  .swal2-popup .ads-check-err-msg { font-size: 12.5px; }
  .swal2-popup .ads-check-err-id { font-size: 13px; }
  .swal2-popup .ads-check-err-item span[style*="10.5px"] { font-size: 12px !important; color: #b91c1c !important; }
  .swal2-popup #adsCheckLiveErrList { font-size: 12.5px !important; }
  .swal2-popup #adsCheckLiveErrBadge { font-size: 12px !important; color: #b91c1c !important; }
  .swal2-popup #adsCheckLiveErrCount { margin-right: .3em; }
  .swal2-popup #btnCopyAdsCheckErrors { min-height: 44px; padding: 0 14px !important; font-size: 13px !important; }
  .swal2-popup.sa-modal .sa-add-btn { min-height: 44px; }
  .swal2-popup.sa-modal .sa-search input { min-height: 44px; }
  .swal2-popup.sa-modal .sa-header { min-height: 54px; box-sizing: border-box; }
  .swal2-popup.sa-modal .sa-ident-seg small { font-size: 11px; }
  .swal2-popup.sa-modal .sa-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 20px 24px; text-align: center; }
  .swal2-popup.sa-modal .sa-empty i { font-size: 34px; line-height: 1; color: #94a3b8; }
  .swal2-popup.sa-modal .sa-empty p { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
  .swal2-popup.sa-modal .sa-empty small { font-size: 12.5px; color: #94a3b8; }
  .swal2-popup.fxnote-popup .ren-bar { padding: 6px 8px; }
  .swal2-popup.fxnote-popup .ren-back { width: 44px; height: 44px; }
  .swal2-popup.fxnote-popup .ren-bar-save { min-height: 44px; padding: 0 18px; }
  .swal2-popup.fxnote-popup .fxnote-field textarea { padding-bottom: 12px; }
  .swal2-popup.fxnote-popup .fxnote-count { position: static; display: block; margin-top: 4px; text-align: right; }
  .note-editor-input { font-size: 16px; }
  .note-editor-save { width: 40px; height: 40px; font-size: 16px; }
  .fx-feat-empty-btn, .fx-grid-empty-btn { height: 44px !important; padding: 0 20px !important; font-size: 14px !important; }
  .fx-feat-empty-title, .fx-grid-empty-title { font-size: 15px !important; }
  .fx-feat-empty-sub, .fx-grid-empty-sub { font-size: 12.5px !important; max-width: 260px; }
}
@media (max-width: 640px) {
  .swal2-popup.ads-check-swal-popup, .swal2-popup.sa-modal, .swal2-popup.fx-pcp-modal { width: calc(100vw - 28px) !important; }
  .swal2-popup.sa-modal .swal2-close, .swal2-popup.fx-pcp-modal .swal2-close { top: 4px !important; right: 4px !important; width: 44px !important; height: 44px !important; font-size: 18px !important; background: #f1f5f9 !important; }
  .swal2-popup.sa-modal .sa-list { max-height: min(320px, calc(var(--fx-dlg-avail) - 270px)); }
  /* popup "Chọn máy tính" (style.css): đầu cao bằng "Chọn tài khoản", danh sách cuộn trong hộp */
  .swal2-popup.fx-pcp-modal .fx-pcp-header { min-height: 54px; box-sizing: border-box; }
  .swal2-popup.fx-pcp-modal .fx-pcp-list { max-height: min(360px, calc(var(--fx-dlg-avail) - 120px)); overscroll-behavior: contain; }
  .swal2-popup .ads-check-err-list-container { max-height: clamp(110px, calc(var(--fx-dlg-avail) - 400px), 230px); }
}
@media (max-height: 480px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup .ads-check-loading-icon { display: none; }
  .swal2-popup .ads-check-err-list-container { max-height: clamp(100px, calc(100dvh - 235px), 230px); }
  .swal2-popup.sa-modal .sa-header { min-height: 48px; padding-top: 10px; }
  .swal2-popup.sa-modal .sa-ident { padding-bottom: 4px; }
  .swal2-popup.sa-modal .sa-search { padding: 6px 20px; }
  .swal2-popup.sa-modal .sa-count { display: none; }
  .swal2-popup.sa-modal .sa-list { max-height: max(110px, calc(100dvh - 245px)); }
  .swal2-popup.sa-modal .swal2-close { top: 2px !important; right: 2px !important; width: 44px !important; height: 44px !important; font-size: 18px !important; background: #f1f5f9 !important; }
}

/* ───────── 8. Quản trị viên BM .ba-popup (bm.js:2308/3337, tkqc.js:11640) + chỉ định tài sản .aam-* (bm.js:1867) — C4 ───────── */
@media (max-width: 640px) {
  .swal2-container .swal2-popup.ba-popup { padding: 0 !important; overflow: hidden !important; border-radius: 18px !important; max-height: var(--fx-dlg-avail) !important; }
  .swal2-container .swal2-popup.ba-popup .swal2-html-container {
    display: flex !important; flex-direction: column; margin: 0 !important; padding: 10px 14px 14px !important;
    max-height: var(--fx-dlg-avail); overflow: hidden !important; word-break: normal !important; overflow-wrap: break-word; text-align: left;
  }
  .swal2-container .swal2-popup.ba-popup .ba-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; }
  .swal2-container .swal2-popup.ba-popup .ba-head,
  .swal2-container .swal2-popup.ba-popup .ba-tabs-row,
  .swal2-container .swal2-popup.ba-popup .ba-tabs,
  .swal2-container .swal2-popup.ba-popup .ba-search-row { flex: 0 0 auto; }
  .swal2-container .swal2-popup.ba-popup .ba-list,
  .swal2-container .swal2-popup.ba-popup .ba-table-wrap { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .swal2-container .swal2-popup.ba-popup .swal2-close { top: 6px !important; right: 6px !important; width: 44px !important; height: 44px !important; font-size: 26px !important; z-index: 5; }
  .swal2-container .swal2-popup.ba-popup .ba-head { margin-bottom: 4px; }
  .swal2-container .swal2-popup.ba-popup .ba-head-row { min-height: 40px; padding-right: 44px; margin-bottom: 2px; }
  .swal2-container .swal2-popup.ba-popup .ba-id-info-row { flex-wrap: wrap; gap: 2px 8px; }
  .swal2-container .swal2-popup.ba-popup .ba-bmname { max-width: 100%; flex: 0 1 auto; min-width: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-id-sep { display: none; }
  .swal2-container .swal2-popup.ba-popup .ba-id-chip { padding: 6px 4px; }
  .swal2-container .swal2-popup.ba-popup .ba-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .swal2-container .swal2-popup.ba-popup .ba-tabs::-webkit-scrollbar { display: none; }
  .swal2-container .swal2-popup.ba-popup .ba-tab { flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 0 10px; gap: 5px; }
  .swal2-container .swal2-popup.ba-popup .ba-tab-count { font-size: 11px; white-space: nowrap; }
  .swal2-container .swal2-popup.ba-popup .ba-tabs-row { display: block; border-bottom: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-tabs-row .ba-tabs { border-bottom: 1.5px solid #e5e7eb; margin-bottom: 10px; }
  .swal2-container .swal2-popup.ba-popup .ba-tabs-actions { padding-bottom: 10px; }
  .swal2-container .swal2-popup.ba-popup .ba-cur-btn,
  .swal2-container .swal2-popup.ba-popup .ba-copy-btn { min-height: 40px; }
  .swal2-container .swal2-popup.ba-popup .ba-search-row { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .swal2-container .swal2-popup.ba-popup .ba-search { flex: 1 1 100%; min-width: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-search input { height: 44px; padding-top: 0; padding-bottom: 0; font-size: 16px; }
  .swal2-container .swal2-popup.ba-popup .ba-assign-all-btn,
  .swal2-container .swal2-popup.ba-popup .ba-del-sel-btn { flex: 1 1 0; min-height: 44px; justify-content: center; padding: 0 10px; }
  .swal2-container .swal2-popup.ba-popup .ba-loading-mini { flex: 1 0 100%; justify-content: center; }
  .swal2-container .swal2-popup.ba-popup .ba-card { display: grid; grid-template-columns: 22px 38px minmax(0, 1fr) auto 44px; grid-template-areas: "pick avatar info info act" "pick avatar chip time act"; column-gap: 10px; row-gap: 6px; align-items: center; padding: 10px 6px 10px 12px; }
  /* Ô tìm của popup QTV ẩn thẻ bằng .hidden — luật display:grid ở trên mạnh hơn .ba-card.hidden của bm.js/tkqc.js nên trên ĐT thẻ không ẩn (giống .ba-row.hidden bên dưới) */
  .swal2-container .swal2-popup.ba-popup .ba-card.hidden { display: none; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-pick { grid-area: pick; width: 22px !important; height: 22px !important; margin: 0 !important; float: none !important; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-avatar { grid-area: avatar; align-self: start; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-info { grid-area: info; min-width: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-role-chip { grid-area: chip; justify-self: start; min-width: 0; max-width: 100%; font-size: 12px; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-time { grid-area: time; min-width: 0; font-size: 12px; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-actions { grid-area: act; width: 44px; height: 44px; padding: 0; font-size: 18px; justify-content: center; }
  .swal2-container .swal2-popup.ba-popup .ba-name { max-width: 100%; min-width: 0; flex: 0 1 auto; }
  .swal2-container .swal2-popup.ba-popup .ba-email { min-width: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-email span { max-width: none; min-width: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-id-mono { padding: 6px 8px; margin-left: -8px; font-size: 12px; overflow-wrap: anywhere; }
  .swal2-container .swal2-popup.ba-popup .ba-platform,
  .swal2-container .swal2-popup.ba-popup .ba-badge-you { font-size: 11px; }
  .swal2-container .swal2-popup.ba-popup .ba-table,
  .swal2-container .swal2-popup.ba-popup .ba-table tbody { display: block; width: 100%; }
  .swal2-container .swal2-popup.ba-popup .ba-table thead { display: none; }
  .swal2-container .swal2-popup.ba-popup .ba-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "acc limit" "acc status"; gap: 4px 12px; align-items: center; padding: 10px 12px; }
  .swal2-container .swal2-popup.ba-popup .ba-row.hidden { display: none; }
  .swal2-container .swal2-popup.ba-popup .ba-row + .ba-row { border-top: 1px solid #f3f4f6; }
  .swal2-container .swal2-popup.ba-popup .ba-row + .ba-row .ba-td { border-top: 0 !important; }
  [data-bs-theme="dark"] .swal2-container .swal2-popup.ba-popup .ba-row + .ba-row { border-top-color: rgba(255, 255, 255, .1); }
  .swal2-container .swal2-popup.ba-popup .ba-td { display: block; padding: 0; min-width: 0; width: auto; }
  .swal2-container .swal2-popup.ba-popup .ba-td-idx { display: none; }
  .swal2-container .swal2-popup.ba-popup .ba-td-acc { grid-area: acc; }
  .swal2-container .swal2-popup.ba-popup .ba-td-limit { grid-area: limit; text-align: right; font-size: 13px; }
  .swal2-container .swal2-popup.ba-popup .ba-td-status { grid-area: status; text-align: right; }
  .swal2-container .swal2-popup.ba-popup .ba-acc-name { max-width: 100%; }
  .swal2-container .swal2-popup.ba-popup .ba-cur-panel { left: 0; right: auto; max-height: min(320px, 45dvh); }
  .swal2-container .swal2-popup.ba-popup .ba-cur-opt { min-height: 44px; }
  .swal2-container .swal2-popup.ba-popup .ba-cur-opt .ba-cur-opt-name { font-size: 11px; }
  .ba-menu { min-width: 220px; max-width: calc(100vw - 16px); }
  .ba-menu .ba-menu-item { min-height: 44px; font-size: 14px; padding: 10px 14px; }
  /* gõ tìm (bàn phím ảo bật): gấp phần đầu lại để danh sách còn chỗ */
  .swal2-container .swal2-popup.ba-popup:has(#ba-search-input:focus) .ba-id-info-row,
  .swal2-container .swal2-popup.ba-popup:has(#ba-search-input:focus) .ba-tabs-actions,
  .swal2-container .swal2-popup.ba-popup:has(#ba-search-input:focus) .ba-loading-mini,
  .swal2-container .swal2-popup.ba-popup:has(#ba-search-input:focus) .ba-assign-all-btn,
  .swal2-container .swal2-popup.ba-popup:has(#ba-search-input:focus) .ba-del-sel-btn { display: none; }
  /* overlay "Chỉ định tài sản" (KHÔNG phải Swal): 3 cột ngang → xếp dọc, thân cuộn, chân đứng yên */
  .aam-overlay { padding: 8px; }
  .aam-modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .aam-header { padding: 10px 12px 10px 14px; }
  .aam-close { width: 44px; height: 44px; }
  .aam-body { flex-direction: column; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .aam-col { padding: 12px 14px; min-height: auto; flex: none; }
  .aam-col-types { width: auto; overflow: visible; border-right: 0; border-bottom: 1px solid #eef0f3; }
  .aam-type-list { flex-direction: row; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .aam-type-list::-webkit-scrollbar { display: none; }
  .aam-type { flex: 0 0 auto; white-space: nowrap; min-height: 44px; padding: 6px 12px 6px 8px; }
  .aam-col-assets { min-width: 0; }
  .aam-search { font-size: 16px; min-height: 44px; }
  .aam-selall { min-height: 36px; margin-bottom: 4px; }
  .aam-grid { flex: none; height: 300px; min-height: 300px; }
  .aam-asset-list { flex: none; height: 300px; min-height: 0; }
  .aam-asset { min-height: 44px; }
  .aam-asset input { width: 20px; height: 20px; }
  .aam-asset-id { font-size: 12px; }
  .aam-col-perm { width: auto; border-left: 0; border-top: 1px solid #eef0f3; overflow: visible; }
  .aam-perm-opts { flex: none; overflow: visible; }
  .aam-perm-opt { padding: 12px; }
  .aam-perm-opt input { width: 22px; height: 22px; }
  .aam-bag-sec { min-height: 44px; }
  .aam-btn-remove { min-height: 44px; }
  .aam-footer { padding: 10px 14px; gap: 8px; }
  .aam-foot-btns { gap: 8px; }
  .aam-btn { min-height: 44px; padding: 0 18px; }
  .aam-status { padding: 10px 14px; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-container .swal2-popup.ba-popup .swal2-close { width: 40px !important; height: 40px !important; }
  .swal2-container .swal2-popup.ba-popup .ba-actions { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .swal2-container .swal2-popup.ba-popup .ba-card > .ba-pick { width: 22px !important; height: 22px !important; margin: 0 4px 0 0 !important; float: none !important; }
  .swal2-container .swal2-popup.ba-popup .ba-cur-btn,
  .swal2-container .swal2-popup.ba-popup .ba-copy-btn { min-height: 40px; }
  .ba-menu .ba-menu-item { min-height: 44px; }
}
@media (min-width: 641px) and (max-height: 500px) and (pointer: coarse) {
  .swal2-container .swal2-popup.ba-popup { padding: 0 !important; overflow: hidden !important; border-radius: 16px !important; max-height: calc(100dvh - 20px) !important; }
  .swal2-container .swal2-popup.ba-popup .ba-search input { font-size: 16px; }
  .swal2-container .swal2-popup.ba-popup .swal2-html-container { display: flex !important; flex-direction: column; margin: 0 !important; padding: 8px 16px 12px !important; max-height: calc(100dvh - 20px); overflow: hidden !important; word-break: normal !important; overflow-wrap: break-word; text-align: left; }
  .swal2-container .swal2-popup.ba-popup .ba-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; }
  .swal2-container .swal2-popup.ba-popup .ba-head,
  .swal2-container .swal2-popup.ba-popup .ba-tabs-row,
  .swal2-container .swal2-popup.ba-popup .ba-tabs,
  .swal2-container .swal2-popup.ba-popup .ba-search-row { flex: 0 0 auto; }
  .swal2-container .swal2-popup.ba-popup .ba-head { margin-bottom: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-head-row { min-height: 40px; padding-right: 44px; margin-bottom: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-tab { min-height: 40px; padding-top: 0; padding-bottom: 0; }
  .swal2-container .swal2-popup.ba-popup .ba-search-row { margin-bottom: 8px; }
  .swal2-container .swal2-popup.ba-popup .ba-list,
  .swal2-container .swal2-popup.ba-popup .ba-table-wrap { flex: 1 1 auto; min-height: 0; max-height: none !important; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .swal2-container .swal2-popup.ba-popup .swal2-close { top: 6px !important; right: 6px !important; width: 40px !important; height: 40px !important; font-size: 26px !important; z-index: 5; }
}
[data-bs-theme="dark"] .aam-col-types,
[data-bs-theme="dark"] .aam-col-perm { border-color: rgba(255, 255, 255, .08); }
/* thẻ QTV đã tích ở chế độ tối: luật tối của modern-theme.css:5246 (0,2,0 !important) đang xoá mất trạng thái "đã tích" */
[data-bs-theme="dark"] .ba-card.ba-card-picked { background: rgba(var(--primary-end-rgb, 139, 92, 246), .28) !important; border-color: var(--primary-end, #8b5cf6) !important; }

/* ───────── 9. Tự động & Bảo mật BM .bmp-pop, Liên kết Zalo .zlink-popup, Telegram (bm.js ~6000–7400) — C5, C6 ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup.bmp-pop .bmp-w { display: flex; flex-direction: column; max-height: var(--fx-dlg-avail); border-radius: inherit; overflow: hidden; }
  .swal2-popup.bmp-pop .bmp-hd,
  .swal2-popup.bmp-pop .bmp-tabs,
  .swal2-popup.bmp-pop .bmp-foot { flex: 0 0 auto; }
  .swal2-popup.bmp-pop .bmp-bd,
  .swal2-popup.bmp-pop .bmp-bd.bmp-2col { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .swal2-popup.bmp-pop .bmp-foot { border-top: 1px solid #f1f5f9; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); }
  [data-bs-theme="dark"] .swal2-popup.bmp-pop .bmp-foot { border-top-color: #2a2f3a; }
  .swal2-container .swal2-popup.bmp-pop .swal2-close,
  .swal2-container .swal2-popup.zlink-popup .swal2-close { top: -8px !important; right: -8px !important; width: 36px !important; height: 36px !important; font-size: 24px !important; overflow: visible !important; }
  .swal2-container .swal2-popup.bmp-pop .swal2-close::after,
  .swal2-container .swal2-popup.zlink-popup .swal2-close::after { content: ""; position: absolute; inset: -6px; }
  .swal2-popup.bmp-pop .bmp-cta { min-height: 40px; padding: 0 16px; font-size: 13px; }
  .swal2-popup.bmp-pop .bmp-tab { min-height: 44px; }
  .swal2-popup.bmp-pop .bmp-sw,
  .swal2-popup.bmp-pop .bmp-sw2 { width: 52px; height: 32px; border-radius: 32px; }
  .swal2-popup.bmp-pop .bmp-sw::before,
  .swal2-popup.bmp-pop .bmp-sw2::before { width: 26px; height: 26px; }
  .swal2-popup.bmp-pop .bmp-sw.on::before,
  .swal2-popup.bmp-pop .bmp-sw2.on::before { transform: translateX(20px); }
  .swal2-popup.bmp-pop .bmp-rule-r { gap: 8px; }
  .swal2-popup.bmp-pop .bmp-gic { width: 40px; height: 40px; font-size: 18px; }
  .swal2-popup.bmp-pop .bmh-filters { gap: 8px; }
  .swal2-popup.bmp-pop .bmh-fchip { min-height: 36px; padding: 0 14px; font-size: 12px; }
  .swal2-popup.bmp-pop .bmp-alltoggle { min-height: 40px; padding: 0 8px; font-size: 13px; }
  .swal2-popup.bmp-pop .bmp-link-btn { min-height: 36px; padding: 0 14px; font-size: 12.5px; }
  .swal2-popup.bmp-pop .bms-safe-btn { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .swal2-popup.bmp-pop .bmp-btn { min-height: 44px; }
  .swal2-popup.bmp-pop .bmp-input,
  .swal2-popup.bmp-pop .bmp-search,
  .swal2-popup.bmp-pop .bmp-ivsel { font-size: 16px; min-height: 44px; }
  .swal2-popup.bmp-pop .bmp-pill,
  .swal2-popup.bmp-pop .bmp-lead,
  .swal2-popup.bmp-pop .bmp-chrow-warn,
  .swal2-popup.bmp-pop .bmh-tag,
  .swal2-popup.bmp-pop .bmh-rule { font-size: 11px; }
  .swal2-popup.bmp-pop .bmh-time,
  .swal2-popup.bmp-pop .bmp-bmi-id,
  .swal2-popup.bmp-pop .bmp-flabel2 { font-size: 11.5px; }
  .swal2-popup.bmp-pop .bmp-rule-sent,
  .swal2-popup.bmp-pop .bmp-opt-de,
  .swal2-popup.bmp-pop .bmp-hint,
  .swal2-popup.bmp-pop .bmp-warn,
  .swal2-popup.bmp-pop .bmp-starter-de { font-size: 12px; }
  .swal2-popup.bmp-pop .bmp-chrow-warn { display: block; width: fit-content; margin: 4px 0 0; white-space: nowrap; }
  .swal2-popup.bmp-pop .bmh-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; }
  .swal2-popup.bmp-pop .bmh-time { grid-column: 2; margin-top: 6px; }
  [data-bs-theme="dark"] .swal2-popup.bmp-pop .bmp-sw.on,
  [data-bs-theme="dark"] .swal2-popup.bmp-pop .bmp-sw2.on { background: #8b5cf6; }
  [data-bs-theme="dark"] .swal2-popup.bmp-pop .bmp-starter-ic[style*="fee2e2"] { background: rgba(220, 38, 38, .18) !important; color: #fca5a5 !important; }
  .swal2-popup.zlink-popup .zlink-wrap { max-height: calc(var(--fx-dlg-avail) - 10px); overflow-y: auto; overscroll-behavior: contain; border-radius: 9px; }
  .swal2-popup.zlink-popup .zlink-account-card { flex-wrap: wrap; row-gap: 8px; }
  .swal2-popup.zlink-popup .zlink-account-info { flex: 1 1 130px; }
  .swal2-popup.zlink-popup .zlink-account-name { overflow-wrap: anywhere; }
  .swal2-popup.zlink-popup .zlink-phone-copy { margin-left: auto; min-height: 40px; padding: 0 14px; font-size: 13px; }
  .swal2-popup.zlink-popup .zlink-code-copy { min-height: 40px; padding: 0 16px; font-size: 13px; }
  .swal2-html-container a[href*="t.me"] { min-height: 44px; padding: 0 18px !important; }
  /* Swal đặt .swal2-html-container{word-break:break-word} (= overflow-wrap:anywhere → min-content 1 ký tự): chữ dịch dài vỡ GIỮA CHỮ */
  .swal2-popup.bmp-pop .swal2-html-container,
  .swal2-popup.zlink-popup .swal2-html-container { word-break: normal; overflow-wrap: break-word; }
  .swal2-popup.bmp-pop .bmp-rule-name,
  .swal2-popup.bmp-pop .bmh-line1,
  .swal2-popup.bmp-pop .bmh-line2 > span,
  .swal2-popup.bmp-pop .bmp-tok { overflow-wrap: anywhere; }
  .swal2-popup.bmp-pop .bmp-rule-name .bmp-pill { overflow-wrap: normal; }
  .swal2-popup.bmp-pop .bmp-hd { flex-wrap: wrap; padding-right: 30px; }
  .swal2-popup.bmp-pop .bmp-hd-t { flex: 1 1 110px; }
  .swal2-popup.bmp-pop .bmp-cta { margin-left: auto; }
  .swal2-popup.bmp-pop .bmp-tabs { overflow-x: auto; scrollbar-width: none; }
  .swal2-popup.bmp-pop .bmp-tabs::-webkit-scrollbar { display: none; }
  .swal2-popup.bmp-pop .bmp-tab { flex: 0 0 auto; white-space: nowrap; margin-bottom: 0; }
}
@media (max-width: 600px) {
  .swal2-popup.bmp-pop .bmp-bd.bmp-2col .bmp-col-l,
  .swal2-popup.bmp-pop .bmp-bd.bmp-2col .bmp-col-r { flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .swal2-popup.bmp-pop .bmp-rule { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "main main main" "sw . act"; row-gap: 10px; align-items: center; }
  .swal2-popup.bmp-pop .bmp-rule > .bmp-rule-main { grid-area: main; }
  .swal2-popup.bmp-pop .bmp-rule > .bmp-sw { grid-area: sw; }
  .swal2-popup.bmp-pop .bmp-rule > .bmp-rule-r { grid-area: act; }
}
@media (max-height: 520px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup.bmp-pop .bmp-hd { padding: 10px 30px 8px 16px; }
  .swal2-popup.bmp-pop .bmp-hd-ic { width: 32px; height: 32px; font-size: 16px; }
  .swal2-popup.bmp-pop .bmp-hd-sub { display: none; }
  .swal2-popup.bmp-pop .bmp-tabs { padding-top: 2px; }
  .swal2-popup.bmp-pop .bmp-bd { padding-top: 10px; padding-bottom: 10px; }
}
/* menu chuột phải của bảng IG (bm.js:5540): mục ≥44px, không tràn mép phải */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #igContextMenu .dropdown-item { min-height: 44px; display: flex; align-items: center; }
  #igContextMenu > ul { max-width: calc(100vw - 16px); }
}

/* ───────── 10. Dùng chung libs.js: Xác nhận mua, thông báo tính năng mới, tiến trình .fxlog-modal, thông tin TK .cp-m, toast, banner hết hạn — C7 ───────── */
@media (max-width: 640px) {
  .fx-buy-confirm > div:first-child { gap: 12px; }
  .fx-buy-confirm > div:first-child > span:first-child { flex: 0 0 auto; white-space: nowrap; }
  .fx-buy-confirm > div:first-child > b { min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .swal2-html-container > div[style*="max-height:400px"]:not(#termsScrollBox) { max-height: none !important; overflow: visible !important; padding-right: 0 !important; }
  .swal2-html-container > div[style*="max-height:400px"] > div { text-align: left !important; }
  /* hộp Điều khoản của Cài đặt (setting.js: nút Đồng ý chỉ mở khi cuộn tới đáy) PHẢI còn cuộn được trong khung, nhưng vừa màn (E4-01) */
  .swal2-html-container > #termsScrollBox { max-height: min(400px, calc(var(--fx-dlg-avail, 100dvh) - 190px)) !important; min-height: 140px; overflow-y: auto !important; overscroll-behavior: contain; }
  .swal2-html-container > div[style*="text-align: center"] > div[style*="white-space: pre-line"] { text-align: left; }
  .fxlog-modal > .border-top.d-flex.justify-content-between { padding: 12px 16px !important; gap: 8px 12px !important; overflow: visible !important; flex-shrink: 0; }
  .fxlog-modal > .border-top.d-flex.justify-content-between > span,
  .fxlog-modal > .border-top.d-flex.justify-content-between > div { flex-shrink: 1 !important; white-space: normal !important; }
  .fxlog-body { min-height: 0; }
  .fxlog-close { width: 40px; height: 40px; }
  .fiox-toast { top: calc(env(safe-area-inset-top, 0px) + 50px) !important; left: 12px !important; right: 12px !important; min-width: 0 !important; max-width: none !important; pointer-events: none; }
  .fiox-expired-bar { bottom: calc(63px + env(safe-area-inset-bottom, 0px)); z-index: 1090; height: auto; min-height: 48px; padding: 6px 12px; gap: 8px; font-size: 12.5px; }
  .fiox-expired-bar > span { white-space: normal; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .fiox-expired-btn { min-height: 36px; padding: 6px 12px; }
  body.fiox-has-expired-bar .account-wrapper { height: calc(100dvh - 112px - var(--fiox-exp-bar-h) - env(safe-area-inset-bottom, 0px)) !important; }
  body.fiox-has-expired-bar #app #adPanel { bottom: calc(63px + var(--fiox-exp-bar-h)); }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup.cp-m .swal2-close { top: -14px; right: -6px; width: 40px; height: 40px; font-size: 20px; }
  .swal2-popup.cp-m .swal2-html-container div[onclick] { padding: 10px 0; margin: -10px 0; }
  .swal2-popup.cp-m .swal2-html-container div[style*="text-overflow:ellipsis"],
  .swal2-popup.cp-m .swal2-html-container span[title] { white-space: normal !important; max-width: none !important; overflow: visible !important; overflow-wrap: anywhere; }
  .swal2-popup.cp-m .swal2-html-container span[title] { text-align: right; }
  .swal2-popup.cp-m .swal2-html-container span[style*="flex:1"] { flex: 0 0 auto !important; white-space: nowrap; }
  .swal2-popup.cp-m #checkpointDataString { font-size: 16px !important; }
  .swal2-popup.cp-m .swal2-html-container button[onclick] { min-height: 44px; }
  [data-bs-theme="dark"] .swal2-popup.cp-m #checkpointDataString { background: #1b2433 !important; color: #cbd5e1 !important; }
  [data-bs-theme="dark"] .swal2-popup.cp-m .swal2-html-container button[onclick] { background: rgba(139, 92, 246, .18) !important; color: #c4b5fd !important; }
}

/* ───────── 11. HOME via.js: Chia sẻ Note, Xem thư, Điều khoản, Nạp tiền nhanh, Thêm UID/BM — C9 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup .swal2-input,
  .swal2-popup .swal2-textarea,
  .swal2-popup .swal2-select { width: 100% !important; max-width: 100%; box-sizing: border-box; margin-left: 0 !important; margin-right: 0 !important; }
  .swal2-popup :is(.swal2-input, .swal2-select, .form-select) { min-height: 44px; }
  .swal2-popup.nt-share-popup { padding: 0 !important; }
  .swal2-popup.nt-share-popup > .swal2-close,
  .swal2-popup.mt-modal > .swal2-close { width: 44px; height: 44px; margin-bottom: -44px; color: #64748b; }
  .nt-share-head > div:last-child { min-width: 0; }
  .nt-share-sub { max-width: 100%; }
  .nt-share-row { min-height: 46px; }
  .nt-share-btn { min-width: 44px; }
  .swal2-popup.mt-modal { height: var(--fx-dlg-avail); }
  .swal2-popup.mt-modal > .swal2-html-container { display: flex !important; flex-direction: column; flex: 1 1 auto; overflow: hidden; }
  .swal2-popup.mt-modal .mt-modal-meta { flex: none; }
  .swal2-popup.mt-modal .mt-modal-iframe { flex: 1 1 auto; height: auto; min-height: 0; }
  /* Điều khoản & Chính sách (màn đăng ký, via.js): cuộn TRONG khung vừa màn để nút Tôi đồng ý/Đóng luôn thấy (D3-01/C9-04: bỏ khung cuộn làm hộp cao 3,5–5 màn, nút nằm tận đáy) */
  .fx-terms-pop .fx-terms { max-height: calc(100vh - 230px); max-height: calc(var(--fx-dlg-avail, 100dvh) - 190px); min-height: 140px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
  .swal2-popup .qd-tab, .swal2-popup .qd-usdt-cancel-btn, .swal2-popup .qd-usdt-retry-btn { min-height: 44px; }
  .swal2-popup .qd-usdt-wallet-copy { width: 44px !important; height: 44px !important; }
  .swal2-popup .qd-pane [style*="font-size:10.5px"], .swal2-popup .qd-pane [style*="font-size:11px"],
  .swal2-popup .qd-usdt-pending [style*="font-size:10.5px"], .swal2-popup .qd-usdt-pending [style*="font-size:11px"] { font-size: 12px !important; }
  .swal2-popup #acAddCatNew { min-height: 44px; }
}

/* ───────── 12. Pixel / Kho tính năng / Camp / Load Pixel (pixel.js, tkqc.js, group.js) — C10, C11 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup .pxp-inp, .swal2-popup .pxp-sel, .swal2-popup .pxp-ta,
  .swal2-popup .ad-limit-input, .swal2-popup #pxBmIds, .swal2-popup #swal-input-ids, .swal2-popup #lpBmIdInput,
  .swal2-popup #storeSearch, .swal2-popup #ba-search-input, .swal2-popup #pxAdvEvent, .swal2-popup #pxAdvAcct { font-size: 16px !important; }
  .swal2-popup .pxp-inp, .swal2-popup .pxp-sel, .swal2-popup #storeSearch { min-height: 44px !important; }
  .swal2-popup .pxp-gbtn { min-height: 44px; }
  .swal2-popup .pxp-ib { width: 44px; height: 44px; font-size: 20px; }
  .swal2-popup.store-popup .btn-store-buy,
  .swal2-popup.store-popup .btn-store-add,
  .swal2-popup.store-popup .btn-store-remove { min-height: 44px; font-size: 12px !important; }
  .swal2-popup.store-popup [style*="height:30px"] { height: 44px !important; }
  .swal2-popup.store-popup #storeSearch { height: 44px !important; }
  .swal2-popup.store-popup #storeAddAll,
  .swal2-popup.store-popup #storeRemoveAll { min-height: 44px; padding: 12px 6px !important; }
  .swal2-popup.store-popup .btn-store-fav { font-size: 24px !important; padding: 12px; margin: -12px; }
  .swal2-popup.pxp-popup .pxp-h > label { min-height: 44px; font-size: 14px !important; display: flex; align-items: center; gap: 8px !important; }
  .swal2-popup.pxp-popup .pxp-h > label > input { width: 22px; height: 22px; }
  .swal2-popup.pxp-popup .pxp-h > button { min-height: 44px; padding: 0 18px !important; font-size: 14px !important; }
  .swal2-popup.camp-budget-popup .cbp-chip { min-height: 44px; padding: 8px 14px; font-size: 13px; }
  .swal2-popup.camp-budget-popup .cbp-presets { gap: 8px; }
  .dspf-ov #dspfStop { min-height: 44px; padding: 10px 22px !important; }
  /* nút × của các popup này nằm TRONG hộp, vùng chạm 40px */
  body .swal2-container .swal2-popup:is(.pxp-popup, .store-popup, .camp-budget-popup) .swal2-close {
    position: absolute !important; top: 6px !important; right: 6px !important; width: 40px !important; height: 40px !important; margin: 0 !important; padding: 0 !important;
    border-radius: 50% !important; font-size: 26px !important; line-height: 1 !important; color: #64748b !important; background: rgba(100, 116, 139, .12) !important; box-shadow: none !important; z-index: 6;
  }
  body .swal2-container .swal2-popup:has(> .swal2-close) :is(.pxp-h, .ad-modal-header, .id-header, .cbp-hd) { padding-right: 40px; }
  .swal2-popup.store-popup .swal2-title { padding-right: 40px !important; }
}
@media (max-width: 640px) {
  .swal2-popup.pxp-popup .pxp-scroll { max-height: calc(100dvh - 260px) !important; }
  .swal2-popup.pxp-popup #pxRtList { max-height: calc(100dvh - 300px) !important; }
  .swal2-popup.pxp-popup #pxAdvResult { max-height: none !important; overflow: visible !important; }
  .swal2-popup.store-popup #storeGrid { max-height: calc(100dvh - 320px) !important; }
  .swal2-popup.pxp-popup div:has(> span[style*="min-width:130px"]) { flex-direction: column !important; gap: 0 !important; }
  .swal2-popup.pxp-popup span[style*="min-width:130px"] { min-width: 0 !important; white-space: normal !important; }
  .swal2-popup.pxp-popup span[style*="word-break:break-all"] { word-break: normal !important; overflow-wrap: anywhere; }
  .swal2-popup.pxp-popup .pxp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swal2-popup.pxp-popup .pxp-gbtn span { white-space: normal; line-height: 1.2; }
  .swal2-popup.pxp-popup #pxAdvEvent,
  .swal2-popup.pxp-popup #pxAdvAcct { flex: 1 1 100% !important; }
  .swal2-popup.pxp-popup .pxp-body > div[style*="display:flex;gap:8px"] { flex-wrap: wrap; }
  .swal2-popup.pxp-popup .pxp-h { flex-wrap: wrap; }
  .swal2-popup.pxp-popup .pxp-h > div[style*="flex:1"] { flex: 1 1 100px !important; }
  .swal2-popup.pxp-popup .pxp-h:has(> label) > div[style*="flex:1"] { flex: 1 1 calc(100% - 60px) !important; }
  .swal2-popup.pxp-popup .pxp-h > button { margin-left: auto !important; }
  .swal2-popup.store-popup .swal2-html-container { word-break: normal; }
  .swal2-popup.store-popup #storeGrid > div { grid-template-columns: 1fr !important; gap: 10px !important; }
  .swal2-popup .lp-card { padding-right: 30px; min-height: 56px; }
  .swal2-popup .lp-check { top: 6px; right: 6px; }
  .swal2-popup:has(.lp-card) { width: min(380px, calc(100vw - 32px)) !important; }
  #pixelModal .modal-header { padding: 12px 14px !important; }
  #pixelModal .modal-footer { padding: 10px 14px !important; }
  #pixelModal #pxGridSearch { font-size: 16px; height: 44px; }
  #pixelModal #pixelGridContainer .uid-copy { font-size: 12px !important; }
  #pixelModal .modal-footer .btn { min-height: 44px; }
  .dspf-ov > div { max-height: calc(100dvh - 24px); overflow: auto; }
  .dspf-ov #dspfErr { overflow-wrap: anywhere; }
}
@media (min-width: 641px) and (max-height: 500px) and (pointer: coarse) {
  .swal2-popup .pxp-scroll, .swal2-popup #pxRtList, .swal2-popup #pxAdvResult, .swal2-popup #storeGrid { max-height: none !important; overflow: visible !important; }
}
@media (hover: none) {
  .swal2-popup.store-popup .btn-store-remove .rm-default { display: none !important; }
  .swal2-popup.store-popup .btn-store-remove .rm-hover { display: inline !important; }
  .swal2-popup.store-popup .btn-store-remove { background: #fef2f2 !important; color: #dc2626 !important; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup.store-popup, .swal2-popup.arl-pop { max-width: calc(100vw - 64px) !important; }
  .swal2-popup.arl-pop .swal2-close { width: 44px !important; height: 44px !important; top: -18px !important; right: -18px !important; }
}

/* ───────── 13. Tự động hoá & Bảo mật TKQC .arl-pop (ads-rules.js), form Telegram .aan-tg (ads-analytics.js), .pqm-swal (page/group-manager) — C11 ───────── */
@media (max-width: 640px) {
  .swal2-popup .aan-tg label { display: block !important; }
  .swal2-popup.pqm-swal .pqm-swal-in.swal2-input { font-size: 16px !important; }
  .swal2-popup.pqm-swal .pqm-swal-ok, .swal2-popup.pqm-swal .pqm-swal-cancel { min-height: 44px; flex: 1 1 auto; min-width: calc(50% - 8px); }
  .swal2-popup.pqm-swal .swal2-actions { width: 100%; flex-wrap: wrap; }
  .swal2-popup.arl-pop .swal2-close { top: 8px !important; right: 8px !important; width: 44px !important; height: 44px !important; z-index: 7; }
  .swal2-popup.arl-pop .arl-hd { padding-right: 60px; }
  .swal2-popup.arl-pop .arl-gic { position: relative; }
  .swal2-popup.arl-pop .arl-gic::before { content: ""; position: absolute; inset: -7px; }
  .swal2-popup.arl-pop .arl-sw::before { content: ""; position: absolute; inset: -12px -6px; }
  .swal2-popup.arl-pop .arl-cta, .swal2-popup.arl-pop .arl-btn.sm, .swal2-popup.arl-pop .arl-tab { min-height: 44px; }
  .swal2-popup.arl-pop .arl-lead, .swal2-popup.arl-pop .arl-row-name .st, .swal2-popup.arl-pop .arl-acc-cur { font-size: 11px; }
  .swal2-popup.arl-pop .arl-acc-id, .swal2-popup.arl-pop .arl-fchip .l { font-size: 11.5px; }
}
/* Swal đặt word-break:break-word → chữ giao diện không vỡ từng chữ cái (xem memory feedback_swal_word_break_min_content) */
@media (max-width: 640px) {
  .swal2-popup.swal2-modal .swal2-html-container { word-break: normal; overflow-wrap: break-word; }
}

/* ───────── 14. Thẻ tính năng + hộp thoại của logic.js: Thống kê link backup .bst-grid, Đồng bộ BM .bms-log, nút "Load…" — C12 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .swal2-popup .swal2-html-container div[style*="font-size:11.5px"] { font-size: 12.5px !important; }
  #popup-after-add-perm,
  #popup-after-close { width: 20px !important; height: 20px !important; }
  .swal2-popup .bms-log { height: min(240px, calc(100dvh - 330px)); min-height: 120px; }
  .swal2-popup #bmSyncStopBtn { min-height: 44px; padding-left: 18px; padding-right: 18px; }
  .swal2-popup .lcw-chips .lcw-chip { border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; padding: 5px 12px; font-size: 12px; cursor: default; }
  [data-bs-theme="dark"] .swal2-popup .lcw-chips .lcw-chip { border-color: rgba(255, 255, 255, .12); background: #1b2433; color: #cbd5e1; }
  .swal2-container:has(.bst-grid) { padding: 6px !important; }
  .swal2-popup:has(.bst-grid) { padding: 14px 8px 12px !important; width: calc(100vw - 12px) !important; max-width: calc(100vw - 12px) !important; }
  .swal2-popup:has(.bst-grid) .swal2-title { font-size: 20px; text-align: left; padding: 0 4px 8px !important; }
  .swal2-popup .bst-grid { height: min(440px, calc(100dvh - 250px)) !important; min-height: 180px; --ag-row-height: 44px; --ag-header-height: 40px; --ag-font-size: 13px; }
  #bstMaximize { display: none !important; }
  i[id^="btnLoad"].ri-download-cloud-2-line { padding: 12px 14px; margin: -12px -14px -12px 0; border-radius: 12px; }
  #backupLinkStatsBtn { min-height: 36px; padding: 0 14px !important; font-size: 12px !important; }
  /* menu chuột phải của thống kê link backup: mục ≥44px; nút ⋯ nhìn thấy được (iOS không phát contextmenu) */
  #bstContextMenu .dropdown-item { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  .bst-more { width: 44px; height: 44px; border: 1.5px solid #e2e8f0; border-radius: 10px; background: transparent; color: #64748b; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
  [data-bs-theme="dark"] .bst-more { border-color: rgba(255, 255, 255, .14); color: #94a3b8; }
  .db-edall-txt { font-size: 16px; }
  .db-edall-row .db-mdel { width: 44px; height: 44px; margin-top: 11px; margin-right: -8px; }
  .db-bgmodal-x { width: 44px; height: 44px; }
}
/* ───────── 15. Chế độ TỐI: màu nhúng cứng (inline) trong html của hộp thoại — C3, C4, C7, C9, C11, C12 ─────────
   (lỗi cùng gốc cũng có ở desktop tối; theo ràng buộc "desktop không đổi" chỉ vá phía điện thoại/tablet cảm ứng) */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  [data-bs-theme="dark"] .swal2-html-container [style*="color:#dc2626"],
  [data-bs-theme="dark"] .swal2-html-container [style*="color: #dc2626"] { color: #fca5a5 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="color:#b45309"],
  [data-bs-theme="dark"] .swal2-html-container [style*="color: #b45309"] { color: #fcd34d !important; }
  [data-bs-theme="dark"] .swal2-popup [style*="var(--bs-heading-color"] { color: #e2e8f0 !important; }
  [data-bs-theme="dark"] .swal2-popup [style*="color: #4b5563"], [data-bs-theme="dark"] .swal2-popup [style*="color:#4b5563"] { color: #cbd5e1 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="color: #334155"], [data-bs-theme="dark"] .swal2-html-container [style*="color:#334155"] { color: #e2e8f0 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="color: #4338ca"], [data-bs-theme="dark"] .swal2-html-container [style*="color: #4f46e5"] { color: #a5b4fc !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="color: #64748b"] { color: #94a3b8 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="background: #f1f5f9"] { background: #1b2433 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="#fff3cd"] { background: rgba(245, 158, 11, .16) !important; color: #fcd34d !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="background:#f8fafc"] { background: #1b2433 !important; color: #cbd5e1 !important; border-left-color: #475569 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="border-bottom:1px solid #e5e7eb"] { border-bottom-color: #2e3a4b !important; }
  [data-bs-theme="dark"] .swal2-popup .swal2-html-container label[style*="solid #e5e7eb"] { border-color: rgba(255, 255, 255, .14) !important; }
  [data-bs-theme="dark"] .swal2-popup b[style*="color:#4f46e5"] { color: #a5b4fc !important; }
  [data-bs-theme="dark"] .swal2-popup b[style*="color:#047857"] { color: #34d399 !important; }
  [data-bs-theme="dark"] .swal2-popup b[style*="color:#7c3aed"] { color: #c4b5fd !important; }
  [data-bs-theme="dark"] .swal2-popup #adsCheckLiveErrList { color: #fca5a5 !important; }
  [data-bs-theme="dark"] .swal2-popup #adsCheckLiveErrBox > div:first-child { color: #f87171 !important; }
  [data-bs-theme="dark"] .swal2-popup #btnCopyAdsCheckErrors { background: #1b2433 !important; border-color: rgba(255, 255, 255, .15) !important; color: #93c5fd !important; box-shadow: none !important; }
  [data-bs-theme="dark"] .swal2-popup .sa-item { border-bottom-color: rgba(255, 255, 255, .08); }
  [data-bs-theme="dark"] .swal2-popup .sa-ident-seg { background: #1b2433; border-color: rgba(255, 255, 255, .14); color: #94a3b8; }
  [data-bs-theme="dark"] .swal2-popup .sa-ident-seg-on { background: rgba(34, 197, 94, .14); border-color: #22c55e; color: #4ade80; }
  [data-bs-theme="dark"] .swal2-popup #acAddCatNew { background: transparent !important; color: #a5b4fc !important; border-color: #6366f1 !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="rgb(146, 64, 14)"] { color: #fcd34d !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="linear-gradient(135deg,#fef3c7"] { background: rgba(245, 158, 11, .14) !important; border-color: rgba(245, 158, 11, .45) !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="color:#92400e"] { color: #fcd34d !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="linear-gradient(135deg,#d1fae5"] { background: rgba(16, 185, 129, .14) !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="color:#065f46"] { color: #6ee7b7 !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="linear-gradient(135deg,#dbeafe"] { background: rgba(59, 130, 246, .16) !important; }
  [data-bs-theme="dark"] .swal2-popup div[style*="color:#1e40af"] { color: #93c5fd !important; }
  [data-bs-theme="dark"] .swal2-popup .qd-usdt-cancel-btn, [data-bs-theme="dark"] .swal2-popup .qd-usdt-err-msg { color: #fca5a5 !important; }
  [data-bs-theme="dark"] .fx-terms summary { color: #c4b5fd; }
}

/* ═════════════════════════ MODAL BOOTSTRAP + OVERLAY TỰ DỰNG (ads/bm/clone/group/page/pixel/index) — B1, B2 ═════════════════════════ */

/* ───────── 16. Khung modal tự dựng #settingModal / #customizeModal / #pxCustomizeModal (markup lặp ở 7 view) — B2 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  body .modal-content > button[aria-label="Close"] { top: 4px !important; right: 8px !important; width: 44px !important; height: 44px !important; font-size: 26px !important; box-shadow: none !important; }
  :root:not([data-bs-theme="dark"]) body .modal-content > button[aria-label="Close"] { background: transparent !important; color: #64748b !important; }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) { overscroll-behavior: contain; }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-dialog { --bs-modal-margin: 8px; width: calc(100% - 16px); }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content > div:nth-of-type(2) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #settingIframe { flex: 0 1 auto; min-height: 0; max-height: none !important; }
  #colCustomize, #pxColCustomize { flex: 0 1 auto; min-height: 0; max-height: 620px !important; overscroll-behavior: contain; }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content > div:first-of-type { flex: 0 0 auto; min-height: 56px; display: flex; align-items: center; padding: 8px 56px 8px 16px !important; }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content > button[aria-label="Close"] {
    top: 6px !important; right: 6px !important; width: 44px !important; height: 44px !important; z-index: 10 !important;
    font-size: 22px !important; line-height: 1; color: #475569 !important; background: radial-gradient(circle at center, #eef0f4 15.5px, transparent 16.5px) !important;
  }
  html[data-bs-theme="dark"] :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content > button[aria-label="Close"] { color: #cbd5e1 !important; background: radial-gradient(circle at center, #334155 15.5px, transparent 16.5px) !important; }
  /* chân: KHÔNG dùng :last-of-type (pixel.js chuyển #colPalettePop vào CUỐI .modal-content) */
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content > div:has(> .btn) { flex: 0 0 auto; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important; }
  :is(#settingModal, #customizeModal, #pxCustomizeModal) .modal-content > div > .btn { min-height: 44px; padding: 0 20px !important; font-size: 14px !important; border-radius: 10px !important; display: inline-flex; align-items: center; justify-content: center; }
  html[data-bs-theme="dark"] :is(#customizeModal, #pxCustomizeModal, #autoFetchLinkModal) .modal-content > div { border-color: rgba(148, 163, 184, .16) !important; }
  :is(#colCustomize, #pxColCustomize) .col-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  :is(#colCustomize, #pxColCustomize) .col-color-pill { min-height: 32px; padding: 4px 12px 4px 10px !important; }
  :is(#colCustomize, #pxColCustomize) .col-color-pill span[style*="monospace"] { font-size: 11px !important; }
  :is(#colCustomize, #pxColCustomize) .col-color-reset { padding: 9px 8px !important; margin: -9px -8px -9px -4px; font-size: 16px !important; }
  :is(#colCustomize, #pxColCustomize) .form-check-input { position: relative; top: 0; }
  :is(#colCustomize, #pxColCustomize) .form-check-input::after { content: ""; position: absolute; inset: -10px; }
  html[data-bs-theme="dark"] :is(#colCustomize, #pxColCustomize) .col-color-pill[data-color=""] { background: transparent !important; border-color: rgba(148, 163, 184, .5) !important; color: #cbd5e1 !important; }
  /* nút ✕ + chân + ô nhập dùng chung mọi modal Bootstrap */
  .modal .modal-header .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: -12px -12px -12px auto; background-size: 14px auto; }
  body .cc-close { top: 6px; right: 8px; width: 44px; height: 44px; font-size: 26px; box-shadow: none; background: transparent; }
  body .scm-close-btn { top: 4px; right: 4px; width: 44px; height: 44px; font-size: 26px; }
  .modal-footer .btn, .modal-content > div[style*="border-top"] .btn-sm { min-height: 44px; }
  .modal-footer .btn-sm, .modal-content > div[style*="border-top"] .btn-sm { font-size: 14px !important; padding-inline: 18px !important; }
  .modal-content .form-control, .modal-content .form-select, .modal-content textarea, .cc-search { font-size: 16px; }
  .ren-bar { padding: 6px 8px; }
  .ren-back { width: 44px; height: 44px; font-size: 22px; }
  .ren-bar-save { min-height: 44px; padding-inline: 18px; }
  html[data-bs-theme="dark"] #phoiModal .modal-header > .btn-close { background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 14px no-repeat !important; }
}

/* ───────── 16b. Trang Cài đặt (setting.html trong #settingIframe): nút "Tải tool" / "Cập nhật tool" ở hàng trạng thái tool của tab Proxy + User Agent ─────────
   Nút btn-sm chỉ cao ~25px. Phải ≥44px để chạm trúng; `.sx-tool-row .sx-tool-btn` (0,2,0) vì <style> của setting.html nằm SAU tệp này và đặt padding 3px 10px (0,1,0).
   [hidden] vẫn ẩn được: luật `.sx-tool-btn[hidden]{display:none!important}` của setting.html có !important. */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .sx-tool-row .sx-tool-btn { min-height: 44px; padding-inline: 14px; display: inline-flex; align-items: center; justify-content: center; }
}
/* popover "Chọn màu cột": điện thoại dọc = tấm đáy toàn chiều ngang (JS gán top/left inline → !important) */
@media (max-width: 640px) {
  #colPalettePop { left: 8px !important; right: 8px !important; top: auto !important; bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important; width: auto !important; padding: 16px !important; border-radius: 16px !important; box-shadow: 0 -8px 32px rgba(15, 23, 42, .28) !important; }
  #colPalettePop .cp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 10px !important; max-height: min(34dvh, 260px) !important; padding: 2px !important; }
  #colPalettePop .cp-sw { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1; min-height: 36px; border-radius: 10px !important; }
  #colPalettePop .cp-hex { font-size: 16px !important; padding: 10px 12px !important; }
  #colPalettePop .cp-apply { min-height: 44px; padding: 0 20px !important; font-size: 14px !important; border-radius: 10px !important; }
  #colPalettePop .cp-native-wrap { width: 44px !important; height: 44px !important; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  body #colPalettePop { width: min(320px, calc(100vw - 16px)) !important; padding: 16px !important; }
  body #colPalettePop .cp-grid { grid-template-columns: repeat(6, 1fr) !important; max-height: min(280px, 40vh) !important; }
  body #colPalettePop .cp-sw { width: 100% !important; height: auto !important; aspect-ratio: 1; min-height: 38px; border-radius: 8px !important; }
  body #colPalettePop .cp-native-wrap { width: 44px !important; height: 44px !important; }
  body #colPalettePop .cp-hex { font-size: 16px !important; min-height: 44px; }
  body #colPalettePop .cp-apply { min-height: 44px; padding-inline: 16px !important; }
}

/* ───────── 17. Overlay tự dựng #scmOverlay / #pmOverlay / #taxOverlay / #renameOverlay (cuộn được, căn giữa an toàn) — B1 ───────── */
@media (max-width: 640px), (max-height: 520px) and (pointer: coarse) {
  .scm-overlay, .pm-overlay { align-items: flex-start; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
  .scm-modal, .pm-modal { margin: auto; }
  .pm-list, .tax-body { max-height: min(60vh, calc(100vh - 230px)); max-height: min(60dvh, calc(100dvh - 230px)); }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .pm-card-sub, .pm-card-num { overflow-wrap: anywhere; }
  .pm-modal .pm-card .badge.rounded-pill, .pm-modal .tax-value .badge.rounded-pill, #cardCount { font-size: 11px; }
  .pm-del-btn { min-height: 40px; }
  .tax-label { flex-basis: 100px; }
  #renameOverlay .scm-input-row > .fx-pwd-toggle { position: static; transform: none; flex: 0 0 auto; font-size: 20px; padding: 12px 0 12px 10px; margin-left: 0 !important; }
}
@media (max-width: 640px) {
  .scm-radio-row { grid-template-columns: 1fr; }
  .scm-radio { min-height: 44px; padding: 10px 14px; }
}

/* ───────── 18. "Tùy chỉnh cột" cc-modal (tkqc.js:9786) — B1-01 BLOCKER: lưới 220|1fr|320 làm cột "Đã chọn" văng ra ngoài màn hình ───────── */
@media (max-width: 640px) {
  .cc-overlay { padding: 0; align-items: stretch; }
  body .cc-modal { max-width: none; max-height: none; height: 100vh; height: 100dvh; border-radius: 0; }
  .cc-header { padding: 8px 64px 8px 16px; min-height: 56px; }
  .cc-title { font-size: 16px; gap: 10px; min-width: 0; }
  .cc-title #ccTitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cc-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, .9fr); }
  .cc-sidebar { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 8px 12px; border-right: 0; border-bottom: 1px solid #e2e8f0; -webkit-overflow-scrolling: touch; }
  .cc-sidebar-item { flex: 0 0 auto; margin: 0; padding: 10px 14px; border-radius: 999px; font-size: 13px; }
  .cc-middle { border-right: 0; border-bottom: 1px solid #e2e8f0; }
  html[data-bs-theme="dark"] .cc-middle { border-bottom-color: #2e3a4b; }
  .cc-search-wrap, .cc-preset-wrap { padding: 8px 16px; }
  .cc-search { font-size: 16px; padding-top: 11px; padding-bottom: 11px; }
  .cc-search-icon { left: 28px; }
  .cc-preset-trigger { height: 44px; font-size: 14px; }
  .cc-preset-menu { max-height: min(280px, 40vh); max-height: min(280px, 40dvh); }
  .cc-list { padding: 0 16px 12px; }
  .cc-col-row { padding: 12px 4px; min-height: 44px; }
  .cc-col-row input[type="checkbox"] { width: 20px; height: 20px; }
  .cc-group-label .cc-group-toggle { min-width: 44px; min-height: 44px; margin: -12px -12px -12px 0; }
  .cc-right-head { padding: 10px 16px 6px; }
  .cc-right-actions .camp-tools-btn { min-height: 36px; font-size: 12px; padding: 6px 10px; }
  .cc-selected-list { padding: 4px 16px 12px; }
  .cc-selected-pill { padding: 10px 12px; }
  .cc-pill-remove, .cc-preset-icon-btn { width: 40px; height: 40px; font-size: 18px; }
  .cc-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .cc-footer-right { width: 100%; margin-left: 0; }
  .cc-btn-cancel, .cc-btn-apply { flex: 1 1 0; min-height: 44px; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .cc-body { grid-template-columns: 170px minmax(0, 1fr) 250px; }
  .cc-col-row { padding: 12px 4px; min-height: 44px; }
  .cc-pill-remove, .cc-preset-icon-btn { width: 40px; height: 40px; font-size: 18px; }
  .cc-group-label .cc-group-toggle { min-width: 44px; min-height: 44px; margin: -12px -12px -12px 0; }
  .cc-right-actions .camp-tools-btn { min-height: 40px; padding: 6px 12px; }
  .cc-btn-cancel, .cc-btn-apply { min-height: 44px; }
}
@media (max-height: 520px) and (pointer: coarse) {
  .cc-overlay { padding: 8px; }
  body .cc-modal { height: calc(100vh - 16px); height: calc(100dvh - 16px); max-height: none; }
  .cc-header { padding: 8px 56px 8px 16px; }
  .cc-footer { padding: 8px 16px; }
}

/* ───────── 19. cardModal, bmInfoModal, phoiModal, igConfigModal, autoFetchLinkModal, viewDataModal — B1, B2 ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #cardModal .modal-body { overflow-x: auto; }
  #cardModal #cards { min-width: 860px; height: min(350px, calc(100vh - 200px)) !important; height: min(350px, calc(100dvh - 200px)) !important; }
  #bmInfoModal .modal-body { max-height: calc(100vh - 190px) !important; max-height: calc(100dvh - 190px) !important; }
  #bmInfoModal .table { min-width: 640px; font-size: 13px; }
  #bmInfoModal .table th, #bmInfoModal .table td { white-space: nowrap; padding: 10px 8px; }
  #bmInfoModal .table td:nth-child(3) { white-space: normal; min-width: 120px; max-width: 150px; }
  #bmInfoModal .table td:nth-child(6) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
  #igConfigModal .form-check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-left: 0; margin-bottom: 0 !important; }
  #igConfigModal .form-check .form-check-input { float: none; margin: 0; flex: 0 0 22px; width: 22px; height: 22px; }
  #igConfigModal .form-check .form-check-label { flex: 1; align-self: stretch; display: flex; align-items: center; font-size: 14px; }
  html[data-bs-theme="dark"] #autoFetchLinkStop.btn { background: rgba(220, 38, 38, .18) !important; color: #f87171 !important; }
  #phoiModal .modal-dialog { --bs-modal-margin: 8px; width: calc(100% - 16px); }
  #phoiModal .modal-content { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  #phoiModal .modal-body { padding: 16px; overflow-y: auto; }
  #phoiModal .modal-body > .d-flex.justify-content-between { flex-wrap: wrap; gap: 8px; }
  #phoiModal #phoiList .row { --bs-gutter-x: 12px; }
  #phoiModal #phoiList .row > .col-3 { flex: 0 0 auto; width: 50%; }
  #phoiModal .phoiItem { height: 100%; }
  #phoiModal .btn-close { width: 44px; height: 44px; padding: 0; background-size: 14px; margin: -8px -12px -8px auto; }
  #phoiModal #phoiControl .btn, #phoiModal .modal-body a.btn, #phoiModal .modal-footer .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 640px) {
  #phoiList .phoiItem .fw-medium { overflow-wrap: anywhere; font-size: 13px; line-height: 1.3; }
  #autoFetchLinkModal .modal-content > div:last-of-type { flex-wrap: wrap; gap: 12px; }
  #autoFetchLinkModal .modal-content > div:last-of-type > .d-flex.gap-3 { flex: 1 1 100%; justify-content: space-between; }
  #autoFetchLinkModal .modal-content > div:last-of-type > .d-flex.gap-2 { flex: 1 1 100%; }
  #autoFetchLinkModal .modal-content > div:last-of-type > .d-flex.gap-2 .btn { flex: 1 1 0; white-space: nowrap; }
  #autoFetchLinkModal .badge { font-size: 12px; }
  #colCustomize .col-item { padding: 10px 12px !important; margin-bottom: 8px !important; }
  #colCustomize .col-color-pill { min-height: 36px; padding-inline: 12px !important; }
  #colCustomize .col-color-pill > span:nth-child(2) { font-size: 11px !important; }
  #colCustomize .col-color-reset { padding: 8px !important; margin: -8px -8px -8px 0; }
}
@media (max-height: 520px) and (pointer: coarse) {
  .modal-dialog { margin-block: 8px; }
  .modal-content:has(> .modal-body) { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); display: flex; flex-direction: column; }
  .modal-content:has(> .modal-body) > .modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
  #cardModal #cards { height: calc(100vh - 190px) !important; height: calc(100dvh - 190px) !important; }
}

/* ═════════════════════════ CỬA SỔ DỮ LIỆU viewAds / viewBm / viewPage + khung #viewDataModal (clone.html) — E1 ═════════════════════════
   Markup: <body class="fx-vw"> ở 3 view (cửa sổ dữ liệu KHÔNG có điều hướng dưới/chat). */

/* ───────── 20. Khung #viewDataModal (modal-xl chứa iframe height=500px) ───────── */
@media (max-width: 640px) {
  #viewDataModal .modal-dialog { margin: 0; max-width: none; width: 100%; min-height: 0; height: 100%; height: 100dvh; }
  #viewDataModal .modal-content { height: 100%; border: 0; border-radius: 0; overflow: hidden; }
  #viewDataModal .modal-body { flex: 1 1 auto; min-height: 0; }
  #viewDataModal .modal-body > iframe { display: block; width: 100%; height: 100%; border: 0; }
  /* ✕ 40px, kính trắng trên thanh tiêu đề tím của cửa sổ (style="top:20px;right:20px" nội tuyến + luật tối modern-theme.css:4989 xoá mất hình X) */
  #viewDataModal .modal-content > button.btn-close {
    top: 4px !important; right: 8px !important; width: 40px; height: 40px; padding: 0; opacity: 1; filter: none;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
    background: rgba(255, 255, 255, .2) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 14px no-repeat !important;
  }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viewDataModal .modal-dialog { max-width: min(94vw, 760px); }
  #viewDataModal .modal-body > iframe { display: block; height: min(82dvh, 720px); }
  #viewDataModal .modal-content > button.btn-close { top: 10px !important; right: 12px !important; width: 40px; height: 40px; padding: 0; opacity: .7; border-radius: 50%; background: transparent var(--bs-btn-close-bg) center / 14px no-repeat !important; }
}
@media (min-width: 641px) and (max-width: 1024px) and (max-height: 500px) and (pointer: coarse) {
  #viewDataModal .modal-dialog { margin: 0; max-width: none; width: 100%; min-height: 0; height: 100%; height: 100dvh; }
  #viewDataModal .modal-content { height: 100%; border: 0; border-radius: 0; overflow: hidden; }
  #viewDataModal .modal-body { flex: 1 1 auto; min-height: 0; }
  #viewDataModal .modal-body > iframe { height: 100%; }
  #viewDataModal .modal-content > button.btn-close { top: 8px !important; right: 12px !important; }
}

/* ───────── 21. BÊN TRONG iframe viewAds/viewBm/viewPage (body.fx-vw) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* ẩn sidebar + ☰ + nút chat nổi (☰ đè tiêu đề; ngăn kéo chứa Đăng xuất + liên kết rời trang; chat đè chân trang) */
  body.fx-vw .hm-side-slot, body.fx-vw .hm-sidebar, body.fx-vw #hmDrawerBurger, body.fx-vw #hmDrawerBackdrop, body.fx-vw .sup-chat { display: none !important; }
  /* bỏ phần chừa 112px cho thanh điều hướng dưới (view KHÔNG có #header) */
  body.fx-vw .account-wrapper { height: 100vh !important; height: 100dvh !important; }
  body.fx-vw .app-wrapper { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
  body.fx-vw .account-wrapper > .border-bottom { flex-shrink: 0; }
  body.fx-vw .account-wrapper > .border-bottom > div > .flex-grow-1 > .position-relative { height: 44px; }
  body.fx-vw #search { height: 44px !important; padding: 0 44px 0 14px !important; border-radius: 12px; font-size: 16px; }
  body.fx-vw #searchSubmit i { top: 50% !important; right: 14px !important; transform: translateY(-50%); }
  body.fx-vw .account-wrapper > .border-bottom .dropdown { margin: 0 !important; }
  body.fx-vw .account-wrapper > .border-bottom .dropdown > .control-btn { display: inline-grid; place-items: center; width: 44px; height: 44px !important; padding: 0 !important; border-radius: 12px; }
  body.fx-vw .account-wrapper > .border-bottom .dropdown > .control-btn i { margin: 0; font-size: 20px; }
  /* danh sách trạng thái KHÔNG bị overflow:hidden cắt (Ads có 9 mục = 458px > cửa sổ 388px): tấm cố định dưới đầu trang, cuộn trong khung */
  body.fx-vw .account-wrapper .dropdown-menu.show { position: fixed !important; inset: 112px 10px auto 10px !important; transform: none !important; width: auto !important; max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); margin: 0 !important; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 16px 36px rgba(20, 24, 60, .28); }
  body.fx-vw .account-wrapper .dropdown-menu.show label { min-height: 44px; }
  /* chân trang: một dải chip trạng thái cuộn ngang (mép phải mờ), mỗi chip 32px, chữ ≥12px */
  body.fx-vw .account-wrapper > .border-top.d-flex.justify-content-between { flex: 0 0 auto; height: 52px !important; padding: 0 !important; gap: 0 !important; overflow: hidden !important; }
  body.fx-vw .account-wrapper > .border-top > div {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; height: 100%; padding: 0 28px 0 12px !important; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border: 0 !important;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  body.fx-vw .account-wrapper > .border-top > div::-webkit-scrollbar { display: none; }
  body.fx-vw .account-wrapper > .border-top > div > span { flex: none; display: inline-flex !important; align-items: center; gap: 6px; height: 32px; margin: 0 !important; padding: 0 6px 0 10px !important; border: 1px solid var(--border-color, rgba(0, 0, 0, .1)) !important; border-radius: 999px; background: var(--bg-body, #f8fafc); font-size: 13px !important; font-weight: 600; white-space: nowrap !important; }
  body.fx-vw .account-wrapper > .border-top > div > span .badge { margin: 0 !important; padding: .3em .6em !important; border-radius: 999px; font-size: 12px !important; }
}
/* ĐIỆN THOẠI DỌC: đầu trang 2 hàng — thanh tiêu đề gradient 48px (tên + số lượng; chừa 56px phải cho ✕ của modal) + hàng tìm kiếm/lọc */
@media (max-width: 640px) {
  body.fx-vw .account-wrapper > .border-bottom { border-bottom: 0 !important; }
  body.fx-vw .account-wrapper > .border-bottom > div { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ttl ttl" "src flt"; align-items: center; height: auto !important; padding: 0 !important; }
  /* ⚠ KHÔNG dùng .pe-3: nút lọc cũng mang class pe-3 → bị dính nền gradient */
  body.fx-vw .account-wrapper > .border-bottom > div > div:first-child { grid-area: ttl; display: flex; align-items: center; min-height: 48px; padding: 0 56px 0 14px !important; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
  body.fx-vw .account-wrapper > .border-bottom h5 { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; color: #fff; white-space: nowrap; }
  body.fx-vw .account-wrapper > .border-bottom h5 #count { flex: none; margin: 0 !important; padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .22) !important; color: #fff !important; }
  body.fx-vw .account-wrapper > .border-bottom > div > .flex-grow-1 { grid-area: src; min-width: 0; margin: 0 !important; padding: 8px 8px 8px 12px; }
  body.fx-vw .account-wrapper > .border-bottom > div > .d-flex.border-end { grid-area: flt; margin: 0 !important; padding: 8px 12px 8px 0 !important; border: 0 !important; }
  [data-bs-theme="dark"] body.fx-vw .account-wrapper > .border-bottom > div > div:first-child { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
}
/* TABLET CẢM ỨNG / ĐIỆN THOẠI NẰM NGANG: đầu trang 1 hàng cao 64px, chừa 56px phải cho ✕ */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  body.fx-vw .account-wrapper > .border-bottom > div { height: 64px !important; padding: 0 56px 0 16px !important; gap: 12px; }
  body.fx-vw .account-wrapper > .border-bottom > div > .d-flex.border-end { margin: 0 !important; padding-right: 12px !important; }
  body.fx-vw .account-wrapper > .border-bottom > div > .flex-grow-1 { margin: 0 !important; }
  body.fx-vw .account-wrapper .dropdown-menu.show { inset: 68px 16px auto auto !important; width: 280px !important; max-height: calc(100dvh - 80px); }
}

/* ───────── 22. Nút ☰ ngăn kéo (#hmDrawerBurger, z 1250) KHÔNG được nổi trên hộp thoại ─────────
   Trang không có #fxTopBar + tablet/nằm ngang để ☰ ở z 1250 > modal Bootstrap 1055 / Swal 1060 → ☰ đè lên tiêu đề hộp thoại. */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  body.modal-open:not(.hm-drawer-open) #hmDrawerBurger,
  body.swal2-shown:not(.hm-drawer-open) #hmDrawerBurger { z-index: 1030 !important; }
}

/* ═════════════════════════ HOME vỏ + dashboard (index.html #viaPanel) — D1 ═════════════════════════
   PHONE = (max-width:640px) · TOUCH = PHONE + tablet cảm ứng + điện thoại nằm ngang. Luật gốc nằm sau khối mobile của style.css nên dùng #viaPanel để thắng độ đặc hiệu. */

/* ───────── 23. Chỉ điện thoại dọc: bố cục dashboard ───────── */
@media (max-width: 640px) {
  /* hero: avatar trái + tên phải (tối đa 2 dòng), UID dưới tên, email trọn hàng — tên/email không bị cắt cụt */
  #viaPanel .nh-hero { padding: 16px; gap: 12px; min-height: 0; }
  #viaPanel .nh-hero-main { display: grid; grid-template-columns: 60px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; align-items: start; }
  #viaPanel .nh-avatar-wrap { grid-row: 1 / span 2; }
  #viaPanel .nh-avatar { width: 60px; height: 60px; font-size: 1.5rem; }
  #viaPanel .nh-online { width: 14px; height: 14px; border-width: 2px; right: 2px; bottom: 2px; }
  #viaPanel .nh-hero-info, #viaPanel .nh-meta { display: contents; }
  #viaPanel .nh-name {
    grid-column: 2; grid-row: 1; align-self: center; min-width: 0;
    margin: 0; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.4px;
    white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }
  #viaPanel .nh-uid { grid-column: 2; grid-row: 2; justify-self: start; max-width: 100%; }
  #viaPanel .nh-uid:empty { display: none; }
  #viaPanel .nh-email { grid-column: 1 / -1; grid-row: 3; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  /* Ngày sinh / Bạn bè / Giới tính → một thẻ danh sách (nhãn trái, giá trị phải) thay vì 3 hộp cao 58px xếp dọc */
  #viaPanel .nh-tiles { grid-template-columns: 1fr; gap: 0; overflow: hidden; border: 1px solid rgba(99, 102, 241, 0.12); border-radius: 14px; background: rgba(99, 102, 241, 0.04); }
  #viaPanel .nh-tile { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 9px 12px; background: none; border: 0; border-radius: 0; }
  #viaPanel .nh-tile + .nh-tile { border-top: 1px solid rgba(99, 102, 241, 0.12); }
  #viaPanel .nh-tile-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 0.95rem; }
  #viaPanel .nh-tile-info { display: contents; }
  #viaPanel .nh-tile-label { grid-column: 2; grid-row: 1; margin: 0; }
  #viaPanel .nh-tile-value { grid-column: 3; grid-row: 1; text-align: right; max-width: 60vw; }
  #viaPanel .nh-hero-foot { padding-top: 10px; margin-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
  /* 3 thẻ đếm một hàng 3 cột (License xuống hàng riêng) thay vì 4 hàng 1 cột cao ~508px */
  #viaPanel .nh-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; gap: 8px; }
  #viaPanel .nh-stat { min-height: 0; padding: 12px 10px; gap: 6px; border-radius: 16px; justify-content: flex-start; }
  #viaPanel .nh-stat-trend { display: none; }
  #viaPanel .nh-stat-icon { width: 28px; height: 28px; font-size: 0.95rem; }
  #viaPanel .nh-stat-value { font-size: 1.35rem; letter-spacing: -0.5px; }
  #viaPanel .nh-stat.nh-license { grid-column: 1 / -1; padding: 14px 16px; }
  /* thẻ danh sách không ép cao 490px khi trống; thẻ Lịch sử ẩn hẳn nếu chưa có phiên bản */
  #viaPanel .nh-tops .nh-card-body { min-height: 0; }
  #viaPanel .nh-empty { padding: 28px 16px; }
  #viaPanel .nh-card-history:has(#versions:empty) { display: none; }
  /* vùng chạm ☰ và nút tài khoản trên thanh tiêu đề 40 → 44 (mở vùng bấm, không đổi nét vẽ) */
  body.fx-has-bar #hmDrawerBurger::before,
  #fxTopBar .fx-bar-btn::before { content: ""; position: absolute; inset: -3px; }
  #fxTopBar .fx-bar-btn { position: relative; }
}

/* ───────── 24. Điện thoại + tablet cảm ứng + nằm ngang: dữ liệu / chữ / chạm ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* hàng top QC/BM/Page: cột phải (số tiền/loại/like) không bị cắt (via.js dựng width:calc(100% - 60px) nội tuyến) */
  #viaPanel .nh-tops .nh-card-body > a { align-items: center; gap: 12px; }
  #viaPanel .nh-tops .nh-card-body > a > .d-flex.align-items-center { flex: 1 1 0; min-width: 0; width: auto !important; }
  #viaPanel .nh-tops .nh-card-body > a .d-flex.flex-column { flex: 1 1 0; min-width: 0; width: auto !important; padding-left: 12px !important; }
  #viaPanel .nh-tops .nh-card-body > a > .text-end { flex: 0 0 auto; max-width: 52%; }
  #viaPanel .nh-tops .nh-card-body > a > .text-end > strong { font-size: 11px; font-weight: 600; color: #64748b; }
  #viaPanel .nh-tops .nh-card-body > a .badge { font-size: 12px; white-space: nowrap; }
  #viaPanel .nh-tops .nh-card-body > a .d-flex.flex-column > span { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  [data-bs-theme="dark"] #viaPanel .nh-tops .nh-card-body > a .d-flex.flex-column > span { color: #94a3b8; }
  /* changelog có URL dài không tràn */
  #viaPanel .vt-body { overflow-wrap: anywhere; font-size: 13px; }
  #viaPanel .vt-badge { font-size: 12px; }
  /* bậc chữ tối thiểu (rem gốc = 14px nên 0.7rem = 9.8px) */
  #viaPanel .nh-greet { font-size: 12px; }
  #viaPanel .nh-uid { font-size: 12px; }
  #viaPanel .nh-email { font-size: 13px; }
  #viaPanel .nh-tile-label { font-size: 13px; }
  #viaPanel .nh-tile-value { font-size: 14px; }
  #viaPanel .nh-foot-status { font-size: 12px; }
  #viaPanel .nh-foot-sync { font-size: 12px; color: #64748b; }
  #viaPanel .nh-stat-label { font-size: 12px; line-height: 1.25; }
  #viaPanel .nh-stat-trend { font-size: 11px; color: #64748b; }
  #viaPanel .nh-license-status { font-size: 11px; }
  #viaPanel .nh-license-days-lbl { font-size: 13px; }
  #viaPanel .nh-license-sessions-row { font-size: 12px; }
  #viaPanel .nh-license-sessions-val { font-size: 13px; }
  #viaPanel .nh-section-label { font-size: 11px; }
  #viaPanel .nh-card-h5 { font-size: 15px; }
  #viaPanel .nh-empty-title { font-size: 14px; }
  #viaPanel .nh-empty-sub { font-size: 12px; }
  #viaPanel .nh-card-link { min-height: 40px; padding: 0 12px; font-size: 12px; }
  /* tương phản tối */
  [data-bs-theme="dark"] #viaPanel .nh-license-status { color: #34d399; }
  [data-bs-theme="dark"] #viaPanel .nh-greet,
  [data-bs-theme="dark"] #viaPanel .nh-card-link { color: #a5b4fc; }
  [data-bs-theme="dark"] #viaPanel .vt-badge.vt-badge-new { background: linear-gradient(135deg, #10b981, #059669) !important; color: #fff !important; }
  [data-bs-theme="dark"] #viaPanel .nh-tiles { border-color: rgba(255, 255, 255, 0.1); background: rgba(99, 102, 241, 0.1); }
  [data-bs-theme="dark"] #viaPanel .nh-tile + .nh-tile { border-top-color: rgba(255, 255, 255, 0.1); }
  #viaPanel .nh-card:hover, #viaPanel .nh-stat:hover, #viaPanel .nh-tile:hover { transform: none; }
  /* ngăn kéo cuộn MỘT vùng (không cuộn lồng): menu không bị che dưới thẻ tài khoản trên máy thấp/nằm ngang */
  .hm-sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .hm-sidebar .hm-scroll { flex: 1 0 auto; overflow: visible; }
  .hm-sidebar .hm-side-header { flex-shrink: 0; }
  /* nút Cài đặt / Đăng xuất 26px → 40px (GIỮ xếp dọc: xếp ngang ăn 50px bề ngang → số dư bị cắt ở 360px) */
  .hm-sidebar .hm-side-actions { gap: 4px; }
  .hm-sidebar .hm-side-act { width: 40px; height: 40px; border-radius: 10px; }
  .hm-sidebar .hm-side-act i { font-size: 18px; }
  /* popup "Danh sách ứng dụng": hàng không bị bóp (lưới có chiều cao xác định → track auto co về 0) */
  .hm-sidebar .hm-app-grid { grid-auto-rows: min-content; }
  .hm-sidebar .hm-app-de { font-size: 12px; }
  .hm-sidebar .hm-app-popup-count { font-size: 11px; }
  .hm-sidebar .hm-section-label { font-size: 11px; }
  .hm-app-search-input { font-size: 16px; }
  .sup-in textarea, #supQ { font-size: 16px; }
  .sup-x { width: 40px; height: 40px; }
}
/* "Giảm chuyển động" của hệ điều hành: dừng animation vô hạn của vỏ HOME (vòng quay avatar, chấm nhịp, quầng sáng nút chat) */
@media (prefers-reduced-motion: reduce) and (max-width: 640px), (prefers-reduced-motion: reduce) and (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .nh-avatar-ring, .nh-foot-dot, .nh-license-dot, .nh-quality .badge::before, .sup-fab, .sup-fab::before { animation: none !important; }
}
/* máy thấp (Android 360×740, iPhone SE 667, nằm ngang): gọn hàng menu để 9 mục + thẻ tài khoản vừa màn */
@media (max-height: 760px) and (max-width: 640px), (max-height: 760px) and (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .hm-sidebar .hm-item { padding-top: 8px !important; padding-bottom: 8px !important; }
  .hm-sidebar .hm-section-label { padding-top: 4px; padding-bottom: 2px; }
}
/* tablet cảm ứng + điện thoại nằm ngang: thanh đầu trang — mở vùng bấm các nút kính 26px, 7 viên điều hướng 28 → 32px
   (modern-theme.css có "#header .rounded.row a{height:28px}" (1,2,1) → dùng .nav-pills-container.rounded.row để đạt (1,3,1)) */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .fiox-theme-btn::before, .fiox-sound-btn::before, .fiox-settings-btn::before, .fiox-zoom-toggle::before, .fiox-lang-toggle::before { content: ""; position: absolute; inset: -3px -1px; }
  #header .nav-pills-container.rounded.row a.nav-pill { height: 32px; }
}

/* ═════════════════════════ HOME: Nạp tiền / Lịch sử biến động / Mua gói / Hỗ trợ — D2 ═════════════════════════ */

/* ───────── 25. Nạp tiền (ngân hàng + USDT) — điện thoại dọc ───────── */
@media (max-width: 640px) {
  .dep-card { min-height: 0; }
  .dep-field { grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "lbl copy" "val copy"; column-gap: 10px; row-gap: 2px; padding: 10px 8px 10px 14px; align-items: center; }
  .dep-field > .dep-label { grid-area: lbl; font-size: 12px; align-self: end; }
  .dep-field > .dep-val { grid-area: val; font-size: 15px; line-height: 1.35; word-break: normal; overflow-wrap: anywhere; align-self: start; }
  .dep-field > .dep-val.dep-mono { word-break: break-all; }
  .dep-field > .dep-copy { grid-area: copy; width: 44px; height: 44px; border-radius: 10px; }
  .dep-note { font-size: 13px; }
  .dep-qr-wrap { min-width: 0; min-height: 0; padding: 12px; }
  .dep-qr-hint { font-size: 12.5px; }
  .dep-card > .mt-card-head { font-size: 0.95rem; }
  [data-bs-theme="dark"] .dep-val.dep-mono:not(.dep-content-val) { color: #f1f5f9 !important; }   /* số tài khoản không đỏ như nội dung CK */
  .dep-input-lbl { font-size: 13px; }
  .dep-input { font-size: 16px; min-height: 44px; }
  .dep-input-hint { font-size: 12px; color: #64748b; }
  .dep-usdt-rate, .dep-usdt-preview { font-size: 13px; }
  .dep-usdt-create-btn { min-height: 48px; font-size: 15px; }
  .dep-badge { font-size: 11px; }
  .dep-usdt-info-bar { font-size: 12.5px; }
  .dep-usdt-amount-lbl, .dep-usdt-wallet-lbl, .dep-usdt-vnd-eq { font-size: 12px; }
  .dep-usdt-wallet-val { font-size: 12.5px; line-height: 1.45; }
  .dep-usdt-copy { width: 44px; height: 44px; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
  .dep-usdt-status-badge { font-size: 12.5px; background: #b45309; }
  .dep-usdt-countdown { font-size: 13px; }
  .dep-usdt-cancel-btn, .dep-usdt-cancel-yes, .dep-usdt-cancel-no { min-height: 44px; font-size: 14px; }
  /* banner khuyến mãi: .dep-page đã có gap 18px → bỏ lề dưới thừa; QR chưa có src → không hiện icon ảnh hỏng */
  .dpb { margin-bottom: 0; }
  #depQrImg:not([src]) { display: none; }
  body > .fiox-toast { top: 50px; right: 12px; left: 12px; max-width: none; }   /* toast không đè nút tài khoản trên thanh 44px */
}

/* ───────── 26. Lịch sử biến động: chỉ dùng "Dòng thời gian" (bảng 7 cột không vừa) + tương phản ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #txViewSwitcher { display: none; }
  #txCard #txTableWrap { display: none !important; }
  #txCard #txFeedWrap { display: flex !important; }
  :root:not([data-bs-theme="dark"]) .tx-feed-time, :root:not([data-bs-theme="dark"]) .tx-feed-flow, :root:not([data-bs-theme="dark"]) .tx-num-mono.tx-before { color: #64748b; }
  :root:not([data-bs-theme="dark"]) .tx-amount-badge.is-positive, :root:not([data-bs-theme="dark"]) .tx-feed-amount.is-positive { color: #047857; }
  :root:not([data-bs-theme="dark"]) .tx-amount-badge.is-negative { color: #b91c1c; }
  :root:not([data-bs-theme="dark"]) .tx-status-tag.is-success, :root:not([data-bs-theme="dark"]) .sup-agent-tag { color: #15803d; }
  :root:not([data-bs-theme="dark"]) .pkg-card-price-suffix { color: #475569; }
  [data-bs-theme="dark"] .dep-input-hint { color: #94a3b8 !important; }
  [data-bs-theme="dark"] .tx-time-cell { color: #94a3b8; }
  [data-bs-theme="dark"] .tx-amount-badge.is-positive { color: #34d399; background: rgba(16, 185, 129, 0.16); }
  [data-bs-theme="dark"] .tx-amount-badge.is-negative { color: #f87171; background: rgba(239, 68, 68, 0.16); }
  [data-bs-theme="dark"] .tx-feed-amount.is-positive { color: #34d399; }
  [data-bs-theme="dark"] .tx-feed-amount.is-negative { color: #f87171; }
  [data-bs-theme="dark"] .tx-status-tag.is-success { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
  [data-bs-theme="dark"] .tx-feed-icon.is-deposit { background: rgba(16, 185, 129, 0.16); }
  [data-bs-theme="dark"] .tx-feed-icon.is-buy_package { background: rgba(139, 92, 246, 0.18); }
  [data-bs-theme="dark"] .tx-feed-icon.is-buy_feature { background: rgba(59, 130, 246, 0.16); }
  [data-bs-theme="dark"] .tx-feed-icon.is-upgrade { background: rgba(34, 197, 94, 0.16); }
  [data-bs-theme="dark"] .tx-feed-icon.is-adjust { background: rgba(245, 158, 11, 0.16); }
  [data-bs-theme="dark"] .tx-feed-icon.is-refund { background: rgba(6, 182, 212, 0.16); }
}
@media (max-width: 640px) {
  .dep-page .tx-page, .tx-page { min-height: 0; flex: 0 0 auto; padding: 0; }
  .tx-section-header { gap: 10px; flex-wrap: nowrap; align-items: flex-start; }
  .tx-section-title-wrap { flex: 1 1 auto; min-width: 0; align-items: flex-start; }
  .tx-header-actions { flex: none; }
  .tx-section-title { font-size: 1.15rem; }
  .tx-section-desc { font-size: 12.5px; color: #64748b; }
  .tx-count-badge { font-size: 12px; }
  .tx-btn-refresh { width: 44px; height: 44px; }
  .tx-table-card, .tx-table-card.is-view-feed, .tx-table-card.is-view-table { min-height: 0; flex: 0 0 auto; }
  /* dải lọc vuốt ngang (trước đây overflow:visible đè overflow-x:auto → 3 nút cuối không với tới) */
  #txCard .tx-filter-bar-wrap { overflow-x: auto; overflow-y: hidden; padding: 10px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #txCard .tx-filter-bar-wrap::-webkit-scrollbar { display: none; }
  #txCard .tx-filter-bar { flex-wrap: nowrap; }
  .tx-filter { min-height: 40px; padding: 0 14px; font-size: 13px; }
  /* thẻ giao dịch: [icon] Loại … ±Số tiền / mô tả 2 dòng / thời gian / số dư */
  .tx-feed-wrap { min-height: 0; padding: 10px; overflow: visible; }
  .tx-feed-wrap .tx-empty { min-height: 160px; }
  .tx-feed-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ic ttl amt" "ic dsc dsc" "ic tim tim" "ic flw flw"; column-gap: 12px; row-gap: 3px; align-items: start; padding: 12px; }
  .tx-feed-left, .tx-feed-body, .tx-feed-headline, .tx-feed-right { display: contents; }
  .tx-feed-icon { grid-area: ic; width: 40px; height: 40px; font-size: 1.15rem; }
  .tx-feed-title { grid-area: ttl; align-self: center; font-size: 15px; }
  .tx-feed-headline .tx-status-tag { display: none; }
  .tx-feed-time { grid-area: tim; font-size: 12px; }
  .tx-feed-desc { grid-area: dsc; font-size: 13px; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .tx-feed-flow { grid-area: flw; font-size: 12px; margin-top: 0; flex-wrap: wrap; }
  .tx-feed-amount { grid-area: amt; align-self: center; font-size: 16px; white-space: nowrap; }
}

/* ───────── 27. Mua gói ───────── */
@media (max-width: 640px) {
  .pkg-page { padding: 12px !important; gap: 12px; }
  .pkg-title { display: none; }
  .pkg-header { padding: 0 4px; }
  .pkg-subtitle { font-size: 13px; }
  .pkg-grid, .pkg-col-main, .pkg-col-summary { gap: 12px; }
  .pkg-card-section > .mt-card-head, .pkg-summary-card > .mt-card-head, .pkg-promo-card > .mt-card-head { padding: 12px 14px; }
  .pkg-duration-grid { padding: 12px; gap: 8px; }
  .pkg-duration-card { padding: 12px 8px; min-height: 48px; display: flex; align-items: center; justify-content: center; }
  .pkg-duration-discount { font-size: 11px; padding: 2px 8px; top: -7px; right: -5px; }
  /* thẻ gói nằm ngang: icon | tên … giá / 2 dòng quyền lợi (cao ~104px thay vì ~220px) */
  .pkg-list-grid { gap: 10px; padding: 12px; }
  .pkg-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 3px; align-items: center; text-align: left; padding: 12px 14px; }
  .pkg-card:has(.pkg-card-popular) { padding-top: 22px; }
  .pkg-card-icon { grid-column: 1; grid-row: 1 / span 3; width: 48px; height: 48px; margin: 0; font-size: 1.3rem; }
  .pkg-card-name { grid-column: 2; grid-row: 1; margin: 0; font-size: 1.02rem; }
  .pkg-card-price-row { grid-column: 3; grid-row: 1; margin: 0; padding: 4px 12px; }
  .pkg-card-sessions { grid-column: 2 / -1; justify-content: flex-start; margin: 0; padding: 0; font-size: 12.5px; }
  .pkg-card-price-suffix { font-size: 12px; color: #64748b; }
  .pkg-card-popular { font-size: 10.5px; padding: 3px 9px; }
  .pkg-card.is-active { transform: none; box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.9), 0 8px 18px -6px rgba(99, 102, 241, 0.4); }
  [data-bs-theme="dark"] .pkg-duration-card.is-active { border-color: var(--primary-start, #6366f1) !important; background: rgba(99, 102, 241, 0.2) !important; }
  [data-bs-theme="dark"] .pkg-card.is-active { border-color: var(--primary-start, #6366f1) !important; background: rgba(99, 102, 241, 0.14) !important; }
  .pkg-summary-body { padding: 14px; }
  .pkg-sum-row { font-size: 13.5px; }
  .pkg-sum-total span { font-size: 12px; }
  .pkg-buy-ar { min-height: 44px; font-size: 13.5px; }
  .pkg-buy-ar .form-check-input { width: 20px; height: 20px; }
  .pkg-autorenew-row .pkg-ar2-desc { font-size: 12px; }
  .pkg-autorenew-row .pkg-ar2-sw::before { content: ""; position: absolute; inset: -10px -6px; }
  .pkg-purchase-btn { min-height: 48px; }
  .pkg-purchase-btn.is-insufficient { color: #451a03; }
  .pkg-promo-input { font-size: 16px; min-height: 44px; min-width: 0; }
  .pkg-promo-input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; }
  .pkg-promo-btn { min-height: 44px; padding: 0 16px; }
  .pkg-col-main, .pkg-col-summary { min-width: 0; }
  .pkg-explain-step small { font-size: 12px; }
  .pkg-explain-notes li { font-size: 12.5px; }
  .pkg-upgrade-guide { font-size: 13px; }
}

/* ───────── 28. Hỗ trợ ───────── */
@media (max-width: 640px) {
  .sup-page { padding: 12px 12px 24px; }
  .sup-poster { margin-bottom: 18px; border-radius: 16px; }
  .sup-poster-in { padding: 18px; }
  .sup-poster-qr { display: none; }
  .sup-poster-ov { background: linear-gradient(0deg, rgba(10, 15, 40, 0.94), rgba(10, 15, 40, 0.6) 60%, rgba(10, 15, 40, 0.3)); }
  .sup-section { margin-bottom: 18px; }
  .sup-section-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .sup-section-meta { font-size: 12.5px; color: #64748b; }
  .sup-grid-3 { gap: 10px; }
  .sup-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "qr body" "qr scan"; text-align: left; column-gap: 14px; row-gap: 6px; align-items: center; padding: 12px 14px; }
  .sup-card-qr-img { grid-area: qr; width: 76px; height: 76px; padding: 5px; border-radius: 10px; }
  .sup-card-body { grid-area: body; align-items: flex-start; }
  .sup-card-name { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: flex-start; text-align: left; gap: 8px; }
  .sup-card-name > i { margin-top: 2px; flex: none; }
  .sup-card-name > span:not(.sup-free) { min-width: 0; overflow-wrap: anywhere; }
  .sup-free { flex: none; align-self: center; font-size: 10.5px; }
  .sup-card-desc { text-align: left; }
  .sup-card-scan { grid-area: scan; justify-self: start; margin: 0; }
  .sup-tip a { display: inline-block; padding: 8px 2px; margin: -8px -2px; }
  [data-bs-theme="dark"] .sup-card-scan { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
  [data-bs-theme="dark"] .sup-card-admin-bill .sup-card-scan { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
  [data-bs-theme="dark"] .sup-card-admin-dev .sup-card-scan { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
}

/* ───────── 29. Khung chat + popup khuyến mãi; tablet cảm ứng; nằm ngang ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .sup-send { width: 40px; height: 40px; }
  .sup-in textarea { padding-right: 54px; }
  .sup-bub { font-size: 14.5px; }
  .sup-agent-tag { font-size: 11.5px; }
  .sup-navlink[data-view-nav], .sup-navlink.sup-pagelink { padding: 8px 14px; font-size: 13px; }
  .dpp-overlay { overflow-y: auto; align-items: flex-start; padding: 16px; }
  .dpp-wrap { margin: auto; }
  .dpp-close { width: 36px; height: 36px; top: 10px; right: 10px; font-size: 18px; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .dep-grid.dep-cols-3, .dep-grid.dep-cols-2 { grid-template-columns: 1fr 1fr; }
  .dep-grid.dep-cols-3 #depUsdtCard { grid-column: 1 / -1; }
  .dep-card { min-height: 0; }
  .dep-field { grid-template-columns: 110px minmax(0, 1fr) 44px; }
  .dep-copy, .dep-usdt-copy { width: 44px; height: 44px; }
  .dep-input, .pkg-promo-input { font-size: 16px; min-height: 44px; min-width: 0; }
  .pkg-promo-btn, .pkg-buy-ar { min-height: 44px; }
  .tx-filter { min-height: 40px; }
  .tx-btn-refresh { width: 44px; height: 44px; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 500px) {
  .dep-page, .pkg-page { padding: 12px 16px; gap: 10px; }
  .dep-title, .pkg-title { font-size: 1.2rem; }
  .dep-title i, .pkg-title i { font-size: 1.3rem; }
  .dep-subtitle, .pkg-subtitle { display: none; }
  .dpb { margin-bottom: 0; padding: 8px 12px; }
}

/* ═════════════════════════ HOME: Đăng nhập/Đăng ký/Quên mật khẩu/Nhập key + Góp ý + Chào mừng — D3 ═════════════════════════ */

/* ───────── 30. Màn xác thực (.au-*) ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  /* khung .au-sup trong suốt 290×386 (fixed, z 9998) nuốt chạm của mọi điều khiển nằm dưới */
  .au-sup { pointer-events: none; }
  .au-sup-fab, .au-sup.open .au-sup-panel { pointer-events: auto; }
  /* thẻ cao hơn khung nhìn: align-items:center cắt mất ĐỈNH (logo, nút đổi ngôn ngữ) và không cuộn tới được */
  .au-page.au-grid { align-items: flex-start; padding: 24px 16px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .au-grid .au-card { margin: auto; }
  .au-page.au-grid .au-form-pane { padding: 28px 22px 24px; }
  /* nút Hỗ trợ: tròn 48px (chỉ icon, tên truy cập vẫn là "Hỗ trợ"), panel không bị cắt đỉnh khi nằm ngang */
  .au-sup { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .au-sup-fab { width: 48px; height: 48px; padding: 0; justify-content: center; gap: 0; }
  .au-sup-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .au-sup-panel { width: min(290px, calc(100vw - 24px)); max-height: calc(100dvh - 84px); overflow-y: auto; }
  .au-sup-item span { font-size: 12px; }
  /* ô nhập 16px (iOS không tự phóng to) + cao 44px; nút mắt 44×44; checkbox/liên kết/ngôn ngữ đủ vùng chạm */
  .au-input { font-size: 16px; height: 44px; }
  .au-input.au-input-code { font-size: 20px; }
  .au-btn { height: auto; min-height: 48px; padding-top: 10px; padding-bottom: 10px; }
  .au-toggle-pass { width: 44px; height: 44px; right: 0; }
  .au-check { align-items: center; gap: 10px; min-height: 44px; font-size: 13.5px; }
  .au-check input { flex: none; width: 22px; height: 22px; margin: 0; }
  .au-check a.au-link { display: inline-block; padding: 14px 2px; margin: -14px 0; }
  .au-link-btn { min-height: 44px; padding: 0 6px; font-size: 14px; }
  .au-link-btn i { font-size: 15px; }
  .au-meta-row { justify-content: center; text-align: center; row-gap: 0; }
  .au-meta { font-size: 13.5px; }
  .au-lang { top: 6px; right: 8px; }
  .au-lang-toggle { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .au-lang-opt { min-height: 44px; font-size: 14.5px; }
  /* chữ phụ ≥ 12.5px và tương phản ≥ 4.5:1 (trước: 11.5px, 1.5–3.6:1) */
  .au-label { font-size: 13.5px; }
  .au-optional, .au-divider span { font-size: 12.5px; }
  .au-section-sub, .au-error { font-size: 13.5px; }
  .au-page.au-grid.au-day .au-link, .au-page.au-grid.au-day .au-link-btn { color: #4f46e5; }
  .au-page.au-grid.au-day .au-input::placeholder { color: #6b7a90; }
  .au-page.au-grid.au-day .au-optional, .au-page.au-grid.au-day .au-divider span { color: #64748b; }
  .au-page.au-grid.au-day .au-error { color: #b91c1c; }
  .au-page.au-grid.au-night .au-link, .au-page.au-grid.au-night .au-link-btn { color: #a5b4fc; }
  .au-page.au-grid.au-night .au-input::placeholder { color: #8b95b3 !important; }
  .au-page.au-grid.au-night .au-optional, .au-page.au-grid.au-night .au-divider span { color: #8b95b3 !important; }
  .au-page.au-grid.au-night .au-error { color: #fca5a5; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.3); }
}
/* panel thành công vẫn giữ tiêu đề "Chào mừng trở lại" phía trên "Thành công!" (luật :has TÁCH RIÊNG: trình duyệt cũ bỏ cả luật nếu không hiểu :has) */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  .au-card:has(.au-success:not([hidden])) .au-form-head { display: none; }
}
@media (max-width: 640px) {
  [data-bs-theme="dark"] .fx-terms summary { color: #c4b5fd; }
}

/* ───────── 31. Góp ý / Yêu cầu (.fr-*) ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  .fr-input { font-size: 16px; padding: 12px 14px; }
  .fr-input-wrap .fr-input { padding-left: 40px; }
  .fr-textarea { min-height: 140px; }
  .fr-btn-submit { min-height: 48px; font-size: 15px; }
  .fr-list-head .fr-refresh { width: 44px; height: 44px; }
  .fr-list-head .fr-tab { min-height: 44px; line-height: 1.2; }
  .fr-page-btn { width: 44px; height: 44px; }
  .fr-page-btn .ri-arrow-left-s-line { display: block; }   /* style.css:6308 ẩn .ri-arrow-left-s-line toàn cục → nút "trang trước" thành vòng tròn rỗng */
  /* chữ quá nhỏ (rem × 14px): nhãn 10.9px, chú thích 8.5px, huy hiệu/thời gian 10px */
  .fr .dep-subtitle { font-size: 13.5px; }
  .fr-label { font-size: 13.5px; }
  .fr-optional { font-size: 12px; }
  .fr-flow-k { font-size: 11px; }
  .fr-step-t { font-size: 14px; }
  .fr-step-d { font-size: 12.5px; }
  .fr-dropzone .fr-dz-main { font-size: 14px; }
  .fr-dropzone .fr-dz-sub { font-size: 12px; }
  .fr-hint { font-size: 12px; }
  .fr-input-wrap > i.fr-ct-z { font-size: 11px; }
  .fr-who { font-size: 13.5px; }
  .fr-item:hover { transform: none; }
  .fr-you { font-size: 11.5px; }
  .fr-badge { font-size: 12px; padding: 4px 11px; }
  .fr-content { font-size: 15px; }
  .fr-meta { font-size: 12px; }
  .fr-note { font-size: 13px; overflow-wrap: anywhere; }
  .fr-page-info { font-size: 13.5px; }
  .fr-img-count { font-size: 12px; }
  .tx-count-badge#frCount { font-size: 12px; }
  /* nút ✕ xoá ảnh 18×18 → ô 28px nhìn thấy + vùng chạm 44px */
  .fr-img-del { width: 28px; height: 28px; top: 4px; right: 4px; font-size: 16px; }
  .fr-img-del::before { content: ""; position: absolute; inset: -8px; }
}
/* vùng cuộn lồng nhau: danh sách cuộn riêng (max-height 70vh, style.css ≤992px) trong trang cũng cuộn → kẹt cử chỉ; để trang cuộn */
@media (max-width: 640px), (max-width: 992px) and (pointer: coarse) {
  .fr-list-body { max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .fr-list { grid-template-columns: minmax(0, 1fr); }   /* 1fr = minmax(auto,1fr): ghi chú admin chứa URL dài làm cả cột nở rộng */
  .fr-item { min-width: 0; padding: 14px; }
  .fr-content, .fr-who { overflow-wrap: anywhere; }
  /* đầu thẻ danh sách: hàng 1 = tiêu đề + đếm + ⟳, hàng 2 = hai tab rộng đủ, không bẻ chữ */
  .fr-list-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 8px; padding: 8px 10px 10px 16px; }
  .fr-list-actions { display: contents; }
  .fr-list-title { grid-column: 1; }
  .fr-list-head .fr-refresh { grid-column: 2; grid-row: 1; }
  .fr-tabs { grid-column: 1 / -1; grid-row: 2; display: flex; }
  .fr-list-head .fr-tab { flex: 1 1 0; justify-content: center; text-align: center; padding: 6px 8px; font-size: 13px; }
  /* lưới ảnh đang soạn: ô vuông co theo cột; dải 3 bước chiếm ~250px trước ô nhập → gọn thành 3 ô icon + tiêu đề */
  .fr-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
  .fr-img-item { width: auto; height: auto; aspect-ratio: 1; }
  .fr-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fr-flow-step { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 8px; }
  .fr-flow-ic { width: 34px; height: 34px; font-size: 17px; }
  .fr-flow-k, .fr-step-d { display: none; }
}
@media (max-width: 400px) {
  .fr-list-head .fr-tab i { display: none; }
}

/* ───────── 32. Trang Chào mừng nhúng (iframe /welcome?embed=1 — welcome.html nạp tệp này) ───────── */
@media (max-width: 640px) {
  /* `.wl-embed .wl-chips` (0,2,0) đè luật ≤640/≤400 (0,1,0) và ép cột tối thiểu 300px → tràn nhóm ở 360/375/390 */
  .wl-embed .wl-chips { grid-template-columns: minmax(0, 1fr); }
  /* đầu nhóm: hàng 1 = icon + tiêu đề + số công cụ, hàng 2 = nút "Khám phá" rộng hết (trước đó ép tiêu đề còn 28–98px) */
  .wl-group-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px; }
  .wl-group-link { grid-column: 1 / -1; justify-content: center; margin-left: 0; min-height: 44px; }
  .wl-count { white-space: nowrap; }
}

/* ═════════════════════════ HOME: Auto Check · Check Live · Phiên Facebook · Auto Monitor · Lấy 2FA — D4 ═════════════════════════
   Luật gốc .ac-/.fbs-/.tfa-/.st-/.tx-table nằm sau khối mobile của style.css (≈9197) → dùng #viaPanel để thắng độ đặc hiệu. */

/* ───────── 33. Auto Check (view auto-check) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .ac-card-head { flex-wrap: wrap; gap: 8px; padding: 12px; }
  #viaPanel .ac-card-head .ac-head-divider { display: none; }
  #viaPanel .ac-card, #viaPanel .ac-zalo-gate { border-radius: 14px; }
  #viaPanel .ac-card-head .ac-search { flex: 1 1 200px; min-width: 0; }
  #viaPanel .ac-hbtn-menu { left: auto; right: 0; }
  /* vùng chạm + cỡ chữ (tab 31px, ô giờ 28px, ô tìm 11,5px, chữ huy hiệu 9,5px) */
  #viaPanel .ac-card-head .ac-cat-chip, #viaPanel .ac-card-head .ac-hbtn, #viaPanel .ac-card-head .ac-search,
  #viaPanel .ac-card-head .ac-hour-box, #viaPanel .ac-card-head .nh-ac-btn { height: 44px; }
  #viaPanel .ac-card-head .nh-ac-tabs { height: 44px; }
  #viaPanel .ac-card-head .nh-ac-tab { min-height: 36px; }
  #viaPanel .ac-card-head .nh-ac-tab-badge { height: 20px; font-size: 11px; }
  #viaPanel .ac-card-head .ac-hm-pick { min-height: 36px; padding: 4px 6px; }
  #viaPanel .ac-search-input { font-size: 16px; }
  /* menu thả Danh mục / Lọc / Giờ + menu chuột phải: mục cao ≥ 44px */
  #viaPanel .ac-cat-opt, #viaPanel .ac-filter-opt { min-height: 44px; }
  #viaPanel .ac-hm-opt { min-height: 40px; }
  #viaPanel .ac-filter-check { width: 20px; height: 20px; }
  #acContextMenu .dropdown-item { min-height: 44px; display: flex; align-items: center; }
}
@media (max-width: 640px) {
  /* hàng đầu thẻ: tab | danh mục + Lọc + Nhập | tìm kiếm | giờ báo cáo + Lưu */
  #viaPanel .ac-card-head .nh-ac-tabs { flex: 1 1 100%; height: 44px; }
  #viaPanel .ac-card-head .nh-ac-tab { flex: 1 1 0; justify-content: center; min-height: 36px; padding: 6px 6px; gap: 4px; font-size: 13px; white-space: nowrap; }
  #viaPanel .ac-card-head .ac-cat-chip { flex: 1 1 0; min-width: 0; height: 44px; }
  #viaPanel .ac-card-head .ac-cat-chip-value { flex: 1 1 auto; min-width: 0; max-width: none; }
  #viaPanel .ac-card-head .ac-hbtn { height: 44px; padding: 0 14px; }
  #viaPanel .ac-card-head .ac-search { flex: 1 1 100%; height: 44px; }
  #viaPanel .ac-card-head .ac-hour-inline { flex: 1 1 100%; height: auto; gap: 8px; }
  #viaPanel .ac-card-head .ac-hour-box { flex: 1 1 auto; height: 44px; justify-content: space-between; }
  #viaPanel .ac-card-head .nh-ac-btn { height: 44px; padding: 0 16px; }
  /* chân thẻ: 2 hộp thống kê → 1 dòng chảy, không tràn; chừa chỗ nút chat nổi bên phải; "Bôi đen" (kéo chuột chọn vùng) không có trên cảm ứng */
  #viaPanel .ac-card .nh-ac-foot { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 4px 14px; padding: 10px 56px 10px 14px; }
  #viaPanel .ac-stats-grp { display: contents; }
  #viaPanel .ac-stat-item { padding: 0; border: 0; font-size: 12.5px; }
  #viaPanel .ac-stat-item .badge { font-size: 11.5px; padding: 3px 7px; }
  #viaPanel .ac-stat-item:has(#acBoiden) { display: none; }
  /* cổng kết nối Zalo (chưa liên kết): 3 nút cùng độ rộng, xếp dọc, cao 44px */
  #viaPanel .ac-zalo-gate { padding: 28px 20px; gap: 12px; }
  #viaPanel .ac-zalo-gate-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; }
  #viaPanel .ac-zalo-gate-btn { justify-content: center; min-height: 44px; }
  #viaPanel .ac-zalo-code { font-size: 26px; letter-spacing: 3px; }
}
@media (max-width: 380px) {
  /* Lọc / Nhập chỉ còn icon để ô Danh mục còn chỗ */
  #viaPanel .ac-card-head .ac-hbtn > span, #viaPanel .ac-card-head .ac-hbtn-caret { display: none; }
  #viaPanel .ac-card-head .ac-hbtn { min-width: 44px; padding: 0 12px; justify-content: center; }
}
/* màn nhỏ HOẶC thấp (điện thoại xoay ngang): trang cuộn, bảng có chiều cao đọc được — trước đây bảng bị bóp còn 0–2 dòng */
@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  #viaPanel .ac-page { overflow-y: auto; padding-bottom: 72px !important; }   /* style.css:9322 đặt .ac-page{padding:12px!important} */
  #viaPanel .ac-card { flex: none; min-height: 0; }
  #viaPanel .ac-card .nh-ac-body, #viaPanel .ac-card .nh-ac-panel.is-active, #viaPanel .ac-tbl-wrap { flex: none; min-height: 0; }
  #viaPanel .ac-aggrid { flex: none; height: 360px; height: clamp(260px, 56dvh, 460px); }
  #viaPanel .ac-title, #viaPanel .ac-header { display: none; }
}

/* ───────── 34. Check Live (iframe /check-live?embed=1 — check-live.html nạp tệp này với media="(pointer: coarse)") ─────────
   Mọi luật gắn (pointer: coarse): bề rộng iframe ≠ bề rộng cửa sổ — cửa sổ máy tính ~860px làm iframe chỉ còn ~440px. */
@media (max-width: 1024px) and (pointer: coarse) {
  .cf-actions .cf-pill, .clv-auth .cf-pill { min-height: 44px; padding: 8px 12px; justify-content: center; }
  .cf-textarea { font-size: 16px; }
  .clv-embed .cf-page { padding-bottom: 72px; }   /* nút chat nổi của app nằm đè góc phải-dưới khung iframe */
  .mt-card-head-row { flex-wrap: wrap; }
  .mt-card-head-row > span { white-space: nowrap; }
}
@media (max-width: 640px) and (pointer: coarse) {
  .clv-embed .cf-page > .cf-header { display: none; }   /* trong app đã có tên trang ở thanh tiêu đề */
  .cf-input-card .mt-card-head-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .cf-input-card .cf-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .cf-input-card .cf-actions .cf-pill { padding: 8px 2px; font-size: 12.5px; gap: 3px; }
  .cf-progress-row { align-items: flex-start; gap: 12px; }
  .cf-progress-row .cf-progress-text { min-width: 0; line-height: 1.35; }
  .cf-progress-row .cf-progress-percent { flex-shrink: 0; }
}
@media (max-height: 500px) and (pointer: coarse) {
  .clv-embed .cf-page > .cf-header { display: none; }
}
@media (max-width: 380px) and (pointer: coarse) {
  .cf-input-card .cf-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ───────── 35. Phiên Facebook (view fb-sessions): bảng 6 cột → danh sách thẻ ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .fbs-table-wrap { overflow-x: hidden; padding-bottom: 64px; }   /* nút chat nổi 44px đè góc phải-dưới: chừa đáy để mục cuối cuộn lên trên nó */
  #viaPanel .fbs-table, #viaPanel .fbs-table tbody { display: block; width: 100%; }
  #viaPanel .fbs-table thead { display: none; }
  /* dòng 1 = UID, dòng 2 = IP + thời gian bên phải, dòng 3 = trình duyệt; nút Xóa icon 44×44 */
  #viaPanel .fbs-table tbody tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 44px; grid-template-areas: "n u u a" "n ip t a" "n br br a"; align-items: center; column-gap: 8px; row-gap: 2px; padding: 12px 8px 12px 14px; border-bottom: 1px solid #f1f5f9; }
  #viaPanel .fbs-table tbody tr:last-child { border-bottom: 0; }
  #viaPanel .fbs-table tbody td { padding: 0; border: 0; min-width: 0; }
  #viaPanel .fbs-table tbody td:nth-child(1) { grid-area: n; }
  #viaPanel .fbs-table tbody td:nth-child(2) { grid-area: u; }
  #viaPanel .fbs-table tbody td:nth-child(3) { grid-area: ip; }
  #viaPanel .fbs-table tbody td:nth-child(4) { grid-area: br; }
  #viaPanel .fbs-table tbody td:nth-child(5) { grid-area: t; text-align: right; }
  #viaPanel .fbs-table tbody td:nth-child(6) { grid-area: a; }
  #viaPanel .fbs-table tbody tr:hover td { background: transparent; }
  #viaPanel .fbs-num { font-size: 12.5px; color: #94a3b8; }
  #viaPanel .fbs-uid-link { font-size: 15px; min-height: 36px; max-width: 100%; }
  #viaPanel .fbs-cell-muted, #viaPanel .fbs-time { font-size: 12.5px; }
  #viaPanel .fbs-cell-muted, #viaPanel .fbs-browser { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #viaPanel .fbs-btn-delete { width: 44px; height: 44px; padding: 0; gap: 0; justify-content: center; border-radius: 12px; font-size: 0; }
  #viaPanel .fbs-btn-delete i { font-size: 18px; }
  #viaPanel .fbs-table tbody tr:has(> .fbs-empty) { display: block; padding: 0; border: 0; grid-column: 1 / -1; }
  [data-bs-theme="dark"] #viaPanel .fbs-table tbody tr { border-bottom-color: rgba(255, 255, 255, 0.1); }
  [data-bs-theme="dark"] #viaPanel .fbs-table tbody tr:hover td { background: transparent !important; }
  [data-bs-theme="dark"] #viaPanel .fbs-num { color: #64748b; }
}
@media (max-width: 640px) {
  /* đầu thẻ: tiêu đề một dòng, cụm [hạn mức | Xóa tất cả] xuống hàng dưới */
  #viaPanel .fbs-card > .mt-card-head { flex-wrap: wrap; row-gap: 8px; }
  #viaPanel .fbs-head-actions { flex: 1 1 auto; flex-wrap: nowrap; justify-content: space-between; }
  #viaPanel .fbs-head-actions > .fbs-quota, #viaPanel .fbs-head-actions > .mt-pill { height: 36px; font-size: 12.5px; }
  #viaPanel .fbs-head-actions > .mt-pill { margin-left: auto; }
}
@media (max-height: 500px) and (pointer: coarse) {
  #viaPanel .fbs-header { display: none; }
  #viaPanel .fbs-page { padding-top: 10px !important; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .fbs-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #viaPanel .fbs-table tbody tr:nth-child(odd):not(:has(> .fbs-empty)) { border-right: 1px solid #f1f5f9; }
  [data-bs-theme="dark"] #viaPanel .fbs-table tbody tr:nth-child(odd):not(:has(> .fbs-empty)) { border-right-color: rgba(255, 255, 255, 0.1); }
}

/* ───────── 36. Auto Monitor BM/UID (view monitor): bảng 8 cột → thẻ ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .sec-inp { font-size: 16px; min-height: 44px; padding: 10px 12px; }
  #viaPanel .mon-toolbar .sec-inp-wrap .sec-inp { padding-right: 12px; }
  #viaPanel .st-btn { min-height: 44px; justify-content: center; }
  /* lưới 12 cột đều nhau — dòng 1: [loại] [giá trị] · dòng 2: [trạng thái] [thời gian kiểm tra] · dòng 3: [nhãn] · dòng 4: [kiểu] [bật] [kiểm tra][xóa]
     (markup via.js:9312: 8 <td> theo thứ tự loại, giá trị, nhãn, kiểu, bật, trạng thái, kiểm tra lúc, nút) */
  #viaPanel .tx-table-wrap { overflow-x: hidden; }
  #viaPanel .tx-table, #viaPanel .tx-table tbody { display: block; width: 100%; min-width: 0; }
  #viaPanel .tx-table thead { display: none; }
  #viaPanel .tx-table tbody tr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; gap: 6px 8px; margin-bottom: 10px; padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
  #viaPanel .tx-table tbody td { padding: 0; border: 0; min-width: 0; }
  #viaPanel .tx-table tbody td:nth-child(1):not(.tx-empty) { grid-column: 1 / span 2; grid-row: 1 / span 2; align-self: start; justify-self: start; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
  #viaPanel .tx-table tbody td:nth-child(2) { grid-column: 3 / span 10; grid-row: 1; overflow-wrap: anywhere; font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #viaPanel .tx-table tbody td:nth-child(6) { grid-column: 3 / span 4; grid-row: 2; justify-self: start; }
  #viaPanel .tx-table tbody td:nth-child(7) { grid-column: 7 / span 6; grid-row: 2; text-align: right; font-size: 11.5px; line-height: 1.3; color: #64748b; }
  #viaPanel .tx-table tbody td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  #viaPanel .tx-table tbody td:nth-child(4) { grid-column: 1 / span 4; grid-row: 4; font-size: 12px; color: #64748b; }
  #viaPanel .tx-table tbody td:nth-child(4) .sec-inp { min-height: 44px; padding-right: 24px; }
  #viaPanel .tx-table tbody td:nth-child(5) { grid-column: 5 / span 2; grid-row: 4; display: flex; align-items: center; justify-content: center; min-height: 44px; }
  #viaPanel .tx-table tbody td:nth-child(5) .mon-act { width: 24px !important; height: 24px !important; }
  #viaPanel .tx-table tbody td:nth-child(8) { grid-column: 8 / span 5; grid-row: 4; justify-self: end; display: flex; gap: 8px; }
  #viaPanel .tx-table tbody td:nth-child(8) .cx-icon-btn { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; padding: 0; }
  #viaPanel .tx-table tbody tr:hover td { background: transparent; }
  #viaPanel .tx-table tbody tr:has(> .tx-empty) { display: block; padding: 0; margin: 0; background: none; border: 0; }
  [data-bs-theme="dark"] #viaPanel .tx-table tbody tr { background: #1b2433; border-color: rgba(255, 255, 255, 0.1); }
  [data-bs-theme="dark"] #viaPanel .tx-table tbody tr:hover td { background: transparent !important; }
  [data-bs-theme="dark"] #viaPanel .tx-table tbody tr:has(> .tx-empty) { background: none; border: 0; }
  [data-bs-theme="dark"] #viaPanel .tx-table tbody td:nth-child(1):not(.tx-empty) { background: rgba(99, 102, 241, 0.2); color: #a5b4fc !important; }
  [data-bs-theme="dark"] #viaPanel .tx-table tbody td:nth-child(4), [data-bs-theme="dark"] #viaPanel .tx-table tbody td:nth-child(7) { color: #94a3b8 !important; }
}
/* hero gọn 1 hàng — trước: khối tím cao 340px chiếm trọn màn hình ngang 844×390 */
@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  #viaPanel .st-page { padding: 12px 12px 80px; max-width: none; }
  #viaPanel .st-hero { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: 16px; }
  #viaPanel .st-hero-icon { width: 44px; height: 44px; border-radius: 12px; }
  #viaPanel .st-hero-icon i { font-size: 22px; }
  #viaPanel .st-hero-title { font-size: 16px; }
  #viaPanel .st-hero-sub { margin-top: 2px; font-size: 12.5px; line-height: 1.45; }
}
@media (max-width: 640px) {
  #viaPanel .st-card { margin-bottom: 12px; border-radius: 14px; }
  #viaPanel .st-card-head { padding: 12px 14px; gap: 12px; flex-wrap: nowrap; }
  #viaPanel .st-card-head-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
  #viaPanel .st-card-body { padding: 14px; }
  /* biểu mẫu: lưới 2 cột thay cho flex-wrap so le (style="flex:…" nội tuyến trên từng .sec-field) */
  #viaPanel .mon-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  #viaPanel .mon-toolbar .sec-field { min-width: 0; }
  #viaPanel .mon-toolbar > .st-btn { width: 100%; }
  #viaPanel #monSetForm .sec-field:first-child, #viaPanel #monAddForm .sec-field:nth-child(3), #viaPanel #monAddForm .sec-field:nth-child(4) { grid-column: 1 / -1; }
  #viaPanel #monBatchForm .mon-toolbar { grid-template-columns: 1fr; }
  /* ô "Bật": hộp 44px, checkbox 24px (đang bị style nội tuyến 20px) */
  #viaPanel .sec-field:has(#monEnabled) .sec-inp-wrap { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
  #viaPanel #monEnabled { width: 24px !important; height: 24px !important; }
  [data-bs-theme="dark"] #viaPanel .sec-field:has(#monEnabled) .sec-inp-wrap { border-color: #2c313b; background: #1a2029; }
  /* đầu thẻ danh sách: tiêu đề một dòng, "Lần chạy gần nhất" + nút "Kiểm tra ngay" xuống hàng dưới */
  #viaPanel .hm-view[data-view="monitor"] .mt-card-head-row { flex-wrap: wrap; row-gap: 8px; }
  #viaPanel .hm-view[data-view="monitor"] .mt-card-head-row > .d-flex { flex: 1 1 100%; justify-content: space-between; }
  #viaPanel #monLastRun { font-size: 12px; line-height: 1.3; min-width: 0; flex: 1 1 0; white-space: normal; }   /* .st-card-desc là nowrap → dòng dài đẩy nút "Kiểm tra ngay" ra ngoài thẻ */
  #viaPanel #monCheckNow { white-space: nowrap; min-height: 36px; padding: 0 12px; font-size: 12.5px; margin-left: auto; flex: none; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .tx-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #viaPanel .tx-table tbody tr { margin-bottom: 0; }
  #viaPanel .tx-table tbody tr:has(> .tx-empty) { grid-column: 1 / -1; }
}

/* ───────── 37. Lấy 2FA (view 2fa-gen) ───────── */
/* trang cuộn được; mỗi thẻ có chiều cao tự nhiên (không còn danh sách cuộn lồng nhau — trước: ≈1,9 mục ở 390×844, 0px khi xoay ngang) */
@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  #app .hm-view.active[data-view="2fa-gen"] { overflow-y: auto; }
  #viaPanel .tfa-page { flex: none; min-height: 0; overflow: visible; padding-bottom: 76px !important; }   /* style.css:9322 đặt .tfa-page{padding:12px!important} */
  #viaPanel .tfa-grid { flex: none; min-height: 0; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #viaPanel .tfa-col { overflow: visible; min-height: 0; min-width: 0; }
  #viaPanel .tfa-card-body { flex: none; }
  #viaPanel .tfa-list { flex: none; min-height: 0; overflow: visible; padding-right: 0; }
  #viaPanel .tfa-title, #viaPanel .tfa-header { display: none; }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .tfa-input { font-size: 16px; min-height: 44px; }
  #viaPanel .tfa-input-row .tfa-input { flex: 1 1 0; min-width: 0; }
  #viaPanel .tfa-btn-add { min-width: 48px; min-height: 44px; }
  #viaPanel .tfa-item { height: auto; min-height: 88px; }
  #viaPanel .tfa-actions { gap: 8px; }
  #viaPanel .tfa-act-btn { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
  #viaPanel .tfa-col > .mt-card-head .cf-pill { min-height: 36px; padding: 0 12px; font-size: 12.5px; }
}
@media (max-width: 640px) {
  #viaPanel .tfa-card-body { padding: 12px; }
  #viaPanel .tfa-item { padding: 12px 12px 12px 14px; gap: 8px; }
  #viaPanel .tfa-code { font-size: 26px; min-height: 40px; display: inline-flex; align-items: center; margin-top: 0; }
  #viaPanel .tfa-secret { font-size: 11.5px; }
  /* gợi ý "chạm để sao chép" bằng icon (trước: chỉ có title= khi rê chuột) — không thêm chữ mới nên không cần từ điển */
  #viaPanel .tfa-code::after { content: "\ecd5"; font-family: "remixicon" !important; font-size: 16px; font-weight: 400; letter-spacing: 0; margin-left: 10px; color: #94a3b8; }
}

/* ═════════════════════════ HOME: Mail tạm · Lưu note · CTV · iframe công cụ — D5 ═════════════════════════ */

/* ───────── 38. Điện thoại dọc ───────── */
@media (max-width: 640px) {
  /* iframe Text Tools / Đọc mail: cao ĐÚNG bằng vùng nhìn thấy (= .account-wrapper), không còn 100vh-78px */
  .hm-view[data-view="text-tools"] > iframe, .hm-view[data-view="hotmail"] > iframe {
    height: calc(100vh - 112px) !important;
    height: calc(100dvh - 112px - env(safe-area-inset-bottom, 0px)) !important;
  }
  /* MAIL TẠM — form tạo email: lưới 2 cột, ô nhập 44px/16px (hết zoom iOS), nút 44px */
  .mt-page .mt-create-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; align-items: end; }
  .mt-page .mt-create-form .mt-field { flex: none; min-width: 0; }
  .mt-page .mt-create-form .mt-field-grow, .mt-page .mt-create-form .mt-field:has(#mtServer) { grid-column: 1 / -1; }
  .mt-page .mt-create-form:has(.mt-field[style*="display: none"]) .mt-field:has(#mtDomain) { grid-column: 1 / -1; }
  .mt-page .mt-create-form .mt-input { min-height: 44px; font-size: 16px; }
  .mt-page .mt-create-form .mt-btn { width: 100%; min-width: 0; min-height: 44px; }
  /* đầu thẻ: nút (Copy/Xóa/Kiểm tra/Copy & Xóa) không bị đẩy ra ngoài khi nhãn dài; chữ nút không rớt dòng */
  .mt-page .mt-card-head-row { flex-wrap: nowrap; gap: 10px; }
  .mt-page .mt-card-head-row > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  .mt-page .mt-card-head-row > .mt-pill, .mt-page .mt-card-head-row > .mt-list-actions { flex: none; }
  .mt-page .mt-pill { min-height: 36px; padding: 0 12px; white-space: nowrap; }
  .mt-page .mt-list-actions { gap: 8px; }
  /* mục danh sách: nút Copy / Xóa 40px, cách nhau 8px (xóa là thao tác phá hủy, không có xác nhận) */
  .mt-page .mt-item-actions { gap: 8px; }
  .mt-page .mt-icon-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .mt-page .mt-item-email { font-size: 14px; }
  .mt-page .mt-item-badge { font-size: 11px; }
  /* thư: OTP là nội dung chính → to, bấm được; tiêu đề tối đa 2 dòng */
  .mt-page .mt-otp-badge { min-height: 34px; padding: 0 12px; font-size: 14px; }
  .mt-page .mt-link-btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
  .mt-page .mt-msg-subj { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .mt-page .mt-link-action { min-width: 40px; min-height: 40px; justify-content: center; }
  .mt-page .mt-link-row { padding: 4px 4px 4px 10px; }
  .mt-page .mt-label { font-size: 11.5px; }
  /* hộp thoại đọc thư (khung đã do mục 11): tiêu đề ≤2 dòng — Swal đặt style="display:block" nội tuyến lên <h2> nên cần !important */
  .swal2-popup.mt-modal .swal2-title { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px !important; padding: 8px 40px 0 0 !important; margin: 0 0 6px !important; }
  .swal2-popup.mt-modal .swal2-html-container { padding: 4px 0 0 !important; }
  .swal2-popup.mt-modal .mt-modal-meta { flex-wrap: nowrap; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; }
  .swal2-popup.mt-modal .mt-modal-meta > div:first-child { flex: 1 1 auto; min-width: 0; }
  .swal2-popup.mt-modal .mt-modal-meta > div:first-child > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .swal2-popup.mt-modal .mt-modal-meta > div:last-child { flex: none; white-space: nowrap; }
  /* LƯU NOTE */
  .nt-page { overflow-y: auto !important; }
  .nt-page .nt-grid { grid-template-columns: minmax(0, 1fr); flex: 0 0 auto; }
  .nt-page .nt-editor-card, .nt-page .nt-side { min-width: 0; flex: none; }
  .nt-page .nt-textarea { flex: none; height: clamp(180px, 30dvh, 280px); min-height: 180px; font-size: 16px; }
  .nt-page .nt-toolbar .mt-input, .nt-page .nt-search-row input { font-size: 16px; min-height: 44px; }
  .nt-page .nt-toolbar .mt-btn { min-height: 44px; }
  .nt-page .nt-search-row { padding: 4px 14px; }
  .nt-page .nt-list { flex: none; overflow: visible; }
  /* thẻ note: tiêu đề full-width (tối đa 2 dòng), hàng dưới = ngày (trái) + 4 nút 40px (phải) */
  .nt-page .nt-item-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "date actions"; align-items: center; gap: 2px 8px; margin-bottom: 6px; }
  .nt-page .nt-item-meta { display: contents; }
  .nt-page .nt-item-title { grid-area: title; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow: hidden; overflow-wrap: anywhere; font-size: 14px; }
  .nt-page .nt-item-date { grid-area: date; margin: 0; font-size: 11px; }
  .nt-page .nt-item-actions { grid-area: actions; gap: 4px; }
  .nt-page .nt-action-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .nt-page .nt-item-preview { max-height: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; font-size: 12px; }
  /* toast (Mail tạm / 2FA / Check live): dưới thanh tiêu đề, giữa màn hình */
  #mtToastBox { top: calc(52px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; align-items: stretch; }
  #mtToastBox .mt-toast { max-width: none; }
  /* CTV (và mọi trang .st-page): thống kê 2 cột, bảng cuộn ngang có bóng ở mép */
  .st-page .cx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .st-page .cx-stat { padding: 12px 14px; gap: 6px; min-width: 0; }
  .st-page .cx-stat-ic { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
  .st-page .cx-stat-val { font-size: clamp(15px, 4.7vw, 20px); overflow-wrap: anywhere; }
  .st-page .cx-stat-lbl { font-size: 12px; }
  .st-page .tx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    background:
      linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) 0 0 / 28px 100% no-repeat local,
      linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) 100% 0 / 28px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)) 0 0 / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)) 100% 0 / 12px 100% no-repeat scroll; }
  [data-bs-theme="dark"] .st-page .tx-table-wrap {
    background:
      linear-gradient(to right, #232e3d 30%, rgba(35, 46, 61, 0)) 0 0 / 28px 100% no-repeat local,
      linear-gradient(to left, #232e3d 30%, rgba(35, 46, 61, 0)) 100% 0 / 28px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0)) 0 0 / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0)) 100% 0 / 12px 100% no-repeat scroll; }
  .st-page .tx-table { min-width: 520px; font-size: 13px; }
  .st-page .tx-table thead th { padding: 9px 12px; font-size: 11px; }
  .st-page .tx-table tbody td { padding: 11px 12px; white-space: nowrap; }
  .st-page .tx-table tbody td:first-child { white-space: normal; min-width: 150px; }
}
/* hero các trang .st-* (CTV, Monitor, Cài đặt…): gọn trên điện thoại dọc + ngang + tablet nhỏ cảm ứng (trước: cột dọc cao ~190px, ngang 340px) */
@media (max-width: 640px), (pointer: coarse) and (max-width: 900px) {
  .st-page { padding: 12px 12px 24px; }
  .st-page .st-hero { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; margin-bottom: 14px; }
  .st-page .st-hero-icon { width: 40px; height: 40px; border-radius: 12px; }
  .st-page .st-hero-icon i { font-size: 20px; }
  .st-page .st-hero-title { font-size: 17px; }
  .st-page .st-hero-sub { font-size: 12.5px; margin-top: 2px; }
}

/* ───────── 39. Mail tạm / Lưu note: điện thoại NGANG + tablet cảm ứng (≤1100px) ───────── */
@media (pointer: coarse) and (min-width: 641px) and (max-width: 1100px) {
  .mt-page { overflow-y: auto !important; }
  .mt-page > .mt-grid { flex: 0 0 auto; }
  .mt-page .mt-list-card, .mt-page .mt-inbox-card { flex: none; }
  .mt-page .mt-right-col .mt-inbox-card { flex: none; }
  .mt-page .mt-inbox-body { min-height: 200px; }
  .mt-page .mt-list-body { max-height: min(340px, 45dvh); }
  .mt-page .mt-card-head-row { flex-wrap: nowrap; gap: 10px; }
  .mt-page .mt-card-head-row > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  .mt-page .mt-card-head-row > .mt-pill, .mt-page .mt-card-head-row > .mt-list-actions { flex: none; }
  .mt-page .mt-pill { min-height: 36px; padding: 0 12px; white-space: nowrap; }
  .mt-page .mt-icon-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .mt-page .mt-item-actions { gap: 8px; }
  .mt-page .mt-otp-badge { min-height: 34px; padding: 0 12px; font-size: 14px; }
  .mt-page .mt-input { min-height: 44px; font-size: 16px; }
  .mt-page .mt-create-form .mt-btn { min-height: 44px; }
  .nt-page { overflow-y: auto !important; }
  .nt-page .nt-grid { grid-template-columns: minmax(0, 1fr); flex: 0 0 auto; }
  .nt-page .nt-editor-card, .nt-page .nt-side { min-width: 0; flex: none; }
  .nt-page .nt-textarea { flex: none; height: clamp(180px, 30dvh, 280px); min-height: 180px; font-size: 16px; }
  .nt-page .nt-toolbar .mt-input, .nt-page .nt-search-row input { font-size: 16px; min-height: 44px; }
  .nt-page .nt-list { flex: none; overflow: visible; }
  .nt-page .nt-item-title { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .nt-page .nt-action-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .nt-page .nt-item-preview { max-height: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
}
/* iPad ngang / điện thoại ngang rất rộng: giữ 2 cột như thiết kế gốc nhưng KHÔNG cho nội dung đẩy cột nở ra */
@media (pointer: coarse) and (min-width: 900px) and (max-width: 1100px) {
  .mt-page > .mt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
  .nt-page .nt-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
}

/* ═════════════════════════ HOME: Trợ lý AI (meta-ai) + Quay & Sửa màn hình (screen-studio) — D6 ═════════════════════════
   index.html nạp tệp này SAU meta-ai.css và screen-studio.css để luật cùng độ đặc hiệu ở đây thắng. */

/* ───────── 40. Trợ lý AI — lỗi chung điện thoại + tablet cảm ứng ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* biến --fx-* KHÔNG được định nghĩa ở đâu trong repo → ở chế độ tối chữ rơi về #1a1a1a trên nền tối (trả lời AI 1.25:1, tiêu đề, ô nhập) */
  [data-bs-theme="dark"] .mai-page {
    --fx-text: #f1f5f9; --fx-muted: #94a3b8; --fx-card: #232e3d; --fx-card-dark: #232e3d;
    --fx-border: rgba(255, 255, 255, 0.12); --fx-border-dark: rgba(255, 255, 255, 0.12);
    --fx-input-bg: rgba(255, 255, 255, 0.06); --fx-code-bg: #0f172a;
    --fx-accent-bg: rgba(129, 140, 248, 0.2); --fx-accent: #c7d2fe;
  }
  [data-bs-theme="dark"] .mai-msg-body code { background: rgba(255, 255, 255, 0.12); }
  [data-bs-theme="dark"] .mai-thinking-label { color: #a5b4fc; }
  /* khối code làm bóng tin nhắn dài ~1800px: thân tin nhắn là flex item có min-width:auto → cho co lại để <pre> tự cuộn ngang */
  .mai-msg-body { min-width: 0; max-width: 100%; }
  .mai-msg-body pre { max-width: 100%; white-space: pre; -webkit-overflow-scrolling: touch; }
  /* <br> thừa trước/sau khối code (_md đổi \n → <br> cả ngoài <pre>) */
  .mai-msg-body br:has(+ pre), .mai-msg-body br:has(+ br + pre), .mai-msg-body pre + br, .mai-msg-body pre + br + br { display: none; }
  /* khối "Suy nghĩ": meta-ai.js:613 chèn nó LÀM ANH EM của thân tin nhắn trong .mai-msg (flex hàng) → lưới 2 cột, Suy nghĩ ở trên, câu trả lời ở dưới */
  .mai-msg.ai { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; align-items: start; }
  .mai-msg.ai .mai-msg-avatar { grid-row: 1 / span 2; }
  .mai-msg.ai .mai-thinking, .mai-msg.ai .mai-msg-body { grid-column: 2; }
  .mai-msg.ai .mai-msg-body { justify-self: start; }
  /* Remix Icon 3.3.0 không có ri-robot-2-* → glyph trống (header, welcome, avatar AI): dùng glyph robot có sẵn */
  .mai-header-icon i::before, .mai-msg.ai .mai-msg-avatar i::before { content: "\f091"; }   /* ri-robot-fill */
  .mai-welcome-icon i::before { content: "\f092"; }                                         /* ri-robot-line */
  /* nút chat nổi (.sup-chat) đè nút Gửi → ẩn ở màn này */
  body:has(.hm-view.active[data-view="meta-ai"]) .sup-chat:not(.open):not(.sup-unread) { opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none; visibility: hidden; }
  /* meta-ai.js (_connectError) gắn .mai-offline vào #maiPage → khoá ô nhập thay vì để gõ/gửi mà không có phản hồi */
  .mai-page.mai-offline .mai-input-wrap { opacity: 0.5; pointer-events: none; }
  /* ô nhập/Gửi: ≥16px (iOS/iPadOS không tự phóng to), nút Gửi 44px */
  .mai-textarea { font-size: 16px; line-height: 1.4; }
  .mai-send-btn { width: 44px; height: 44px; font-size: 18px; }
  .mai-connect-input { font-size: 16px; min-height: 44px; }   /* ô dán cookie (chưa kết nối): 13px → iOS tự phóng to */
  .mai-connect-btn { min-height: 44px; }
}
/* ───────── 41. Trợ lý AI — bố cục điện thoại dọc ───────── */
@media (max-width: 640px) {
  /* tên trang đã ở thanh 44px → bỏ icon + tiêu đề lặp; hàng điều khiển gọn */
  .mai-header { padding: 6px 12px; gap: 8px; }
  .mai-header-icon, .mai-header-text h2 { display: none; }
  .mai-header-text p { display: flex; align-items: center; font-size: 13px; }
  .mai-hdr-btn { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
  .mai-think-toggle { min-height: 44px; padding: 0 6px; font-size: 13px; gap: 8px; }
  .mai-think-sw { width: 36px; height: 20px; border-radius: 10px; }
  .mai-think-sw::after { width: 16px; height: 16px; }
  .mai-think-toggle input:checked + .mai-think-sw::after { transform: translateX(16px); }
  /* khung chat tràn mép: bỏ lớp "thẻ trong thẻ" (mất 40px ngang), bong bóng rộng hơn, chữ ≥ 14px */
  .mai-chat { margin: 0; border-radius: 0; border-width: 1px 0 0; }
  .mai-messages { padding: 12px 12px 8px; gap: 10px; overscroll-behavior: contain; }
  .mai-msg { max-width: 94%; }
  .mai-msg.user .mai-msg-avatar { display: none; }
  .mai-msg.ai { grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; }
  .mai-msg-avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 14px; }
  .mai-msg-body { padding: 10px 14px; font-size: 15px; line-height: 1.55; }
  .mai-msg-body pre { font-size: 12.5px; }
  .mai-thinking { font-size: 13px; padding: 8px 12px; }
  /* ô nhập: vùng chạm 44px, nút gửi tròn */
  .mai-input-wrap { padding: 8px 12px; gap: 8px; }
  .mai-textarea { min-height: 44px; max-height: 108px; padding: 10px 14px; border-radius: 22px; }
  .mai-send-btn { border-radius: 50%; }
  /* trạng thái trống: bỏ tiêu đề thứ 3, chip gợi ý xếp dọc dễ chạm */
  .mai-welcome { padding: 24px 16px; }
  .mai-welcome h3 { display: none; }
  .mai-welcome p { font-size: 14px; line-height: 1.55; }
  .mai-suggestions { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; }
  .mai-sug-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 22px; text-decoration: none; }
}
/* màn thấp (nằm ngang / bàn phím ảo): giữ ô nhập + nút Gửi trong khung nhìn */
@media (max-height: 520px) and (max-width: 640px), (max-height: 520px) and (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .mai-header { padding: 4px 12px; }
  .mai-header-text { display: none; }
  .mai-header-actions { margin-left: auto; }
  .mai-messages { padding: 8px 12px; }
  .mai-input-wrap { padding: 6px 12px; }
  .mai-textarea { min-height: 40px; max-height: 64px; }
}

/* ───────── 42. Quay & Sửa màn hình (screen-studio) ───────── */
@media (max-width: 640px) {
  .ss-rec-card { padding: 24px 16px; }
  .ss-opt { min-height: 48px; padding: 8px 2px; font-size: 14px; }
  .ss-opt > span:first-child { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
  .ss-opt small { flex: 0 0 calc(100% - 25px); margin-left: 25px; font-size: 12px; line-height: 1.4; }   /* gợi ý xuống DƯỚI nhãn */
  .ss-btn-lg { width: 100%; min-height: 48px; font-size: 15px; }
  .ss-rec-hint { font-size: 12px; }
  .ss-select { font-size: 16px; min-height: 44px; }
}
/* editor một cột, bỏ bảng 340px cuộn lồng (điện thoại + tablet cảm ứng ≤900px) */
@media (max-width: 640px), (max-width: 900px) and (pointer: coarse) {
  .ss-page { overflow: visible; }
  .ss-editor { gap: 12px; }
  /* khung xem trước + thanh phát DÍNH trên cùng khi cuộn bảng điều khiển bên dưới */
  .ss-editor-main { position: sticky; top: 0; z-index: 6; gap: 8px; padding: 0 0 8px; background: #fafafb; box-shadow: 0 8px 10px -9px rgba(15, 23, 42, 0.3); }
  .ss-preview-wrap { flex: 0 0 auto; }
  .ss-canvas { width: auto; max-width: 100%; max-height: 30vh; max-height: 30dvh; }   /* khung dọc 9:16 không đẩy hết bảng điều khiển khỏi màn */
  .ss-transport { flex-wrap: wrap; gap: 8px 10px; }
  .ss-icon-btn { width: 44px; height: 44px; }
  .ss-time { flex: 1 1 auto; font-size: 13px; }
  .ss-transport > .ss-btn-sm { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .ss-timeline { order: 9; flex: 1 0 100%; }   /* timeline xuống hàng riêng, rộng hết */
  .ss-tl-handle { width: 16px; }
  .ss-tl-handle::before { content: ""; position: absolute; inset: -4px -10px; }   /* vùng chạm ~36px, nhìn vẫn 16px */
  .ss-panel { max-height: none; overflow: visible; }
  .ss-tabs { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .ss-tabs::-webkit-scrollbar { display: none; }
  .ss-tabs .ss-tab { flex: 0 0 auto; min-width: 64px; min-height: 56px; padding: 8px 10px; font-size: 11px; white-space: nowrap; scroll-snap-align: start; }   /* tab thứ 6 ló ra → gợi ý vuốt ngang */
  .ss-tabpane { overflow: visible; flex: 0 0 auto; padding: 16px 12px 20px; }
  /* thanh Xuất dính đáy: 1 hàng [Xuất MP4][Xuất GIF][↻] */
  .ss-panel-foot { position: sticky; bottom: 0; z-index: 6; flex-direction: row; align-items: stretch; gap: 8px; padding: 8px 12px; background: #fff; border-radius: 0 0 14px 14px; }
  .ss-panel-foot .ss-btn-row { flex: 1 1 auto; }
  .ss-panel-foot .ss-btn { min-width: 0; min-height: 44px; padding: 6px 8px; font-size: 14px; line-height: 1.2; white-space: normal; text-align: center; }
  #ssNewBtn { flex: 0 0 44px; width: 44px; padding: 0; font-size: 0; gap: 0; }   /* chỉ icon ↻ */
  #ssNewBtn i { font-size: 20px; }
  /* linh kiện trong bảng: chữ ≥ 12px, vùng chạm ≥ 40–44px */
  .ss-field { margin-bottom: 16px; }
  .ss-field > label { font-size: 13px; }
  .ss-seg { flex-wrap: wrap; row-gap: 4px; }
  .ss-seg button { flex: 1 1 auto; min-width: 56px; }
  .ss-seg button, .ss-tgl { min-height: 40px; font-size: 12.5px; padding: 8px 8px; }
  .ss-btn-sm { min-height: 44px; font-size: 13px; padding: 0 12px; }
  .ss-hint { font-size: 12.5px; }
  .ss-field input[type="range"] { height: 32px; }
  .ss-field input[type="color"] { height: 44px; }
  .ss-dir-grid { grid-template-columns: repeat(3, 44px); }
  .ss-dir-grid button { width: 44px; height: 44px; }
  .ss-swatch { width: 44px; height: 32px; }
  .ss-textarea, .ss-cap-text { font-size: 16px; }
  .ss-cap-time { font-size: 12px; padding: 10px 4px; }
  .ss-cap-del, .ss-atrack-del { min-width: 44px; min-height: 44px; font-size: 18px; }
  .ss-wall span { font-size: 11px; }
  .ss-tl-sr { font-size: 10px; }
}
/* chế độ tối + nút chat nổi không đè thanh Xuất / nút Bắt đầu khi editor đang mở */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  [data-bs-theme="dark"] .ss-editor-main { background: #1b2433; }
  [data-bs-theme="dark"] .ss-btn.ss-btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: transparent; color: #fff; }
  [data-bs-theme="dark"] .ss-btn.ss-btn-danger:not(.ss-btn-ghost) { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: transparent; color: #fff; }
  [data-bs-theme="dark"] .ss-panel-foot { background: #232e3d; }
  [data-bs-theme="dark"] .ss-tab { color: #94a3b8; }
  [data-bs-theme="dark"] .ss-tab:hover, [data-bs-theme="dark"] .ss-tab.active { color: #c4b5fd; }
  [data-bs-theme="dark"] .ss-tab.active { border-bottom-color: #818cf8; }
  [data-bs-theme="dark"] .ss-time, [data-bs-theme="dark"] .ss-seg button { color: #94a3b8; }
  [data-bs-theme="dark"] .ss-seg button.active { color: #c4b5fd; }
  [data-bs-theme="dark"] .ss-field > label b, [data-bs-theme="dark"] .ss-cap-time { color: #a5b4fc; }
  body:has(.hm-view.active[data-view="screen-studio"] #ssEditor:not([hidden])) .sup-chat:not(.open):not(.sup-unread) { opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none; visibility: hidden; }
}
/* nằm ngang (điện thoại 844×390 / 740×360 rơi vào luật tablet cảm ứng): 2 cột, không còn xem trước cao hơn cả màn */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  .ss-header { display: none; }
  .ss-page { padding: 8px 12px; gap: 8px; }
  .ss-rec-card { max-width: none; margin: 0; padding: 16px 20px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
  .ss-rec-visual { display: none; }
  .ss-rec-opts { flex: 1 1 380px; }
  .ss-rec-card > .ss-btn-lg { flex: 0 0 260px; }
  .ss-rec-hint { flex: 1 1 100%; font-size: 12px; }
  .ss-editor { flex-direction: row; align-items: flex-start; gap: 12px; }
  .ss-editor-main { position: sticky; top: 0; flex: 1 1 58%; min-width: 0; }
  .ss-canvas { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); }
  .ss-panel { flex: 1 1 42%; width: auto; max-height: calc(100dvh - 60px); overflow: hidden; }
  .ss-tabpane { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: 12px; }
  .ss-panel-foot { position: static; }
}

/* ═════════════════════════ THẺ TÍNH NĂNG (#adPanel) — /ads /bm /page /group /profile /pixel — A1..A4 ═════════════════════════
   Mọi thẻ cùng một khuôn: .card[data-feature] > .p-3 (đầu: ⠿ + icon + tên · công tắc + ⓘ + ✕) + .border-top (ruột).
   Bốn đề xuất cùng chủ đề được gộp thành MỘT bộ vùng chạm cho cả 6 trang. modern-theme.css hay !important → vỏ #adPanel viết "#app #adPanel …". */

/* ───────── 43. Đầu thẻ + nhịp danh sách ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* nhịp: gap inline 10px + margin-bottom 12px (modern-theme.css:747) = 22px → một khoảng 12px */
  #app #adPanel [id$="SortableCards"] { gap: 12px !important; }
  #app #adPanel [id$="SortableCards"] > .card[data-feature] { margin-bottom: 0 !important; }
  /* cân mép trái/phải (scrollbar-gutter:stable chừa 8px bên phải) + cuộn-vào-vùng-nhìn chừa thanh dính */
  #app #adPanel > .flex-grow-1 { scrollbar-gutter: auto; scroll-padding-top: 64px; scroll-padding-bottom: 24px; }
  /* đầu thẻ: vùng chạm ≥44px, glyph giữ nguyên */
  #app #adPanel .card[data-feature] > .p-3:first-child { padding: 4px 4px 4px 8px !important; }
  #app #adPanel .card[data-feature] > .p-3:first-child .form-check { min-height: 52px; }
  #app #adPanel .card[data-feature] > .p-3:first-child label.form-check-label { min-width: 0; flex: 1 1 auto; padding-right: 8px; }
  #app #adPanel .card[data-feature] > .p-3:first-child label.form-check-label > i { flex: none; }
  #app #adPanel .card[data-feature] > .p-3:first-child label.form-check-label .fw-bold { font-size: 14px; font-weight: 700 !important; line-height: 1.3; text-wrap: balance; }
  #app #adPanel .card[data-feature] .drag-handle { flex: none; align-items: center; justify-content: center; width: 28px; height: 44px; margin: 0 2px 0 0 !important; font-size: 18px !important; touch-action: none; }
  #app #adPanel .card[data-feature] > .p-3:first-child .form-check > .d-flex { gap: 0 !important; }
  #app #adPanel .card[data-feature] > .p-3:first-child input[role="switch"] { position: relative; margin: 0 6px 0 4px !important; }
  #app #adPanel .card[data-feature] > .p-3:first-child input[role="switch"]::after { content: ""; position: absolute; inset: -12px -6px; }
  #app #adPanel .card[data-feature] .btn-feature-info,
  #app #adPanel .card[data-feature] .btn-hide-feature { display: inline-flex !important; align-items: center; justify-content: center; box-sizing: border-box; flex: 0 0 38px; width: 38px; height: 44px; margin: 0 !important; line-height: 1; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
  #app #adPanel .card[data-feature] .btn-hide-feature { margin-left: 6px !important; }   /* ✕ (ẩn tính năng, KHÔNG hỏi lại) cách ⓘ 6px để chạm lệch không ẩn nhầm */
  /* không "dính hover" sau khi chạm (modern-theme.css:438,755) + thẻ ĐANG BẬT nổi lên khi cuộn danh sách dài: vạch tím bên trái */
  #app #adPanel .card[data-feature]:hover { transform: none !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03) !important; }
  #app #adPanel .card[data-feature]:has(> .p-3:first-child input[role="switch"]:checked) { box-shadow: inset 3px 0 0 #8b5cf6, 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03) !important; }
  /* tối: công tắc TẮT dịu hơn (track #d1d5db chói trên thẻ tối); ⠿ #ccc trên nền trắng chỉ 1.6:1 */
  [data-bs-theme="dark"] #app #adPanel .card[data-feature] .form-switch .form-check-input:not(:checked) { background-color: #44546a !important; }
  [data-bs-theme="dark"] #app #adPanel .card[data-feature] .form-switch .form-check-input:not(:checked)::before { background-color: #cbd5e1; }
  :root:not([data-bs-theme="dark"]) #app #adPanel .card[data-feature] > .p-3:first-child .drag-handle { color: #8a94a6 !important; }
}
/* điện thoại dọc: cột thẻ cân hai bên — bỏ rãnh cuộn 8px (cảm ứng không cần) */
@media (max-width: 640px) {
  #app #adPanel > .flex-grow-1 { scrollbar-width: none; }
  #app #adPanel > .flex-grow-1::-webkit-scrollbar { display: none; }
  body.mtab-fn .sup-chat.sup-unread { right: auto; left: 12px; }   /* chat có tin chưa đọc: sang góc trái ở tab Chức năng để không che công tắc */
}

/* ───────── 44. Ruột thẻ: ô nhập, Select2, nút phụ, hàng chọn, ô kết quả ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* ô nhập ≥16px (iOS không tự phóng to khi chạm) — [data-feature] thuần vì 6 công cụ /page sống ngoài #adPanel */
  [data-feature] :is(.form-control, .form-select, select, textarea, input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"], [type="range"], [type="color"])) { font-size: 16px !important; }
  #app #adPanel .card[data-feature] :is(input.form-control, select.form-select, button.form-control):not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
  #app #adPanel .card[data-feature] textarea.form-control { line-height: 1.4; }
  /* placeholder nhỏ hơn chữ nhập (iOS chỉ xét cỡ chữ của chính ô) + "…" thay vì cắt giữa chữ */
  #app #adPanel .card[data-feature] :is(input.form-control, textarea.form-control)::placeholder { font-size: 14px; }
  #app #adPanel .card[data-feature] input.form-control { text-overflow: ellipsis; }
  [data-feature] .form-label { font-size: 13.5px; margin-bottom: 8px !important; }   /* mb-1 (4px) và mb-2 (8px) trộn lẫn giữa các thẻ → một nhịp 8px */
  [data-feature] .row.mb-2 { margin-bottom: 16px !important; }
  #app #adPanel .card[data-feature] .badge { font-size: 12px; }
  #app #adPanel .card[data-feature] .quyen-fmt-chip .quyen-fmt-grip { font-size: 12px; }
  /* Select2 một lựa chọn: cao bằng .form-control 16px (46px), cùng cỡ chữ */
  [data-feature] .select2-container--default .select2-selection--single { height: 46px; box-shadow: none !important; border-color: var(--bs-border-color, #dee2e6); }   /* bóng 0 2px 4px của style.css:6416 làm Select2 khác hẳn .form-control cạnh nó */
  [data-feature] .select2-container--default .select2-selection--single .select2-selection__rendered { font-size: 16px; line-height: 44px; padding-left: 14px; }
  [data-feature] .select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px; top: 1px; }
  /* hàng ≥3 cột (col-4×3) → 2 + 1: mỗi ô còn ≥120px ở 360px; hàng 2 cột chứa ô ID/chữ → xếp dọc (ID BM 16 chữ số không lọt nửa cột) */
  /* X1-01: :has() với [class*="col-"] (khớp chuỗi con trên class) làm Chrome tính lại kiểu của MỌI .row tổ tiên mỗi khi 1 class đổi (chạm 1 ô lưới: 11→83ms ở CPU 4×) → liệt kê tường minh các lớp cột mà thẻ tính năng dùng (card.html chỉ có col, col-3…col-9, col-12) */
  #app #adPanel .card[data-feature] .row:has(> :is(.col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12):nth-child(3)) { --bs-gutter-y: 0.75rem; }
  #app #adPanel .card[data-feature] .row:has(> :is(.col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12):nth-child(3)) > :is(.col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12) { flex: 0 0 auto; width: 50%; }
  [data-feature] .row:has(> :is(.col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12) input[type="text"]):not(:has(> :is(.col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12):nth-child(3))) > :is(.col, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12) { flex: 0 0 100%; max-width: 100%; width: 100%; }
  /* ô kết quả (textarea) + 2 nút Copy/Xoá: tách rời, 38×34, cách nhau 8px (gốc: tab 32–34×22 dính nhau; Xoá KHÔNG hỏi lại) */
  [data-feature] .textarea-copy-btn { padding: 11px 14px !important; }
  #app #adPanel .card[data-feature] div:has(> textarea.form-control + .textarea-copy-btn) > textarea.form-control { padding-top: 48px; min-height: 148px; }
  #app #adPanel .card[data-feature] .textarea-copy-btn,
  #app #adPanel .card[data-feature] .textarea-clear-btn { position: absolute !important; top: 6px !important; width: 38px; height: 34px; padding: 0 !important; justify-content: center; align-items: center; font-size: 17px !important; border: 1px solid #dee2e6 !important; border-radius: 10px !important; z-index: 4 !important; }
  #app #adPanel .card[data-feature] .textarea-copy-btn { right: 6px !important; }
  #app #adPanel .card[data-feature] .textarea-clear-btn { right: 52px !important; }
  /* nút/chip nhỏ trong thân thẻ → cao ≥32px (pill Auto/Thêm số/Reset/Ngẫu nhiên/Bảng thống kê/Tắt auto/Load/∞/⊕, icon ☁, mắt 👁) */
  #app #adPanel .card[data-feature] :is(#backupEmailModeToggle, #resetEmailSL, #backupLinkStatsBtn, #renameBmModeToggle, #nhanPoolBtn) { display: inline-flex !important; align-items: center; min-height: 32px; padding: 0 12px !important; font-size: 12px !important; }
  #app #adPanel .card[data-feature] #nhanPoolBtnClose { min-height: 32px; top: -16px !important; padding: 0 12px !important; font-size: 12px !important; }
  #app #adPanel .card[data-feature] .btn.btn-sm { min-height: 36px; font-size: 13px; }
  #app #adPanel .card[data-feature] i.ri-download-cloud-2-line { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; margin: -8px -8px -8px 0; }
  #app #adPanel .card[data-feature] .infinity-toggle,
  #app #adPanel .card[data-feature] #igLoginBtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: 0 !important; }
  #app #adPanel .card[data-feature] .fx-pwd-wrap > input { padding-right: 44px; }
  #app #adPanel .card[data-feature] .fx-pwd-toggle { right: 0; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  #app #adPanel .card[data-feature] .control-btn.btn.border.w-100 { min-height: 40px; }
  /* hàng tích chọn / radio / công tắc phụ: cả hàng bấm được, cao 44px */
  #app #adPanel .card[data-feature] .form-check:not(.form-switch) { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-left: 0; margin-bottom: 0; }
  #app #adPanel .card[data-feature] .form-check:not(.form-switch) > .form-check-input { float: none; margin: 0; width: 22px; height: 22px; flex: none; }
  #app #adPanel .card[data-feature] .form-check:not(.form-switch) > .form-check-label { margin: 0 !important; padding: 10px 0; flex: 1; }
  #app #adPanel .card[data-feature] label.d-flex:has(> .form-switch) { padding-top: 11px !important; padding-bottom: 11px !important; }
  [data-feature] .border.rounded > label.justify-content-between { min-height: 44px; }   /* hàng công tắc phụ (Cập nhật Avatar / Change bio / Nhét Page vào BM …) 38 → 44px */
  /* tối: viền ô kết quả + 2 khối nền sáng cứng (inline thiếu dấu cách nên rule [style*="background: #…"] không bắt) + ☁ #1e55d1 chìm trên nền tối (2,1:1) */
  [data-bs-theme="dark"] #app #adPanel .card[data-feature] div:has(> textarea.form-control + .textarea-copy-btn)::after { border-color: rgba(255, 255, 255, 0.14); }
  [data-bs-theme="dark"] #app #adPanel .card[data-feature] #cpMoreBox { background: rgba(255, 255, 255, 0.04) !important; border-color: rgba(255, 255, 255, 0.12) !important; }
  [data-bs-theme="dark"] #app #adPanel .card[data-feature] #nhanPoolBtnClose { background: #2a2230 !important; }
  [data-bs-theme="dark"] #app #adPanel .card[data-feature] :is(.textarea-copy-btn, .textarea-clear-btn) { border-color: rgba(255, 255, 255, 0.14) !important; }
  [data-bs-theme="dark"] #app #adPanel i[id^="btnLoad"] { color: #60a5fa !important; }
  /* hộp xổ Select2 (gắn <body>, ngoài #adPanel): dòng ≥44px, chữ 16px, ô tìm 44px.
     (F1-01: KHÔNG ẩn ô tìm theo số kết quả đang hiện — gõ lọc còn <8 kết quả thì ô tìm biến mất giữa lúc đang gõ, mất focus + bàn phím) */
  body .select2-container--default .select2-results__option { font-size: 16px; padding: 12px 14px; min-height: 44px; }
  body .select2-container--default .select2-search--dropdown .select2-search__field { font-size: 16px; height: 44px; }
  body .select2-container--default .select2-results > .select2-results__options { max-height: min(336px, 45vh); }
}
@media (max-height: 520px) and (pointer: coarse) {
  body > .select2-container--open .select2-results__options { max-height: 132px !important; }   /* landscape thấp: danh sách thấp hơn để lật lên được */
}

/* ───────── 45. Thanh trên danh sách thẻ: ô tìm + Sắp xếp/Thêm ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #app #adPanel .fx-fsearch-input { height: 40px; }
  #app #adPanel .fx-fsearch-ic { font-size: 16px; }
  #app #adPanel .fx-fsearch-clear { right: 16px; width: 40px; justify-content: center; font-size: 18px; }
}
/* điện thoại dọc + nằm ngang: một hàng [ô tìm | Sắp xếp | Thêm] thay vì hai thanh dính chiếm ~96px */
@media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
  #app #adPanel > .flex-grow-1:has(> [id$="SortableCards"]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; align-content: start; }
  #app #adPanel > .flex-grow-1 > .fx-fsearch { grid-column: 1; grid-row: 1; top: 0; padding: 6px 4px 6px 12px; border-bottom: 0; box-shadow: 0 1px 0 #e5e7eb; }
  #app #adPanel > .flex-grow-1 > .fx-fsearch .fx-fsearch-input { height: 40px; text-overflow: ellipsis; }
  #app #adPanel > .flex-grow-1 > .fx-fsearch .fx-fsearch-ic { left: 24px; top: 6px; bottom: 6px; }
  #app #adPanel > .flex-grow-1 > .fx-fsearch .fx-fsearch-clear { right: 12px; top: 6px; bottom: 6px; }
  #app #adPanel > .flex-grow-1 > .d-flex.align-items-center.justify-content-between { grid-column: 2; grid-row: 1; padding: 6px 12px 6px 0 !important; min-height: 0 !important; top: 0; box-shadow: 0 1px 0 #e5e7eb; justify-content: flex-end !important; }
  #app #adPanel > .flex-grow-1 > [id$="SortableCards"] { grid-column: 1 / -1; grid-row: 2; }
  #app #adPanel > .flex-grow-1 > .d-flex.align-items-center.justify-content-between > span:first-child { display: none; }   /* "Chức năng n/N" đã có ở tab phía trên */
}
[data-bs-theme="dark"] #app #adPanel > .flex-grow-1 > .fx-fsearch,
[data-bs-theme="dark"] #app #adPanel > .flex-grow-1 > .d-flex.align-items-center.justify-content-between { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08); }
/* màn thấp (nằm ngang / bàn phím ảo): thanh dính cuộn đi cùng danh sách */
@media (max-height: 520px) and (pointer: coarse) {
  #app #adPanel > .flex-grow-1 { scroll-padding-top: 8px; }
  #app #adPanel > .flex-grow-1 > .d-flex[style*="sticky"] { position: static !important; }
  #app #adPanel .fx-fsearch { position: relative !important; }   /* relative (không static): icon kính lúp + nút ✕ là absolute, cần hộp chứa */
}
/* tablet cảm ứng: nút "Sắp xếp / Thêm" của ngăn kéo cao 23px, chữ 11px (inline) */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #app #adPanel > .flex-grow-1 > .d-flex .btn.btn-sm { min-height: 40px; padding: 0 16px !important; font-size: 13px !important; }
}

/* ───────── 46. /page + /group: ruột riêng từng công cụ (6 công cụ /page sống ngoài #adPanel nên dùng [data-feature] thuần) ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  [data-feature] :is(.par-chk, .psd-chk) { min-height: 44px; display: flex; align-items: center; }   /* ô tick "Nhắn tin riêng…" / "Xáo trộn thứ tự bình luận": nhãn cao 19px → 44px */
  [data-feature] .db-sw2::before { content: ""; position: absolute; inset: -10px -6px; }            /* công tắc .db-sw2 42×24: vùng chạm 54×44 */
  /* chân ghi chú .db-foot ("Tick các Page … rồi bấm Bắt đầu …"): đang flex icon/chữ/<b>/chữ thành 3–4 cột → "Bắt đầu" vỡ thành cột hẹp 2 dòng */
  [data-feature] :is(.db-foot, .db-hint) { display: block !important; position: relative; padding-left: 22px; font-size: 12.5px !important; line-height: 1.5 !important; color: #64748b !important; }
  [data-feature] :is(.db-foot, .db-hint) > i { position: absolute; left: 2px; top: 2px; }
  [data-bs-theme="dark"] [data-feature] :is(.db-foot, .db-hint) { color: #94a3b8 !important; }
  [data-feature] .db-adv-lbl { font-size: 12px !important; color: #64748b !important; }   /* "CÀI ĐẶT NÂNG CAO" 11px #94a3b8 (2.5:1) */
  [data-bs-theme="dark"] [data-feature] .db-adv-lbl { color: #94a3b8 !important; }
  /* page-tuong-tac · "Cấu hình chung": 3 cột 90px → 2 cột + hàng công tắc */
  [data-feature="page-tuong-tac"] .ptt-cfggrid { grid-template-columns: 1fr 1fr; row-gap: 12px; }
  [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld:nth-child(2) { padding-right: 0; }
  [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld:last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 0 0; border-left: 0; border-top: 1px solid #eef2f7; }
  [data-bs-theme="dark"] [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld:last-child { border-top-color: #2e3947; }
  [data-feature="page-tuong-tac"] .ptt-cfggrid .db-sw2 { margin-top: 0; }
  [data-feature="page-tuong-tac"] .ptt-react span { width: 44px; height: 44px; }   /* chip cảm xúc 38px → 44px */
  [data-feature="page-auto-reply"] .par-add { min-height: 44px; }                   /* "Thêm quy tắc" 37px → 44px */
  /* page-theo-doi · KPI 4 cột → 2×2; ⓘ chỉ có tooltip title (cảm ứng không rê chuột) → chạm (focus, tabindex=0) hiện bong bóng; bảng 8 cột có bóng mờ hai mép */
  [data-feature="page-theo-doi"] .ptd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-feature="page-theo-doi"] .ptd-sh { position: relative; }
  [data-feature="page-theo-doi"] .ptd-tip { box-sizing: content-box; padding: 9px; margin: -9px; }
  [data-feature="page-theo-doi"] .ptd-tip:focus::after { content: attr(title); position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 6; padding: 8px 10px; border-radius: 10px; background: #0f172a; color: #fff; font: 500 12.5px/1.45 inherit; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3); }
  [data-feature="page-theo-doi"] .ptd-tw {
    background:
      linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left center / 28px 100% no-repeat local,
      linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) right center / 28px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)) left center / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)) right center / 10px 100% no-repeat scroll,
      #fff;
  }
  [data-feature="page-theo-doi"] .ptd-xs, [data-feature="page-theo-doi"] .ptd-ff > button { min-height: 36px; }   /* nút phụ khối kết quả 28–30px → 36px; chip lọc 28px → 36px */
  /* tối: chữ nhãn quyền (inline #475569) gần như vô hình trên nền #1b2433 */
  [data-bs-theme="dark"] :is(#themDoiTacPermLabel, #pageAssetGroupPermLabel) { color: #cbd5e1 !important; }
  /* trạng thái rỗng của danh sách thẻ */
  .fx-feat-empty-btn { height: 44px; padding: 0 20px; font-size: 14px; }
  .fx-feat-empty-sub { font-size: 13px; color: #64748b; }
  .fx-feat-empty-title { font-size: 15px; }
}

/* ───────── 47. /ads: nút phụ riêng + /profile: workspace "Công cụ profile" và "Nuôi tài khoản" ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* ☁︎ lấy ID / ↻ load Pixel: vùng chạm 40px mà KHÔNG đổi bề cao hàng */
  #app #adPanel #btnLoadBmAdminIds, #app #adPanel #btnLoadAdsAdminIds, #app #adPanel #btnLoadAdPartnerIds, #app #adPanel #loadPixelBtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; font-size: 22px !important; border-radius: 10px; }
  /* "Tất cả/Trừ tôi/Chỉ tôi" (xoá admin) — select cỡ nhỏ inline 12px; viên "Ngẫu nhiên/Lần lượt" (đổi tên) */
  #app #adPanel #loadAdsAdminMode { font-size: 16px !important; height: 40px; padding: 6px 36px 6px 12px !important; }
  #app #adPanel [data-parent="removeAdminMode"] > .d-flex { flex-wrap: wrap; gap: 8px; }
  #app #adPanel [data-parent="removeAdminMode"] > .d-flex > .d-flex { flex: 1 1 100%; justify-content: space-between; }
  #app #adPanel #renameAdsModeToggle { position: relative; font-size: 12px !important; padding: 5px 12px !important; line-height: 1.2; }
  #app #adPanel #renameAdsModeToggle::before { content: ""; position: absolute; inset: -9px -4px; }
  /* cặp Tiền tệ | Timezone (đổi thông tin): chuỗi tz dài → xếp dọc; Lên Camp: khe giữa nhóm Cơ bản|Chi tiết và ô "Chế độ" */
  #app #adPanel #ciCurrencyBox .row > .col-6 { flex: 0 0 100%; max-width: 100%; }
  #app #adPanel #ciCurrencyBox .row > .col-6 + .col-6 { margin-top: 12px; }
  #app #adPanel .lc-variant-toggle { margin-bottom: 12px; }
}
@media (max-width: 640px) {
  /* workspace "Công cụ profile": nav thành dải ngang như .adt-panel */
  .pqm-ws-profile .pqm-main { flex-direction: column; }
  .pqm-ws-profile .pqm-nav { width: auto; flex: 0 0 auto; flex-direction: row; gap: 6px; padding: 8px 10px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid #eef2f7; scrollbar-width: none; }
  .pqm-ws-profile .pqm-nav::-webkit-scrollbar { display: none; }
  .pqm-ws-profile .pqm-nav-group { display: flex; gap: 6px; flex: none; }
  .pqm-ws-profile .pqm-nav-lbl { display: none; }
  .pqm-ws-profile .pqm-nav-item { width: auto; margin: 0; white-space: nowrap; padding: 0 14px; min-height: 44px; flex: none; }
  .pqm-ws-profile .pqm-brand-s { display: none; }
  .pqm-ws-profile .pqm-panel { inset: 8px; }
  .pqm-hep.pqm-ws-profile .pqm-work { margin: 0; max-width: none; width: 100%; }   /* .pqm-hep .pqm-work {margin:0 auto; max-width:1320px} (modern-theme.css:8353) làm cột co về 0 khi .pqm-main xếp dọc */
  [data-bs-theme="dark"] .pqm-ws-profile .pqm-nav { border-bottom-color: #2e3947; }
  /* Nuôi tài khoản: băng điều khiển xuống dòng, chip + tab + bánh răng đủ vùng chạm */
  .pft-nuoi { padding: 14px 12px 24px; }
  .pft-nuoi-band { padding: 12px; gap: 12px; }
  .pft-nuoi-bleft { flex-wrap: wrap; width: 100%; }
  .pft-nuoi-bstat { flex: 1 1 140px; min-width: 0; }
  .pft-nuoi-run { margin-left: 0; min-height: 44px; flex: 1 1 auto; justify-content: center; }
  .pft-nuoi-gic { width: 44px; height: 44px; }
  .pft-nuoi-chips { width: 100%; }
  .pft-nuoi-chip { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .pft-nuoi-chipsel, .pft-nuoi-chipnum { font-size: 16px; min-height: 32px; }
  .pft-nuoi-chipnum { width: 40px; }
  .pft-nuoi-tab { min-height: 40px; }
  .pft-nuoi-tcfg { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
  .pft-nuoi-tact { top: 8px; right: 8px; gap: 4px; }
  .pft-nuoi-grid { grid-template-columns: minmax(0, 1fr); }
  .pft-nuoi-pop { padding: 12px; }
  .pft-nuoi-pop-card { padding: 16px; max-height: calc(100dvh - 24px); }
  .pft-nuoi-pop-x { width: 40px; height: 40px; }
  .pft-nuoi-sinp { font-size: 16px; min-height: 44px; }
  .pft-nuoi-pop-done { min-height: 44px; padding: 0 28px; }
}

/* ═════════════════════════ Đọc mail (hotmail.html — iframe trong HOME, nạp tệp này với media="(pointer: coarse)") — B3 + D5 ═════════════════════════
   html:has(.hm-wrap) = chỉ trang này (hotmail.html không có class trên <body>); luật chung của Bootstrap (.modal-*, .form-control, .btn-close) đi kèm tiền tố đó. */

/* ───────── 48. Đọc mail ───────── */
@media (max-width: 640px), (pointer: coarse) and (max-width: 1100px) {
  html:has(.hm-wrap) body { padding: 12px; font-size: 14px; }
  .hm-wrap { gap: 12px; min-height: 0; }
  /* hero gọn, biểu ngữ không tràn; dòng mô tả dài 3 dòng chỉ tốn chỗ (tên trang đã ở thanh tiêu đề app) */
  .hm-hero { padding: 12px 14px; gap: 10px; border-radius: 14px; }
  .hm-hero-left { gap: 10px; width: 100%; }
  .hm-hero-icon { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
  .hm-hero-title-row { flex-wrap: wrap; row-gap: 2px; }
  .hm-hero-title { font-size: 15px; }
  .hm-hero-sub { display: none; }
  .hm-hero-banner { width: 100%; min-width: 0; flex-shrink: 1; padding: 6px 12px; font-size: 11.5px; }
  .hm-card { border-radius: 14px; }
  /* đầu thẻ: tiêu đề 1 dòng, cụm nút xuống hàng riêng, chia đều */
  .hm-card-head { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .hm-card-title { white-space: nowrap; }
  .hm-card-head > .d-flex { flex: 1 1 100%; }
  .hm-card-head > .d-flex > .hm-btn { flex: 1 1 0; }
  .hm-btn { height: 44px; font-size: 14px; padding: 0 16px; }
  /* bảng tài khoản → thẻ (không cần cuộn ngang; OTP / Link / thao tác hiện ngay) */
  .hm-table-wrap { overflow: visible; }
  .hm-table, .hm-table tbody { display: block; width: 100%; }
  .hm-table thead { display: none; }
  .hm-table tbody tr { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "mail mail mail" "stat otp lnk" "act act act"; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
  .hm-table tbody tr:last-child { border-bottom: 0; }
  .hm-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .hm-table td.ps-3 { padding-left: 0 !important; }   /* Bootstrap ps-3/pe-3 có !important */
  .hm-table td.pe-3 { padding-right: 0 !important; }
  .hm-table tbody tr:hover td { background: none; }
  .hm-table td:nth-child(1) { grid-area: mail; }
  .hm-table td:nth-child(2) { grid-area: stat; }
  .hm-table td:nth-child(3) { grid-area: otp; }
  .hm-table td:nth-child(4) { grid-area: lnk; }
  .hm-table td:nth-child(5) { grid-area: act; }
  .hm-table td:has(> .hm-dash) { display: none; }
  .hm-table td[colspan] { grid-area: auto; grid-column: 1 / -1; }
  .hm-table td:nth-child(5) > .d-flex.justify-content-end { justify-content: space-between !important; gap: 4px !important; }
  .hm-email-cell { display: flex; max-width: 100%; }
  .hm-email-txt { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
  .hm-code-chip { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .hm-act-btn { width: 40px; height: 40px; font-size: 17px; }
  /* thẻ link */
  .hm-side-body { padding: 12px; gap: 10px; }
  .hm-seg-tab { height: 40px; font-size: 13px; }
  .hm-code-area { min-height: 180px; font-size: 13px; }
  html:has(.hm-wrap) .form-control { font-size: 16px !important; min-height: 44px; }
  /* hộp thoại */
  html:has(.hm-wrap) .modal-dialog { margin: 10px auto; }
  html:has(.hm-wrap) .modal-content { border-radius: 16px !important; }
  html:has(.hm-wrap) .modal-header { padding: 12px 14px !important; }
  html:has(.hm-wrap) .modal-body { padding: 14px !important; }
  html:has(.hm-wrap) .modal-footer { padding: 10px 14px !important; gap: 8px; }
  html:has(.hm-wrap) .modal-footer .hm-btn { flex: 1 1 0; }
  html:has(.hm-wrap) .btn-close { flex: none; box-sizing: border-box; width: 44px; height: 44px; padding: 0; background-size: 14px; background-position: center; margin: -8px -10px -8px 8px; }
  .hm-fmt-grid { gap: 6px; margin-bottom: 12px; }
  .hm-fmt-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 8px 10px; }
  .hm-fmt-card strong { margin: 0; font-size: 12px; }
  .hm-fmt-card code { font-size: 12px; }
  #bulkInput { min-height: 160px; font-size: 16px !important; }
  #importResultText { height: min(50vh, 360px); font-size: 13px !important; }
  /* hộp đọc mail */
  #mailModal .modal-content { max-height: calc(100dvh - 20px) !important; }
  #mailModal .modal-header > div { min-width: 0; flex: 1 1 auto; }
  #mailEmail { display: block; overflow-wrap: anywhere; font-size: 12px; }
  #mailModal .modal-content > .px-3 { padding: 10px 12px !important; }
  #mailModal .modal-content > .px-3 > .d-flex, #mailModal .px-3.py-2 > .d-flex { flex-wrap: wrap; }
  #searchSender, #searchKeyword { flex: 1 1 calc(50% - 4px); min-width: 0; }
  #btnFindOtp { flex: 1 1 100%; height: 44px !important; }
  #mailModal .modal-body.p-0 { padding: 0 !important; min-height: 96px; }
  #otpResults { max-height: 38dvh; overflow-y: auto; overscroll-behavior: contain; flex: 0 0 auto; }
  #otpResults .hm-code-chip { min-height: 44px; }
  #otpResults .hm-act-btn { width: 44px !important; height: 44px !important; flex: 0 0 44px; font-size: 16px !important; }
  #otpResults a.text-truncate { display: block; flex: 1 1 auto; min-width: 0; max-width: 100% !important; line-height: 44px; }
  .hm-mail-item { padding: 12px 14px; border-left: 3px solid transparent; }
  #toastBox { top: 10px; left: 12px; right: 12px; align-items: stretch; }
}
/* điện thoại nằm ngang / màn thấp: tiêu đề + chân luôn thấy, thân cuộn (giống .modal-dialog-scrollable) */
@media (pointer: coarse) and (max-height: 500px) {
  #addModal .modal-dialog, #importResultModal .modal-dialog { height: calc(100% - 1rem); }
  #addModal .modal-content, #importResultModal .modal-content { max-height: 100%; }
  #addModal .modal-body, #importResultModal .modal-body { overflow-y: auto; }
}

/* ═════════════════════════ Text Tools (text-tools.html — iframe trong HOME, nạp tệp này với media="(pointer: coarse)") — B3 + D5 ═════════════════════════
   text-tools.html KHÔNG có <body>/class → mọi luật gắn .tt-wrapper hoặc html:has(.tt-wrapper); .tool-btn còn xuất hiện ở setting.html nên không được để trần. */

/* ───────── 49. Text Tools ───────── */
@media (pointer: coarse) {
  .tt-wrapper .tool-tab { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .tt-wrapper .tool-btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
  .tt-wrapper .io-header .tool-btn { min-height: 36px; font-size: 12.5px !important; }
  .tt-wrapper .tool-input, .tt-wrapper .tool-select { min-height: 44px; font-size: 16px; padding: 0 10px; }
  html:has(.tt-wrapper) .form-control-sm { min-height: 44px; font-size: 16px !important; }
  .tt-wrapper .io-area, .tt-wrapper #gqlToken, .tt-wrapper #gqlDocId, .tt-wrapper #gqlVars { font-size: 16px !important; }
  .tt-wrapper .io-area { min-height: 160px; }
  .tt-wrapper .toolbar-row .tool-input[style*="width"] { width: 72px !important; }
  .tt-wrapper .toolbar-row { gap: 8px; }
  /* nhãn inline #64748b trên nền tối chỉ đạt ~3.5:1 */
  [data-bs-theme="dark"] .tt-wrapper .tool-panel [style*="#64748b"],
  [data-bs-theme="dark"] .tt-wrapper .tool-panel [style*="#475569"] { color: #94a3b8 !important; }
}
@media (max-width: 640px), (pointer: coarse) and (max-height: 520px) {
  html:has(.tt-wrapper) body { padding: 12px; }
  .tt-wrapper { min-height: 0; }
  /* tiêu đề + thống kê: thống kê xuống dòng riêng, không bị bóp thành "0 / ký / tự" */
  .tt-wrapper > .d-flex.justify-content-between { flex-wrap: wrap; gap: 6px; margin-bottom: 12px !important; }
  .tt-wrapper > .d-flex.justify-content-between > div:first-child { flex: 1 1 100%; }
  .tt-wrapper .status-bar { flex: 1 1 100%; justify-content: flex-start; gap: 14px; white-space: nowrap; }
  .tt-wrapper .page-title { font-size: 1.05rem; }
  /* 18 tab → một hàng cuộn ngang, mép phải mờ báo còn nữa (trước: 6 hàng × 28px) */
  .tt-wrapper .tool-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 8px 10px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
  .tt-wrapper .tool-tabs::-webkit-scrollbar { display: none; }
  .tt-wrapper .tool-tab { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
  .tt-wrapper .tool-panel { padding: 10px; }
  /* GraphQL: Variables full-width; doc_id + 2 nút xếp lưới 2 cột (hết "Tạo Code F12" rớt 2 dòng) */
  #panel-graphql .col-8, #panel-graphql .col-4 { flex: 0 0 100%; width: 100%; max-width: 100%; }
  #panel-graphql .col-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
  #panel-graphql .col-4 > label, #panel-graphql .col-4 > input { grid-column: 1 / -1; margin-bottom: 0 !important; }
  #panel-graphql .col-4 > .tool-btn { margin-top: 0 !important; }
  #panel-graphql #gqlVars { min-height: 110px !important; }
  html:has(.tt-wrapper) #toastBox { top: 10px !important; left: 12px; right: 12px !important; }
  html:has(.tt-wrapper) #toastBox > div { max-width: none !important; }
}

/* ═════════════════════════ Thiết kế phôi (phoi.html — mở tab mới từ bm.js; <body class="fx-phoi">) — B3 ═════════════════════════ */

/* ───────── 50. Phôi: bảng điều khiển trên cuộn riêng + khung phôi dưới; hộp chọn phôi 2 cột ───────── */
@media (max-width: 900px) and (pointer: coarse), (max-width: 640px) {
  body.fx-phoi { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .fx-phoi .panel.p-3 { height: auto; flex: 0 0 auto; flex-direction: column; gap: 8px; padding: 8px !important; max-height: 46dvh; overflow-y: auto; }
  /* hàng New / Load / Save / Test (2 <input type=file> ẩn nằm cùng hàng nên chỉ nhắm label + button) */
  .fx-phoi .panel > .d-flex:first-child { gap: 8px; }
  .fx-phoi .panel > .d-flex:first-child > label, .fx-phoi .panel > .d-flex:first-child > button { flex: 1 1 0; min-height: 52px; margin: 0 !important; padding-left: 8px !important; padding-right: 8px !important; }
  /* palette: một hàng cuộn ngang, chip 44px */
  .fx-phoi .panel > .border.rounded:nth-child(2) { margin: 0 !important; overflow-x: auto; }
  .fx-phoi .panel .d-inline-flex.flex-wrap { flex-wrap: nowrap !important; padding-right: 0 !important; }
  .fx-phoi .panel .phoi-elm { flex: 0 0 auto; margin: 0 8px 0 0 !important; }
  .fx-phoi .panel .phoi-elm > div { min-height: 44px; display: flex; align-items: center; white-space: nowrap; }
  /* Size / Font / Style / Color */
  .fx-phoi .panel > .border.rounded.d-flex { margin: 0 !important; flex-wrap: wrap; gap: 8px 12px; }
  .fx-phoi .panel > .border.rounded.d-flex > div { margin: 0 !important; }
  .fx-phoi .panel > .border.rounded.d-flex > div:nth-child(2) { flex: 1 1 150px; }
  .fx-phoi .panel select[name="fontFamily"] { width: 100% !important; }
  .fx-phoi .panel input, .fx-phoi .panel select { font-size: 16px !important; min-height: 44px; }
  .fx-phoi .panel #textBold { min-width: 44px; min-height: 44px; }
  .fx-phoi .wrapper { flex: 1 1 auto; width: 100%; height: auto; min-height: 0; padding: 12px; }
  /* hộp chọn phôi: 2 cột, danh sách tự cuộn, tên cắt 2 dòng */
  .fx-phoi #phoiModal .modal-dialog { margin: 8px; height: calc(100% - 16px); }
  .fx-phoi #phoiModal .modal-content { max-height: 100%; }
  .fx-phoi #phoiModal .modal-body { overflow-y: auto; padding: 12px; }
  .fx-phoi #phoiList .col-3 { width: 50%; }
  .fx-phoi #phoiList .phoiItem { padding: 8px !important; }
  .fx-phoi #phoiList .phoiItem .fw-medium { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .fx-phoi .modal-header .btn-close { box-sizing: border-box; width: 44px; height: 44px; padding: 0; margin: -8px -10px -8px auto; background-position: center; }
  .fx-phoi .modal-footer .btn { min-height: 44px; }
}

/* ═════════════════════════ Trang nhỏ độc lập: Chào mừng · Check Live (công khai) · Check lỗi · Pool · Share · Stop — E2 ═════════════════════════
   Mỗi trang tự nạp tệp này sau CSS riêng; luật gắn lớp/wrapper riêng của trang (không để trần) vì tệp còn nạp ở trang khác. */

/* ───────── 51. Chào mừng (welcome.html, đứng riêng): nhóm, chip 2 cột, vùng chạm liên kết, vệt màu — phần bổ sung cho mục 32 ───────── */
@media (max-width: 640px) {
  .wl-group { padding: 18px 14px 16px; border-radius: 22px; }
  .wl-group-head { margin-bottom: 14px; }
  .wl-group-ic { width: 44px; height: 44px; border-radius: 14px; font-size: 22px; }
  .wl-group-t h3 { font-size: 19px; line-height: 1.25; }
  .wl-group-link { height: 44px; padding: 0 14px; font-size: 14px; gap: 4px; white-space: nowrap; }
  .wl-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wl-chip { padding: 10px; gap: 8px; border-radius: 14px; }
  .wl-chip-ic { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
  .wl-chip-n { font-size: 13px; overflow-wrap: anywhere; }
  .wl-nav-links > a[href="/login"] { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; white-space: nowrap; }
  html:has(.wl-hero) { --ink-2: #6b6585; }   /* tương phản chữ phụ (biến chỉ có ở welcome.css) */
}
@media (max-width: 339px) {
  .wl-chips { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .wl-nav-links > a:not(.wl-btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; white-space: nowrap; }
}
@media (max-width: 900px) {
  /* mép cắt cứng của vệt màu + hình minh hoạ hero trên màn hẹp */
  .wl-hero { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent); }
  .wl-hero-art { display: flex; flex-wrap: nowrap; justify-content: center; gap: 10px; height: auto; margin-top: 8px; }
  .wl-hero-art .wl-bub { position: static; flex: 0 1 56px; width: auto; height: auto; aspect-ratio: 1; border-radius: 18px; }
  .wl-hero-art .wl-bub i { font-size: 24px; }
}

/* ───────── 52. Check Live (check-live.html độc lập, body.clv-body) — phần bổ sung cho mục 34 ───────── */
@media (max-width: 1024px) and (pointer: coarse) {
  .clv-body .clv-logo { min-height: 44px; }
  .clv-body .cf-output-card .cf-actions { gap: 8px; }
  .clv-body .cf-progress-row { font-size: 12px; }
  .clv-body #mtToastBox { left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); }
  .clv-body .mt-toast { max-width: none; }
}

/* ───────── 53. Check lỗi (check-loi.html, body.cl-body) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .cl-search input { font-size: 16px; height: 48px; padding-right: 52px; }
  .cl-clear { width: 44px; height: 44px; right: 2px; font-size: 20px; }
  .cl-more { min-height: 44px; padding: 0 24px; font-size: 14px; }
  .cl-empty, .cl-foot { color: #64748b; }
  [data-bs-theme="dark"] .cl-empty { color: #94a3b8; }
}

/* ───────── 54. Pool (pool.html, body.pool-body) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .pool-wrap { height: auto; min-height: 100vh; min-height: 100dvh; padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); }
  .pool-result { flex: none; min-height: 0; }
  .pool-list { flex: none; overflow: visible; }
  .pool-grid { flex: none; height: min(70vh, 560px); min-height: 320px; }
  .pool-wrap .pool-auth .form-control, .pool-wrap .pool-list-head .form-control, .pool-wrap .pool-list-head .form-select { font-size: 16px; min-height: 44px; }
  .pool-wrap #poolView, .pool-wrap .pool-meta .btn { min-height: 44px; }
  .pool-wrap .fx-pwd-toggle { right: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
  .pool-wrap .fx-pwd-wrap > .form-control { padding-right: 44px; }
  .pool-wrap .lk-copy { font-size: 20px; padding: 12px; margin: -12px; }
}
@media (max-width: 640px) {
  .pool-hero { padding: 14px 16px; }
  .pool-hero i { font-size: 26px; }
  .pool-wrap .kpi-row { gap: 8px; }
  .pool-wrap .kpi { padding: 12px; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
  .pool-wrap .kpi-ic { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
  .pool-wrap .kpi-n { font-size: 22px; }
  .pool-wrap .via-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .pool-wrap .via-card { min-width: 0; }
  .pool-list-head { flex-direction: column; align-items: stretch; }
  .pool-list-head > .d-flex { width: 100%; }
  .pool-wrap .search-wrap { flex: 1 1 auto; min-width: 0; }
  .pool-wrap .search-wrap input { width: 100%; }
  .pool-wrap .via-name, .pool-wrap .pill { font-size: 12px; }
  .pool-sec-title .badge { font-size: 12px; }
}

/* ───────── 55. Share portal (share.html) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .shp-refresh { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .shp-ai-btn { min-height: 44px; padding: 0 18px; font-size: 14px; }
  .shp-tab { min-height: 44px; padding: 0 16px; font-size: 13px; }
  .shp-act, .shp-sw { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .shp-sw { padding-left: 10px; }
  .shp-c-acts { gap: 8px; }
}
@media (max-width: 640px) {
  .shp { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .shp-toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .shp-ov { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .shp-stat { padding: 12px; gap: 10px; }
  .shp-stat-ic { width: 32px; height: 32px; font-size: 16px; }
  .shp-stat-v { font-size: 16px; overflow-wrap: anywhere; }
  .shp-p-l { font-size: 11px; }
  .shp-upd { border-left: 0; margin-left: 0; padding-left: 0; }
}

/* ═════════════════════════ Công cụ Ads (#adtPanel: Phân tích Ads #aanPanel, Radar đối thủ #aradPanel) · Quy tắc QC (.arl-*) · Lên Camp wizard (.lcw-*) — E3d ═════════════════════════
   TOUCH = (max-width:640px), (max-width:1024px) and (pointer:coarse). Radar: CSS gốc nằm trong <style id="arad-style"> do ads-radar.js chèn SAU style.css → luật phải mang #aradPanel. */

/* ───────── 57. Công cụ Ads + Phân tích Ads (#adtPanel / #aanPanel) ───────── */
@media (max-width: 640px) {
  /* điện thoại dọc: tấm phủ toàn khung nội dung (dưới #fxTopBar 44px, trên thanh dưới) */
  #accounts > #adtPanel { position: fixed; top: 44px; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 1020; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  /* điện thoại nằm ngang: phủ toàn màn hình; chừa chỗ cho ☰ (#hmDrawerBurger z=1250, 32px) */
  #accounts > #adtPanel { position: fixed; inset: 0; z-index: 1040; }
  #adtPanel .pqm-topbar { padding-left: 56px; }
}
/* phone dọc + ngang: một vùng cuộn, tab dính, dải số liệu gọn, bảng cột đầu dính */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  #adtPanel .pqm-topbar { padding-top: 4px; padding-bottom: 4px; gap: 10px; }
  #adtPanel .pqm-back { min-height: 40px; padding: 0 12px 0 8px; }
  #adtPanel .pqm-brand-ic { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
  #adtPanel .pqm-brand-s { display: none; }
  #adtPanel .pqm-nav { padding: 6px 8px; }
  #adtPanel .pqm-nav-item { min-height: 40px; }
  #aanPanel .aan-view { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #aanPanel .aan-tabc { flex: none; overflow: visible; min-height: auto; padding: 12px 12px 68px; }
  #aanPanel .aan-tabs { position: sticky; top: 0; z-index: 3; scrollbar-width: none; }
  #aanPanel .aan-tabs::-webkit-scrollbar { display: none; }
  #aanPanel .aan-strip { padding: 10px 12px; gap: 8px; }
  #aanPanel .aan-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; width: 100%; }
  #aanPanel .aan-stat .k { font-size: 10.5px; }
  #aanPanel .aan-stat .v { font-size: 15px; }
  #aanPanel .aan-striptail { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #aanPanel .aan-striptail::-webkit-scrollbar { display: none; }
  #aanPanel .aan-striptail > * { flex: 0 0 auto; }
  #aanPanel .aan-tbtn { order: -1; min-height: 34px; }
  #aanPanel .aan-flags { padding: 8px 12px; }
  #aanPanel .aan-kpigrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #aanPanel .aan-kpic { padding: 10px 10px 2px; }
  #aanPanel .aan-kpic-v { font-size: 17px; }
  #aanPanel .aan-kpic-k { font-size: 10px; }
  #aanPanel .aan-sl { flex-wrap: wrap; row-gap: 2px; }
  #aanPanel .aan-sl .c { margin-left: 0; flex-basis: 100%; }
  #aanPanel .aan-drill-bd { padding: 12px 12px 68px; }
  #aanPanel .aan-drill-hd { padding: 8px 12px; }
  #aanPanel .aan-dtabs { scrollbar-width: none; }
  #aanPanel .aan-dtabs::-webkit-scrollbar { display: none; }
}
/* mọi thiết bị cảm ứng ≤1024: header 1 hàng (pills vuốt ngang), bảng, drill, lịch, hộp Mục tiêu */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  #aanPanel .aan-hd { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  #aanPanel .aan-hd-ic, #aanPanel .aan-hd-t { display: none; }
  #aanPanel .aan-switch { margin: 0; flex: 0 0 auto; min-height: 38px; padding: 0 11px; }
  #aanPanel .aan-pers { flex: 1 1 0; min-width: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
  #aanPanel .aan-pers::-webkit-scrollbar { display: none; }
  #aanPanel .aan-per { flex: 0 0 auto; min-height: 36px; padding: 0 13px; }
  #aanPanel .aan-tbl th:first-child, #aanPanel .aan-tbl td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
  #aanPanel .aan-tbl th:first-child { background: #fafbfc; }
  [data-bs-theme="dark"] #aanPanel .aan-tbl td:first-child { background: #171c24; }
  [data-bs-theme="dark"] #aanPanel .aan-tbl th:first-child { background: #141922; }
  #aanPanel .aan-tbl .nmcell { max-width: 150px; }
  #aanPanel .aan-tbl .nm, #aanPanel .aan-tbl .ac { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #aanPanel .aan-tbl td.wrap { min-width: 190px; }
  #aanPanel .aan-drill .aan-row { flex-wrap: wrap; }
  #aanPanel .aan-drill .aan-row-m { flex: 1 1 calc(100% - 30px); }
  #aanPanel .aan-drill-vd { max-width: none; flex: 1 0 100%; text-align: left; margin: 0 0 0 20px; }
  #aanPanel .aan-back { min-height: 38px; }
  #aanPanel .aan-drillable .aan-drill-h { opacity: 1; }
  .aan-cpop .aan-cal-nav { width: 40px; height: 40px; }
  .aan-cpop .aan-cal-day, .aan-cpop .aan-cal-grid > span { height: 38px; }
  .swal2-popup .swal2-html-container .aan-tg-row label { display: block !important; justify-content: flex-start !important; }
  .swal2-popup .aan-tg-row input, .swal2-popup .aan-tg-ig input, #aanPanel .aan-chat-in input { font-size: 16px; }
}
@media (max-width: 640px) {
  /* bảng chọn tài khoản (aan picker) */
  #aanPanel .aan-pk { padding: 8px 12px 4px; max-width: none; }
  #aanPanel .aan-pk-hero { flex-wrap: wrap; gap: 10px; padding: 2px 2px 12px; margin-bottom: 10px; }
  #aanPanel .aan-pk-ht { flex: 1 1 150px; min-width: 0; }
  #aanPanel .aan-pk-search { order: 3; flex: 1 0 100%; width: auto; max-width: none; margin-left: 0; height: 44px; }
  #aanPanel .aan-pk-search input { font-size: 16px; }
  #aanPanel .aan-pk-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "av main spend go" "av pill spend go"; column-gap: 12px; row-gap: 5px; align-items: center; padding: 12px; }
  #aanPanel .aan-pk-row .avatar-letter { grid-area: av; }
  #aanPanel .aan-pk-main { grid-area: main; }
  #aanPanel .aan-pk-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #aanPanel .aan-pk-pill { grid-area: pill; justify-self: start; }
  #aanPanel .aan-pk-spend { grid-area: spend; min-width: 0; }
  #aanPanel .aan-pk-go { grid-area: go; }
  #aanPanel .aan-pk-lb { font-size: 10px; }
}

/* ───────── 58. Radar đối thủ (#aradPanel) ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  /* vùng chạm ≥36–40px, ô nhập ≥16px, chữ ≥11.5px */
  #aradPanel .arad-search input { font-size: 16px; }
  #aradPanel .arad-bar .select2-container .select2-selection--single, #aradPanel .arad-tools .select2-container .select2-selection--single { height: 40px; }
  #aradPanel .arad-bar .select2-container--default .select2-selection--single .select2-selection__rendered,
  #aradPanel .arad-tools .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; font-size: 14px; }
  #aradPanel .arad-bar .select2-container--default .select2-selection--single .select2-selection__arrow,
  #aradPanel .arad-tools .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
  #aradPanel .arad-go, #aradPanel .arad-tbtn { height: 40px; }
  #aradPanel .arad-heart, #aradPanel .arad-act, #aradPanel .arad-lb-x { width: 40px; height: 40px; }
  #aradPanel .arad-pgbtn { width: 36px; height: 36px; }
  #aradPanel .arad-chip-x { min-height: 36px; padding: 0 10px; }
  #aradPanel .arad-linkchip { min-height: 30px; }
  #aradPanel .arad-b, #aradPanel .arad-cta, #aradPanel .arad-linkchip, #aradPanel .arad-st, #aradPanel .arad-pgsub { font-size: 11.5px; }
}
/* điện thoại dọc + ngang: bỏ tiêu đề trùng mục nav, thanh tìm 2 hàng gọn, thanh công cụ 1 hàng vuốt ngang */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  #aradPanel .arad-hd { display: none; }
  #aradPanel .arad-bar { padding: 10px 12px; gap: 8px; }
  #aradPanel .arad-search { flex: 1 1 100%; min-width: 0; height: 44px; }
  /* 3 ô chọn + nút Tìm = 2 hàng × 2 ô */
  #aradPanel .arad-bar .select2-container { flex: 1 1 calc(50% - 4px); width: calc(50% - 4px) !important; }
  #aradPanel .arad-bar .select2-container .select2-selection--single { height: 44px; }
  #aradPanel .arad-bar .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; }
  #aradPanel .arad-bar .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
  #aradPanel .arad-go { flex: 1 1 calc(50% - 4px); height: 44px; justify-content: center; }
  #aradPanel .arad-ctx { padding: 0 12px; }
  #aradPanel .arad-ctx:not(:empty) { padding: 8px 12px 0; }
  #aradPanel .arad-body { padding: 12px 12px 68px; }
  #aradPanel .arad-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 12px; }
  #aradPanel .arad-tools::-webkit-scrollbar { display: none; }
  #aradPanel .arad-tools > * { flex: 0 0 auto; }
  #aradPanel .arad-tspacer { display: none; }
  #aradPanel .arad-tools .select2-container { width: auto !important; min-width: 128px; }
  #aradPanel #aradSort + .select2-container { min-width: 168px; }
  #aradPanel .arad-lb { padding: 12px; }
}
/* điện thoại dọc: lưới 2 cột gọn (1 cột = thẻ cao ~560px: 12 kết quả = ~6600–7100px cuộn) */
@media (max-width: 640px) {
  #aradPanel .arad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #aradPanel .arad-media { aspect-ratio: 1; }
  #aradPanel .arad-cbody { padding: 9px; gap: 6px; }
  #aradPanel .arad-text { -webkit-line-clamp: 3; font-size: 12.5px; }
  #aradPanel .arad-pgname { font-size: 12.5px; }
  #aradPanel .arad-acts { padding: 8px 0 0; gap: 4px; }
  #aradPanel .arad-tags { top: 5px; left: 5px; }
  #aradPanel .arad-heart { top: 4px; right: 4px; }
}

/* ───────── 59. Quy tắc QC (.arl-*, popup Swal .arl-pop) ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  .arl-gic { width: 40px; height: 40px; font-size: 18px; }
  .arl-gic.arl-sidebtn { background: #eef2ff; color: #4f46e5; opacity: 1; }
  [data-bs-theme="dark"] .arl-gic.arl-sidebtn { background: #232a4a; color: #a5b4fc; }
  .arl-cta, .arl-cta.sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .swal2-popup.arl-pop .swal2-close { width: 36px; height: 36px; }
  .arl-tab { min-height: 44px; }
  /* công tắc 48×32 (như iOS 51×31) + vùng chạm nới thêm bằng ::before (không đổi bố cục) */
  .arl-sw { width: 48px; height: 32px; }
  .arl-sw::after { top: 3px; left: 3px; width: 26px; height: 26px; }
  .arl-sw.on::after { transform: translateX(16px); }
  .arl-sw::before { content: ""; position: absolute; inset: -6px -4px; }
  .arl-bedit, .arl-bdel, .arl-cx { width: 40px; height: 40px; }
  .arl-kbtn { min-height: 40px; }
  .arl-in, .arl-in.sm, .arl-nm input, .arl-sc-search input { font-size: 16px; }
  .arl-in { min-height: 40px; }
  .arl-in.sm { width: 112px; }
  .arl-w .arl-cur2 .select2-selection--single { min-height: 40px; }
  .arl-w .arl-cur2 .select2-selection--single .select2-selection__rendered { font-size: 14px; padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 640px) {
  .arl-hd { padding: 12px 14px; gap: 8px; }
  .arl-hd-ic { display: none; }
  .arl-hd-ti { font-size: 14.5px; }
  .swal2-popup.arl-pop .swal2-close { top: -14px !important; right: -8px !important; }
  .arl-bd { padding: 12px; }
  /* dòng quy tắc: [công tắc | tên + câu NẾU…] rồi hàng nút (mắt, xoá) bên dưới, căn phải — cột tên rộng ~220px thay vì 125px */
  .arl-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-items: start; padding: 12px 14px 6px; }
  .arl-row > .arl-sw { grid-column: 1; grid-row: 1; margin-top: 2px; }
  .arl-row > .arl-row-main { grid-column: 2; grid-row: 1; }
  .arl-row > .arl-row-r { grid-column: 2; grid-row: 2; justify-self: end; gap: 4px; }
  .arl-row > .arl-row-cf { grid-column: 1 / -1; }
  .arl-row-name { align-items: flex-start; flex-wrap: wrap; }
  .arl-row-sent { font-size: 12.5px; }
  .arl-tok { font-size: 12px; }
  .arl-lead { font-size: 11px; }
  /* thẻ số dư: bỏ icon ví (chiếm hàng riêng); dòng TK = tên 1 hàng đủ rộng, số liệu + pill hàng dưới */
  .arl-bcard .arl-c2-ic { display: none; }
  .arl-brow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .arl-brow-nm { grid-column: 1 / -1; grid-row: 1; }
  .arl-brow-nm span { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .arl-brow .arl-bar { grid-column: 1; grid-row: 2; }
  .arl-brow-v { grid-column: 2; grid-row: 2; font-size: 12px; }
  .arl-brow .arl-pill { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  /* nhật ký: icon + chữ cùng dòng (mỗi mảnh 1 hàng flex → icon rơi cuối dòng, dấu · đầu dòng) */
  .arl-ev-meta { display: block; line-height: 1.55; }
  .arl-ev-meta > * { display: inline; }
  /* biểu mẫu: ô giá trị + tiền tệ + nút Bỏ xuống dòng thay vì tràn (nút ✕ bị cắt) */
  .arl-valgrp { flex-wrap: wrap; flex: 1 1 100%; }
  .arl-cx { margin-left: auto; }
  .arl-step-body { padding: 11px 12px 13px; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  .arl-hd { padding: 8px 14px; }
  .arl-hd-sub { display: none; }
  .arl-w { height: calc(100dvh - 24px); }
  .swal2-popup.arl-pop .swal2-html-container { max-height: calc(100dvh - 24px); }
}

/* ───────── 60. Lên Camp wizard (.lcw-*): tờ toàn màn hình + stepper chấm + chân dính ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  /* .lcw-steps là flex item của .lcw-modal (column) + overflow-x:auto → min-height 0 → bị ép co (74→38px) khi thân dài, nhãn bước bị cắt đôi */
  .lcw-steps { flex-shrink: 0; }
  .lcw-close { width: 40px; height: 40px; }
  .lcw-input { font-size: 16px; }
  .lcw-opt { min-height: 44px; }
  .lcw-chip { min-height: 36px; }
  .lcw-mini-btn { min-height: 36px; padding: 0 6px; }
  .lcw-sug-inc, .lcw-sug-exc { width: 28px; height: 28px; font-size: 16px; }
  .lcw-int-rm, .lcw-ex-rm { padding: 9px; margin: -9px -7px -9px 0; }
  .lcw-btn { min-height: 44px; white-space: nowrap; }
  .lcw-fprog { white-space: nowrap; }
}
@media (max-width: 640px) {
  .lcw-overlay { padding: 0; align-items: stretch; justify-content: stretch; }
  .lcw-modal { width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .lcw-head { padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 8px; gap: 10px; }
  .lcw-badge { width: 36px; height: 36px; border-radius: 10px; }
  .lcw-badge i { font-size: 19px; }
  .lcw-h-title { font-size: 15.5px; }
  .lcw-h-sub { font-size: 12px; line-height: 1.35; }
  /* stepper: 6 chấm nối nhau, ẩn nhãn (tiêu đề phụ + "Bước n / 6" ở chân đã nói bước nào) → thấy được bước 5, 6 */
  .lcw-steps { padding: 2px 16px 10px; overflow: visible; }
  .lcw-step { min-width: 0; gap: 0; }
  .lcw-step-t { display: none; }
  .lcw-step-n { width: 26px; height: 26px; font-size: 12px; }
  .lcw-step:not(:last-child)::after { top: 12px; }
  .lcw-body { padding: 4px 14px 16px; -webkit-overflow-scrolling: touch; }
  .lcw-cols { gap: 14px; }
  .lcw-aside { padding: 12px; gap: 12px; }
  .lcw-card, .lcw-dcard { padding: 12px 10px; }
  .lcw-opt { padding: 9px 12px; }
  .lcw-search-item { padding: 12px; }
  .lcw-posts { max-height: none; overflow: visible; }
  /* chân dính đáy, né thanh Home / tai thỏ; "Hủy" thừa (đã có ×) → 3 mục không còn bị bóp xuống 2–3 dòng */
  .lcw-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .lcw-foot .lcw-cancel { display: none; }
  .lcw-btn { padding: 0 16px; }
  .lcw-btn-primary { padding: 0 22px; }
  .lcw-err { margin: 0 14px 8px; }
  .lcw-revgroup { padding: 2px 12px 8px; }
  .lcw-rev-row { flex-direction: column; gap: 2px; }
  .lcw-rev-v { text-align: left; }
  .lcw-tnode.lv1 { margin-left: 12px; }
  .lcw-tnode.lv2 { margin-left: 24px; }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) and (max-height: 520px) {
  .lcw-overlay { padding: 0; }
  .lcw-modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .lcw-head { padding: 8px 16px 4px; }
  .lcw-h-sub { display: none; }
  .lcw-steps { padding: 0 24px 6px; }
  .lcw-step-t { display: none; }
  .lcw-step-n { width: 24px; height: 24px; }
  .lcw-step:not(:last-child)::after { top: 11px; }
  .lcw-body { padding: 4px 18px 10px; }
  .lcw-foot { padding: 8px 16px; }
  .lcw-btn { min-height: 40px; }
  .lcw-cols { grid-template-columns: 1fr 1fr; }
  .lcw-aside { position: static; }
}

/* ═════════════════════════ Workspace "Nội dung & Tương tác" (/noi-dung-tuong-tac, page-manager.js, .pqm-ws-page) — E3a ═════════════════════════
   Tiền tố `#app .pqm-ws-page` (1 ID) để thắng `.pqm-ws-page .pqm-main.pqm-tab-tt > .pqm-work` (0,4,0) ở style.css:4031 và modern-theme.css.
   Popup tự dựng gắn thẳng vào <body> (ngoài #app) → tiền tố `body`. Thanh "Trang áp dụng" cần JS đổi lớp .pqm-npg-open (page-manager.js bindEvents). */

/* ───────── 61. Vỏ workspace: một lưới 3 cột × 2 hàng [← | dải tab | ⟳] + vùng làm việc một cột ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  #app .pqm-ws-page .pqm-modal { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  #app .pqm-ws-page .pqm-topbar, #app .pqm-ws-page .pqm-main { display: contents; }
  #app .pqm-ws-page .pqm-brand, #app .pqm-ws-page .pqm-top-sp { display: none; }
  #app .pqm-ws-page .pqm-back { grid-area: 1 / 1; margin: 6px 0 6px 10px; align-self: center; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  #app .pqm-ws-page .pqm-back span { display: none; }
  #app .pqm-ws-page .pqm-refresh { grid-area: 1 / 3; margin: 6px 10px 6px 0; align-self: center; width: 40px; height: 40px; border-radius: 12px; }
  #app .pqm-ws-page .pqm-nav { grid-area: 1 / 2; width: auto; min-width: 0; flex-direction: row; gap: 6px; padding: 6px 10px; overflow-x: auto; overflow-y: hidden;
    border: 0; background: transparent; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%); }
  #app .pqm-ws-page .pqm-nav::-webkit-scrollbar { display: none; }
  #app .pqm-ws-page .pqm-nav-group { display: contents; }
  #app .pqm-ws-page .pqm-nav-lbl { display: none; }
  #app .pqm-ws-page .pqm-nav-item { width: auto; flex: none; margin: 0; height: 40px; padding: 0 14px 0 11px; gap: 8px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; white-space: nowrap; font-size: 13px; scroll-snap-align: center; }
  #app .pqm-ws-page .pqm-nav-item .pqm-nav-ic { width: 18px; height: 18px; }
  #app .pqm-ws-page .pqm-nav-item.on { background: #eef2ff; border-color: #c7d2fe; color: #4f46e5; }
  #app .pqm-ws-page .pqm-topbar { border-bottom: 0; }
  #app .pqm-ws-page .pqm-modal::before { content: ""; grid-area: 1 / 1 / 2 / 4; border-bottom: 1px solid #eef2f7; background: #fff; }   /* nền + vạch chân cho hàng đầu (hai con display:contents không có hộp) */
  /* vùng làm việc: cột dọc, 1 cột */
  #app .pqm-ws-page .pqm-work, #app .pqm-hep.pqm-ws-page .pqm-work { grid-area: 2 / 1 / 3 / 4; display: flex; flex-direction: column; max-width: none; margin: 0; min-height: 0; background: #fff; }
  #app .pqm-ws-page .pqm-content { order: 2; flex: 1 1 0; min-height: 0; width: 100%; }
  #app .pqm-ws-page .pqm-panel { inset: 0; border: 0; border-radius: 0; box-shadow: none; }
  /* thanh tóm tắt "Trang áp dụng" (48px); chạm → bảng chọn Trang trượt từ đáy (JS đổi lớp .pqm-npg-open trên .pqm-navpg) */
  #app .pqm-ws-page .pqm-navpg { order: 0; width: auto; flex: 0 0 auto; padding: 6px 10px; background: #f4f5f8; border-bottom: 1px solid #eef2f7; }
  #app .pqm-ws-page .pqm-navpg .pqm-npg-card { flex: 1; padding: 0 12px; gap: 0; border-radius: 12px; box-shadow: none; min-height: 44px; }
  #app .pqm-ws-page .pqm-navpg .pqm-npg-head { min-height: 44px; cursor: pointer; }
  #app .pqm-ws-page .pqm-navpg .pqm-npg-head::after { content: "\ea4e"; font-family: remixicon; font-size: 20px; line-height: 1; color: #94a3b8; margin-left: 6px; transition: transform .18s; }
  #app .pqm-ws-page .pqm-navpg:not(.pqm-npg-open) .pqm-npg-card > :not(.pqm-npg-head) { display: none; }
  #app .pqm-ws-page .pqm-navpg.pqm-npg-open { position: absolute; inset: 0; z-index: 60; padding: 0; background: rgba(15, 23, 42, .5); align-items: flex-end; }
  #app .pqm-ws-page .pqm-navpg.pqm-npg-open .pqm-npg-card { flex: 0 1 auto; width: 100%; max-height: 82%; padding: 4px 12px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 10px; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 32px rgba(15, 23, 42, .25); }
  #app .pqm-ws-page .pqm-navpg.pqm-npg-open .pqm-npg-head::after { transform: rotate(180deg); }
  #app .pqm-ws-page .pqm-navpg.pqm-npg-open .pqm-npglist { min-height: 120px; }
  #app .pqm-ws-page .pqm-pgsearch-in { font-size: 16px; height: 44px; }
  #app .pqm-ws-page .pqm-pgall { min-height: 44px; font-size: 14px; }
  #app .pqm-ws-page .pqm-pgall input, #app .pqm-ws-page .pqm-pgcb { width: 20px; height: 20px; }
  #app .pqm-ws-page .pqm-pgitem { min-height: 56px; padding: 8px 12px; }
  /* tab Đăng bài: danh sách bài → dải chip cuộn ngang phía trên; ba nút chạy → đáy 1 hàng (icon trên, chữ dưới) */
  #app .pqm-ws-page .pqm-sidepv, #app .pqm-ws-page .pqm-pv-card { display: contents; }   /* inline display:none của JS vẫn thắng ở các tab khác */
  #app .pqm-ws-page .pqm-pv-scroll { order: 1; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 8px 10px; border-bottom: 1px solid #eef2f7; background: #fff; scrollbar-width: none; }
  #app .pqm-ws-page .pqm-pv-scroll::-webkit-scrollbar { display: none; }
  #app .pqm-ws-page .pqm-pv-scroll .pqm-npg-head { display: none; }
  #app .pqm-ws-page .pqm-pv-card .pqm-cbox { display: flex; flex-direction: row; align-items: stretch; gap: 8px; padding: 0; border: 0; box-shadow: none; background: transparent; }
  #app .pqm-ws-page .pqm-plist { flex-direction: row; gap: 8px; }
  #app .pqm-ws-page .pqm-pitem { flex: none; width: 168px; min-height: 48px; }
  #app .pqm-ws-page .pqm-addpost { margin-top: 0; width: auto; flex: none; padding: 0 14px; min-height: 48px; white-space: nowrap; }
  #app .pqm-ws-page .pqm-pv-card .pqm-run-wrap { order: 3; margin: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #eef2f7; background: #fff; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #app .pqm-ws-page .pqm-pv-card .pqm-run-row { display: contents; }
  #app .pqm-ws-page .pqm-pv-card .pqm-run-wrap .pqm-btn { height: 56px; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; font-size: 12px; line-height: 1.15; text-align: center; white-space: normal; }
  #app .pqm-ws-page .pqm-pv-card .pqm-run-wrap .pqm-btn i { font-size: 20px; }
  /* tiêu đề panel: tên tab đã sáng ở dải tab → bỏ (trừ Tăng theo dõi: JS dời nút Bắt đầu vào đó) */
  #app .pqm-ws-page .pqm-phead { padding: 10px 14px; }
  #app .pqm-ws-page .pqm-phead-s { display: none; }
  #app .pqm-ws-page .pqm-panel:not([data-panel="theo-doi"]) > .pqm-phead { display: none; }
  #app .pqm-ws-page .pqm-host { padding: 12px 12px 16px; }
  /* nút chat nổi: ẩn trong workspace (đè lên nút chạy / nút Tải thêm) — cùng cách tab "Chức năng" đã làm */
  body:has(.pqm-ws-page) .sup-chat:not(.open):not(.sup-unread) { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; visibility: hidden; }
  /* màu tối cho các bề mặt mới của vỏ (nền sáng cứng #fff/#f4f5f8 ở bản sáng phải có cặp tối) */
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-modal::before { background: #161b22; border-bottom-color: #2e3947; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-nav-item { background: #1e2530; border-color: #2e3947; color: #94a3b8; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-nav-item.on { background: rgba(99, 102, 241, .2); border-color: rgba(99, 102, 241, .55); color: #a5b4fc; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-work { background: #1e2735; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-navpg { background: #151b25; border-bottom-color: #2e3947; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-navpg .pqm-npg-head::after { color: #7a8496; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-navpg.pqm-npg-open { background: rgba(2, 6, 14, .66); }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-pv-scroll { background: #1e2735; border-bottom-color: #2e3947; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-pv-card .pqm-run-wrap { background: #1e2735; border-top-color: #2e3947; }
  [data-bs-theme="dark"] #app .pqm-ws-page .pqm-gfoot { background: #1e2735; }
}

/* ───────── 62. 3 tab dạng bảng (Đã lên lịch · Quản lý bài · Quét tương tác) — điện thoại dọc ───────── */
@media (max-width: 640px) {
  /* thân panel CUỘN DỌC (thanh lọc cuộn đi, bảng giữ chiều cao dùng được); gốc: modern-theme.css:7634/7794 đặt .pqm-pbody{overflow:hidden;display:flex} */
  #app .pqm-ws-page .pqm-panel:is([data-panel="scheduled"], [data-panel="published"], [data-panel="quet-tuong-tac"]) > .pqm-pbody { display: block; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
  #app .pqm-ws-page .pqm-gwrap { height: clamp(320px, calc(100dvh - 300px), 640px); min-height: 0; }
  /* thanh lọc: lưới 2 cột, mọi ô cao 44px, ô tìm ≥16px (chống iOS tự phóng to) */
  #app .pqm-ws-page .pqm-gbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; padding: 10px 12px; }
  #app .pqm-ws-page .pqm-gbar > * { min-width: 0; }
  #app .pqm-ws-page .pqm-gsp { display: none; }
  #app .pqm-ws-page .pqm-drp-btn { height: 44px; justify-content: space-between; padding: 0 12px; }
  #app .pqm-ws-page .pqm-gbar .select2-container { width: 100% !important; min-width: 0; }
  #app .pqm-ws-page .pqm-gbar .select2-container .select2-selection--single { height: 44px; border-radius: 9px; }
  #app .pqm-ws-page .pqm-gbar .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; font-size: 14px; padding-left: 12px; padding-right: 28px; }
  #app .pqm-ws-page .pqm-gbar .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; right: 6px; }
  #app .pqm-ws-page .pqm-gsearch { grid-column: 1 / -1; min-width: 0; }
  #app .pqm-ws-page .pqm-gbar .pqm-gsearch-in { height: 44px; font-size: 16px; padding-left: 36px; }
  #app .pqm-ws-page .pqm-gsearch > i { left: 12px; font-size: 17px; }
  #app .pqm-ws-page .pqm-gbar .pqm-btn { height: 44px; padding: 0 10px; justify-content: center; font-size: 13px; white-space: nowrap; }
  #app .pqm-ws-page .pqm-cfclear { grid-column: 1 / -1; }
  /* ô loại bài + ô tìm chung 1 hàng ở tab lịch (không có bộ chọn ngày) và ở thanh lọc của tab Quét */
  #app .pqm-ws-page .pqm-panel:is([data-panel="scheduled"], [data-panel="quet-tuong-tac"]) .pqm-gsearch:not(.pqs-url) { grid-column: auto; }
  /* chân trang bảng: bỏ "Bôi đen" (kéo chọn vùng = thao tác chuột), thống kê cuộn ngang, nút Tải thêm / Soạn bài full-width */
  #app .pqm-ws-page .pqm-gfoot { position: sticky; bottom: 0; z-index: 3; background: #fff; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; min-height: 0; }
  #app .pqm-ws-page .pqm-gfoot .pqm-fcnt > span:nth-child(3) { display: none; }
  #app .pqm-ws-page .pqm-fstats { flex: 1 1 0; min-width: 0; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  #app .pqm-ws-page .pqm-fstats::-webkit-scrollbar { display: none; }
  #app .pqm-ws-page .pqm-fstats > span { white-space: nowrap; flex: none; }
  #app .pqm-ws-page .pqm-gstat { flex: 1 0 100%; order: 5; }
  #app .pqm-ws-page .pqm-gstat:empty { display: none; }
  #app .pqm-ws-page .pqm-pubmore, #app .pqm-ws-page .pqm-schadd { margin-right: 0; flex: 1 0 100%; order: 6; height: 44px; justify-content: center; font-size: 13px; }
  #app .pqm-ws-page .pqm-panel[data-panel="quet-tuong-tac"] .pqm-gfoot { padding-right: 12px; }
  /* tab Quét tương tác: link (full) · loại quét (full) · [giới hạn | Bắt đầu quét] */
  #app .pqm-ws-page .pqs-url { grid-column: 1 / -1; min-width: 0; }
  #app .pqm-ws-page .pqm-panel[data-panel="quet-tuong-tac"] select[data-q="mode"] + .select2-container { grid-column: 1 / -1; width: 100% !important; }
  #app .pqm-ws-page .pqm-panel[data-panel="quet-tuong-tac"] .pqm-btn[data-q="start"],
  #app .pqm-ws-page .pqm-panel[data-panel="quet-tuong-tac"] .pqm-btn[data-q="stop"] { height: 44px; font-size: 14px; }
}

/* ───────── 63. Ruột 3 thẻ công cụ (Đăng bài · Seeding · Tăng theo dõi) + màn "Đăng nhiều bài" — điện thoại dọc ───────── */
@media (max-width: 640px) {
  /* thanh chạy dính đáy của Seeding: nút full-width, cao 48px */
  #app .pqm-ws-page .pqm-runbar { padding: 10px 0 2px; }
  #app .pqm-ws-page .pqm-run { align-self: stretch; justify-content: center; height: 48px; font-size: 14px; }
  /* Đăng bài — đầu khung soạn: tên Trang 1 dòng (tên dài 3 dòng = ăn ~100px), "+N" luôn thấy */
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-hdmeta { flex: 1; min-width: 0; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-nm { display: flex; align-items: baseline; min-width: 0; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-nm [data-fbnm] { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-nm [data-fbmore] { flex: none; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-hd { margin-bottom: 10px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-ed .gmw-msg { font-size: 17px; padding: 12px; }
  /* ô nhập trong thẻ ≥16px (iOS Safari tự phóng to khi chạm ô <16px) + vùng chạm ≥40px */
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-cmtnum input,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .db-cmtnum input,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-cmtin,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-grpin,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-dp-sel,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-in,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-ai-count,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cmts,
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-in,
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-find input { font-size: 16px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-cmtnum input,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .db-cmtnum input { width: 72px; height: 42px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-grpin { height: 44px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-dp-nav { width: 40px; height: 40px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-dp-day { height: 40px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-dp-sel { height: 40px; }
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-cmtadd,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-cmtbulk,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-grpreload,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-grpselall,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .db-grpaddbtn,
  #app .pqm-ws-page [data-feature="page-dang-bai"] .gmw-fb-mbtn,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-ai-btn { min-height: 44px; }
  /* Seeding — "Cấu hình chung": 3 ô ngang lệch nhịp (nhãn 1–2 dòng) → lưới 2 cột, ô Xáo trộn là hàng riêng nhãn trái · công tắc phải */
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cfggrid { grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: end; }
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld:first-child,
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld:last-child { padding: 0; border-left: 0; }
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cfggrid > .db-cmtfld:last-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .ptt-cfggrid .db-sw2 { margin-top: 0; }
  /* câu nhắc cuối thẻ: flex làm vỡ câu thành 3 cột (chữ · <b> · chữ) ở bề ngang hẹp → quay về dòng chữ liền */
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .db-foot { display: block; font-size: 12px; line-height: 1.5; }
  #app .pqm-ws-page [data-feature="page-tuong-tac"] .db-foot i { margin-right: 6px; vertical-align: -2px; }
  /* Tăng theo dõi — nút công cụ 40px, bộ lọc kết quả 40px, bảng cuộn ngang trong khung, vùng chạm dấu ⓘ */
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-xs { min-height: 40px; padding: 0 12px; font-size: 13px; }
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-tip { font-size: 20px; padding: 10px; margin: -10px -6px; }
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-ff { flex-wrap: wrap; }
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-ff button { min-height: 40px; }
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-find { flex: 1 0 100%; }
  #app .pqm-ws-page [data-feature="page-theo-doi"] .ptd-find input { height: 44px; }
  #app .pqm-ws-page .pqm-panel[data-panel="theo-doi"] .ptd-start { height: 44px; }
  #app .pqm-ws-page .pqm-panel[data-panel="theo-doi"] .ptd-stop { height: 44px; }
  /* màn "Đăng nhiều bài": cuộn cả màn (checklist bài hết bị bóp còn ~40px), phân phối 2 cột, ô nhập 16px/44px, nút Bắt đầu dính đáy */
  #app .pqm-ws-page .pqm-compose.running .pqm-monitor { padding: 12px; overflow-y: auto; }
  #app .pqm-ws-page .pqm-mon-hd { flex-wrap: wrap; gap: 8px; }
  #app .pqm-ws-page .pqm-mon-ttl { flex: 1 0 100%; }
  #app .pqm-ws-page .pqm-mon-act { flex: 1 0 100%; }
  #app .pqm-ws-page .pqm-mon-act > button { flex: 1; justify-content: center; min-height: 44px; white-space: nowrap; }
  #app .pqm-ws-page .pqm-mon-setup { flex: none; min-height: auto; }
  #app .pqm-ws-page .pqm-mon-checklist { flex: none; max-height: 38dvh; }
  #app .pqm-ws-page .pqm-mon-setuphd { flex-wrap: wrap; }
  #app .pqm-ws-page .pqm-mon-selall { min-height: 40px; }
  #app .pqm-ws-page .pqm-mon-distrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  #app .pqm-ws-page .pqm-mon-distrow .pqm-df { min-width: 0; }
  #app .pqm-ws-page .pqm-din, #app .pqm-ws-page .pqm-dsel { font-size: 16px; height: 44px; padding: 0 10px; }
  #app .pqm-ws-page .pqm-mon-chk { align-items: flex-start; min-height: 44px; }
  #app .pqm-ws-page .pqm-mon-chk input { width: 22px; height: 22px; margin-top: 1px; }
  #app .pqm-ws-page .pqm-mon-start { position: sticky; bottom: 0; align-self: stretch; justify-content: center; min-height: 48px; margin-top: 4px; }
  /* bảng theo dõi 10 cột: giữ # · Trang · Trạng thái · Kết quả (ẩn Bài/Loại/Bình luận/Story/Nhóm/Giờ) để khỏi cuộn ngang */
  #app .pqm-ws-page .pqm-mon-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(10)) { display: none; }
  #app .pqm-ws-page .pm-pg > span:last-child { max-width: 120px; }
  #app .pqm-ws-page .pqm-mon-stats { flex-wrap: wrap; gap: 8px 16px; }
}

/* ───────── 64. Popup tự dựng của workspace (gắn thẳng vào <body>) — điện thoại dọc ───────── */
@media (max-width: 640px) {
  /* bộ chọn khoảng ngày .pqm-drp: rộng ~790px (2 lịch × 210 + 15 mốc 2 cột) ⇒ tràn 399px, nút "Áp dụng" nằm NGOÀI màn hình ⇒ bảng trượt từ đáy: mốc = dải chip cuộn ngang, 1 lịch, chân 2 hàng */
  body .pqm-drp { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto; max-height: 88dvh; overflow-y: auto; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -12px 32px rgba(15, 23, 42, .25); }
  body .pqm-drp-body { flex-direction: column; }
  body .pqm-drp-presets { display: flex; flex-wrap: nowrap; gap: 8px; padding: 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #f0f0f0; border-radius: 18px 18px 0 0; scrollbar-width: none; }
  body .pqm-drp-presets::-webkit-scrollbar { display: none; }
  body .pqm-drp-preset, body .pqm-drp-preset[data-k="custom"] { flex: none; padding: 0 14px; height: 40px; display: inline-flex; align-items: center; margin: 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; font-size: 13px; }
  body .pqm-drp-preset.on { border-color: #c7d2fe; }
  body .pqm-drp-cals { padding: 12px 10px; gap: 6px; align-items: flex-start; }
  body .pqm-drp-cal { min-width: 0; }
  body .pqm-drp-cal[data-side="1"] { display: none; }
  body .pqm-drp-nav { width: 40px; height: 40px; min-width: 40px; }
  body .pqm-drp-day { width: 100%; max-width: 40px; height: 40px; font-size: 14px; }
  body .pqm-drp-csb { height: 36px; font-size: 13px; }
  body .pqm-drp-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  body .pqm-drp-range { display: grid; grid-template-columns: 1fr auto 1fr; }
  body .pqm-drp-d { height: 44px; font-size: 16px; padding: 0 10px; min-width: 0; }
  body .pqm-drp-acts { display: grid; grid-template-columns: 1fr 1fr; }
  body .pqm-drp-acts .pqm-btn { height: 44px; justify-content: center; }
  /* nền mờ chặn chạm xuyên (chạm ra ngoài → trình nghe capture đóng popup, KHÔNG kích hoạt phần tử bên dưới) */
  body:has(.pqm-drp:not([style*="display: none"]))::after { content: ""; position: fixed; inset: 0; z-index: 3150; background: rgba(15, 23, 42, .45); }
  /* menu chuột phải #pqmCtx.ctx-2col (~750px, 2 cột): cột "Bài viết" bị cắt, mục cao 34px → bảng hành động từ đáy, 1 cột, mục 48px */
  body #pqmCtx.ctx-2col.open { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; max-height: 78dvh; overflow-y: auto; flex-direction: column; border-radius: 18px 18px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  body #pqmCtx .ctx-col { width: 100%; min-width: 0; }
  body #pqmCtx .dropdown-item { min-height: 48px; display: flex; align-items: center; font-size: 15px; }
  body:has(#pqmCtx.open)::after { content: ""; position: fixed; inset: 0; z-index: 1999; background: rgba(15, 23, 42, .45); }
  /* hộp thoại bình luận .pqm-cmt: bảng gần kín màn từ đáy; thao tác từng bình luận 20px → 40px; ô chọn 13px → 22px; ô nhập 16px; chân dính đáy chừa tai thỏ/bàn phím */
  body .pqm-cmt-ov { padding: 0; align-items: flex-end; }
  body .pqm-cmt { width: 100%; max-height: 94dvh; height: 94dvh; border-radius: 18px 18px 0 0; }
  body .pqm-cmt-hd { padding: 12px 56px; }
  body .pqm-cmt-x { width: 40px; height: 40px; right: 10px; }
  body .pqm-cmt-pimg { height: 200px; }
  body .pqm-cmt-phd, body .pqm-cmt-ptx, body .pqm-cmt-pcnt, body .pqm-cmt-list { padding-left: 12px; padding-right: 12px; }
  body .pqm-cmt-tools { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px; }
  body .pqm-cmt-all { min-height: 44px; }
  body .pqm-cmt-all input, body .pqm-cmt-cb { width: 22px; height: 22px; margin: 0; accent-color: #6366f1; }
  body .pqm-cmt-cb { margin-top: 9px; }
  body .pqm-cmt-tools .select2-container { width: 160px !important; }
  body .pqm-cmt-tools .select2-container--default .select2-selection--single { height: 40px; }
  body .pqm-cmt-tools .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; }
  body .pqm-cmt-tools .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
  body .pqm-cmt-bulk { padding: 0 12px 10px; }
  body .pqm-cmt-bulk .pqm-btn { height: 40px; padding: 0 12px; font-size: 13px; }
  body .pqm-cmt-acts { gap: 2px 6px; padding: 0 0 0 4px; margin-top: 2px; }
  body .pqm-cmt-a { min-height: 36px; padding: 0 8px; font-size: 12.5px; }
  body .pqm-cmt-tm { margin-right: 4px; }
  body .pqm-cmt-kids { margin-left: 10px; padding-left: 10px; }
  body .pqm-cmt-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-radius: 0; }
  body .pqm-cmt-in { font-size: 16px; min-height: 44px; }
  body .pqm-cmt-send { width: 44px; height: 44px; }
  body .pqm-cmt-as { width: 44px; height: 44px; justify-content: center; }
  /* hộp thoại chọn tư cách .pqm-as: bảng từ đáy, ô tìm 16px/44px, mục 56px */
  body .pqm-as-ov { padding: 0; align-items: flex-end; }
  body .pqm-as { width: 100%; max-height: 88dvh; border-radius: 18px 18px 0 0; }
  body .pqm-as-x { width: 40px; height: 40px; right: 10px; }
  body .pqm-as-in { font-size: 16px; height: 44px; }
  body .pqm-as-it { min-height: 56px; }
  body .pqm-as-list { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  /* bộ chọn giờ .pqm-dtp: chỉ chỉnh vùng chạm (nav/đóng 30px → 40, ô giờ 16px, nút 44px) */
  body .pqm-dtp-nav, body .pqm-dtp-x { width: 40px; height: 40px; }
  body .pqm-dtp-day { height: 40px; }
  body .pqm-dtp-hm { font-size: 16px; height: 44px; }
  body .pqm-dtp-foot .pqm-btn { height: 44px; padding: 0 18px; }
  body .pqm-dtp-ov { align-items: flex-end; padding: 0; }
  body .pqm-dtp { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  body .pqm-dtp-foot { border-radius: 0; }
  /* cấu hình Tăng theo dõi .ptd-pop (style.css:4243): hàng "Nghỉ dài sau" vỡ, chân popup đẩy nút Bắt đầu xuống hàng riêng 94px, ô số 28px/12.5px, đóng 30px */
  body .ptd-pop[data-feature="page-theo-doi"] { padding: 0; align-items: flex-end; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-pop-card { max-width: none; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-pop-x { width: 40px; height: 40px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-gname { font-size: 12px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-row { min-height: 52px; padding: 6px 12px; flex-wrap: wrap; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-rl { font-size: 14px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-fld { height: 40px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-fld input { width: 52px; font-size: 16px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-fld em { font-size: 12px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-flds { flex: 1 1 100%; justify-content: flex-end; gap: 8px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-opt span { min-height: 44px; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-pop-ft { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-pop-ft .ptd-sp { display: none; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-pop-ft .ptd-estbox { grid-column: 1 / -1; }
  body .ptd-pop[data-feature="page-theo-doi"] .ptd-pop-ft .pqm-btn { height: 48px; justify-content: center; font-size: 14px; }
  /* popup nền chữ .db-bgmodal / "Chỉnh sửa tất cả" .db-edall (style.css:2315): bảng từ đáy dùng dvh, nút đóng 44px */
  body .db-bgmodal { align-items: flex-end; }
  body .db-bgmodal-card { width: 100%; max-height: 90dvh; border-radius: 18px 18px 0 0; }
  body .db-bgmodal-x { width: 44px; height: 44px; }
  body .db-bgnone { min-height: 44px; }
  body .db-bgmodal-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 6px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
  body .db-edall .db-mdel { width: 44px; height: 44px; }
  body .db-edall .db-mgrip { width: 32px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; touch-action: none; }
  body .db-edall .db-edall-txt { font-size: 16px; }
  /* Select2 mở từ thanh lọc / hộp bình luận: mục 44px (mặc định 34px) */
  body .select2-dropdown.pqm-gsel-dd .select2-results__option,
  body .select2-dropdown.pqm-cmt-ord-dd .select2-results__option { min-height: 44px; display: flex; align-items: center; padding: 0 12px; font-size: 14px; }
  /* màu tối của bộ chọn ngày */
  [data-bs-theme="dark"] body .pqm-drp-presets { border-bottom-color: #2e3947; }
  [data-bs-theme="dark"] body .pqm-drp-preset, [data-bs-theme="dark"] body .pqm-drp-preset[data-k="custom"] { background: #1e2530; border-color: #2e3947; color: #94a3b8; }
  [data-bs-theme="dark"] body .pqm-drp-preset.on { background: rgba(99, 102, 241, .24); border-color: rgba(99, 102, 241, .55); color: #a5b4fc; }
  [data-bs-theme="dark"] body .pqm-drp { box-shadow: 0 -12px 32px rgba(0, 0, 0, .6); }
}

/* ═════════════════════════ Nhóm: Quản lý nhóm (/quan-ly-nhom, .pqm-ws-group) · Tìm & tham gia (/tim-nhom, .pqm-ws-finder) · Công cụ BM bằng Token (#bmTokenPanel, .bmt-*) — E3c ═════════════════════════
   Mục 1–2 dùng cho CẢ HAI công cụ nhóm; mục 3–7 chỉ cho /quan-ly-nhom (.pqm-ws-group.pqm-hep — KHÔNG dùng .pqm-hep trần: page-manager và profile-tools cũng mang lớp đó). */

/* ───────── 65. Quản lý nhóm ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  /* thanh trên: gọn, nút ≥44px, bỏ phụ đề */
  .pqm-overlay.pqm-ws-group .pqm-topbar { padding: 8px 12px; gap: 10px; }
  .pqm-overlay.pqm-ws-group .pqm-back { height: 44px; padding: 0 14px 0 10px; border-radius: 12px; }
  .pqm-overlay.pqm-ws-group .pqm-brand { flex: 1; gap: 10px; }
  .pqm-overlay.pqm-ws-group .pqm-brand-ic { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
  .pqm-overlay.pqm-ws-group .pqm-brand-s { display: none; }
  .pqm-overlay.pqm-ws-group .pqm-top-sp { display: none; }
  .pqm-overlay.pqm-ws-group .pqm-top-ic { width: 44px; height: 44px; border-radius: 12px; }
  /* khung: cột dọc; thanh bên → viên phân đoạn (cùng khuôn .mtab-seg của app), nhãn dài xuống dòng */
  .pqm-overlay.pqm-ws-group .pqm-main { flex-direction: column; min-height: 0; overflow: hidden; }
  .pqm-overlay.pqm-ws-group .pqm-nav { width: auto; flex: none; flex-direction: row; gap: 2px; padding: 3px; margin: 10px 12px 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #f1f5f9; overflow: visible; }
  .pqm-overlay.pqm-ws-group .pqm-nav-group { display: contents; }
  .pqm-overlay.pqm-ws-group .pqm-nav-lbl { display: none; }
  .pqm-overlay.pqm-ws-group .pqm-nav-item { flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; margin: 0; padding: 4px 8px; justify-content: center; gap: 6px; border-radius: 9px; font-size: 13px; font-weight: 600; line-height: 1.15; text-align: center; }
  .pqm-overlay.pqm-ws-group .pqm-nav-item i { font-size: 17px; flex-shrink: 0; }
  .pqm-overlay.pqm-ws-group .pqm-nav-item.on { background: #fff; color: #5b4df0; box-shadow: 0 2px 8px rgba(30, 41, 90, .14); }
  .pqm-overlay.pqm-ws-group .pqm-nav-item.on i { color: #5b4df0; }
  /* /quan-ly-nhom: vùng làm việc = MỘT mạch cuộn dọc, các thẻ xếp chồng */
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-work { flex: 1; min-height: 0; flex-direction: column; gap: 12px; padding: 12px 12px 0; max-width: 760px; width: 100%; margin: 0 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-navpg { width: auto; flex: none; padding: 0; background: transparent; display: block; order: 3; margin-bottom: 4px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-navpg .pqm-npg-card { min-height: 0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-navpg .gmw-glist { flex: none; max-height: min(320px, 42dvh); }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-work > .pqm-content { flex: none; position: static; background: transparent; order: 2; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-work .pqm-panel { position: static; inset: auto; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-panel[data-panel="dang-bai"] .pqm-phead { display: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-panel[data-panel="dang-bai"] .pqm-pbody { display: block; overflow: visible; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-compose { display: block; max-width: none; margin: 0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-cmid { overflow: visible; }
  .pqm-overlay.pqm-ws-group.pqm-hep .gmw-compose3 .pqm-cmid { padding: 12px; }
  /* thẻ phải → dải "tab bài viết" cuộn ngang + thanh nút chạy dính đáy */
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv,
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-pv-card,
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-pv-scroll { display: contents; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-npg-head { order: 0; padding: 0 4px; margin-bottom: -6px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-cbox { order: 1; display: flex; flex-direction: row; align-items: stretch; gap: 8px; padding: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-cbox::-webkit-scrollbar { display: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-plist { display: contents; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-pitem { flex: 0 0 min(72%, 250px); scroll-snap-align: start; min-height: 56px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-pgrip { display: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-pdel { padding: 12px; margin: -12px -8px -12px 0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-addpost { flex: 0 0 auto; width: auto; margin: 0; padding: 0 16px; min-height: 56px; white-space: nowrap; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-run-wrap { order: 9; position: sticky; bottom: 0; z-index: 5; margin: 4px -12px 0; padding: 10px 12px 12px; background: #fff; border-top: 1px solid #e8eaf1; box-shadow: 0 -8px 20px -10px rgba(15, 23, 42, .22); }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-run-wrap .pqm-btn { height: 44px; justify-content: center; font-size: 13.5px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-work:has(.gmw-editor :is(textarea, input):focus) .pqm-run-wrap { position: static; }   /* đang gõ chữ: bàn phím ảo ẩn thanh nút để nhường cho ô soạn */
  /* nút chat nổi KHÔNG đè lên nút Đăng */
  body.gmw-mgr-open .sup-chat:not(.open):not(.sup-unread) { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; visibility: hidden; }
  /* màn hình Theo dõi (Đăng nhiều bài): thanh tiêu đề/nút xuống dòng, danh sách bài gọn, BẢNG CHẠY → THẺ */
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-compose.running .pqm-monitor { padding: 12px; overflow: visible; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-hd { flex-wrap: wrap; gap: 8px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-ttl { flex: 1 1 100%; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-act { flex: 1 1 100%; gap: 8px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-act > button { flex: 1 1 0; min-height: 44px; justify-content: center; white-space: nowrap; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-setuphd { flex-wrap: wrap; row-gap: 8px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-selall { min-height: 40px; padding: 0 14px; white-space: nowrap; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-checklist { border: 0; padding: 0; max-height: none; overflow: visible; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-citem { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "cb doc main" ". . bd"; column-gap: 10px; row-gap: 6px; padding: 12px; min-height: 56px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-citem input { grid-area: cb; width: 22px; height: 22px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-citem .pm-cdoc { grid-area: doc; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-citem .pm-cmain { grid-area: main; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-citem .pm-cbadges { grid-area: bd; }
  .pm-cbg { font-size: 12px; padding: 3px 9px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-dist { padding: 12px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-distrow { gap: 10px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-distrow .pqm-df { flex: 1 1 100%; min-width: 0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-din, .pqm-overlay.pqm-ws-group.pqm-hep .pqm-dsel { min-height: 44px; font-size: 16px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-chk { align-items: flex-start; padding: 6px 0; min-height: 44px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-chk input { width: 22px; height: 22px; margin-top: 1px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-start { align-self: stretch; justify-content: center; min-height: 48px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-stats { gap: 14px; flex-wrap: wrap; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-tablewrap { overflow: visible; border: 0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table, .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody { display: block; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table thead { display: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "n g st" ". p p" ". r t"; column-gap: 8px; row-gap: 4px; align-items: center; padding: 10px 12px; margin-bottom: 8px; border: 1px solid #eef2f7; border-radius: 12px; background: #fff; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td { display: block; padding: 0; border: 0; min-width: 0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(1) { grid-area: n; color: #94a3b8; font-variant-numeric: tabular-nums; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(2) { grid-area: g; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(3) { grid-area: p; max-width: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(4) { display: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(5) { grid-area: st; justify-self: end; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(6) { grid-area: r; min-width: 0; overflow-wrap: anywhere; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td:nth-child(7) { grid-area: t; justify-self: end; color: #94a3b8; font-size: 12px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody td.pm-pg { display: flex; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table .pm-pg > span:last-child { min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table .pm-link { min-height: 36px; align-items: center; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table .pm-errmsg { white-space: normal; max-width: none; display: block; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr.on { background: #f5f7ff; border-color: #c7d2fe; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr.done { background: #f6fef9; border-color: #bbf7d0; }
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr.fail { background: #fef6f6; border-color: #fecaca; }
  /* vùng chạm ≥44px / ô nhập 16px (iOS không phóng to) */
  .pqm-overlay.pqm-ws-group.pqm-hep :is(.gmw-gsearch-in, .gmw-edall-txt, .db-cmtin, .db-cmtnum input) { font-size: 16px; }
  .gmw-edall-txt { font-size: 16px; resize: none; }
  .pqm-overlay.pqm-ws-group.pqm-hep .gmw-gsearch-in { height: 44px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .gmw-gall { min-height: 44px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .gmw-git { min-height: 48px; }
  .pqm-overlay.pqm-ws-group.pqm-hep .gmw-git > input, .pqm-overlay.pqm-ws-group.pqm-hep .gmw-gall input { width: 22px; height: 22px; }
  .gmw-git-open { width: 44px; height: 44px; margin: -9px -6px -9px 0; }
  .gmw-editor .db-sw2 span::before { content: ""; position: absolute; inset: -12px -8px; }
  .gmw-editor .gmw-fb-addbtn { width: 44px; height: 44px; }
  .gmw-editor .gmw-fb-mbtn { min-height: 44px; }
  .gmw-editor .db-cmtadd { min-height: 44px; }
  .gmw-editor .db-cmtnum input { padding-top: 11px; padding-bottom: 11px; }
  .gmw-editor .db-cmtdel { padding: 14px; margin: -14px -12px -14px -14px; }   /* -12px bên phải = vừa trong lề thẻ, không gây tràn ngang */
  .gmw-editor .db-cmtcam { width: 44px; height: 44px; }
  .gmw-editor .db-cmtmdel { width: 28px; height: 28px; top: -10px; right: -10px; }
  .gmw-editor .db-cmtmdel::after { content: ""; position: absolute; inset: -8px; }
  .gmw-edall-row .db-mdel { width: 44px; height: 44px; margin-top: 8px; font-size: 20px; }
  .gmw-edall-row .db-mgrip { width: 32px; margin-left: -4px; text-align: center; touch-action: none; }
  .gmw-bgmodal-x { width: 44px; height: 44px; }
  .swal2-popup.pqm-swal .pqm-swal-in.swal2-input { font-size: 16px !important; }
  /* chế độ tối (token của modern-theme: nền #151b25, thẻ #1e2735, vạch #2e3947); tương phản thực đo: #334155 trên #1e2735 = 1.45:1, #4f46e5 = 2.39:1 → cần ≥4.5:1 */
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group .pqm-nav { background: #12171e; border-color: #2e3947; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group .pqm-nav-item.on { background: #2a3547; color: #c7d2fe; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group .pqm-nav-item.on i { color: #a5b4fc; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-run-wrap { background: #1e2735; border-top-color: #2e3947; box-shadow: 0 -8px 20px -10px rgba(0, 0, 0, .6); }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr { background: #1e2735; border-color: #2e3947; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr.on { background: rgba(99, 102, 241, .14); border-color: rgba(99, 102, 241, .45); }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr.done { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-table tbody tr.fail { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-stats .cnt { color: #e5e7eb; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-stats .tm { color: #94a3b8; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pqm-mon-ttl { color: #a5b4fc; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-group.pqm-hep .pm-link { color: #a5b4fc; }
}
/* điện thoại nằm ngang / màn thấp: thanh nút chạy cuộn cùng nội dung (không ăn 1/3 màn hình) */
@media (max-height: 480px) and (max-width: 1024px) and (pointer: coarse), (max-width: 640px) and (max-height: 480px) {
  .pqm-overlay.pqm-ws-group.pqm-hep .pqm-sidepv .pqm-run-wrap { position: static; margin: 0; }
  .pqm-overlay.pqm-ws-group .pqm-topbar { padding: 4px 12px; }
}

/* ───────── 66. Tìm & tham gia nhóm (/tim-nhom, group-finder.js, .pqm-ws-finder) ───────── */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  /* công cụ "Tìm & tham gia": 2 thẻ (bộ lọc | kết quả) xếp chồng, .pqm-content cuộn dọc */
  .pqm-overlay.pqm-ws-finder .pqm-content { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .pqm-overlay.pqm-ws-finder .pqm-panel.tnf-flush { position: static; inset: auto; padding: 12px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel.tnf-flush .tnf-body { display: flex; flex-direction: column; gap: 12px; height: auto; overflow: visible; }
  .pqm-overlay.pqm-ws-finder .tnf-filters { height: auto; overflow: visible; border-right: 0; }
  .pqm-overlay.pqm-ws-finder .tnf-filters-scroll { overflow: visible; padding: 12px; gap: 10px; }
  .pqm-overlay.pqm-ws-finder .tnf-filters-footer { padding: 10px 12px; border-radius: 0 0 14px 14px; }
  .pqm-overlay.pqm-ws-finder .tnf-results { overflow: visible; }
  .pqm-overlay.pqm-ws-finder .tnf-sec-hd { border-radius: 12px 12px 0 0; }
  /* gợi ý tỉnh/thành nằm trong thẻ .tnf-sec-card (overflow:hidden) → bị cắt chỉ còn 1 vệt: mở thẻ khi danh sách đang hiện */
  .pqm-overlay.pqm-ws-finder .tnf-sec-card:has(.tnf-ta-menu:not([hidden])) { overflow: visible; }
  /* ô nhập: cao 44px, chữ 16px (iOS không phóng to) */
  .pqm-overlay.pqm-ws-finder .tnf-in { height: 44px; font-size: 16px; }
  .pqm-overlay.pqm-ws-finder .tnf-in::placeholder { font-size: 14px; }
  .pqm-overlay.pqm-ws-finder .tnf-input-ic { font-size: 17px; }
  .pqm-overlay.pqm-ws-finder .tnf-input-wrap .tnf-in { padding-left: 36px; }
  .pqm-overlay.pqm-ws-finder .tnf-ta-clear { top: 12px; right: 12px; font-size: 20px; }
  .pqm-overlay.pqm-ws-finder .tnf-ta-item { padding: 12px; font-size: 15px; }
  .pqm-overlay.pqm-ws-finder .tnf-range-box .tnf-in { padding-left: 42px; }
  .pqm-overlay.pqm-ws-finder .tnf-btn, .pqm-overlay.pqm-ws-finder .tnf-btn-reset { height: 44px; }
  .pqm-overlay.pqm-ws-finder .tnf-btn-reset { width: 44px; }
  .pqm-overlay.pqm-ws-finder .tnf-seg button { padding: 10px 8px; min-height: 40px; font-size: 13px; }
  .pqm-overlay.pqm-ws-finder .tnf-toggle-card { padding: 12px; min-height: 52px; }
  .pqm-overlay.pqm-ws-finder .tnf-link { min-height: 44px; padding: 0 12px; }
  .pqm-overlay.pqm-ws-finder .tnf-switch { width: 44px; height: 26px; }
  .pqm-overlay.pqm-ws-finder .tnf-slider:before { height: 20px; width: 20px; left: 3px; bottom: 3px; }
  .pqm-overlay.pqm-ws-finder .tnf-switch input:checked + .tnf-slider:before { transform: translateX(18px); }
  .pqm-overlay.pqm-ws-finder .tnf-badge-safe { font-size: 12px; }
  .pqm-overlay.pqm-ws-finder .tnf-cb { width: 22px; height: 22px; margin: 0; }
  /* kết quả: BẢNG → THẺ (mỗi nhóm 2 dòng), không cuộn ngang */
  .pqm-overlay.pqm-ws-finder .tnf-tablewrap { overflow: visible; }
  .pqm-overlay.pqm-ws-finder table.tnf-tbl:not(.gms-tbl) { min-width: 0; display: block; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) :is(thead, tbody) { display: block; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) thead tr { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 0; position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid #e2e8f0; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) thead th { display: block; position: static; padding: 0; border: 0; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) thead th.tnf-numh { display: none; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) thead th:nth-child(2) { flex: 1; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) thead th:first-child { width: 44px !important; height: 44px; display: flex; align-items: center; justify-content: center; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 4px; padding: 10px 12px 12px 0; border-bottom: 1px solid #f1f5f9; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody tr::after { content: ""; order: 3; flex: 0 0 100%; height: 0; }   /* ngắt dòng: 3 chỉ số xuống hàng 2, không va nhau ở 360px */
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td { display: block; padding: 0; border: 0; min-width: 0; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(1) { order: 1; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; height: 44px; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(2) { order: 1; flex: 1 1 0; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(6) { order: 2; flex: 0 0 auto; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(n+3):nth-child(-n+5) { order: 4; flex: 0 0 auto; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(3) { margin-left: 52px; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(4), .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(5) { margin-left: 8px; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td.tnf-numc { text-align: left; font-size: 12.5px; white-space: nowrap; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td.tnf-numc::before { font-family: "remixicon"; font-size: 14px; color: #94a3b8; margin-right: 4px; vertical-align: -1px; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(3)::before { content: "\ede3"; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(4)::before { content: "\ea7e"; }
  .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td:nth-child(5)::before { content: "\f274"; }
  .pqm-overlay.pqm-ws-finder .tnf-gname a { overflow-wrap: anywhere; padding: 12px 0; }   /* padding dọc của <a> inline mở rộng vùng bấm, không đổi bố cục / line-clamp */
  .pqm-overlay.pqm-ws-finder .tnf-join { min-height: 44px; padding: 0 12px; }
  .pqm-overlay.pqm-ws-finder .tnf-badge { padding: 6px 12px; }
  .pqm-overlay.pqm-ws-finder .tnf-av { width: 40px; height: 40px; }
  .pqm-overlay.pqm-ws-finder .tnf-rbar { padding: 8px 12px; gap: 8px; }
  /* công cụ "Quét thành viên": panel là THẺ cuộn dọc (điều khiển cuộn đi, chân trang dính đáy) */
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] { position: absolute; inset: 12px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-phead { padding: 10px 14px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-phead-t { display: none; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-phead-s { margin: 0; font-size: 12.5px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-pbody { overflow-y: auto; display: block; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gbar { padding: 10px 12px; gap: 8px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqs-url,
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gsearch { flex: 1 1 100%; min-width: 0; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gbar .pqm-gsearch-in { height: 44px; font-size: 16px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gbar .pqm-gsel { flex: 1 1 0; min-width: 0; height: 44px; font-size: 16px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gbar .pqm-btn { height: 44px; flex: 1 1 calc(50% - 4px); justify-content: center; white-space: nowrap; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] #gms_scanBtn,
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] #gms_stopBtn { flex: 1 1 0; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gsp { display: none; }
  .pqm-overlay.pqm-ws-finder .gms-listwrap { overflow: visible; flex: none; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gfoot { position: sticky; bottom: 0; background: #fff; padding: 8px 12px; gap: 8px; }
  .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gstat { flex: 1 1 100%; white-space: normal; }
  .pqm-overlay.pqm-ws-finder .gms-tbl { min-width: 0; display: block; }
  .pqm-overlay.pqm-ws-finder .gms-tbl :is(thead, tbody) { display: block; }
  .pqm-overlay.pqm-ws-finder .gms-tbl thead { display: none; }
  .pqm-overlay.pqm-ws-finder .gms-tbl tbody tr { position: relative; display: block; padding: 10px 116px 10px 12px; min-height: 64px; border-bottom: 1px solid #f1f5f9; }
  .pqm-overlay.pqm-ws-finder .gms-tbl tbody td { display: block; padding: 0; border: 0; min-width: 0; }
  .pqm-overlay.pqm-ws-finder .gms-tbl tbody td:nth-child(1), .pqm-overlay.pqm-ws-finder .gms-tbl tbody td.gms-joincol { display: none; }
  .pqm-overlay.pqm-ws-finder .gms-tbl .pqs-user, .pqm-overlay.pqm-ws-finder .gms-tbl .pqs-uid { height: auto; }
  .pqm-overlay.pqm-ws-finder .gms-tbl .pqs-uid { margin-top: 2px; }
  .pqm-overlay.pqm-ws-finder .gms-tbl .pqs-mono { font-size: 12.5px; color: #64748b; }
  /* hai nút 44px (sao chép UID | mở hồ sơ) đặt tuyệt đối bên phải hàng → hàng chỉ cao ~64px thay vì ~111px (60 thành viên: 3.8k px thay vì 6.7k px) */
  .pqm-overlay.pqm-ws-finder .gms-tbl .pqs-uid .pqm-gic { position: absolute; right: 60px; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 10px; font-size: 18px; }
  .pqm-overlay.pqm-ws-finder .gms-tbl tbody td:nth-child(5) { position: absolute; right: 8px; top: 50%; margin-top: -22px; }
  .pqm-overlay.pqm-ws-finder .gms-tbl tbody td:nth-child(5) .pqm-gic { width: 44px; height: 44px; border-radius: 10px; font-size: 18px; }
  .pqm-overlay.pqm-ws-finder .gms-tbl .pqm-gth { width: 36px; height: 36px; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) thead tr { background: #161b22; border-bottom-color: #2a3341; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody tr,
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .gms-tbl tbody tr { border-bottom-color: #232b36; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td.tnf-numc { color: #cbd5e1; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .tnf-tbl:not(.gms-tbl) tbody td.tnf-numc::before { color: #64748b; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .pqm-panel[data-panel="quet-tv"] .pqm-gfoot { background: #1e2735; }
  [data-bs-theme="dark"] .pqm-overlay.pqm-ws-finder .gms-tbl .pqs-mono { color: #94a3b8; }
}

/* ───────── 67. Công cụ BM bằng Token (#bmTokenPanel, bm-token.css — thay khối @media 620px cũ) ───────── */
@media (max-width: 640px) {
  .bmt-hd { padding: 10px 12px; gap: 10px; }
  .bmt-hd-sub { display: none; }
  .bmt-scroll { padding: 12px; gap: 12px; }
  .bmt-card { padding: 14px; border-radius: 14px; }
  .bmt-row2, .bmt-row3 { flex-direction: column; align-items: stretch; gap: 12px; }
  .bmt-row2 .bmt-field, .bmt-row3 .bmt-field { flex: none; width: 100%; }
  .bmt-verify > .bmt-lb { display: none; }   /* nhãn &nbsp; giữ cho nút thẳng hàng ở màn rộng → thừa 1 dòng ở màn hẹp */
  /* dải tab: 2×2 có NHÃN (bản cũ ẩn chữ → chỉ còn icon không tự giải nghĩa) */
  .bmt-tabs { grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; }
  .bmt-tab { flex-direction: row; justify-content: center; gap: 8px; padding: 0 8px; font-size: 13px; }
  .bmt-tab span { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bmt-tab i { font-size: 18px; flex-shrink: 0; }
  .bmt-panel-hd { font-size: 15px; margin-bottom: 12px; }
  .bmt-panel-actions { justify-content: stretch; margin-top: 0; }
  .bmt-panel-actions .btn { flex: 1 1 140px; }
  .bmt-count { flex: 1 1 100%; text-align: center; }
  /* khung kết quả "Kiểm tra": display:flex tách từng nút văn bản thành cột (tên BM dài bị bóp 5 dòng) → để chữ chạy liên tục */
  .bmt-bminfo { display: block; line-height: 1.5; overflow-wrap: anywhere; }
  .bmt-bminfo > i { margin-right: 6px; vertical-align: -2px; }
  /* bảng → thẻ (2 dòng): nút Hủy/Xóa luôn thấy, không cuộn ngang */
  .bmt-tablewrap { overflow: visible; margin-top: 10px; }
  .bmt-table, .bmt-table tbody { display: block; width: 100%; }
  .bmt-table thead { display: none; }
  .bmt-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "t t act" "r s act"; align-items: center; column-gap: 10px; row-gap: 6px; padding: 12px 0; border-bottom: 1px solid #e8eaf1; }
  [data-bs-theme="dark"] .bmt-table tbody tr { border-bottom-color: #262c36; }
  .bmt-table tbody tr:hover { background: transparent; }
  .bmt-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .bmt-table td:nth-child(1) { grid-area: t; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
  .bmt-table td:nth-child(2) { grid-area: r; }
  .bmt-table td:nth-child(3) { grid-area: s; font-size: 12.5px; color: #64748b; overflow-wrap: anywhere; }
  .bmt-table td.bmt-td-act { grid-area: act; align-self: stretch; display: flex; align-items: center; }
  .bmt-badge { padding: 3px 10px; font-size: 12px; }
  .bmt-empty { padding: 24px 12px; }
  .bmt-log { max-height: 180px; }
}
/* cảm ứng (điện thoại + tablet + ngang): vùng chạm ≥44px, ô nhập 16px (iOS không phóng to) */
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  .bmt-back { height: 44px; padding: 0 14px 0 10px; border-radius: 12px; }
  .bmt-overlay .form-control, .bmt-overlay .form-select { min-height: 48px; font-size: 16px; }
  .bmt-overlay .btn { min-height: 48px; font-size: 14px; font-weight: 600; }
  .bmt-overlay .bmt-table .btn { min-height: 44px; padding: 0 14px; }
  .bmt-tab { min-height: 48px; }
  .bmt-copybox .form-control { padding-right: 56px; }
  .bmt-copybtn { width: 48px; }
  .bmt-log-hd { min-height: 48px; padding-top: 0; padding-bottom: 0; }
  .bmt-log-clear { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; }
  /* nút chat nổi không đè lên ô nhập/nút: ẩn khi panel đang mở */
  body:has(#bmTokenPanel) .sup-chat:not(.open):not(.sup-unread) { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; visibility: hidden; }
}
@media (max-height: 480px) and (max-width: 1024px) and (pointer: coarse) {
  .bmt-hd { padding: 4px 12px; }
  .bmt-hd-ic { display: none; }
  .bmt-scroll { padding: 8px 12px; gap: 8px; }
}

/* ═════════════════════════ Hộp thư Trang (page-inbox.js, .pmb-*) — E3b ═════════════════════════
   Điện thoại ≤640px: danh sách → hội thoại là 2 bước (page-inbox.js đổi lớp .pmb-has-thread, nút ← / ⓘ chỉ được dựng ở điện thoại);
   tablet dọc / điện thoại nằm ngang 641–900px: 2 khung, thông tin = tấm trượt từ phải (nút ⓘ, lớp .pmb-show-info).
   ⚠ KHÔNG đặt tên lớp trạng thái là .pmb-thread-open: lớp đó ĐÃ DÙNG cho nút "Mở trong Facebook" trong đầu hội thoại. */

/* ───────── 68. Hộp thư — điện thoại dọc ───────── */
.pmb-thread-back, .pmb-thread-info { display: none; }
@media (max-width: 640px) {
  /* lưới 1 cột KHÔNG nở theo nội dung (gốc rễ +439px): minmax(0,1fr) thay cho 1fr (= minmax(auto,1fr)) */
  .pmb-tab-inbox, .pmb-tab-comments { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .pmb-stats-2col { grid-template-columns: minmax(0, 1fr); }
  /* hai bước: danh sách → hội thoại */
  .pmb-modal:not(.pmb-has-thread) .pmb-col-thread { display: none; }
  .pmb-modal.pmb-has-thread .pmb-col-list, .pmb-modal.pmb-has-thread .pmb-head { display: none; }
  /* đầu trang: 2 hàng gọn (← · Trang ▾ · ⚙ 🔔 ⟳ / 3 tab dạng segmented, COPY .mtab-seg) */
  .pmb-head { flex-wrap: wrap; gap: 8px; padding: 8px 10px 6px; }
  .pmb-title, .pmb-head-sp { display: none; }
  .pmb-back { order: 1; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .pmb-back span { display: none; }
  .pmb-back i { font-size: 20px; }
  .pmb-pagesel { order: 2; flex: 1 1 0; min-width: 0; max-width: none; height: 40px; padding: 0 10px; font-size: 16px; border-radius: 12px; text-overflow: ellipsis; }
  .pmb-icon { order: 3; width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
  .pmb-tabs { order: 4; flex: 1 1 100%; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: #f1f5f9; border: 1px solid #e2e8f0; }
  .pmb-tab-btn { flex: 1 1 0; min-width: 0; height: 40px; padding: 0 6px; justify-content: center; gap: 6px; border-radius: 9px; font-size: 13px; white-space: nowrap; }
  .pmb-tab-btn.on { color: #5b4df0; box-shadow: 0 2px 8px rgba(30, 41, 90, 0.14); }
  [data-bs-theme="dark"] .pmb-tabs { background: #1b2433; border-color: rgba(255, 255, 255, 0.1); }
  [data-bs-theme="dark"] .pmb-tab-btn { color: #94a3b8; }
  [data-bs-theme="dark"] .pmb-tab-btn.on { background: #2e3a4b; color: #c9b8ff; box-shadow: none; }
  /* danh sách hội thoại */
  .pmb-list-top { padding: 10px 10px 6px; gap: 6px; }
  .pmb-search-box { height: 44px; padding: 0 12px; border-radius: 12px; gap: 8px; }
  .pmb-search-box i { font-size: 18px; }
  .pmb-search { height: 100%; font-size: 16px; }
  .pmb-list-count { font-size: 12px; }
  .pmb-filters { gap: 8px; padding: 0 10px 8px; }
  .pmb-chip { height: 36px; padding: 0 14px; font-size: 13px; }
  .pmb-filt-nav { display: none !important; }
  .pmb-conv-list, .pmb-messages, .pmb-col-info, .pmb-tab-stats, .pmb-picker-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .pmb-conv { gap: 12px; padding: 12px; }
  .pmb-conv > .pmb-av { width: 48px; height: 48px; }
  .pmb-conv-name { font-size: 15px; }
  .pmb-conv-snip { font-size: 13.5px; }
  .pmb-conv-time, .pmb-conv-page { font-size: 12px; }
  .pmb-tag { font-size: 11.5px; }
  .pmb-unread { min-width: 22px; height: 22px; font-size: 12px; }
  /* hội thoại */
  .pmb-thread-head { height: 56px; min-height: 56px; padding: 0 6px 0 4px; gap: 6px; }
  .pmb-thread-back, .pmb-thread-info, .pmb-thread-open { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: #64748b; font-size: 22px; padding: 0; }
  .pmb-thread-info { font-size: 20px; }
  .pmb-modal.pmb-show-info .pmb-thread-info { background: #eef2ff; color: #5b4df0; }
  [data-bs-theme="dark"] .pmb-modal.pmb-show-info .pmb-thread-info { background: #2e3a4b; color: #c9b8ff; }
  .pmb-thread-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pmb-thread-sub { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pmb-messages { padding: 12px 10px; }
  .pmb-bubble { max-width: calc(100% - 74px); padding: 9px 13px; font-size: 15px; }
  .pmb-msg-img { max-width: 220px; max-height: 260px; object-fit: cover; }
  .pmb-msg-file { min-height: 32px; align-items: center; }
  .pmb-msg-reply { opacity: 0.55; width: 32px; height: 32px; font-size: 15px; }
  .pmb-msg.grp-last .pmb-bubble[title]::after { content: attr(title); display: block; margin-top: 3px; font-size: 11px; line-height: 1.2; opacity: 0.6; }
  .pmb-composer { padding: 6px 10px 10px; }
  .pmb-comp-tools { gap: 4px; margin-bottom: 4px; }
  .pmb-ct { width: 40px; height: 40px; font-size: 21px; }
  .pmb-input { min-height: 44px; padding: 10px 14px; font-size: 16px; border-radius: 14px; }
  .pmb-send { width: 44px; height: 44px; border-radius: 14px; }
  .pmb-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* placeholder dài gãy 2 dòng + bị cắt trong ô 1 dòng */
  /* nút chat nổi KHÔNG đè nút Gửi / cột phải của danh sách */
  body:has(.pmb-tab-inbox) .sup-chat:not(.open) { opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none; visibility: hidden; }
  .pmb-mode-btn { height: 36px; padding: 0 12px; font-size: 13px; }
  .pmb-reply-x { width: 40px; height: 40px; align-items: center; justify-content: center; font-size: 20px; }
  .pmb-cmt-act { width: 36px; height: 36px; font-size: 16px; }
  /* thông tin / nhãn / ghi chú: tấm trượt phủ dưới đầu hội thoại (nút ⓘ) */
  .pmb-modal.pmb-show-info .pmb-col-info { display: block; position: absolute; left: 0; right: 0; bottom: 0; top: 56px; z-index: 30; background: #fff; border-left: 0; overflow-y: auto; }
  [data-bs-theme="dark"] .pmb-modal.pmb-show-info .pmb-col-info { background: #1e2530; }
  .pmb-info-page { display: block; }
  .pmb-tagopt, .pmb-tagnew { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .pmb-note { min-height: 120px; font-size: 16px; padding: 10px 12px; }
  /* popover (emoji / trả lời nhanh / nhãn mới) → tấm đáy full bề ngang, neo trên hàng công cụ */
  .pmb-pop { left: 8px !important; right: 8px !important; width: auto !important; max-height: 55%; overflow-y: auto; z-index: 45; border-radius: 16px; padding: 10px; }
  .pmb-pop-emoji { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
  .pmb-emo { height: 40px; font-size: 24px; }
  .pmb-quick-item { min-height: 44px; padding: 8px 10px; }
  .pmb-quick-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -10px -8px 0; font-size: 18px; }
  .pmb-quick-title, .pmb-quick-text, .pmb-tag-name { min-height: 44px; font-size: 16px; }
  .pmb-btn-primary, .pmb-btn-ghost { min-height: 44px; }
  .pmb-cdot { width: 32px; height: 32px; }
  /* thống kê */
  .pmb-tab-stats { padding: 14px 12px 20px; }
  .pmb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pmb-kpi:last-child { grid-column: 1 / -1; }
  .pmb-kpi { padding: 12px; gap: 10px; }
  .pmb-kpi-ic { width: 38px; height: 38px; font-size: 19px; }
  .pmb-kpi-val { font-size: 20px; }
  .pmb-stats-card { padding: 14px 12px; }
  .pmb-bar-lbl { width: 38%; }
  .pmb-table { min-width: 440px; }
  .pmb-table td:first-child { min-width: 150px; }
  .pmb-table td:not(:first-child) { white-space: nowrap; }
  /* chọn Trang: tấm đáy */
  .pmb-picker-ov { padding: 0; align-items: flex-end; }
  .pmb-picker { width: 100%; max-height: 92%; border-radius: 20px 20px 0 0; }
  .pmb-picker-hd { padding: 14px 16px 10px; }
  .pmb-picker-tools { flex-wrap: wrap; padding: 8px 16px; }
  .pmb-picker-sb { flex: 1 1 100%; height: 44px; }
  .pmb-picker-search { font-size: 16px; height: 100%; }
  .pmb-picker-tools .pmb-btn-ghost { flex: 1 1 0; }
  .pmb-picker-tools .pmb-picker-reload { flex: 0 0 44px; padding: 0; }
  .pmb-pick { min-height: 52px; }
  .pmb-pick input { width: 22px; height: 22px; }
  .pmb-picker-x { width: 40px; height: 40px; }
  .pmb-picker-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .pmb-picker-save { min-height: 44px; }
  /* nền tối: các chỗ KHÔNG có luật tối sẵn (chữ #334155/#475569/#64748b trên nền #1e2530 ≈ 1.6–3:1) */
  [data-bs-theme="dark"] .pmb-pop-hd, [data-bs-theme="dark"] .pmb-quick-t { color: #e2e8f0; }
  [data-bs-theme="dark"] .pmb-quick-add { border-top-color: #2e3947; }
  [data-bs-theme="dark"] .pmb-quick-x { color: #64748b; }
  [data-bs-theme="dark"] .pmb-cdot.on { border-color: #f1f5f9; box-shadow: 0 0 0 2px #1e2530 inset; }
  [data-bs-theme="dark"] .pmb-stats-scope, [data-bs-theme="dark"] .pmb-bar-lbl { color: #cbd5e1; }
  [data-bs-theme="dark"] .pmb-bar-val { color: #e2e8f0; }
  [data-bs-theme="dark"] .pmb-noreply { background: #3a2e12; border-color: #5c4a1c; color: #fbbf24; }
  [data-bs-theme="dark"] .pmb-picker-sub, [data-bs-theme="dark"] .pmb-picker-count, [data-bs-theme="dark"] .pmb-kpi-lbl { color: #94a3b8; }
  [data-bs-theme="dark"] .pmb-picker-tools .pmb-search-box { background: #262f3c; }
}
/* màn rất hẹp (≤380: Android 360, iPhone SE/mini 375): nút ← dư (thanh dưới đã có "Pages") → nhường chỗ cho ô chọn Trang */
@media (max-width: 380px) {
  .pmb-back { display: none; }
}

/* ───────── 69. Hộp thư — tablet cảm ứng + điện thoại nằm ngang (641–1024px) ───────── */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .pmb-back { height: 40px; }
  .pmb-icon { width: 40px; height: 40px; }
  .pmb-pagesel { height: 40px; font-size: 16px; }
  .pmb-tab-btn { height: 36px; }
  .pmb-search-box { height: 44px; padding: 0 12px; }
  .pmb-search, .pmb-picker-search { height: 100%; font-size: 16px; }
  .pmb-tag { font-size: 11.5px; }
  .pmb-conv-time, .pmb-conv-page, .pmb-list-count { font-size: 12px; }
  .pmb-chip { height: 36px; padding: 0 14px; }
  .pmb-filt-nav { display: none !important; }
  .pmb-ct { width: 40px; height: 40px; font-size: 21px; }
  .pmb-input { min-height: 44px; font-size: 16px; }
  .pmb-send { width: 44px; height: 44px; }
  .pmb-note, .pmb-quick-title, .pmb-quick-text, .pmb-tag-name { font-size: 16px; }
  .pmb-tagopt, .pmb-tagnew { min-height: 36px; padding: 0 12px; }
  .pmb-msg-reply { opacity: 0.55; width: 32px; height: 32px; }
  .pmb-cmt-act { width: 36px; height: 36px; }
  .pmb-quick-item { min-height: 44px; }
  .pmb-quick-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; }
  .pmb-emo { height: 40px; }
  .pmb-cdot { width: 32px; height: 32px; }
  .pmb-pick { min-height: 52px; }
  .pmb-pick input { width: 22px; height: 22px; }
  .pmb-picker-save, .pmb-btn-primary, .pmb-btn-ghost { min-height: 44px; }
  .pmb-conv-list, .pmb-messages, .pmb-col-info, .pmb-tab-stats, .pmb-picker-list { overscroll-behavior: contain; }
  body:has(.pmb-tab-inbox) .sup-chat:not(.open) { opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none; visibility: hidden; }
}
/* tablet dọc + điện thoại NẰM NGANG (≤900): 2 khung danh sách | hội thoại, thông tin = tấm trượt từ phải (nút ⓘ) */
@media (min-width: 641px) and (max-width: 900px) and (pointer: coarse) {
  .pmb-tab-inbox, .pmb-tab-comments { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .pmb-stats-2col { grid-template-columns: minmax(0, 1fr); }
  .pmb-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pmb-head { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  .pmb-title, .pmb-head-sp { display: none; }
  .pmb-back { width: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .pmb-back span { display: none; }
  .pmb-pagesel { flex: 1 1 0; min-width: 120px; max-width: none; border-radius: 12px; }
  .pmb-icon { border-radius: 12px; }
  .pmb-tabs { flex: none; }
  .pmb-tab-btn { padding: 0 12px; white-space: nowrap; }
  .pmb-thread-info, .pmb-thread-open { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: #64748b; font-size: 20px; padding: 0; }
  .pmb-modal.pmb-show-info .pmb-thread-info { background: #eef2ff; color: #5b4df0; }
  .pmb-thread-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pmb-thread-sub { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pmb-body { position: relative; }
  .pmb-modal.pmb-show-info .pmb-col-info { display: block; position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 100%); z-index: 30; background: #fff; border-left: 1px solid #eef2f7; box-shadow: -12px 0 32px rgba(15, 23, 42, 0.14); overflow-y: auto; }
  [data-bs-theme="dark"] .pmb-modal.pmb-show-info .pmb-col-info { background: #1e2530; border-left-color: #2e3947; }
  .pmb-bubble { max-width: calc(100% - 74px); font-size: 15px; }
  .pmb-pop { z-index: 45; max-height: 60%; overflow-y: auto; }
  .pmb-picker-ov { padding: 16px; }
}

/* ───────── 70. Hộp thư — màn THẤP cảm ứng (điện thoại nằm ngang ≤500px cao, hoặc bàn phím ảo đang mở) ───────── */
@media (max-height: 500px) and (pointer: coarse) {
  .pmb-list-count { display: none; }
  .pmb-list-top { padding: 6px 10px 4px; }
  .pmb-search-box { height: 38px; }
  .pmb-filters { padding-bottom: 6px; }
  .pmb-chip { height: 32px; }
  .pmb-head { padding: 4px 10px; gap: 6px; }
  .pmb-back, .pmb-icon { width: 36px; height: 36px; }
  .pmb-pagesel { height: 36px; }
  .pmb-tab-btn { height: 32px; }
  .pmb-thread-head { height: 48px; min-height: 48px; }
  .pmb-modal.pmb-show-info .pmb-col-info { top: 48px; }
  .pmb-messages { padding: 8px 10px; }
  /* khung soạn 1 hàng: công cụ + ô nhập + Gửi */
  .pmb-composer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 6px; padding: 6px 10px; }
  .pmb-comp-tools { flex: none; margin: 0; }
  .pmb-comp-row { flex: 1 1 0; min-width: 0; }
  .pmb-reply-bar, .pmb-noreply, .pmb-mode { flex: 1 1 100%; margin-bottom: 0; }
  .pmb-input { min-height: 40px; }
  .pmb-send { width: 40px; height: 40px; }
  .pmb-tab-stats { padding: 10px 12px; }
}

/* ───────── 71. Bộ chọn khoảng ngày của toolbar /ads (#dateRangePicker trong khay ⋯) — 1 tháng, ‹ › cạnh tiêu đề, ô ngày 44px, mốc nhanh thành chip, chân dính đáy ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .tkqc-toolbar.tbm .tbm-tray .drp-presets {
    display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; min-width: 0; gap: 8px; padding: 12px; background: transparent; border: 0;
  }
  .tkqc-toolbar.tbm .tbm-tray .drp-preset {
    flex: 0 0 auto; display: flex; align-items: center; min-height: 40px; padding: 0 14px;
    border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 999px; font-size: 13.5px;
  }
  .tkqc-toolbar.tbm .tbm-tray .drp-preset.active { border-color: #6366f1; }
  .tkqc-toolbar.tbm .tbm-tray .drp-calendars {
    display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; column-gap: 4px; padding: 4px 12px 12px;
  }
  .tkqc-toolbar.tbm .tbm-tray #drpCalLeft { display: contents; }
  .tkqc-toolbar.tbm .tbm-tray #drpCalRight { display: none; }
  .tkqc-toolbar.tbm .tbm-tray #drpNavPrev { grid-row: 1; grid-column: 1; width: 44px; height: 44px; }
  .tkqc-toolbar.tbm .tbm-tray #drpNavNext { grid-row: 1; grid-column: 3; width: 44px; height: 44px; }
  .tkqc-toolbar.tbm .tbm-tray #drpCalLeft .drp-cal-header { grid-row: 1; grid-column: 2; justify-content: center; }
  .tkqc-toolbar.tbm .tbm-tray #drpCalLeft .drp-cal-grid { grid-row: 2; grid-column: 1 / -1; margin-top: 6px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-cal-grid .drp-day { width: 100%; max-width: 44px; height: auto; aspect-ratio: 1; margin: 1px 0; justify-self: center; font-size: 15px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-cselect-btn { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-cselect-list { max-height: min(240px, 40dvh); overflow-y: auto; }
  .tkqc-toolbar.tbm .tbm-tray .drp-cselect-item { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-footer { position: sticky; bottom: -10px; background: inherit; flex-wrap: wrap; gap: 10px; padding: 10px 12px 20px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-footer .drp-range-text { flex: 1 1 100%; text-align: center; }
  .tkqc-toolbar.tbm .tbm-tray .date-range-picker .drp-footer > div { display: flex; gap: 8px; width: 100%; }
  .tkqc-toolbar.tbm .tbm-tray .drp-footer .btn-sm { flex: 1 1 0; width: auto; margin: 0 !important; padding: 0 18px !important; font-size: 14px; justify-content: center !important; text-align: center; }
}
/* màn thấp (điện thoại nằm ngang): mốc nhanh = 1 hàng cuộn ngang, chân 1 hàng [khoảng ngày | Hủy | Áp dụng] để còn chỗ cho lịch */
@media (max-height: 520px) and (pointer: coarse) {
  .tkqc-toolbar.tbm .tbm-tray .drp-presets { flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; scrollbar-width: none; }
  .tkqc-toolbar.tbm .tbm-tray .drp-presets::-webkit-scrollbar { display: none; }
  .tkqc-toolbar.tbm .tbm-tray .drp-preset { min-height: 36px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-footer { flex-wrap: nowrap; align-items: center; padding: 8px 12px 18px; }
  .tkqc-toolbar.tbm .tbm-tray .drp-footer .drp-range-text { flex: 1 1 0; min-width: 0; text-align: left; }
  .tkqc-toolbar.tbm .tbm-tray .date-range-picker .drp-footer > div { flex: none; width: auto; }
  .tkqc-toolbar.tbm .tbm-tray .drp-footer .btn-sm { flex: none; min-width: 96px; height: 40px !important; }
}

/* ───────── 72. Sửa sau đợt rà soát độc lập 15/11/2026 (F2-01, E3e-01/02/03, D2-01, X2-02, E3c-01, E4-02/F4-02) ───────── */
/* F2-01: menu chuột phải của lưới (#contextMenu: 3 cột 720px / 2 cột 480px, mục 34px) → bảng từ đáy 1 cột, cuộn được, mục 48px. Nền mờ = bóng đổ khổng lồ (KHÔNG dùng body:has — :has gốc làm tính lại kiểu cả trang) */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  body #contextMenu.open { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; max-width: none !important; max-height: 78vh; max-height: 78dvh; overflow-y: auto; overscroll-behavior: contain; display: flex !important; flex-direction: column; gap: 8px; background: var(--bg-card, #fff) !important; border-radius: 18px 18px 0 0 !important; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .45) !important; z-index: 2000; }
  body #contextMenu.ctx-2col::after, body #contextMenu.ctx-2col::before { display: none; }
  body #contextMenu .ctx-col { width: 100% !important; flex: 0 0 auto !important; }
  body #contextMenu .dropdown-menu { position: static !important; display: block !important; float: none; width: auto; min-width: 0 !important; margin: 0 !important; box-shadow: none !important; border: 0 !important; background: transparent !important; }
  body #contextMenu .dropdown-item { min-height: 48px; display: flex; align-items: center; font-size: 15px !important; padding: 10px 12px !important; }
}
@media (max-width: 640px) {
  /* E3e-01: ô số liệu cổng khách xếp dọc (icon trên, số dưới) → "1.489.653.390 VND" không bị bẻ giữa chữ số */
  .shp-stat { flex-direction: column; align-items: flex-start; gap: 8px; }
  .shp-stat-v { overflow-wrap: normal; word-break: normal; }
  /* E3e-02/03: tên chiến dịch/nhãn/văn bản AI dài liền không dấu cách: bẻ được, không cắt cụt, không đẩy rộng cả trang */
  .shp-c-name, .shp-title, .shp-sub, .shp-ai-body, .shp-ai-err { overflow-wrap: anywhere; min-width: 0; }
  .shp-c-top { align-items: flex-start; }
  .shp-brand > div:last-child { min-width: 0; }
  /* D2-01: thẻ gói — viên giá xuống dưới tên (giá 152px không co làm cột tên còn 31–49px ở 360/375) */
  .pkg-card { grid-template-columns: 48px minmax(0, 1fr); }
  .pkg-card-icon { grid-row: 1 / span 4; }
  .pkg-card-name { grid-column: 2; grid-row: 1; }
  .pkg-card-price-row { grid-column: 2; grid-row: 2; justify-self: start; }
  .pkg-card-sessions { grid-column: 2; }
  /* E4-02/F4-02: ô nhập của Cài đặt ≥16px (iOS không tự phóng to) */
  .sec-inp { font-size: 16px; }
  #licenseKey, .form-control.token-hidden, .gsheet-custom-input { font-size: 16px !important; }
}
@media (min-width: 641px) and (max-width: 900px) and (pointer: coarse) {
  /* X2-02: tấm thông tin hộp thư (tablet dọc/ngang) chừa đầu hội thoại để còn chạm ⓘ đóng lại */
  .pmb-modal.pmb-show-info .pmb-col-info { top: 66px; }
}
@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
  /* E3c-01: thẻ Nhật ký của Công cụ BM bằng Token bị bóp còn 2px (flex column + overflow:auto) */
  .bmt-scroll > * { flex-shrink: 0; }
}

/* ───────── 73. Sửa nhỏ sau phản biện đợt 2 (C6-01, C3-01, C9-03/D5-02) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  /* C6-01/C3-01: mục 1 đã đổi CHỮ sang sáng ở chế độ tối nhưng nền inline sáng (#fef3c7/#fef2f2/#ecfdf5) còn nguyên → tương phản 1,3–1,7:1; đổi nền theo */
  [data-bs-theme="dark"] .swal2-popup :is(div, span)[style*="background:#fef3c7"], [data-bs-theme="dark"] .swal2-popup :is(div, span)[style*="background: #fef3c7"] { background: rgba(245, 158, 11, .14) !important; }
  [data-bs-theme="dark"] .swal2-html-container span[style*="background: #fef2f2"] { background: rgba(239, 68, 68, .16) !important; border-color: rgba(239, 68, 68, .4) !important; color: #fca5a5 !important; }
  [data-bs-theme="dark"] .swal2-html-container [style*="background: #ecfdf5"] { background: rgba(16, 185, 129, .16) !important; border-color: rgba(16, 185, 129, .4) !important; color: #6ee7b7 !important; }
  /* C9-03/D5-02: hộp đọc thư đặt height cố định nhưng Swal là grid (hàng auto chia đều phần dư → khoảng trắng ~300px trên/dưới tiêu đề, thư chỉ còn nửa hộp) → flex cột, thư chiếm phần còn lại */
  .swal2-popup.mt-modal { display: flex !important; flex-direction: column; }
  .swal2-popup.mt-modal > .swal2-html-container { flex: 1 1 auto; min-height: 0; }
  .swal2-popup.mt-modal > .swal2-close { align-self: flex-end; }
}

/* ───────── 74. Máy cảm ứng: bỏ nút "Tải Extension" ở ngăn kéo (không cài được extension Chrome trên điện thoại/tablet; hộp "Cần cài Extension" bỏ ở scripts.js). KHÔNG xoá node: scripts.js/via.js còn tìm #hmSideDownload để gắn href ───────── */
@media (pointer: coarse) {
  #hmSideDownload { display: none !important; }
  /* cùng điều kiện: mục "Kết nối điện thoại" (/agent — trang của MÁY TÍNH) nhường chỗ cho "Kết nối máy tính" (/remote, style.css) */
  #hmSideAgent { display: none !important; }
}

/* ───────── 75. Máy cảm ứng CHƯA có cầu nối extension (libs.js bỏ qua khởi tạo → html.fx-boot-bailed): giao diện GIỐNG HỆT Chrome máy tính — thanh công cụ ▶/ô tìm/⋯, tab Bảng/Chức năng + số n/N, sắp xếp, Kho "+", kéo-thả, ✕, công tắc, ⓘ; thẻ chỉ mờ/khoá khi tài khoản HẾT HẠN (như bên máy tính). ▶/Tải dữ liệu/menu công cụ hiện hộp "cần máy tính" (scripts.js). Còn lại 2 luật: khung "Thêm tính năng" cũ chờ scripts.js quyết định (thẻ/danh mục) rồi mới hiện; danh mục chữ dự phòng (html.fx-cat-on) kiểu thẻ Kho tính năng, 1 cột ───────── */
@media (pointer: coarse) {
  html.fx-boot-bailed:not(.fx-cat-off):not(.fx-cards-on):not(.fx-cat-on) .fx-feat-empty,
  html.fx-cat-on .fx-fsearch-empty { display: none !important; }
  .fx-cat { display: flex; flex-direction: column; gap: 8px; }
  .fx-cat-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
  .fx-cat-ic { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--fx-cat-bg); }
  .fx-cat-ic i { font-size: 18px; color: var(--fx-cat-c); }
  .fx-cat-txt { min-width: 0; }
  .fx-cat-name { font-size: 13px; font-weight: 700; color: #1a1a1a; }
  .fx-cat-desc { margin-top: 2px; font-size: 12px; line-height: 1.5; color: #6b7280; overflow-wrap: anywhere; }
  .fx-cat-none { padding: 40px 0; text-align: center; font-size: 13px; color: #9ca3af; }
  [data-bs-theme="dark"] .fx-cat-item { background: var(--bg-card); border-color: var(--border-light); box-shadow: none; }
  [data-bs-theme="dark"] .fx-cat-name { color: #e2e8f0; }
  [data-bs-theme="dark"] .fx-cat-desc { color: #94a3b8; }
}

/* ───────── 76. Chrome cũ (Android ≤107, iOS ≤15.3) KHÔNG có đơn vị dvh. Khai báo `calc(100dvh − …)` CÓ env()/var() không bị bỏ lúc phân tích (hàm thay thế được kiểm muộn) mà hỏng lúc tính giá trị → height:auto: .account-wrapper co về ~100px, vùng Bảng/Chức năng trống (đo trên Realme RMX3611, Chrome 103). Viết lại các khai báo đó bằng --fx-dvh (scripts.js gán = innerHeight/100 px, cập nhật khi xoay/đổi thanh địa chỉ). Chrome mới: @supports sai → khối này không áp ───────── */
@supports not (height: 100dvh) {
  @media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
    .tkqc-toolbar.tbm { --tbm-max: calc(var(--fx-dvh, 1vh) * 100 - 123px); }
  }
  @media (max-width: 640px) {
    :root { --fx-dlg-avail: calc(var(--fx-dvh, 1vh) * 100 - 24px - var(--fx-swal-bottom)); }
    .account-wrapper { height: calc(var(--fx-dvh, 1vh) * 100 - 112px) !important; }
    body.fiox-has-expired-bar .account-wrapper { height: calc(var(--fx-dvh, 1vh) * 100 - 112px - var(--fiox-exp-bar-h)) !important; }
    .hm-view[data-view="text-tools"] > iframe, .hm-view[data-view="hotmail"] > iframe { height: calc(var(--fx-dvh, 1vh) * 100 - 112px) !important; }
    .tkqc-toolbar.tbm { --tbm-max: calc(var(--fx-dvh, 1vh) * 100 - 222px); }
  }
  @media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
    :root { --fx-dlg-avail: calc(var(--fx-dvh, 1vh) * 100 - 20px); }
  }
}

/* ───────── 76b. Chrome ≤104 KHÔNG có :has() → luật chứa nó bị bỏ im lặng. Thay các bố cục chính bằng lớp do scripts.js gắn (html.fx-nav, .fx-sc): chừa chỗ thanh điều hướng dưới cho hộp thoại; một hàng [ô tìm | Sắp xếp | Thêm] ở sidebar tính năng (luật gốc ở mục 45 + dòng :has đầu tệp) ───────── */
@supports not selector(:has(a)) {
  @media (max-width: 640px) {
    html.fx-nav { --fx-swal-bottom: calc(63px + env(safe-area-inset-bottom, 0px)); }
  }
  @media (max-width: 640px), (max-height: 500px) and (pointer: coarse) {
    #app #adPanel > .flex-grow-1.fx-sc { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; align-content: start; }
  }
}

/* ───────── 77. Máy cảm ứng: thanh cuộn tuỳ biến (::-webkit-scrollbar 8px toàn cục ở style.css/modern-theme.css). Chrome Android không vẽ nó như thanh nổi của hệ thống mà thành thanh CỐ ĐỊNH chiếm 8px bề rộng trang + hiện vĩnh viễn. Trang: bỏ hẳn (vẫn cuộn bình thường); khung cuộn bên trong: mảnh 3px, giữ gợi ý còn nội dung ───────── */
@media (pointer: coarse) {
  *::-webkit-scrollbar { width: 3px !important; height: 3px !important; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0 !important; height: 0 !important; }
}

/* ───────── 80. Chrome ≤110 / Safari ≤16.1 KHÔNG có color-mix(). Khai báo `color-mix(… var(--x) …)` KHÔNG bị bỏ lúc phân tích (có var() ⇒ hợp lệ muộn) mà hỏng lúc tính giá trị ⇒ thuộc tính về unset (nền trong suốt, viền biến mất, icon gradient chữ-trong-suốt MẤT HẲN). Khai báo dự phòng đặt TRƯỚC không cứu được ⇒ ghi đè trong @supports not (cùng bộ chọn, nằm sau). Trình duyệt mới KHÔNG chạy khối này. Đã kiểm cơ chế bằng Chrome headless (nền = rgba(0,0,0,0) khi chỉ có dự phòng đặt trước). Gốc: style.css 7375-7822 (HOME), modern-theme.css 2885-2902 (tối) + 6833-6990 (Lencamp) + 7298 (hộp thư). Dùng NỀN MÀU (background-color), không dùng shorthand `background`, để giữ background-clip:text của icon ───────── */
@supports not (color: color-mix(in srgb, red, blue)) {
  .hm-scroll > .hm-item > i, .hm-sidebar .hm-grad-ic, .hm-app-ic i { background-color: var(--c, #6366f1); }
  .hm-app-grid .hm-app:hover { border-color: var(--c, #6366f1); box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08); }
  .hm-app-grid .hm-app.active { background: #eef2ff; border-color: var(--c, #6366f1); box-shadow: none; }
  .hm-app-ic { background: #f1f5f9; border: 1px solid #e2e8f0; }
  [data-bs-theme="dark"] .hm-app-grid .hm-app:hover { border-color: var(--c, #6366f1) !important; box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5) !important; }
  [data-bs-theme="dark"] .hm-app-ic { background: #1a2234 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
  [data-bs-theme="dark"] .hm-app-grid .hm-app.active { background: #1b2540 !important; border-color: var(--c, #6366f1) !important; box-shadow: none !important; }
  [data-bs-theme="dark"] .hm-app-grid .hm-app:hover .hm-app-lb, [data-bs-theme="dark"] .hm-app-grid .hm-app.active .hm-app-lb { color: #f1f5f9 !important; }
  .lcw-card:hover, .lcw-dcard:hover, .lcw-opt:hover, .lcw-chip:hover, .lcw-post:hover, .lcw-sug:hover, .lcw-ind:hover { border-color: var(--lc-acc); }
  .lcw-chip-ex { border-color: var(--lc-danger); }
  .lcw-upload { border: 1.5px dashed var(--lc-line); }
  .lcw-adimg { background: #cbd6ea; }
  .lcw-adimg-ph { background: #8fa4cf; }
  .lcw-err { border: 1px solid var(--lc-danger); }
  .pmb-tagopt.on { background: #eef2ff; }
}

/* ───────── 81. Chrome ≤107: (a) panel chat hỗ trợ dùng `min(524px, calc(100dvh − …))` — không có var()/env() nên bị BỎ lúc phân tích, rơi về height 524px cố định, máy thấp bị cắt đầu → dùng --fx-dvh (scripts.js gán); (b) `scale:` riêng lẻ (Chrome 104) → ô tick .checkbox-lg to 1.4 lần bằng transform; (c) scrollbar-width (121) → dải tab chiến dịch /ads cần ::-webkit-scrollbar để ẩn thanh 3px (mục 77) ───────── */
@supports not (height: 100dvh) {
  @media (max-width: 640px) {
    .sup-panel { height: min(524px, calc(var(--fx-dvh, 1vh) * 100 - 135px)); }
  }
}
@supports not (scale: 1) {
  .checkbox-lg .form-check-input { transform: scale(1.4); }
}
@supports not (scrollbar-width: none) {
  @media (max-width: 640px) {
    #app[data="ads"] #campTabsRow > .d-flex::-webkit-scrollbar { display: none; }
  }
}

/* ───────── 90. Chrome ≤104 KHÔNG có :has() → luật `tr:has(> .fbs-empty|.tx-empty)` (mục 35/36) bị bỏ: ô trạng thái trống/"Đang tải…" của Phiên Facebook, Cộng tác viên, Auto Monitor nằm lọt vào cột 26px/1-trên-12 của dòng thẻ → chữ rơi từng từ một dòng (đo trên Realme RMX3611, Chrome 103). Cho CHÍNH ô đó phủ hết bề ngang dòng (không cần :has) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .tx-table tbody td.tx-empty { grid-column: 1 / -1; }
  #viaPanel .fbs-table tbody td.fbs-empty { grid-area: auto; grid-column: 1 / -1; }
  /* Lấy 2FA: dòng trống "Nhấn [icon] để lưu key" — icon nằm TRONG câu bị luật `.tfa-empty i` (36px, display:block) biến thành khối to chen giữa câu → để nó nằm cùng dòng như chữ */
  .tfa-empty > div i { display: inline; margin: 0; font-size: 1.15em; vertical-align: -0.12em; }
}
@media (max-width: 640px) {
  /* Mail tạm: mục 1687 gộp `.mt-field-grow` với `:has(#mtServer)` trong CÙNG danh sách bộ chọn → Chrome ≤104 bỏ CẢ luật, ô Input/Server chỉ còn nửa hàng (placeholder "user@sub.doma" bị cắt). Viết lại không dùng :has (Server luôn là ô thứ 4 của biểu mẫu) */
  .mt-page .mt-create-form .mt-field-grow, .mt-page .mt-create-form .mt-field:nth-child(4) { grid-column: 1 / -1; }
}

/* ───────── 91. Mail tạm 360px: ô "Domain" hiện "🎲 Ngẫu nhiên" bị cắt mất chữ cuối. Gốc: mục 38 chia form 2 cột ĐỀU nhau (Subdomain | Domain); ở 360px mỗi cột 134,5px, ô chọn có padding 12px + 28px (chừa mũi tên) + viền 2px ⇒ vùng chữ chỉ 92,5px trong khi "🎲 Ngẫu nhiên" ở 16px (cỡ cố định để iOS không zoom) rộng 101,9px ⇒ tràn 9,4px, select cắt thẳng tay. Chia lại lưới 6 phần: Subdomain 2/6 (placeholder "random" 51px vừa vùng chữ 60px), Domain 4/6 (vùng chữ 141px), hai nút cuối vẫn 3/6 + 3/6. Chỉ dùng nth-child (không :has) nên chạy cả Chrome ≤104; Input/Server (ô 1 và 4) vẫn do mục 38 + 90 phủ cả hàng; khi Subdomain ẩn, luật `:has(.mt-field[style*="display: none"])` của mục 38 (đặc hiệu cao hơn) vẫn cho Domain cả hàng ───────── */
@media (max-width: 640px) {
  .mt-page .mt-create-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mt-page .mt-create-form > * { grid-column: span 3; }
  .mt-page .mt-create-form > .mt-field-grow, .mt-page .mt-create-form > .mt-field:nth-child(4) { grid-column: 1 / -1; }
  .mt-page .mt-create-form > .mt-field:nth-child(2) { grid-column: span 2; }
  .mt-page .mt-create-form > .mt-field:nth-child(3) { grid-column: span 4; }
}

/* ───────── 92. Chrome ≤110 / Safari ≤16.1 (không color-mix): thay dự phòng "gần đúng" của mục 80 cho icon menu + lưới ứng dụng HOME bằng bản TƯƠNG ĐƯƠNG CHÍNH XÁC. --c khác nhau theo từng mục nên không có "màu đặc" duy nhất; dùng đồng nhất thức color-mix(srgb, C p%, B) = nền C phủ lên B@(1-p): nền ĐẶC var(--c) + lớp phủ B trong suốt; viền = lớp phủ border-box mỏng hơn lớp padding-box; vòng inset = ::after opacity; nhãn tối = chữ cắt từ nền (background-clip:text) C + trắng 15%; gradient icon C phủ trắng@.48/.40 → 0. Sai số đo so với bản color-mix thật (Chrome headless, 18 màu, sáng + tối, mặc định/active/hover): nền + viền ô icon ≤ 1/255, thẻ active/hover ≤ 3. KHÔNG làm được: bóng viền ngoài 1px khi hover và quầng sáng dưới icon khi hover (overflow:hidden của .hm-app cắt pseudo) — chỉ hiện lúc hover. Khối này nằm SAU mục 80 cùng độ đặc hiệu ⇒ ghi đè. Dòng đầu: style.css cho .hm-app transition cả `background`; nền ĐẶC var(--c) ở đây sẽ chớp màu đặc ~180ms mỗi lần rời hover/active (lớp phủ background-image mất NGAY, background-color mới nội suy dần) ⇒ bỏ `background` khỏi transition của thẻ ───────── */
@supports not (color: color-mix(in srgb, red, blue)) {
  .hm-app-grid .hm-app { transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), border-color 0.18s ease, box-shadow 0.18s ease; }
  /* icon gradient chữ — C phủ trắng@.48 (menu, nút ứng dụng) / @.40 (icon trong ô ứng dụng) → trong suốt */
  .hm-scroll > .hm-item > i, .hm-sidebar .hm-grad-ic, .hm-app-ic i { background-color: var(--c, #64748b); background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0)); }
  .hm-sidebar .hm-grad-ic { background-color: var(--c, #6366f1); }
  .hm-app-ic i { background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); }
  /* ô icon sáng — nền mix(C 12%, #f1f5f9), viền mix(C 22%, trong suốt) */
  .hm-app-ic { border: 1px solid transparent; background: linear-gradient(rgba(241, 245, 249, 0.6173), rgba(241, 245, 249, 0.6173)) padding-box, linear-gradient(rgba(241, 245, 249, 0.6864), rgba(241, 245, 249, 0.6864)) border-box, var(--c, #6366f1); }
  /* thẻ hover sáng — nền #fff, viền mix(C 45%, #e2e8f0) */
  .hm-app-grid .hm-app:hover { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(rgba(226, 232, 240, 0.55), rgba(226, 232, 240, 0.55)) border-box, var(--c, #6366f1); box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08); }
  /* thẻ active sáng — nền mix(C 10%, #fff), viền mix(C 50%, #e2e8f0), vòng inset 1px mix(C 40%, trong suốt) (::after, bo 13px = bo viền 14px − 1px viền) */
  .hm-app-grid .hm-app.active { border-color: transparent; background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)) padding-box, linear-gradient(rgba(226, 232, 240, 0.5), rgba(226, 232, 240, 0.5)) border-box, var(--c, #6366f1); box-shadow: none; }
  .hm-app-grid .hm-app.active::after { content: ""; position: absolute; inset: 0; border-radius: 13px; box-shadow: inset 0 0 0 1px var(--c, #6366f1); opacity: 0.4; pointer-events: none; }
  /* chế độ tối (gốc modern-theme.css, toàn bộ !important ⇒ ghi đè cũng !important) — ô icon: nền mix(C 16%, #1a2234), viền mix(C 28%, trong suốt) */
  [data-bs-theme="dark"] .hm-app-ic { border-color: transparent !important; background: linear-gradient(rgba(26, 34, 52, 0.5951), rgba(26, 34, 52, 0.5951)) padding-box, linear-gradient(rgba(26, 34, 52, 0.6048), rgba(26, 34, 52, 0.6048)) border-box, var(--c, #6366f1) !important; }
  /* tối hover — nền #1e293b, viền mix(C 50%, rgba(255,255,255,.18)) */
  [data-bs-theme="dark"] .hm-app-grid .hm-app:hover { border-color: transparent !important; background: linear-gradient(#1e293b, #1e293b) padding-box, linear-gradient(rgba(71, 80, 94, 0.5), rgba(71, 80, 94, 0.5)) border-box, var(--c, #6366f1) !important; box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5) !important; }
  /* tối active — nền mix(C 18%, #161f30), viền mix(C 55%, trong suốt), vòng inset mix(C 50%, trong suốt) */
  [data-bs-theme="dark"] .hm-app-grid .hm-app.active { border-color: transparent !important; background: linear-gradient(rgba(22, 31, 48, 0.7147), rgba(22, 31, 48, 0.7147)) padding-box, linear-gradient(rgba(22, 31, 48, 0.369), rgba(22, 31, 48, 0.369)) border-box, var(--c, #6366f1) !important; box-shadow: none !important; }
  [data-bs-theme="dark"] .hm-app-grid .hm-app.active::after { opacity: 0.5; }
  /* nhãn tối khi hover/active — màu chữ mix(C 85%, #fff) ≡ chữ cắt từ nền C phủ trắng@.15 */
  [data-bs-theme="dark"] .hm-app-grid .hm-app:hover .hm-app-lb, [data-bs-theme="dark"] .hm-app-grid .hm-app.active .hm-app-lb { background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15)), var(--c, #6366f1); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}

/* ───────── 93. (a) Danh sách kéo-sau-khi-giữ: Sortable cảm ứng nay phải GIỮ ~200ms mới kéo (delayOnTouchOnly) — giữ yên lâu hơn trên Chrome Android bật chọn chữ + menu callout trên pill "Đã chọn" (popup Tuỳ chỉnh cột /ads), nên cấm chọn như #colCustomize ở mục 16. (b) /nurture tab "Nuôi tài khoản": profile-tools.js nay điền mặc định (7→22 giờ) khi chưa có extension, chip "Khung giờ" (2 ô số 40px + mũi tên ≈ 102px) trong nửa hàng 128,5px bị tràn 27px ⇒ cho chip thứ 2 cả hàng ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .cc-selected-pill { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
@media (max-width: 640px) {
  .pft-nuoi-chip:nth-child(2) { flex-basis: 100%; }
}

/* ───────── 94. Chạm: menu chuột phải + kéo thẻ (F2-02 phần tablet, F2-05, F2-06). Nhấn giữ trên iPhone/iPad nay mở được menu (fx-longpress.js) ─────────
   (a) /profile: #contextMenu 1 cột (KHÔNG .ctx-2col) do clone.js đặt top/left = pageX/pageY, không kẹp mép ⇒ tablet dọc nhấn nửa phải là menu tràn
       ra ngoài. Điện thoại/nằm ngang đã thành bảng từ đáy ở mục 72 (clone.js cũng thêm .open) ⇒ tablet cảm ứng dùng CÙNG bảng đó; menu 2 cột
       (scripts.js tự kẹp mép) giữ nguyên ở tablet.
   (b) Hộp "Danh sách thẻ" /ads: context.min.js chèn .context (position:fixed) vào #cards tại clientX/Y, không kẹp mép, mục 24px chữ 9pt ⇒ bảng từ
       đáy như mục 72, mục 48px chữ 15px; giữ màu gốc chrome-bright (nền #fff, chữ #000). left/top inline của thư viện thua !important.
       KHÔNG phủ nền mờ 100vmax như mục 72: thư viện chỉ đóng menu khi chạm TRONG #cards ⇒ nền mờ làm tưởng chạm đâu cũng đóng (chỉ bóng đổ như .pqm-drp).
   (c) Tay kéo ⠿ của thẻ tính năng: Sortable cảm ứng nay phải giữ ~200ms ⇒ giữ lâu thì iOS bật chọn chữ/callout trên ký tự ⠿ (style inline chỉ có
       user-select không tiền tố, Safari cần -webkit-) */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  body #contextMenu.open:not(.ctx-2col) { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; max-width: none !important; max-height: 78vh; max-height: 78dvh; overflow-y: auto; overscroll-behavior: contain; display: flex !important; flex-direction: column; gap: 8px; background: var(--bg-card, #fff) !important; border-radius: 18px 18px 0 0 !important; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .45) !important; z-index: 2000; }
  body #contextMenu:not(.ctx-2col) .dropdown-menu { position: static !important; display: block !important; float: none; width: auto; min-width: 0 !important; margin: 0 !important; box-shadow: none !important; border: 0 !important; background: transparent !important; }
  body #contextMenu:not(.ctx-2col) .dropdown-item { min-height: 48px; display: flex; align-items: center; font-size: 15px !important; padding: 10px 12px !important; }
}
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  body #cards > .context { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; min-width: 0; max-height: 78vh; max-height: 78dvh; overflow-y: auto; overscroll-behavior: contain; font-size: 15px; border: 0; border-radius: 18px 18px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 32px rgba(15, 23, 42, .25); z-index: 2000; }
  body #cards > .context .item { display: flex; align-items: center; min-height: 48px; padding: 10px 12px; border-radius: 10px; }
  .card[data-feature] .drag-handle { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

/* ───────── 95. Máy cảm ứng: ẩn ứng dụng/nút chỉ chạy được nhờ extension Chrome hoặc trên máy tính (điện thoại/tablet không cài được extension — cùng lý do mục 74). KHÔNG xoá node (scripts.js/setting.js/hotmail.html còn tìm theo id/lớp):
   Quay màn hình (di động không có getDisplayMedia) + Trợ lý AI ở sidebar — via.js setActiveView đưa mọi đường vào thẳng (/screen-studio, ?view=, homeActiveView cũ, back/forward) về Mua gói;
   "Chuyển tài khoản" ở menu tài khoản của thanh tiêu đề (scripts.js chỉ gán display inline, thua !important); "Đọc OTP từ phiên Chrome" ở /read-mail cùng hàng bọc nó (hàng rỗng vẫn ăn gap của .hm-side-body + mt-2);
   thẻ "Phiên Facebook" (cookie/token đọc qua extension) và 2 hàng "Tải tool" XMetaRunner (tệp .exe Windows) trong Cài đặt.
   Hàng bọc nút OTP chọn KHÔNG cần :has() (.d-flex.mt-2 là con trực tiếp DUY NHẤT có mt-2 của .hm-side-body ở hotmail.html) để Chrome ≤104 không
   còn dải rỗng; thẻ Phiên Facebook vẫn cần :has() nên để luật riêng — Chrome ≤104 bỏ cả luật chứa :has() ⇒ thẻ đó hiện như cũ ───────── */
@media (pointer: coarse) {
  .hm-sidebar .hm-app[data-view="screen-studio"], .hm-sidebar .hm-item[data-view="meta-ai"], #fxBarMenu [data-fx="switch"], #btnOwaOtp, .hm-side-body > .d-flex.mt-2, .sx-tool-row { display: none !important; }
  .sx-card:has(#cookie) { display: none !important; }
}

/* ───────── 96. Kết nối điện thoại / máy tính (view remote-agent /agent, remote-phone /remote — style.css "KẾT NỐI ĐIỆN THOẠI / MÁY TÍNH"):
   nút đủ 44px, nút hành động xếp cột, chừa đáy cho nút chat nổi .sup-chat (không dùng :has() — Chrome ≤104 bỏ cả luật) ───────── */
@media (max-width: 640px), (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  #viaPanel .hm-view[data-view="remote-agent"] .dep-page, #viaPanel .hm-view[data-view="remote-phone"] .dep-page { padding-bottom: 72px !important; }
  #viaPanel .rmt-top-acts .mt-pill { min-height: 44px; padding: 0 14px; font-size: 13px; }
  #viaPanel .rmt-toggle { min-height: 48px; }
  #viaPanel .rmt-toggle > span:first-child { font-size: 14px; }
  #viaPanel .rmt-btns > .st-btn, #viaPanel .rmt-btns > .ac-zalo-gate-btn { min-height: 44px; }
  #viaPanel .rmt-fld-row > .ac-zalo-gate-btn { min-height: 44px; }
  /* nút Gỡ / Ngắt kết nối của dòng = nút icon 44×44 như nút Xóa của Phiên Facebook (mục 35) — tên máy không bị cắt */
  #viaPanel .rmt-row .st-zalo-unlink-head { width: 44px; height: 44px; padding: 0; gap: 0; justify-content: center; border-radius: 12px; font-size: 0; }
  #viaPanel .rmt-row .st-zalo-unlink-head i { font-size: 18px; }
  #viaPanel .rmt-row .mt-pill { position: relative; font-size: 12.5px; }
  #viaPanel .rmt-row .mt-pill::before { content: ""; position: absolute; inset: calc(50% - 22px) -4px; } /* vùng chạm đúng 44px dù viên cao bao nhiêu, hình giữ gọn */
  /* mắt hiện/ẩn mật khẩu: "#viaPanel .sec-inp{padding:10px 12px}" (mục 36) xoá chỗ chừa cho icon → chừa lại; vùng chạm ~45px (icon vẫn 17px) */
  #viaPanel #rmpPw { padding-right: 46px; }
  #viaPanel .rmt-col .sec-eye::after { content: ""; position: absolute; inset: -10px -14px; }
  #viaPanel .rmt-kv .pkg-sum-row { font-size: 14px; }
}
@media (max-width: 640px) {
  #viaPanel .rmt-top { flex-direction: column; gap: 10px; }
  #viaPanel .rmt-top-acts { padding-top: 0; }
  #viaPanel .rmt-btns > .st-btn, #viaPanel .rmt-btns > .ac-zalo-gate-btn { flex: 1 1 100%; }
  #viaPanel .rmt-btns.rmt-btns-row > .st-btn, #viaPanel .rmt-btns.rmt-btns-row > .ac-zalo-gate-btn { flex: 1 1 0; } /* Quay lại | Kết nối cùng hàng như hộp xác nhận */
  #viaPanel .rmt-qr { min-width: 0; min-height: 0; }
}

/* @@FX-MOBILE-END@@ */
