/* Hộp chat CSKH — tiền tố hc-. Chỉ token theme (7 theme), bo tối đa 8px (ảnh đại diện tròn, bong bóng tin giữ 14px như cũ),
   viền chỉ để phân tách cột / dòng, không shadow nặng. Nút ≥ 44px (cột icon lọc máy tính 40px trong ô 52px — điện thoại 44px), focus rõ, có reduced motion.
   THAY FOXIA ĐỢT 1 (anh Nghĩa duyệt bản xem trước 10/10/2026): [cột icon lọc 52 · danh sách] | khung chat | panel khách (≥1280, ẩn / hiện được);
   761–1279 panel thành ngăn phải; ≤760 một màn một lúc, cột lọc thành hàng chip cuộn ngang dưới ô tìm, bảng chọn trượt từ dưới.
   Màu cố định DUY NHẤT: 3 nguồn page (đỏ / xanh dương / tím) — chữ trắng trên nền đặc đạt ≥ 4,5:1 ở mọi theme.
   Thêm 16/10/2026: màu hãng Facebook / Zalo CHỈ ở dấu logo + gạch dưới nút đang chọn của thanh tách nền tảng (chữ vẫn token theme). */
.hc-trang { color: var(--text-main); min-width: 0; max-width: 100%; overflow-x: clip; --hc-n-do: #dc2626; --hc-n-xanh: #2563eb; --hc-n-tim: #7c3aed; --hc-fb: #1877f2; --hc-zl: #0068ff; --hc-ig: #d62976; }

/* ── Tối ưu không gian làm việc chuyên dụng cho Hộp chat trên Desktop (≥1024px) ──
   Thu gọn sidebar toàn hệ thống thành rail 72px (rê chuột tự mở nổi 248px không đẩy bố cục),
   giảm padding thừa của .main-viewport / main / #app-header để ưu tiên diện tích cho 3 cột Hộp chat. */
@media (min-width: 1024px) {
  body.itn-shell:has(#module-content .hc-trang) { --sb-w: 78px; }
  body.itn-shell:has(#module-content .hc-trang) .main-viewport { margin-left: 78px !important; padding: 6px 12px 6px !important; }
  body.itn-shell:has(#module-content .hc-trang) .main-viewport > * { max-width: none !important; }
  body.itn-shell:has(#module-content .hc-trang) #app-header { min-height: 46px !important; margin-bottom: 6px !important; padding-top: 4px !important; padding-bottom: 4px !important; }
  body.itn-shell:has(#module-content .hc-trang) main { padding: 0 !important; }
  html body.itn-shell:has(#module-content .hc-trang) #app-nav.app-nav:not(:hover):not(:focus-within) { width: 78px !important; padding-inline: 4px !important; }
  body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-brand { justify-content: center; padding-inline: 0; }
  body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-brand .sb-name,
  body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-group-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .nav-tab-btn.sb-item,
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-folder-toggle,
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) [data-itn-sx] { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 5px 2px !important; font-size: 10px !important; text-align: center; white-space: normal; line-height: 1.15; }
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) :is(.nav-tab-btn.sb-item, .sb-folder-toggle, [data-itn-sx]) .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-chevron,
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-folder.is-open .sb-folder-body { display: none !important; }
  html body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .nav-tab-btn.sb-item .nav-badge { position: absolute; top: 3px; right: 6px; margin: 0; }
  body.itn-shell:has(#module-content .hc-trang) #app-nav:not(:hover):not(:focus-within) .sb-group + .sb-group { border-top: 1px solid var(--sb-line); padding-top: 6px; }
  html body.itn-shell:has(#module-content .hc-trang) #app-nav.app-nav:is(:hover, :focus-within) { width: 248px !important; z-index: 10030 !important; box-shadow: 12px 0 32px rgba(0, 0, 0, .24) !important; }
  body.itn-shell.hc-tap-trung:has(#module-content .hc-trang) #app-header { display: none !important; }
  body.itn-shell.hc-tap-trung:has(#module-content .hc-trang) .main-viewport { padding-top: 4px !important; padding-bottom: 4px !important; }
}

.hc-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; min-height: 40px; }
.hc-dau-trai { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hc-dau h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; }
.hc-sub { margin: 0; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hc-dau-nut { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
@media (min-width: 761px) {
  .hc-dau-nut .hc-nut, .hc-dau-nut .tl-toolbar .hc-nut { min-height: 44px; padding: 0 11px; font-size: 13px; font-weight: 600; background: transparent; border-color: var(--border-color); }
  .hc-dau-nut .hc-nut:hover, .hc-dau-nut .tl-toolbar .hc-nut:hover { background: var(--bg-card); }
  .hc-dau-nut .hc-nut.is-bat { background: var(--theme-accent-soft); border-color: var(--theme-accent-strong); color: var(--theme-accent-strong); }
}
.hc-ic { flex: none; }
.sr-only { position: absolute !important; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.hc-nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-color); border-radius: 8px;
  background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.hc-nut:hover { background: var(--bg-card-hover, var(--bg-card)); }
.hc-nut.is-chinh { background: var(--theme-accent-strong); border-color: var(--theme-accent-strong); color: #fff; }
.hc-nut.is-chinh:hover { filter: brightness(1.06); }
.hc-nut:disabled { opacity: .55; cursor: default; filter: none; }
.hc-nut-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; text-decoration: none; }
.hc-nut-ic:hover { background: var(--bg-card-hover, var(--bg-input)); color: var(--text-main); }
.hc-nut-ic.is-bat { background: var(--theme-accent-soft); color: var(--theme-accent-strong); }
.hc-nut-ic:disabled { opacity: .4; cursor: default; background: transparent; }
.hc-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--theme-accent-strong); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hc-trang :is(button, input, select, textarea, a):focus-visible { outline: 2px solid var(--theme-accent-strong); outline-offset: 2px; }

.hc-canh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 6px 12px; border: 1px solid var(--border-color); border-left: 3px solid var(--txt-bad); border-radius: 8px; background: var(--bg-card); font-size: 13px; }
.hc-canh.is-mat-mang { border-left-color: var(--txt-warn); }
.hc-canh > svg { color: var(--txt-bad); }
.hc-canh.is-mat-mang > svg { color: var(--txt-warn); }
.hc-canh span { flex: 1; min-width: 200px; }

/* Khung chính kiểu Meta Business Suite: [cột danh sách (kéo giãn được)] | khung chat ưu tiên | panel khách */
.hc-khung { display: grid; grid-template-columns: var(--hc-ds-w, 348px) minmax(0, 1fr); border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); overflow: hidden; min-height: 460px; }
.hc-khung.co-the { grid-template-columns: var(--hc-ds-w, 336px) minmax(0, 1fr) 320px; }
.hc-khung.co-the .hc-ds { grid-template-columns: minmax(0, 1fr); }

/* Cột danh sách: thanh Facebook/Zalo trên cùng, tiếp theo ô tìm, hàng chip lọc trực quan có chữ tiếng Việt, dải tóm tắt lọc, danh sách hội thoại */
.hc-ds { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr); grid-template-areas: "nt" "dau" "loc" "nv" "tom" "chon" "than"; min-height: 0; border-right: 1px solid var(--border-color); }
.hc-keo-ds { position: absolute; top: 0; right: -4px; bottom: 0; width: 7px; z-index: 4; cursor: col-resize; user-select: none; touch-action: none; }
.hc-keo-ds::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background-color .15s; }
.hc-keo-ds:hover::after, body.hc-dang-keo .hc-keo-ds::after { background: var(--theme-accent-strong); }
body.hc-dang-keo { cursor: col-resize !important; user-select: none !important; }
.hc-ds-dau { grid-area: dau; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border-color); min-width: 0; }
.hc-ds-than { grid-area: than; }

/* Thanh Facebook / Zalo (anh Nghĩa 16/10/2026) — trên cùng cột danh sách. Tách: hai nút như tab, nút đang chọn gạch dưới màu hãng
   + nền nhạt, nút kia logo xám; số đỏ = tin chưa đọc của từng bên. Gộp: một dòng "Facebook + Zalo · chung một hộp". Nút Tách / Gộp ở góc phải. */
.hc-nt { grid-area: nt; display: flex; align-items: stretch; gap: 6px; min-width: 0; padding: 0 8px 0 0; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.hc-nt.is-gop { padding-left: 10px; }
.hc-nt-logo { display: inline-flex; flex: none; }
.hc-nt-logo svg { display: block; }
.hc-nt-tab { flex: 1; display: flex; min-width: 0; }
.hc-nt-nut { --hc-nt-mau: var(--hc-fb); flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 42px; padding: 0 5px; margin-bottom: -1px;
  border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.hc-nt-nut.is-zalo { --hc-nt-mau: var(--hc-zl); }
/* Instagram (113): nút thứ ba chỉ hiện khi đã có kênh Instagram. 3 nút: chỉ nút đang chọn hiện chữ (rộng hơn), nút còn lại logo + số chưa đọc
   (tên đọc qua aria-label / title) — cột danh sách hẹp không cắt chữ thành "Facebo…". */
.hc-nt-nut.is-instagram { --hc-nt-mau: var(--hc-ig); }
.hc-nt.is-ba .hc-nt-nut { gap: 4px; padding: 0 3px; }
.hc-nt.is-ba .hc-nt-nut:not(.is-bat) .hc-nt-ten { display: none; }
.hc-nt.is-ba .hc-nt-nut.is-bat { flex-grow: 2; }
.hc-nt.is-ba .hc-nt-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hc-hs-muc h3 .hc-nt-logo, .hc-hs-muc summary .hc-nt-logo { vertical-align: -5px; margin-right: 4px; }
.hc-nut .hc-nt-logo { margin-right: 2px; }
.hc-nt-nut .hc-nt-logo { filter: grayscale(1); opacity: .6; }
.hc-nt-nut:hover { color: var(--text-main); background: var(--bg-card-hover, var(--bg-input)); }
.hc-nt-nut:hover .hc-nt-logo, .hc-nt-nut.is-bat .hc-nt-logo { filter: none; opacity: 1; }
.hc-nt-nut.is-bat { color: var(--text-main); font-weight: 700; border-bottom-color: var(--hc-nt-mau); background: color-mix(in srgb, var(--hc-nt-mau) 10%, var(--bg-card)); }
.hc-trang .hc-nt-nut:focus-visible { outline-offset: -3px; }
.hc-nt-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-nt-so { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--txt-bad); color: var(--bg-card); font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.hc-nt-gop { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 42px; font-size: 13.5px; }
.hc-nt-gop b { flex: none; white-space: nowrap; }
.hc-nt-phu { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.hc-nt-doi { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 8px;
  background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.hc-nt-doi:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-loc-tom { grid-area: tom; display: flex; align-items: flex-start; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--border-color); background: var(--theme-accent-soft); font-size: 12px; color: var(--text-main); }
.hc-loc-tom span { flex: 1; min-width: 0; line-height: 1.4; }
.hc-loc-tom .hc-link { flex: none; font-size: 12px; min-height: 22px; }
.hc-tim { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 38px; padding: 0 8px 0 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-muted); }
.hc-tim input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 13.5px; }
.hc-tim-xoa { flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; }
.hc-tim-xoa:hover { background: var(--bg-card-hover, var(--border-color)); color: var(--text-main); }
.hc-trang .hc-tim:focus-within { outline: 2px solid var(--theme-accent-strong); outline-offset: 1px; }
html body .hc-trang .hc-tim input:focus, html body[data-itn-theme] .hc-trang .hc-tim input:focus, html body[data-itn-theme] .hc-trang .hc-tim input:focus-visible { outline: 0 !important; box-shadow: none !important; }
.hc-tim-nho { min-height: 38px; margin-bottom: 8px; }
.hc-o input, .hc-o textarea, .hc-o select { min-height: 44px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 14px; }

/* Hàng chip lọc trực quan (Meta Business Suite): trên Desktop tự xuống dòng gọn để KHÔNG cắt chữ hay ẩn bộ lọc; trên Mobile cuộn ngang */
.hc-loc { grid-area: loc; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 3px; padding: 5px 6px; overflow-x: visible; overflow-y: visible; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.hc-loc-sep { display: none; }
.hc-loc-nut { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: auto; min-width: 0; height: 26px; padding: 0 6.5px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.hc-loc-nut > svg { display: none; }
.hc-loc-nut.is-pop::after { content: "▾"; font-size: 10px; color: var(--text-muted); margin-left: 1px; line-height: 1; }
.hc-loc-nut:hover { background: var(--bg-card-hover, var(--bg-card)); color: var(--text-main); }
/* Đang lọc: nền mặt thẻ + vòng nhấn rõ ràng */
.hc-loc-nut.is-bat { background: var(--bg-card); border-color: var(--theme-accent-strong); box-shadow: inset 0 0 0 1px var(--theme-accent-strong); color: var(--theme-accent-strong); }
.hc-loc-nut.is-bat > svg, .hc-loc-nut.is-bat.is-pop::after { color: inherit; }
.hc-loc-ten { display: inline; }
.hc-loc-so { position: static; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--border-color); color: var(--text-main); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.hc-loc-nut.is-bat .hc-loc-so { background: var(--theme-accent-strong); color: #fff; }
.hc-loc-cham { width: 6px; height: 6px; border-radius: 50%; background: var(--theme-accent-strong); flex: none; }
.hc-tip { display: none; }

/* Dòng hội thoại phân cấp kiểu Meta Business Suite:
   Dòng 1: Tên khách thẳng hàng từ đầu dòng + ghim + thời gian.
   Dòng 2: Nội dung xem trước + chỉ báo phụ (SĐT / nhắc hẹn).
   Dòng 3: Chip Page/kênh (avatar thật theo ID nguồn) + nhãn trạng thái / chờ / phụ trách. */
.hc-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; min-height: 0; }
.hc-dong-o { position: relative; border-left: 4px solid transparent; border-bottom: 1px solid var(--border-color); }
.hc-dong-o.is-n-do { border-left-color: var(--hc-n-do); } .hc-dong-o.is-n-xanh { border-left-color: var(--hc-n-xanh); } .hc-dong-o.is-n-tim { border-left-color: var(--hc-n-tim); }
.hc-dong { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; width: 100%; min-height: 78px; padding: 9px 10px 8px 8px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; align-items: start; }
.hc-dong:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-dong.is-chon { background: var(--theme-accent-soft); box-shadow: inset 3px 0 0 var(--theme-accent-strong); }
.hc-av { position: relative; display: inline-grid; place-items: center; overflow: hidden; width: 44px; height: 44px; border-radius: 50%; background: var(--bg-input, var(--border-color)); color: var(--text-main); font-size: 14px; font-weight: 700; flex: none; }
.hc-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.hc-av-chu { display: grid; place-items: center; width: 100%; height: 100%; }
.hc-av-nho { width: 26px; height: 26px; font-size: 10px; }
.hc-av-o { position: relative; width: 44px; height: 44px; margin-top: 2px; }
.hc-so { position: absolute; top: -5px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--bg-card); border-radius: 10px; background: var(--txt-bad); color: var(--bg-card); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.hc-dong-g { display: grid; gap: 3px; min-width: 0; }
.hc-dong-1, .hc-dong-2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hc-ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--text-main); line-height: 1.3; }
.hc-dong.is-moi .hc-ten { font-weight: 700; }
.hc-luc { flex: none; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hc-dong.is-moi .hc-luc { color: var(--text-main); font-weight: 600; }
.hc-cuoi { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.hc-dong.is-moi .hc-cuoi { color: var(--text-main); font-weight: 600; }
.hc-ban { display: inline-flex; vertical-align: -2px; margin-right: 3px; color: var(--text-muted); }
.hc-ghim { flex: none; display: inline-flex; color: var(--txt-warn); }
.hc-dong-3 { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin-top: 2px; min-width: 0; overflow: hidden; }
.hc-dong-ic { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex: none; color: var(--text-muted); }
.hc-dong-ic .is-sdt { color: var(--txt-ok); }
.hc-dong-them { position: absolute; top: 30px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-muted); cursor: pointer; opacity: 0; z-index: 2; }
.hc-dong-o:hover .hc-dong-them, .hc-dong-them:focus-visible, .hc-dong-them[aria-expanded="true"] { opacity: 1; }
.hc-dong .hc-kenh { max-width: 148px; }
.hc-kenh, .hc-tt { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg-input, var(--bg-card)); border: 1px solid var(--border-color); }
.hc-dong-3 :is(.hc-kenh, .hc-tt, .hc-nguon, .hc-nhan-mau, .hc-cho, .hc-im, .hc-pt-trong) { min-height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; }
.hc-kenh { flex: 0 1 auto; color: var(--text-muted); min-width: 0; }
.hc-kenh-ten { overflow: hidden; text-overflow: ellipsis; }
.hc-kenh::before { content: ""; flex: none; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; }
.hc-kenh.has-avatar::before { display: none; }
.hc-kenh-anh { flex: none; width: 14px; height: 14px; margin-right: 4px; border-radius: 50%; object-fit: cover; }
/* Phân biệt kênh bằng CHỮ + hình dấu (tròn đặc = Facebook, vuông = Zalo OA, vòng rỗng = Zalo cá nhân). */
.hc-kenh.is-fb::before { background: var(--theme-accent-strong); }
.hc-kenh.is-oa::before { background: var(--theme-accent-strong); border-radius: 2px; }
.hc-kenh.is-zl::before { background: transparent; border: 2px solid var(--theme-accent-strong); width: 5px; height: 5px; }
.hc-kenh.is-ig::before { background: transparent; border: 2px solid var(--theme-accent-strong); border-radius: 2px; width: 5px; height: 5px; }
/* 134: Facebook qua Pancake — tam giác (khác tròn Facebook / vuông OA / vòng Zalo), có chữ "PC …" trên nhãn nên không chỉ dựa vào hình. */
.hc-kenh.is-pk::before { background: var(--theme-accent-strong); border-radius: 1px; clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 7px; height: 7px; }
.hc-tt { flex: none; background: transparent; border-color: color-mix(in srgb, currentColor 28%, var(--border-color)); }
.hc-tt.is-ok { color: var(--txt-ok); } .hc-tt.is-warn { color: var(--txt-warn); } .hc-tt.is-bad { color: var(--txt-bad); }
.hc-tt.is-info { color: var(--txt-accent, var(--theme-accent-strong)); } .hc-tt.is-idle { color: var(--text-muted); }
/* Nguồn page: nền đặc 3 màu cố định + chữ trắng (có chữ, không chỉ màu); chưa gắn = viền đứt */
.hc-nguon { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; color: #fff; flex: none; cursor: pointer; }
.hc-nguon.is-do { background: var(--hc-n-do); } .hc-nguon.is-xanh { background: var(--hc-n-xanh); } .hc-nguon.is-tim { background: var(--hc-n-tim); }
.hc-nguon.is-chua { color: var(--text-muted); background: transparent; border: 1px dashed var(--border-color); font-weight: 500; }
.hc-cham { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--hc-n-do); }
.hc-cham.is-xanh { background: var(--hc-n-xanh); } .hc-cham.is-tim { background: var(--hc-n-tim); } .hc-cham.is-chua { background: transparent; border: 2px dashed var(--text-muted); }
/* Ghi chú màu tuỳ chỉnh + nút cộng nhanh cạnh Nguồn page */
.hc-nhan-mau { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; max-width: 148px; padding: 0 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--hc-nm-mau, #ef4444) 38%, transparent); background: color-mix(in srgb, var(--hc-nm-mau, #ef4444) 14%, var(--bg-card)); color: var(--hc-nm-mau, #ef4444); font-size: 11.5px; font-weight: 700; white-space: nowrap; flex: none; cursor: pointer; }
.hc-nhan-mau > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.hc-nhan-cham { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--hc-nm-mau, #ef4444); }
.hc-nguon-cong { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px dashed var(--border-color); border-radius: 6px; background: var(--bg-input, var(--bg-card)); color: var(--text-muted); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.hc-nguon-cong:hover { border-style: solid; border-color: var(--theme-accent-strong); color: var(--theme-accent-strong); background: var(--bg-card); }
.hc-hs-nhan { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.hc-cho, .hc-im { flex: none; display: inline-flex; align-items: center; gap: 3px; min-height: 22px; padding: 0 7px; border: 1px solid currentColor; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--txt-warn); }
.hc-cho.is-lau { color: var(--txt-bad); }
.hc-im { color: var(--text-muted); border-style: dashed; font-weight: 500; }
.hc-pt { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--bg-card); border-radius: 50%; background: var(--text-muted); color: var(--bg-card); font-size: 8.5px; font-weight: 700; letter-spacing: -.02em; }
.hc-pt.is-toi { background: var(--theme-accent-strong); color: #fff; }
.hc-pt-trong { flex: none; display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent); border-radius: 6px; background: transparent; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.hc-trong { display: grid; justify-items: center; align-content: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--text-muted); flex: 1; }
.hc-trong p { margin: 0; max-width: 40ch; line-height: 1.5; }
.hc-trong.is-bad strong { color: var(--txt-bad); }
.hc-spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-color); border-top-color: var(--theme-accent-strong); animation: hc-quay .8s linear infinite; }
@keyframes hc-quay { to { transform: rotate(360deg); } }

/* Cột chat (Vùng làm việc ưu tiên) */
.hc-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-app, var(--bg-card)); container-type: inline-size; }
.hc-chat.is-trong { justify-content: center; }
.hc-chat-dau { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px 10px 6px 14px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.hc-chat-dau .hc-av-dau { width: 38px; height: 38px; font-size: 13px; }
.hc-chat-ai { flex: 1; min-width: 0; }
.hc-chat-ai h2 { margin: 0; font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-chat-ai p { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 3px 0 0; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 0; }
.hc-chat-nut { display: flex; align-items: center; gap: 2px; flex: none; }
.hc-pc { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
.hc-nut-gon { min-height: 36px; padding: 0 11px; font-size: 13px; }
.hc-nut-vuong { width: 36px; padding: 0; }
.hc-pt-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; max-width: 180px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); font-size: 12.5px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; }
.hc-pt-chip .hc-pt-ten { overflow: hidden; text-overflow: ellipsis; }
.hc-pt-chip.is-toi { border-color: var(--theme-accent-strong); color: var(--theme-accent-strong); background: var(--bg-card); }
.hc-pt-chip.is-trong { border-style: dashed; color: var(--text-muted); font-weight: 500; }
/* Khung chat hẹp thực sự (<520px): mới rút gọn chữ nút phụ và đưa Gọi/Tìm vào menu ⋯ */
@container (max-width: 520px) {
  .hc-chat-dau .hc-an-hep { display: none; }
  .hc-pt-chip { max-width: 130px; }
}
@container (max-width: 440px) { .hc-chat-dau .hc-av-dau, .hc-chat-dau .hc-an-hep-c { display: none; } }
.hc-pc-loi { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 7px 12px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); font-size: 13px; font-weight: 600; color: var(--txt-bad); }
.hc-qc { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); font-size: 12.5px; color: var(--text-muted); }
.hc-qc b { color: var(--text-main); font-weight: 600; }
.hc-qc .hc-link { min-height: 28px; }
/* 123: khách đến từ quảng cáo / bài viết / video (đầu khung chat) — ảnh thu nhỏ + tiêu đề + nút mở bài; chip trong danh sách; lịch sử ở ngăn Thông tin khách */
.hc-nd { gap: 10px; flex-wrap: nowrap; }
.hc-nd-anh { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-input, var(--bg-card)); }
.hc-nd-ic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg-input, var(--bg-card)); flex: none; }
.hc-nd-chu { flex: 1; min-width: 0; display: grid; gap: 1px; }
.hc-nd-chu p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-nd-chu small { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-nd .hc-nut { flex: none; }
.hc-nd-chip { display: inline-flex; align-items: center; gap: 3px; min-height: 22px; max-width: 100%; padding: 0 7px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-input, var(--bg-card)); font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-nd-ls { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.hc-nd-ls + .hc-nd-ls { padding-top: 10px; border-top: 1px solid var(--border-color); }
.hc-nd-ls img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-input, var(--bg-card)); }
.hc-nd-ls > div { display: grid; gap: 2px; min-width: 0; }
.hc-nd-ls > div > b { overflow-wrap: anywhere; }
.hc-nd-ls span { color: var(--text-muted); font-size: 12.5px; }
/* 123: dòng "Khách bấm từ quảng cáo / bài viết" chen trong luồng tin, kèm link mở bài */
.hc-tin.is-nguon { align-self: center; max-width: 92%; margin: 4px 0; align-items: center; }
.hc-tin.is-nguon .hc-bong { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 6px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; white-space: normal; background: var(--bg-card); border: 1px dashed var(--theme-accent-strong); color: var(--text-main); }
.hc-tin.is-nguon .hc-bong > span { overflow-wrap: anywhere; }
.hc-tin.is-nguon .hc-bong a { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--theme-accent-strong); text-decoration: none; white-space: nowrap; }
.hc-tin.is-nguon .hc-bong a:hover { text-decoration: underline; }
.hc-tin.is-nguon .hc-tin-phu { text-align: center; }
.hc-tin-ds { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; padding: 14px 18px 10px; display: flex; flex-direction: column; gap: 8px; }
.hc-ngay-tach { align-self: center; margin: 6px 0; }
.hc-ngay-tach span { display: inline-block; padding: 2px 10px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-card); font-size: 11.5px; color: var(--text-muted); }
.hc-tin { display: flex; flex-direction: column; max-width: min(74%, 580px); }
.hc-tin.is-nhom-tiep { margin-top: -4px; }
.hc-tin.is-khach { align-self: flex-start; }
.hc-tin.is-shop { align-self: flex-end; align-items: flex-end; }
.hc-tin.is-ghi-chu { align-self: center; max-width: 90%; margin: 6px 0; align-items: center; }
.hc-tin-hang { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.hc-tin.is-shop .hc-tin-hang { flex-direction: row-reverse; }
.hc-tin-them { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; opacity: 0; }
.hc-tin:hover .hc-tin-them, .hc-tin-them:focus-visible { opacity: 1; }
.hc-tin-them:hover { background: var(--bg-card-hover, var(--bg-card)); color: var(--text-main); }
.hc-tin-vao { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.hc-tin-vao .hc-av { width: 26px; height: 26px; font-size: 9.5px; }
.hc-tin.is-nhom-tiep .hc-tin-vao .hc-av { visibility: hidden; }
.hc-tin-vao .hc-bong { min-width: 0; }
.hc-bong { padding: 9px 13px; border-radius: 8px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.hc-bong a { color: inherit; text-decoration: underline; }
.hc-tin.is-khach .hc-bong { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 14px 14px 14px 4px; }
.hc-tin.is-khach.is-nhom-tiep .hc-bong { border-top-left-radius: 6px; }
.hc-tin.is-shop .hc-bong { background: var(--theme-accent-strong); color: #fff; border-radius: 14px 14px 4px 14px; }
.hc-tin.is-shop.is-nhom-tiep .hc-bong { border-top-right-radius: 6px; }
.hc-tin.is-ghi-chu .hc-bong { background: var(--bg-card); border: 1px dashed var(--txt-warn); color: var(--text-main); border-radius: 8px; font-size: 13px; padding: 7px 12px; }
.hc-tin.is-ghi-chu .hc-bong b { color: var(--txt-warn); }
.hc-tin.is-ghi-chu .hc-tin-phu { text-align: center; }
.hc-tin.is-tim-thay .hc-bong { outline: 3px solid var(--txt-warn); outline-offset: 2px; }
/* Khung trích dẫn "Trả lời …" trên đầu bong bóng (01/11): vạch trái + nền mờ theo màu bong bóng; bấm nhảy tới tin gốc. */
.hc-bong.co-trich { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.hc-bong.co-trich.is-tep { padding: 6px; }
.hc-trich { display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0; margin: 0; padding: 5px 9px 5px 10px; border: 0; border-left: 3px solid var(--theme-accent-strong); border-radius: 6px; background: var(--bg-input, var(--bg-page)); color: var(--text-muted); font: inherit; font-size: 12.5px; line-height: 1.35; text-align: left; white-space: normal; cursor: pointer; }
.hc-trich.is-mat { cursor: default; font-style: italic; }
.hc-trich:not(.is-mat):hover { filter: brightness(.96); }
.hc-tin.is-shop .hc-trich { border-left-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .92); }
.hc-trich-ai { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.hc-trich-ai svg { flex: none; }
.hc-trich-nd { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.hc-bong.co-trich .hc-tep-anh img, .hc-bong.co-trich .hc-anh-ngoai img { border-radius: 6px; }
.hc-bong.is-anh { display: inline-flex; align-items: center; gap: 6px; font-style: italic; }
.hc-bong.is-tep { display: grid; gap: 6px; padding: 4px; }
/* Ảnh / sticker không kèm chữ (28/10): như Messenger — không nền bong bóng, ảnh tự đứng góc bo; có chú thích thì giữ bong bóng. */
.hc-tep-anh img:not([width]) { max-width: 260px; }
.hc-bong.is-tep:has(> .hc-tep-anh:only-child) { width: fit-content; max-width: 100%; padding: 0; background: transparent !important; border: 0 !important; }
.hc-bong.is-tep .hc-tep-chu { padding: 2px 9px 5px; }
.hc-tep-anh { display: block; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: zoom-in; line-height: 0; overflow: hidden; }
/* width theo thuộc tính (kichAnh đã thu vừa 260 × 320) — width:auto từng đè thuộc tính → bong bóng rộng theo ảnh gốc. Ảnh CDN không có kích thước → trần 260 px cứng. */
.hc-tep-anh img { display: block; height: auto; max-width: min(260px, 100%); max-height: 320px; border-radius: 8px; object-fit: contain; background: var(--bg-input, var(--bg-card)); }
.hc-tep-cho { display: inline-flex; align-items: center; gap: 8px; min-width: 160px; min-height: 96px; padding: 0 12px; border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-muted); font-size: 13px; font-style: normal; }
.hc-tep-cho .hc-spin { width: 16px; height: 16px; }
.hc-tep-nut { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 280px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.hc-tep-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hc-tep-loi { padding: 0 8px 4px; font-size: 12px; font-weight: 600; color: var(--txt-bad); }
.hc-tin.is-shop .hc-tep-loi { color: #fff; }
.hc-tin-phu { margin-top: 3px; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hc-tudong { color: var(--txt-warn); font-weight: 600; }

/* Thanh soạn tin nhắn (Meta Business Suite): công cụ đính kèm/mẫu + ô nhập tự giãn dòng + dòng xác nhận kênh gửi & nút Gửi */
.hc-canh-nhanh { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 7px 12px; border-top: 1px solid var(--border-color); background: var(--bg-card); color: var(--txt-warn); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.hc-canh-nhanh svg { margin-top: 1px; }
.hc-soan { position: relative; border-top: 1px solid var(--border-color); background: var(--bg-card); padding: 6px 12px 8px; }
.hc-soan-ic { display: flex; align-items: center; gap: 2px; margin: 0 -4px 4px; overflow-x: auto; scrollbar-width: none; }
.hc-soan-ic::-webkit-scrollbar { display: none; }
.hc-soan-ic .hc-nut-ic { width: 36px; height: 36px; }
.hc-nut-ic.is-sap-co { opacity: .45; }
.hc-soan textarea { display: block; width: 100%; min-height: 52px; max-height: 168px; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 14.5px; line-height: 1.45; resize: vertical; box-sizing: border-box; }
.hc-soan-nut { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
/* Khay nút ô soạn (28/10 14:15): bảng "…" — công cụ chưa ghim + Tuỳ chỉnh; chế độ Tuỳ chỉnh là danh sách bật / tắt. */
.hc-khay-them { display: none; }
.hc-soan.is-mo-khay .hc-khay-them { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; margin: 0 0 6px; padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.hc-khay-o { display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 64px; padding: 6px 2px; border: 0; border-radius: 10px; background: transparent; color: var(--text-main); font: inherit; font-size: 12px; cursor: pointer; }
.hc-khay-o:hover:not(:disabled) { background: var(--bg-card-hover, var(--bg-input)); }
.hc-khay-o:disabled { opacity: .45; cursor: default; }
.hc-khay-vong { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-input, var(--bg-card)); color: var(--theme-accent-strong); }
.hc-khay-o.is-sua .hc-khay-vong { color: var(--text-muted); }
.hc-khay-ten { line-height: 1.2; text-align: center; }
.hc-soan.is-mo-khay .hc-khay-them.is-sua { grid-template-columns: minmax(0, 1fr); gap: 0; }
.hc-khay-goi { margin: 0 0 2px; font-size: 12.5px; color: var(--text-muted); }
.hc-khay-chon { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; border-bottom: 1px solid var(--border-color); font-size: 14px; color: var(--text-main); cursor: pointer; }
.hc-khay-chon > span { flex: 1; }
.hc-khay-chon > input { width: 20px; height: 20px; margin: 0; accent-color: var(--theme-accent-strong); }
.hc-khay-xong { justify-self: end; margin-top: 6px; }
.hc-dk-ds { display: flex; gap: 8px; margin: 2px 0 8px; padding: 2px 2px 4px; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.hc-dk { position: relative; flex: none; display: grid; width: 132px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); overflow: hidden; font-size: 12px; }
.hc-dk.is-loi { border-color: var(--txt-bad); }
.hc-dk-hinh { display: grid; place-items: center; gap: 2px; height: 72px; padding: 4px 6px; color: var(--text-muted); text-align: center; overflow: hidden; }
.hc-dk-hinh:has(img) { padding: 0; }
.hc-dk-hinh img { display: block; width: 100%; height: 72px; object-fit: cover; }
.hc-dk-ten { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; line-height: 1.3; }
.hc-dk-x { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.hc-dk progress { display: block; width: 100%; height: 3px; border: 0; background: var(--border-color); -webkit-appearance: none; appearance: none; }
.hc-dk progress::-webkit-progress-bar { background: var(--border-color); }
.hc-dk progress::-webkit-progress-value { background: var(--txt-ok); }
.hc-dk progress::-moz-progress-bar { background: var(--txt-ok); }
.hc-dk.is-loi progress::-webkit-progress-value { background: var(--txt-bad); }
.hc-dk input { width: 100%; min-height: 34px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 12.5px; box-sizing: border-box; }
.hc-dk-tt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 6px; min-height: 26px; padding: 3px 8px; line-height: 1.3; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hc-dk-nut { display: inline-flex; gap: 10px; }
.hc-dk-nut .hc-link { min-height: 24px; font-size: 12px; }
.hc-soan-ghi { flex: 1; min-width: 0; padding: 0 4px; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-soan-nut .hc-nut.is-chinh { margin-left: auto; min-height: 38px; padding: 0 16px; }
/* Bảng gợi ý tin nhắn nhanh (gõ /) nổi trên ô soạn */
.hc-mau { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 4px); max-height: 300px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); box-shadow: 0 8px 24px rgba(0,0,0,.14); z-index: 5; }
.hc-mau-dau { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); font-size: 12px; color: var(--text-muted); }
.hc-mau-dau .hc-link { min-height: 32px; font-size: 12.5px; }
.hc-mau-trong { margin: 0; padding: 12px; font-size: 13px; color: var(--text-muted); }
.hc-mau-dong { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border-color); background: transparent; color: var(--text-main); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.hc-mau-dong:last-child { border-bottom: 0; }
.hc-mau-dong:hover, .hc-mau-dong.is-chon { background: var(--theme-accent-soft); }
.hc-mau-ma { font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--bg-input, var(--bg-card)); color: var(--text-muted); white-space: nowrap; }
.hc-mau-nd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hc-mo { color: var(--text-muted); font-weight: 400; }
.hc-ok { color: var(--txt-ok); } .hc-bad { color: var(--txt-bad); }

/* Panel khách & nghiệp vụ iTN (cột phải ≥1280 / ngăn phải):
   Đầu thẻ ngang gọn (48px) → 4 công cụ nhanh → xem trước ghi chú/nhắc hẹn → thông tin khách & Chốt khách → chi nhánh ngay tầm mắt */
.hc-khung > .hc-the { min-height: 0; overflow-y: auto; border-left: 1px solid var(--border-color); background: var(--bg-card); }
.hc-hs { display: flex; flex-direction: column; }
.hc-hs-dau { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; text-align: left; border-bottom: 1px solid var(--border-color); }
.hc-av-lon { width: 48px; height: 48px; font-size: 18px; flex: none; }
.hc-hs-dau-chinh { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hc-hs-ten { display: flex; align-items: center; justify-content: flex-start; gap: 2px; margin: 0; font-size: 15.5px; max-width: 100%; }
.hc-hs-ten > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-hs-ten .hc-nut-ic { width: 32px; height: 32px; }
.hc-hs-chip { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 5px; margin: 0; }
.hc-sua-ten { display: flex; align-items: center; gap: 4px; width: 100%; }
.hc-sua-ten input { min-height: 38px; flex: 1; min-width: 0; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 14.5px; font-weight: 600; }
.hc-luoi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border-color); }
.hc-luoi-nut { position: relative; display: grid; justify-items: center; gap: 3px; min-height: 54px; padding: 5px 2px; border: 0; border-radius: 8px; background: transparent; color: var(--text-main); font: inherit; font-size: 11.5px; cursor: pointer; text-align: center; }
.hc-luoi-nut:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-luoi-vong { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border-color); border-radius: 50%; background: var(--bg-card); color: var(--text-muted); }
.hc-luoi-nut.is-bat .hc-luoi-vong { background: var(--theme-accent-soft); color: var(--theme-accent-strong); border-color: transparent; }
.hc-luoi-ten { line-height: 1.2; }
.hc-luoi-dem { position: absolute; top: 2px; right: calc(50% - 24px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--theme-accent-strong); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; }
.hc-luoi-nut.is-sap-co { cursor: default; color: var(--text-muted); }
.hc-luoi-nut.is-sap-co .hc-luoi-vong { opacity: .5; }
.hc-sap-co { display: inline-block; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border-color); color: var(--text-muted); font-size: 10.5px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.hc-luoi-nut .hc-sap-co { position: absolute; top: 0; right: 4px; }
.hc-hs-tom-tat { display: grid; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border-color); background: var(--bg-input, var(--bg-card)); }
.hc-hs-tom-muc { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 7px; width: 100%; min-height: 44px; padding: 7px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 12.5px; line-height: 1.35; text-align: left; cursor: pointer; }
.hc-hs-tom-muc:hover { border-color: var(--theme-accent-strong); }
.hc-hs-tom-muc > svg { color: var(--text-muted); margin-top: 2px; }
.hc-hs-tom-muc.is-nhac > svg { color: var(--txt-warn); }
.hc-hs-tom-muc > span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hc-pad-x { padding: 8px 14px 0; }
.hc-hs-muc { padding: 12px 14px 14px; border-bottom: 1px solid var(--border-color); display: grid; gap: 8px; }
.hc-the > .hc-hs > .hc-hs-dau { padding: 9px 12px; }
.hc-the > .hc-hs > .hc-luoi { padding: 6px 8px; }
.hc-the > .hc-hs > .hc-luoi .hc-luoi-nut { min-height: 46px; padding: 3px 2px; }
.hc-the > .hc-hs > .hc-hs-tom-tat { padding: 6px 12px; gap: 5px; }
.hc-the > .hc-hs > .hc-hs-tom-tat .hc-hs-tom-muc { min-height: 36px; padding: 5px 8px; }
.hc-the > .hc-hs > .hc-hs-muc { padding: 8px 12px 10px; gap: 5px; }
.hc-the > .hc-hs .hc-dong-tt { min-height: 34px; padding: 2px 0; }
.hc-the > .hc-hs .hc-dong-tt.is-doc { gap: 4px; padding: 4px 0; }
.hc-the > .hc-hs .hc-seg-nut { min-height: 30px; padding: 0 7px; font-size: 12px; }
.hc-the > .hc-hs .hc-hen input { min-height: 34px; }
.hc-the > .hc-hs .hc-nguon-nut button { min-height: 32px; font-size: 11.5px; }
.hc-the > .hc-hs > .hc-hs-chan { padding: 8px 12px; gap: 5px; }
.hc-hs-muc h3 { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--text-muted); letter-spacing: .01em; text-transform: uppercase; }
.hc-dong-tt { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 3px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.hc-dong-tt.is-doc { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 0; }
.hc-nh { flex: none; display: inline-flex; align-items: center; gap: 6px; width: 124px; color: var(--text-muted); }
.hc-dong-tt.is-doc .hc-nh { width: auto; }
.hc-gt { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; font-variant-numeric: tabular-nums; }
.hc-gt .hc-link { min-height: 30px; }
.hc-gt input { width: 146px; min-height: 38px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 13.5px; }
.hc-ghi-phai { text-align: right; margin-top: -4px !important; }
.hc-nguon-nut { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hc-nguon-nut button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 0 4px; border: 2px solid transparent; border-radius: 8px; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.hc-nguon-nut .is-do { background: var(--hc-n-do); } .hc-nguon-nut .is-xanh { background: var(--hc-n-xanh); } .hc-nguon-nut .is-tim { background: var(--hc-n-tim); }
/* Đang chọn: dấu ✓ + viền đậm màu chữ chính (không chỉ dựa vào màu); không làm mờ nút chưa chọn để chữ trắng vẫn đạt tương phản */
.hc-nguon-nut button[aria-checked="true"] { border-color: var(--text-main); box-shadow: inset 0 0 0 2px var(--bg-card); }
.hc-nguon-nut button:disabled { cursor: default; }
.hc-nguon-nut button:disabled:not([aria-checked="true"]) { opacity: .35; }
.hc-bo-nguon { justify-self: start; min-height: 28px; font-size: 12px; }
.hc-goi-y { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; padding: 7px 10px; border: 1px dashed var(--border-color); border-radius: 8px; font-size: 12px; color: var(--text-main); }
.hc-goi-y .hc-link { min-height: 28px; }
.hc-seg { display: flex; flex-wrap: wrap; gap: 5px; }
.hc-seg-nut { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 9px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-main); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.hc-seg-nut[aria-checked="true"] { border-color: currentColor; background: var(--bg-input, var(--bg-card)); }
.hc-seg-nut[aria-checked="true"].is-info { color: var(--txt-accent, var(--theme-accent-strong)); } .hc-seg-nut[aria-checked="true"].is-ok { color: var(--txt-ok); }
.hc-seg-nut[aria-checked="true"].is-warn { color: var(--txt-warn); } .hc-seg-nut[aria-checked="true"].is-bad { color: var(--txt-bad); }
.hc-seg-nut[aria-checked="true"].is-idle { color: var(--text-main); }
.hc-o { display: grid; gap: 4px; font-size: 13px; color: var(--text-muted); }
.hc-o textarea { padding: 10px; min-height: 64px; resize: vertical; }
.hc-ghi { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.hc-dl { margin: 0; display: grid; }
.hc-dl > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; padding: 3px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.hc-dl dt { color: var(--text-muted); } .hc-dl dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.hc-hd { display: grid; gap: 4px; }
.hc-hd + .hc-hd { padding-top: 10px; border-top: 1px solid var(--border-color); }
.hc-hd-1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.hc-hd-1 span { flex: none; font-size: 12px; font-weight: 700; color: var(--theme-accent-strong); }
.hc-hd-2 { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hc-hd-2 b { color: var(--text-main); }
.hc-bh { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.hc-bh li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border-color); font-size: 12.5px; }
.hc-bh li span:last-child { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.hc-hen { display: flex; align-items: flex-end; gap: 12px; }
.hc-hen .hc-o { flex: 1; min-width: 0; }
.hc-bo-hen { min-height: 44px; font-size: 13px; }
.hc-ls { list-style: none; margin: 0; padding: 0; display: grid; }
.hc-ls li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border-color); font-size: 12.5px; line-height: 1.4; }
.hc-ls li:first-child { border-top: 0; }
.hc-ls q { display: block; margin-top: 2px; color: var(--text-muted); font-style: italic; }
.hc-ls time { flex: none; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hc-hs-chan { padding: 10px 14px; border-bottom: 1px solid var(--border-color); background: color-mix(in srgb, var(--theme-accent-soft) 45%, var(--bg-card)); display: grid; gap: 8px; }
.hc-hs-chan .hc-nut { width: 100%; min-height: 40px; }
/* Ngăn phụ của panel: Ghi chú · Nhắc hẹn · Tệp đã gửi */
.hc-phu { min-height: 100%; }
.hc-phu-dau { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 6px 8px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.hc-phu-dau h3 { flex: 1; margin: 0; font-size: 15px; }
.hc-phu-than { padding: 12px 14px; display: grid; gap: 8px; }
.hc-phu-chan { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border-color); background: var(--bg-card); }
.hc-phu-chan textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 14px; resize: vertical; }
.hc-phu > .hc-o-loi { padding: 0 14px 10px; }
.hc-ghi-ds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hc-ghi-dong { position: relative; display: grid; gap: 4px; padding: 8px 44px 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 13.5px; }
.hc-ghi-dong p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.hc-ghi-dong small { color: var(--text-muted); font-size: 12px; }
.hc-ghi-dong > .hc-nut-ic { position: absolute; top: 0; right: 0; }
.hc-ghi-dong.is-nhac { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; color: var(--text-main); }
.hc-ghi-dong.is-nhac > svg { color: var(--txt-warn); margin-top: 2px; }
.hc-tab { display: flex; border-bottom: 1px solid var(--border-color); }
.hc-tab button { flex: 1; min-height: 44px; padding: 0 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.hc-tab button[aria-selected="true"] { color: var(--theme-accent-strong); border-bottom-color: var(--theme-accent-strong); }
.hc-tab button:disabled { cursor: default; opacity: .7; }
.hc-luoi-anh { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hc-luoi-anh-o { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-muted); overflow: hidden; cursor: pointer; }
.hc-luoi-anh-o img { width: 100%; height: 100%; object-fit: cover; }
.hc-tep-dong { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 13.5px; }
.hc-tep-dong > a, .hc-tep-dong > .hc-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--theme-accent-strong); text-align: left; }
.hc-tep-dong small { grid-column: 2; color: var(--text-muted); font-size: 12px; }

/* Ngăn phải (hồ sơ khách ở <1280, kết nối kênh, chuyển, cấu hình) */
.hc-ngan-nen { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 10040; }
.hc-ngan { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 10050; display: flex; flex-direction: column; background: var(--bg-card); color: var(--text-main); border-left: 1px solid var(--border-color); overflow-y: auto; }
.hc-ngan.is-rong { width: min(640px, 100%); }
.hc-ngan-dau { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); z-index: 2; }
.hc-ngan-dau h2 { margin: 0; font-size: 17px; }
.hc-ngan > .hc-tab { position: sticky; top: 60px; z-index: 1; background: var(--bg-card); }
.hc-kn { list-style: none; margin: 0; padding: 0; }
.hc-kn li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.hc-kn-ten { display: grid; gap: 4px; min-width: 0; font-size: 14px; }
.hc-kn-ten .hc-kenh { justify-self: start; }
.hc-ch-kenh { align-items: flex-end !important; }
.hc-ch-o { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex-basis: 100%; }
.hc-ch-o .hc-o input, .hc-ch-o .hc-o select { width: 100%; min-width: 0; }
.hc-ch-giao { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; min-width: 0; }
.hc-ch-giao legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 13.5px; font-weight: 600; }
.hc-ch-nguoi { display: flex; flex-wrap: wrap; gap: 0 14px; }
.hc-chk { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13.5px; cursor: pointer; min-width: 0; }
.hc-chk input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--theme-accent-strong); }
.hc-chk-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Bảng chọn nổi (popover) — máy tính đặt cạnh nút; điện thoại trượt từ dưới */
.hc-pop { position: fixed; z-index: 10070; display: grid; gap: 2px; min-width: 240px; max-width: min(92vw, 340px); max-height: min(80vh, 560px); overflow-y: auto; padding: 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.hc-pop.is-emoji { width: 340px; }
.hc-pop h4 { margin: 4px 4px 4px; font-size: 13px; }
.hc-pop .hc-chk { padding: 0 6px; border-radius: 6px; }
.hc-pop .hc-chk:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-pop .hc-seg { margin: 0 4px 6px; }
.hc-pop-muc { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-main); font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none; }
.hc-pop-muc:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-pop-muc:disabled { color: var(--text-muted); cursor: default; background: transparent; }
.hc-pop-muc > span:first-of-type { flex: 1; min-width: 0; }
.hc-pop-muc.is-kq span { display: grid; gap: 2px; padding: 6px 0; font-size: 13px; }
.hc-pop-muc.is-kq small { color: var(--text-muted); font-size: 11.5px; }
.hc-pop-dau { color: var(--theme-accent-strong); display: inline-flex; }
.hc-pop-sep { height: 1px; margin: 4px 0; background: var(--border-color); }
.hc-pop-cuon { max-height: 280px; overflow-y: auto; display: grid; }
.hc-pop-dau-nhom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 4px 4px; }
.hc-pop-dau-nhom h4 { margin: 0; font-size: 13px; }
.hc-pop-dau-nhom .hc-nut-gon { min-height: 28px; padding: 0 9px; font-size: 12px; gap: 4px; border-radius: 999px; }
.hc-tao-nhan { display: grid; gap: 8px; margin: 4px; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); }
.hc-tao-nhan > input[type="text"] { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-card); color: var(--text-main); font: inherit; font-size: 14px; box-sizing: border-box; }
.hc-mau-bang { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hc-mau-o { width: 24px; height: 24px; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; flex: none; transition: transform .12s; }
.hc-mau-o[aria-checked="true"] { border-color: var(--text-main); box-shadow: 0 0 0 2px var(--bg-card) inset; transform: scale(1.1); }
.hc-mau-tuy { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px dashed var(--border-color); border-radius: 999px; background: var(--bg-card); font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.hc-mau-tuy input[type="color"] { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.hc-tao-nhan-nut { display: flex; justify-content: flex-end; gap: 6px; }
.hc-tao-nhan-nut .hc-nut-gon { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.hc-nhan-ds { max-height: 210px; }
.hc-nhan-dong { display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.hc-nhan-dong:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-nhan-dong .hc-chk { flex: 1; min-width: 0; min-height: 38px; }
/* 18/10/2026: xoá ghi chú màu phải xác nhận ngay tại dòng (ghi chú dùng chung — gỡ khỏi mọi khách của mọi nhân viên). */
.hc-nhan-dong.is-hoi { flex-wrap: wrap; padding: 6px 8px; background: color-mix(in srgb, var(--theme-danger, #c0262d) 9%, transparent); }
.hc-nhan-dong.is-hoi:hover { background: color-mix(in srgb, var(--theme-danger, #c0262d) 12%, transparent); }
.hc-nhan-hoi { flex: 1 1 180px; min-width: 0; font-size: 13px; line-height: 1.45; }
.hc-nhan-dong .hc-chk:hover { background: transparent; }
.hc-nhan-dong-nut { display: flex; align-items: center; gap: 2px; flex: none; padding-right: 4px; }
.hc-nhan-dong-nut .hc-nut-ic { width: 28px; height: 28px; }
.hc-pop-chan { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.hc-pop-ngay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px; }
.hc-pop-ngay input { width: 100%; min-width: 0; }
.hc-pop .hc-ghi, .hc-pop .hc-o-loi { padding: 4px 6px; }
.hc-pop-nen { position: fixed; inset: 0; z-index: 10065; background: rgba(0,0,0,.32); }
.hc-emoji { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; max-height: 260px; overflow-y: auto; }
.hc-emoji button { min-height: 40px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.hc-emoji button:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-emoji-nhom { grid-column: 1 / -1; padding: 6px 4px 2px; font-size: 11.5px; color: var(--text-muted); }

/* Hộp thoại (modal): thư mục ảnh mẫu · quản lý tin nhắn nhanh · tạo nhắc hẹn */
.hc-lop { position: fixed; inset: 0; z-index: 10060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.45); }
.hc-hop { display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: 92vh; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.hc-hop.is-rong { max-width: 880px; }
.hc-hop-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border-color); }
.hc-hop-dau h2 { margin: 0; font-size: 16px; }
.hc-hop-than { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.hc-hop-chan { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border-color); }
.hc-hop-trai { margin-right: auto; font-size: 12.5px; color: var(--text-muted); }
.hc-tm { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; min-height: 360px; }
.hc-tm-trai { display: grid; align-content: start; gap: 2px; padding-right: 10px; border-right: 1px solid var(--border-color); }
.hc-tm-muc { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-main); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.hc-tm-muc > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-tm-muc:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-tm-muc.is-bat { background: var(--theme-accent-soft); color: var(--theme-accent-strong); font-weight: 600; }
.hc-tm-muc.is-them { color: var(--theme-accent-strong); }
.hc-tm-con { display: block; padding-left: 16px; }
.hc-tm-nhom { padding: 10px 8px 4px; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.hc-tm-tao { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 4px; }
.hc-tm-tao input { min-height: 40px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; }
.hc-tm-phai { min-width: 0; display: grid; align-content: start; gap: 8px; }
.hc-tm-luoi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.hc-tm-anh { position: relative; display: grid; gap: 4px; padding: 3px; border: 2px solid transparent; border-radius: 8px; min-width: 0; }
.hc-tm-anh.is-chon { border-color: var(--theme-accent-strong); }
.hc-tm-chon { position: relative; display: block; padding: 0; border: 0; border-radius: 6px; background: var(--bg-input, var(--bg-card)); cursor: pointer; overflow: hidden; aspect-ratio: 4 / 3; }
.hc-tm-hinh { display: grid; place-items: center; width: 100%; height: 100%; object-fit: cover; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.hc-tm-tick { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 12px; font-weight: 700; }
.hc-tm-anh.is-chon .hc-tm-tick { background: var(--theme-accent-strong); }
.hc-tm-ten { display: flex; align-items: center; gap: 0; min-width: 0; font-size: 12.5px; }
.hc-tm-ten > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 2px; }
.hc-tm-ten .hc-nut-ic { width: 36px; height: 36px; }
.hc-tm-sao.is-bat { color: var(--txt-warn); }
.hc-tm-sao.is-bat svg { fill: currentColor; }
.hc-tm-hoi { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--txt-bad); border-radius: 8px; font-size: 12.5px; }
.hc-tm-hoi .hc-link { min-height: 32px; }
.hc-cm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.hc-cm-form > .hc-o:nth-of-type(3), .hc-cm-form > .hc-chot-nut, .hc-cm-form > .hc-o-loi { grid-column: 1 / -1; }
.hc-cm-ds { list-style: none; margin: 0; padding: 0; }
.hc-cm-ds li { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 13.5px; }
.hc-cm-ds li p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.hc-cm-ds .hc-mau-ma { justify-self: start; margin-top: 2px; }
.hc-cm-nut { display: flex; }
.hc-cm-ds .hc-tm-hoi { grid-column: 1 / -1; }

/* Trạng thái gửi / lỗi / thông báo */
.hc-khong-gui { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 6px; font-size: 13px; color: var(--txt-warn); line-height: 1.4; }
.hc-khong-gui.is-chan { margin: 0; padding: 12px; border-top: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-muted); }
.hc-o-loi { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: -4px 0 0; font-size: 12.5px; font-weight: 600; color: var(--txt-bad); }
.hc-soan .hc-o-loi { margin: 6px 0 0; }
.hc-gui-loi-lai { margin-left: auto; flex: none; font-size: 12.5px; min-height: 24px; }
.hc-trang [aria-invalid="true"] { border-color: var(--txt-bad) !important; }
.hc-tin.is-loi .hc-bong { opacity: .72; }
/* 28/10: tin Pancake khoá vì khách đang trong câu hỏi tự động của quảng cáo — máy chủ tự gửi lại khi Facebook mở khoá: màu chờ, không đỏ */
.hc-cho-lai, .hc-tin-loi.is-cho { color: var(--txt-warn); }
.hc-mbs-tin { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }   /* 06/11: nút mở Hộp thư page (Business Suite) dưới tin kẹt câu hỏi tự động QC */
.hc-tin-kb { margin: 4px 0 0 32px; min-width: 0; max-width: calc(100% - 32px); }   /* 28/10: nút "Kết bạn qua Zalo" dưới tin khách có SĐT (thụt bằng ảnh đại diện 26px + 6px) */
/* Tên nhân viên / số Zalo dài phải xuống dòng, không đẩy vùng cuộn ngang. */
.hc-ket-ban-sdt { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; padding-top: 6px; padding-bottom: 6px; }
.hc-ket-ban-sdt > svg { flex: none; }
.hc-ket-ban-sdt.is-bat { background: var(--primary, #1877f2); color: #fff; }
.hc-tin-loi { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--txt-bad); max-width: 340px; text-align: right; }
.hc-thu-lai-tin { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px; border: 1px solid var(--txt-bad); border-radius: 6px; background: var(--bg-card); color: var(--txt-bad); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.hc-thu-lai-tin:hover { background: var(--txt-bad); color: #fff; }
.hc-thu-lai-tin:disabled { opacity: .6; cursor: default; }
.hc-anh-xem { z-index: 10085; background: rgba(0, 0, 0, .78); }
.hc-anh-khung { display: flex; flex-direction: column; width: min(92vw, 960px); max-height: 92vh; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.hc-anh-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-card); }
.hc-anh-ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.hc-anh-nut { display: flex; align-items: center; gap: 6px; flex: none; }
.hc-anh-than { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.9); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.hc-anh-hinh { display: block; max-width: 100%; max-height: calc(92vh - 96px); object-fit: contain; border-radius: 4px; transform-origin: 50% 50%; transition: transform .14s ease-out; cursor: zoom-in; -webkit-user-drag: none; -webkit-touch-callout: none; }
/* 18/10/2026: phóng to / kéo trong trình xem — đang kéo / chụm thì tắt hiệu ứng để ảnh bám tay. */
.hc-anh-than.is-phong .hc-anh-hinh { cursor: grab; }
.hc-anh-than.is-keo .hc-anh-hinh { transition: none; cursor: grabbing; }
.hc-anh-zoom { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(32,32,32,.88); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hc-anh-zoom button.hc-nut-ic, .hc-anh-ty { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: #fff; font: 600 20px/1 inherit; cursor: pointer; }
.hc-anh-ty { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 6px; }
.hc-anh-zoom button:disabled { opacity: .4; cursor: default; }
.hc-anh-zoom button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.hc-anh-zoom button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (max-width: 760px) {
  .hc-anh-xem { padding: 0; }
  .hc-anh-khung { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .hc-anh-dau { padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
  .hc-anh-dau .hc-nut-ic { min-width: 44px; min-height: 44px; }
  .hc-anh-dau .hc-nut-gon { min-height: 40px; }
  .hc-anh-than { padding: 0 0 env(safe-area-inset-bottom); }
  .hc-anh-hinh { max-height: calc(100dvh - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 0; }
  .hc-anh-zoom { bottom: calc(14px + env(safe-area-inset-bottom)); }
}
.hc-tin-moi-goc { position: relative; height: 0; flex: none; z-index: 2; }
.hc-tin-moi { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 8px; background: var(--theme-accent-strong); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.16); }
.hc-tin-moi[hidden] { display: none; }
.hc-tin-moi:hover { filter: brightness(1.06); }
/* Dưới hàng nút đầu trang (28/10: ở 96px báo nổi che đúng nút gạt Thông báo vừa bấm). */
.hc-toast { position: fixed; right: 24px; top: calc(140px + env(safe-area-inset-top, 0px)); z-index: 10095; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 8px; background: var(--text-main); color: var(--bg-card); font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.22); pointer-events: none; }
.hc-toast.is-loi { background: #b91c1c; color: #fff; }
.hc-anh-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.hc-sdt { color: var(--text-muted); text-decoration: none; font-variant-numeric: tabular-nums; }
.hc-sdt:hover { color: var(--theme-accent-strong); text-decoration: underline; }
.hc-them-nua { width: calc(100% - 20px); margin: 10px; }
.hc-pad { padding: 14px; }
.hc-chot-ok { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; margin: 0; font-weight: 600; color: var(--txt-ok); }
.hc-chot-ok span { grid-column: 2; font-size: 12.5px; font-weight: 400; color: var(--text-muted); }
.hc-chot { display: grid; gap: 10px; }
.hc-chot fieldset, .hc-hs-muc fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.hc-chot legend { margin-bottom: 6px; font-size: 13px; color: var(--text-muted); }
.hc-radio { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.hc-radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--theme-accent-strong); }
.hc-radio:has(input:checked) { border-color: var(--theme-accent-strong); box-shadow: inset 0 0 0 1px var(--theme-accent-strong); }
.hc-radio:has(input:focus-visible) { outline: 2px solid var(--theme-accent-strong); outline-offset: 2px; }
.hc-chot-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hc-kn-tt { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-kn-ten .hc-mo { font-size: 12px; font-variant-numeric: tabular-nums; }
.hc-kn-nut { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hc-kn-cn { min-height: 44px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 14px; }
.hc-hs-muc .hc-kn { margin: 0 -14px; }
.hc-kn li > .hc-o-loi { flex-basis: 100%; margin: 0; }
.hc-hoi-ngat { flex-basis: 100%; display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-color); border-left: 3px solid var(--txt-bad); border-radius: 8px; }
.hc-hoi-ngat p { margin: 0; font-size: 13.5px; }
.hc-nut.is-nguy { background: var(--theme-danger, var(--txt-bad)); border-color: var(--theme-danger, var(--txt-bad)); color: #fff; }
/* Nút gạt Thông báo tin khách (28/10): công tắc trong nút đầu trang — xanh = bật, giữa = một phần, xám = im lặng. */
.hc-gat { gap: 8px; }
.hc-gat-ray { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--border-color); transition: background .15s; }
.hc-gat-nut { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.hc-gat.is-bat .hc-gat-ray { background: #16a34a; }
.hc-gat.is-bat .hc-gat-nut { transform: translateX(14px); }
.hc-gat[aria-checked="mixed"] .hc-gat-ray { background: #86a98f; }
.hc-gat[aria-checked="mixed"] .hc-gat-nut { transform: translateX(7px); }
@media (prefers-reduced-motion: reduce) { .hc-gat-ray, .hc-gat-nut { transition: none; } }
/* Kênh đã ngắt kết nối (28/10): nhóm riêng, đóng sẵn — không lẫn với kênh đang chạy. */
.hc-kn-ngat { margin-top: 10px; border-top: 1px solid var(--border-color); }
.hc-kn-ngat > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.hc-kn-ngat > summary::after { content: '▾'; margin-left: 6px; transition: transform .15s; }
.hc-kn-ngat[open] > summary::after { transform: rotate(180deg); }
.hc-kn-ngat > .hc-ghi { margin-bottom: 6px; }
details.hc-hs-muc > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.hc-form-oa { display: grid; gap: 10px; }
/* 134: kết nối Pancake xong — địa chỉ nhận tin để dán vào Pancake (cuộn ngang trong ô, không đẩy ngăn rộng ra). */
.hc-pk-xong { display: grid; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; }
.hc-pk-url { display: flex; gap: 6px; align-items: center; min-width: 0; }
.hc-pk-url code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 6px 8px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 12px; user-select: all; }
.hc-qr { display: grid; justify-items: start; gap: 10px; }
.hc-qr-anh { width: 220px; height: 220px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; image-rendering: pixelated; }
.hc-qr p { margin: 0; font-size: 13.5px; line-height: 1.45; }
/* Đợt A: sticker, video / ghi âm tại chỗ, thẻ link / định vị / danh thiếp, "Tải tin cũ hơn" */
.hc-tep-anh.is-sticker img { max-width: 120px; max-height: 120px; background: transparent; }
.hc-bong.is-tep:has(.is-sticker) { background: transparent; border-color: transparent; box-shadow: none; }
.hc-tep-video { display: block; width: min(280px, 100%); max-height: 360px; border-radius: 8px; background: #000; }
.hc-tep-audio { display: block; width: min(280px, 100%); min-height: 44px; }
.hc-tep-tai { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; font-size: 13px; }
.hc-the-tin { display: grid; gap: 3px; max-width: 280px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-main); text-decoration: none; min-height: 44px; }
a.hc-the-tin:hover { border-color: var(--theme-accent); }
.hc-the-nhan { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted, var(--text-main)); }
.hc-the-tin b { font-size: 14px; overflow-wrap: anywhere; }
.hc-the-mo { font-size: 13px; color: var(--text-muted, var(--text-main)); overflow-wrap: anywhere; }
.hc-the-url { font-size: 12px; color: var(--theme-accent); }
/* Thẻ cuộc gọi Zalo (16/10/2026): icon tròn + tiêu đề đậm + thời lượng; nút GỌI LẠI dưới vạch ngăn, cao 44px (gọi SĐT khách bằng máy).
   a.hc-goi-lai (không phải .hc-goi-lai) để thắng .hc-bong a / .hc-chat.hc-zl .hc-bong a — nút không gạch chân, giữ màu riêng. */
.hc-goi { display: grid; min-width: 216px; max-width: 280px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card); color: var(--text-main); }
.hc-goi-than { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; }
.hc-goi-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--theme-accent) 14%, transparent); color: var(--theme-accent); }
.hc-goi.is-nho .hc-goi-ic { background: color-mix(in srgb, var(--txt-bad) 14%, transparent); color: var(--txt-bad); }
.hc-goi-chu { display: grid; gap: 2px; min-width: 0; }
.hc-goi-chu b { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.hc-goi-phu { font-size: 13px; line-height: 1.3; color: var(--text-muted, var(--text-main)); font-variant-numeric: tabular-nums; }
a.hc-goi-lai { display: flex; align-items: center; justify-content: center; min-height: 44px; border-top: 1px solid var(--border-color); color: var(--theme-accent); font-size: 13.5px; font-weight: 700; letter-spacing: .04em; text-decoration: none; }
a.hc-goi-lai:hover { background: color-mix(in srgb, var(--theme-accent) 8%, transparent); }
.hc-goi-lai:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: -2px; }
.hc-tin-cu { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 8px; }
.hc-tin-cu .hc-nut { min-height: 44px; }

/* Tablet (761–1279): danh sách gọn, panel khách thành ngăn phải */
@media (max-width: 1279px) {
  .hc-khung, .hc-khung.co-the { grid-template-columns: var(--hc-ds-w, 336px) minmax(0, 1fr); }
  .hc-tin { max-width: 82%; }
}
/* Màn ≤1023px: canCao() đã trừ chiều cao #iphone-bottom-bar khi tính .hc-khung → bỏ padding-bottom của .main-viewport để không dư khoảng trắng cuối trang */
@media (max-width: 1023px) {
  body.itn-shell:has(#module-content .hc-trang) .main-viewport { padding-bottom: 0 !important; }
}
/* Điện thoại: một màn một lúc — danh sách (hàng chip lọc cuộn ngang dưới ô tìm) → chat toàn màn → thông tin khách (ngăn toàn màn) */
@media (max-width: 760px) {
  html:has(#module-content .hc-trang) { overflow: hidden; overscroll-behavior-y: none; }
  body.itn-shell:has(#module-content .hc-trang) { min-height: 0; overflow: visible; overflow-x: hidden; overflow-x: clip; overscroll-behavior-y: none; }
  /* 31/10 (video anh Nghĩa "soạn tin bị giựt"): styles.css cho body đệm đáy 70px (chừa thanh dưới) — canCao() đã tự trừ thanh dưới nên ở Hộp chat
     đệm này chỉ làm trang cao hơn màn ~90px. Gõ xuống dòng, iOS cuộn CẢ TRANG theo con trỏ → thanh tên khách trôi khỏi đầu, gửi xong mới giật về. */
  body.itn-shell:has(#module-content .hc-trang), body.itn-shell:has(#module-content .hc-trang) .main-viewport > main { padding-bottom: 0 !important; }
  /* Màn chat trên iPhone (28/10 13:44 "focus thẳng vào tin nhắn khách"): ẩn hẳn thanh đầu app + thanh dưới — về danh sách bằng nút ← là hiện lại. */
  body.itn-shell:has(#module-content .hc-trang.is-xem-chat) #app-header,
  body.itn-shell:has(#module-content .hc-trang.is-xem-chat) #iphone-bottom-bar { display: none !important; }
  /* body đã chừa safe-area-inset-top một lần (styles.css "App Store 1.0") → .main-viewport KHÔNG cộng thêm (28/10 14:13 iPhone: hở ~60pt trên khung chat). */
  body.itn-shell:has(.hc-trang.is-xem-chat) .main-viewport { padding-top: 0 !important; padding-bottom: 0 !important; }
  /* Không còn thanh dưới → chừa vạch Home cho ô soạn (bàn phím đang mở thì không cần). */
  html:not(.itn-ban-phim) .hc-trang.is-xem-chat .hc-soan { padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  body.itn-shell:has(.hc-trang.is-xem-chat) .main-viewport > main { padding-top: 0 !important; }
  body.itn-shell:has(.hc-trang.is-xem-chat) #app-header { margin-bottom: 0 !important; }
  .hc-dau { flex-wrap: nowrap; align-items: center; gap: 6px; margin-bottom: 4px; }
  .hc-dau > div:first-child { flex: none; }
  .hc-dau h1 { font-size: 20px; line-height: 1.2; white-space: nowrap; }
  .hc-sub, .hc-an-hep, .hc-dau-nut .hc-an-hep, .hc-keo-ds { display: none; }
  .hc-dau-nut .hc-nut { width: 44px; min-height: 44px; padding: 0; flex: none; border-color: transparent; background: transparent; }
  /* Nút chỉ có chữ (Kiểm tra bot, tên bot của mình, Tiến độ huấn luyện — tro-ly.js) KHÔNG ép 44px: giữ trên 1 hàng ngang cùng tiêu đề,
     tự đẩy sang phải khi đủ chỗ (margin-left:auto) và cuộn ngang mượt khi có thêm nút trợ lý — tiết kiệm 44px chiều dọc màn hình. */
  .hc-dau-nut { flex: 1 1 0; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .hc-dau-nut > :first-child { margin-left: auto; }
  .hc-dau-nut::-webkit-scrollbar { display: none; }
  .hc-dau-nut a.hc-nut, .hc-dau-nut .tl-toolbar .hc-nut { width: auto; min-height: 44px; padding: 0 10px; font-size: 13px; white-space: nowrap; background: var(--bg-input, var(--bg-card)); border-color: transparent; }
  .hc-khung, .hc-khung.co-the { grid-template-columns: minmax(0, 1fr); min-height: 180px; max-height: calc(100dvh - var(--hc-khung-top, 121px)); }
  .hc-trang.is-xem-ds .hc-chat, .hc-trang.is-xem-chat .hc-ds { display: none; }
  .hc-trang.is-xem-chat .hc-dau, .hc-trang.is-xem-chat .hc-canh { display: none; }
  /* Thu gọn khi vuốt danh sách (28/10 13:44): ẩn thanh đầu app + dòng "Hộp chat" + cảnh báo kênh + thanh dưới — chỉ còn tab page, tìm, lọc, khách.
     Chỉ trong Hộp chat (:has) — rời module thì JS gỡ lớp hc-gon. */
  body.itn-shell.hc-gon:has(#module-content .hc-trang.is-gon) #app-header,
  body.itn-shell.hc-gon:has(#module-content .hc-trang.is-gon) #iphone-bottom-bar,
  .hc-trang.is-gon .hc-dau, .hc-trang.is-gon .hc-canh { display: none !important; }
  body.itn-shell.hc-gon:has(#module-content .hc-trang.is-gon) .main-viewport { padding-top: 0 !important; padding-bottom: 0 !important; }
  /* Hàng "Hộp chat" + nút công cụ ẩn sẵn trên iPhone, nút ••• cạnh ô tìm mở lại (S.moDau). */
  .hc-trang.is-xem-ds:not(.is-mo-dau) .hc-dau { display: none; }
  body.itn-shell.hc-gon:has(#module-content .hc-trang.is-gon) .main-viewport > main { padding-top: 0 !important; }
  /* Gọn sẵn (không cần vuốt): cảnh báo kênh 1 dòng, tab page / ô tìm / chip lọc thấp hơn. */
  .hc-canh { flex-wrap: nowrap; margin: 0 0 4px; padding: 4px 8px; font-size: 12px; line-height: 1.3; }
  .hc-canh > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hc-canh .hc-link { flex: none; min-height: 32px; }
  .hc-ds { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr); grid-template-areas: "nt" "dau" "loc" "nv" "tom" "chon" "than"; border-right: 0; }
  .hc-nt-nut, .hc-nt-gop, .hc-nt-doi { min-height: 44px; }
  .hc-nt-nut, .hc-nt-doi { position: relative; }
  .hc-ds-dau { padding: 4px 8px; gap: 4px; }
  .hc-ds-dau .hc-tim, .hc-ds-dau .hc-tim input { min-height: 44px; }
  .hc-loc { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 5px; padding: 5px 8px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border-color); background: var(--bg-card); scrollbar-width: none; }
  .hc-loc::-webkit-scrollbar { display: none; }
  .hc-loc-sep { width: 1px; height: 22px; margin: 0 2px; }
  .hc-loc-nut { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto; min-width: 44px; min-height: 44px; height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: var(--bg-input, var(--bg-card)); font-size: 12.5px; font-weight: 600; color: var(--text-main); white-space: nowrap; }
  .hc-loc-nut > svg { display: none; }
  .hc-loc-nut.is-bat { border-color: var(--theme-accent-strong); box-shadow: inset 0 0 0 1px var(--theme-accent-strong); background: var(--bg-card); color: var(--theme-accent-strong); }
  .hc-loc-ten { display: inline; }
  .hc-loc-so { position: static; background: transparent; color: var(--text-muted); font-size: 12px; padding: 0; min-width: 0; height: auto; line-height: inherit; }
  .hc-loc-nut.is-bat .hc-loc-so { color: inherit; }
  .hc-loc-cham, .hc-tip { display: none; }
  .hc-dong { min-height: 66px; padding: 6px 10px 6px 8px; gap: 10px; }
  .hc-dong-g { gap: 2px; }
  .hc-dong-3 { flex-wrap: nowrap; gap: 4px; margin-top: 0; min-width: 0; }
  .hc-dong .hc-kenh, .hc-dong .hc-tt, .hc-dong .hc-cho, .hc-dong .hc-im, .hc-dong .hc-pt-trong { min-height: 20px; padding: 0 6px; font-size: 11.5px; }
  .hc-dong .hc-pt-trong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .hc-dong-them { opacity: 1; top: auto; bottom: 0; right: 0; width: 44px; height: 44px; border-color: transparent; background: transparent; }
  .hc-dong-ic { margin-right: 28px; flex: none; }
  .hc-chat-dau { padding: 6px 4px 6px 2px; gap: 4px; }
  .hc-av-dau, .hc-chat-dau .hc-an-hep-c { display: none; }
  .hc-chat-ai p .hc-kenh, .hc-chat-ai p .hc-sdt, .hc-chat-ai p .hc-cho { display: none; }
  .hc-pt-chip { max-width: 96px; }
  .hc-nut-gon, .hc-soan-nut .hc-nut.is-chinh, .hc-nguon-nut button, .hc-seg-nut, .hc-hs-chan .hc-nut, .hc-sua-ten input, .hc-gt input { min-height: 44px; }
  .hc-nut-gon { padding: 0 10px; }
  .hc-nut-vuong, .hc-hs-ten .hc-nut-ic { width: 44px; height: 44px; }
  .hc-dk { width: 116px; }
  .hc-tin { max-width: 88%; }
  .hc-tin-them { opacity: 1; width: 44px; height: 44px; }
  .hc-tm-ten .hc-nut-ic, .hc-emoji button, .hc-dk-x { min-width: 44px; min-height: 44px; }
  .hc-dk-x { top: 0; right: 0; border-radius: 0 0 0 8px; }
  .hc-tin-ds { padding: 12px 10px 6px; }
  .hc-soan-ic .hc-nut-ic { width: 44px; height: 44px; }
  .hc-soan-ghi { display: none; }
  /* Ô soạn gọn (28/10 14:13 + 14:15): một hàng [nút đã ghim…] [•••] [ô nhập] [Gửi]; bảng "…" mở phía trên hàng.
     Hộp kiểu Zalo có ô soạn riêng (soanZl), Phòng luyện chat dùng [data-lc-soan] nên khoanh đúng [data-hc-soan]. */
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 4px; padding: 6px 8px; }
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] > * { flex: 0 0 100%; min-width: 0; }
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] .hc-khay-them { order: 1; }
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] .hc-soan-ic { order: 2; flex: none; gap: 0; margin: 0; overflow: visible; }
  /* line-height 22px (như ô Zalo): 22 + đệm 20 + viền 2 = đúng 44px một dòng — để 1.45 (23,2px) thì gõ chữ đầu ô nở thêm 1px (31/10). */
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] textarea { order: 3; flex: 1 1 0; min-height: 44px; max-height: 120px; padding: 10px 14px; border-radius: 22px; line-height: 22px; resize: none; }
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] .hc-soan-nut { order: 4; flex: none; margin-top: 0; }
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] .hc-soan-nut .hc-nut.is-chinh { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px; }
  /* Nút Gửi chỉ còn biểu tượng (chữ "Gửi" vẫn đọc được cho trình đọc màn hình) để ô nhập rộng hơn. */
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] .hc-gui-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hc-chat:not(.hc-zl) .hc-soan[data-hc-soan] .hc-o-loi { order: 5; }
  .hc-ngan, .hc-ngan.is-rong { width: 100%; border-left: 0; }
  .hc-toast { right: 16px; left: 16px; top: calc(132px + env(safe-area-inset-top, 0px)); justify-content: center; }
  .hc-tin-moi { min-height: 44px; }
  .hc-pop.is-day { left: 0 !important; right: 0; bottom: 0; top: auto !important; max-width: none; width: 100%; max-height: 78vh; border-radius: 8px 8px 0 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .hc-pop .hc-chk, .hc-pop-muc { min-height: 48px; }
  .hc-lop { padding: 0; align-items: flex-end; }
  .hc-hop, .hc-hop.is-rong { max-width: none; max-height: 94vh; border-radius: 8px 8px 0 0; }
  .hc-tm { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hc-tm-trai { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 6px; border-right: 0; border-bottom: 1px solid var(--border-color); }
  .hc-tm-trai .hc-tm-nhom { display: none; }
  .hc-tm-muc { width: auto; flex: none; min-height: 44px; white-space: nowrap; }
  .hc-tm-con { padding-left: 0; display: contents; }
  .hc-tm-tao { flex: none; grid-template-columns: 160px auto auto; }
  .hc-tm-luoi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc-cm-form { grid-template-columns: minmax(0, 1fr); }
  .hc-cm-ds li { grid-template-columns: minmax(0, 1fr) auto; }
  .hc-cm-ds li > div { grid-column: 1 / -1; grid-row: 2; }
  .hc-ch-o { grid-template-columns: minmax(0, 1fr); }
  .hc-nh { width: 118px; }
}

/* Theme tối: nền nhấn graphite / gold-noir sáng → chữ trên nút chính dùng màu nền app; chữ nhấn trên nền nhạt dùng --theme-accent. */
html[data-itn-theme="graphite"] :is(.hc-nut.is-chinh, .hc-tin.is-shop .hc-bong, .hc-pt.is-toi, .hc-luoi-dem, .hc-tin-moi), html[data-itn-theme="gold-noir"] :is(.hc-nut.is-chinh, .hc-tin.is-shop .hc-bong, .hc-pt.is-toi, .hc-luoi-dem, .hc-tin-moi) { color: var(--bg-app); }
html:is([data-itn-theme="graphite"], [data-itn-theme="gold-noir"], [data-itn-theme="sapphire"]) :is(.hc-tt.is-info, .hc-seg-nut[aria-checked="true"].is-info, .hc-hd-1 span, .hc-link, .hc-pt-chip.is-toi, .hc-loc-nut.is-bat, .hc-dau-nut .hc-nut.is-bat, .hc-nut-ic.is-bat, .hc-tab button[aria-selected="true"], .hc-tm-muc.is-bat, .hc-pop-dau, .hc-tm-muc.is-them, .hc-tep-dong > a, .hc-tep-dong > .hc-link) { color: var(--theme-accent); }
html:is([data-itn-theme="graphite"], [data-itn-theme="gold-noir"], [data-itn-theme="sapphire"]) :is(.hc-tab button[aria-selected="true"]) { border-bottom-color: var(--theme-accent); }
@media (prefers-reduced-motion: reduce) { .hc-spin { animation: none; } .hc-tip { transition: none; } }

/* ── Bot trả lời page (10/10/2026) — ngăn hc-ngan như Kết nối kênh; iPhone phủ toàn màn (.hc-ngan width 100% ở ≤760px). ── */
.hc-ngan-bot { width: min(560px, 100%); }
.hc-bot-canh { margin: 12px 14px 0; }
.hc-bot-ds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hc-bot-the { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card); min-width: 0; }
.hc-bot-dau { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.hc-bot-dau .hc-kn-ten { overflow-wrap: anywhere; }
.hc-bot-dong { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-size: 14px; }
.hc-cong-tac { position: relative; flex: none; width: 52px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.hc-cong-tac > span { position: absolute; left: 0; top: 8px; width: 52px; height: 28px; border-radius: 14px; background: var(--border-color); transition: background .15s; }
.hc-cong-tac > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.hc-cong-tac[aria-checked="true"] > span { background: var(--txt-ok, #2e7d32); }
.hc-cong-tac[aria-checked="true"] > span::after { transform: translateX(24px); }
.hc-cong-tac:focus-visible { outline: 2px solid var(--theme-accent-strong); outline-offset: 2px; border-radius: 14px; }
.hc-cong-tac:disabled { opacity: .55; cursor: default; }
.hc-bot-gio { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hc-bot-gio select { width: 100%; }
.hc-bot-luu { width: 100%; }
.hc-bot-nk { width: 100%; border-collapse: collapse; font-size: 13px; }
.hc-bot-nk th, .hc-bot-nk td { padding: 6px 4px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.hc-bot-nk th { font-weight: 700; color: var(--text-muted); }
.hc-bot-nk td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hc-bot-ls { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .hc-cong-tac > span, .hc-cong-tac > span::after { transition: none; } }
@media (max-width: 760px) {
  /* iPhone: ô chọn 16px để Safari không tự phóng to khi chạm. */
  .hc-ngan-bot select { font-size: 16px; }
  .hc-bot-nk thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hc-bot-nk, .hc-bot-nk tbody, .hc-bot-nk tr, .hc-bot-nk td { display: block; width: 100%; box-sizing: border-box; }
  .hc-bot-nk tr { margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; }
  .hc-bot-nk td { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border: 0; }
  .hc-bot-nk td::before { content: attr(data-nhan); color: var(--text-muted); font-weight: 600; flex: none; }
  .hc-bot-nk td:first-child { white-space: normal; }
}

/* ── Giao diện kiểu app Zalo (anh Nghĩa 16/10/2026) ──
   Chỉ áp cho phần Zalo khi đang TÁCH (gốc .hc-trang.is-zl; cột .hc-ds.hc-zl; khung .hc-chat.hc-zl) — Facebook và thanh Facebook | Zalo | Gộp giữ nguyên.
   Bảng màu khai báo bằng biến --zl-*: SÁNG (theme có body.theme-light) theo app Zalo; TỐI (body không có .theme-light) theo chế độ tối Zalo.
   Mọi cặp chữ/nền đã tính đạt AA ≥ 4,5:1 (thanh xanh dùng #0b6ef5→#0057e3 thay vì #0190f3 của Zalo để chữ trắng 12–13px còn đạt 4,6:1;
   viên mốc giờ #66768a thay vì xám nhạt của Zalo cùng lý do). Màu nguồn page (.hc-nguon.is-do/.is-xanh/.is-tim) không đổi. Không dùng !important
   trừ 3 luật tràn màn điện thoại phải thắng padding !important của app-shell. */
.hc-trang.is-zl, .hc-zl {
  --zl-dau: linear-gradient(90deg, #0b6ef5, #0057e3); --zl-dau-dac: #0057e3;
  --zl-nen: #e2e9f1; --zl-ds-nen: #ffffff; --zl-the: #ffffff; --zl-vien: #e3e8ef; --zl-pill: #eef2f7;
  --zl-bong-vao: #ffffff; --zl-vien-vao: #e3e8ef; --zl-bong-ra: #e5efff; --zl-vien-ra: #c7dcff;
  --zl-chu: #081c36; --zl-chu-mo: #546579; --zl-ic: #546579;
  --zl-moc-nen: #66768a; --zl-chon: #e5efff; --zl-hover: #f3f6fa; --zl-hover-tin: rgba(8, 28, 54, .07);
  --zl-xanh: #0068ff; --zl-nut: #0068ff; --zl-xanh-nhat: rgba(0, 104, 255, .12); --zl-do: #dc2730;
  --zl-ghi-nen: #fff7e0; --zl-ghi-vien: #e0b457; --zl-ghi-chu: #8a5a00;
  --zl-goi-lai: #0057e3; --zl-goi-nho: #dc2730; --zl-goi-nho-nen: rgba(220, 39, 48, .12);
  --zl-bong-do: 0 2px 10px rgba(16, 36, 70, .14);
}
body:not(.theme-light) .hc-trang.is-zl, body:not(.theme-light) .hc-zl {
  --zl-dau: linear-gradient(90deg, #163a6e, #102d5a); --zl-dau-dac: #102d5a;
  --zl-nen: color-mix(in srgb, #16181c 75%, var(--bg-app, #16181c)); --zl-ds-nen: color-mix(in srgb, #1b1e23 75%, var(--bg-app, #1b1e23)); --zl-the: color-mix(in srgb, #23262b 75%, var(--bg-app, #23262b)); --zl-vien: #30353c; --zl-pill: #2f343b;
  --zl-bong-vao: color-mix(in srgb, #2b2e33 80%, var(--bg-app, #2b2e33)); --zl-vien-vao: #383c43; --zl-bong-ra: #1f3a64; --zl-vien-ra: #2b4f87;
  --zl-chu: #eef1f5; --zl-chu-mo: #a3adbb; --zl-ic: #a3adbb;
  --zl-moc-nen: #3f454e; --zl-chon: #22304a; --zl-hover: #22252b; --zl-hover-tin: rgba(255, 255, 255, .09);
  --zl-xanh: #4d9bff; --zl-nut: #0b63e6; --zl-xanh-nhat: rgba(77, 155, 255, .16); --zl-do: #dc2730;
  --zl-ghi-nen: #3a2f14; --zl-ghi-vien: #b48a2e; --zl-ghi-chu: #f1c76b;
  --zl-goi-lai: #7db4ff; --zl-goi-nho: #ff6b6b; --zl-goi-nho-nen: rgba(255, 107, 107, .16);
  --zl-bong-do: 0 2px 10px rgba(0, 0, 0, .45);
}
.hc-trang.is-zl .hc-khung { border-color: var(--zl-vien); }

/* Cột danh sách: thanh tìm xanh Zalo (ô tìm trong suốt như app: kính + chữ trắng) · hàng tab lọc 1 dòng cuộn ngang · dòng hội thoại 48px */
.hc-ds.hc-zl { background: var(--zl-ds-nen); border-right-color: var(--zl-vien); }
.hc-ds.hc-zl .hc-ds-dau { gap: 0; padding: 6px 6px 6px 8px; border-bottom: 0; background: var(--zl-dau-dac) var(--zl-dau); color: #fff; }
.hc-ds.hc-zl .hc-tim { min-height: 40px; padding: 0 6px 0 10px; border: 0; border-radius: 999px; background: transparent; color: #fff; }
.hc-ds.hc-zl .hc-tim > svg { color: #fff; }
.hc-ds.hc-zl .hc-tim input { color: #fff; font-size: 15px; -webkit-appearance: none; appearance: none; }
.hc-ds.hc-zl .hc-tim input::placeholder { color: #fff; opacity: 1; }
.hc-ds.hc-zl .hc-tim input::-webkit-search-cancel-button { filter: invert(1) brightness(2); }
.hc-ds.hc-zl .hc-tim .hc-tim-xoa { color: #fff; }
.hc-ds.hc-zl .hc-tim .hc-tim-xoa:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.hc-trang .hc-ds.hc-zl .hc-tim:focus-within { outline: 2px solid #fff; outline-offset: -2px; }
.hc-ds.hc-zl .hc-ds-dau .hc-nut-ic { width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.hc-ds.hc-zl .hc-ds-dau .hc-nut-ic:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.hc-ds.hc-zl .hc-ds-dau .hc-nut-ic.is-bat, .hc-ds.hc-zl .hc-ds-dau .hc-nut-ic[aria-pressed="true"] { background: rgba(255, 255, 255, .24); color: #fff; }
.hc-ds.hc-zl .hc-loc { flex-wrap: nowrap; gap: 0; padding: 0 4px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--zl-vien); background: var(--zl-ds-nen); scrollbar-width: thin; scrollbar-color: var(--zl-vien) transparent; }
.hc-ds.hc-zl .hc-loc::-webkit-scrollbar { height: 5px; }
.hc-ds.hc-zl .hc-loc::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--zl-vien); }
.hc-ds.hc-zl .hc-loc .hc-loc-sep { display: none; }
.hc-ds.hc-zl .hc-loc .hc-loc-nut { height: 42px; min-width: 0; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; box-shadow: none; color: var(--zl-chu-mo); font-size: 13.5px; font-weight: 600; gap: 5px; }
.hc-ds.hc-zl .hc-loc .hc-loc-nut:hover { color: var(--zl-chu); background: transparent; }
.hc-ds.hc-zl .hc-loc .hc-loc-nut.is-bat { color: var(--zl-chu); border-bottom-color: var(--zl-chu); background: transparent; box-shadow: none; }
.hc-ds.hc-zl .hc-loc .hc-loc-nut.is-pop::after { color: inherit; }
.hc-ds.hc-zl .hc-loc .hc-loc-so { position: static; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--zl-pill); color: var(--zl-chu); font-size: 11px; font-weight: 700; line-height: 18px; }
.hc-ds.hc-zl .hc-loc .hc-loc-nut.is-bat .hc-loc-so { background: var(--zl-nut); color: #fff; }
.hc-ds.hc-zl .hc-loc-tom { background: var(--zl-chon); color: var(--zl-chu); border-bottom-color: var(--zl-vien); }
.hc-ds.hc-zl .hc-list { background: var(--zl-ds-nen); }
.hc-ds.hc-zl .hc-dong-o { border-bottom: 0; }
.hc-ds.hc-zl .hc-dong-o::after { content: ""; position: absolute; left: 68px; right: 0; bottom: 0; height: 1px; background: var(--zl-vien); pointer-events: none; }
.hc-ds.hc-zl .hc-dong-o:last-child::after { display: none; }
.hc-ds.hc-zl .hc-dong { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; min-height: 72px; padding: 9px 12px 9px 8px; align-items: center; color: var(--zl-chu); }
.hc-ds.hc-zl .hc-dong:hover { background: var(--zl-hover); }
.hc-ds.hc-zl .hc-dong.is-chon, .hc-ds.hc-zl .hc-dong.is-chon:hover { background: var(--zl-chon); box-shadow: none; }
.hc-ds.hc-zl .hc-av-o { width: 48px; height: 48px; margin-top: 0; }
.hc-ds.hc-zl .hc-av-o .hc-av { width: 48px; height: 48px; font-size: 15px; background: var(--zl-pill); color: var(--zl-chu); }
.hc-ds.hc-zl .hc-dong-g { gap: 2px; }
.hc-ds.hc-zl .hc-ten { font-size: 15.5px; font-weight: 500; color: var(--zl-chu); }
.hc-ds.hc-zl .hc-dong.is-moi .hc-ten { font-weight: 700; }
.hc-ds.hc-zl .hc-luc, .hc-ds.hc-zl .hc-dong.is-moi .hc-luc { font-size: 12px; font-weight: 400; color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-ghim { color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-cuoi { font-size: 13.5px; font-weight: 400; color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-dong.is-moi .hc-cuoi { font-weight: 700; color: var(--zl-chu); }
.hc-ds.hc-zl .hc-ban { color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-dong-ic { margin-left: auto; color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-so.hc-zl-so { position: static; min-width: 20px; height: 20px; margin: 0; padding: 0 6px; border: 0; border-radius: 10px; background: var(--zl-do); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; }
.hc-ds.hc-zl .hc-dong-3 { gap: 3px; margin-top: 3px; }
.hc-ds.hc-zl .hc-dong-3 :is(.hc-kenh, .hc-tt, .hc-im, .hc-pt-trong) { min-height: 19px; padding: 0 5px; border-radius: 5px; font-size: 10.5px; border-color: var(--zl-vien); }
.hc-ds.hc-zl .hc-dong-3 :is(.hc-cho, .hc-nhan-mau) { min-height: 19px; padding: 0 5px; border-radius: 5px; font-size: 10.5px; }
.hc-ds.hc-zl .hc-dong-3 .hc-kenh-anh { width: 12px; height: 12px; margin-right: 3px; }
.hc-ds.hc-zl .hc-dong-3 .hc-kenh { background: var(--zl-pill); color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-dong-3 .hc-pt-trong { display: inline-block; flex: 0 4 auto; min-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 19px; color: var(--zl-chu-mo); }
.hc-ds.hc-zl .hc-dong-3 .hc-kenh { flex: 0 1 auto; min-width: 66px; }
.hc-ds.hc-zl .hc-dong-3 :is(.hc-tt, .hc-cho, .hc-nguon, .hc-nhan-mau) { flex: none; }
.hc-ds.hc-zl .hc-dong-them { top: 50%; bottom: auto; right: 8px; transform: translateY(-50%); border-radius: 50%; border-color: var(--zl-vien); background: var(--zl-the); color: var(--zl-chu-mo); }

/* Khung chat: thanh xanh (‹ · tên + kênh/SĐT · icon trắng) + dải CSKH trắng một hàng · tin ghim nổi · nền xám xanh · bong bóng Zalo */
.hc-chat.hc-zl { background: var(--zl-nen); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-chat-dau.hc-zl-dau { display: block; min-height: 0; padding: 0; border-bottom: 0; background: transparent; }
.hc-chat.hc-zl .hc-zl-thanh { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 6px 0 12px; background: var(--zl-dau-dac) var(--zl-dau); color: #fff; }
.hc-chat.hc-zl .hc-zl-thanh .hc-zl-lui { width: 44px; height: 44px; margin-left: -6px; margin-right: -4px; border-radius: 50%; color: #fff; }
.hc-chat.hc-zl .hc-zl-thanh .hc-av-dau { width: 36px; height: 36px; font-size: 12.5px; background: rgba(255, 255, 255, .22); color: #fff; }
.hc-chat.hc-zl .hc-zl-thanh .hc-chat-ai h2 { font-size: 16.5px; font-weight: 700; color: #fff; line-height: 1.25; }
.hc-chat.hc-zl .hc-zl-thanh .hc-zl-phu { flex-wrap: nowrap; gap: 4px 8px; margin-top: 2px; overflow: hidden; color: #fff; font-size: 12.5px; }
.hc-chat.hc-zl .hc-zl-phu .hc-kenh { flex: 0 1 auto; min-height: 20px; max-width: 170px; padding: 0 7px 0 3px; border: 0; border-radius: 10px; background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); color: #fff; font-size: 11.5px; }
.hc-chat.hc-zl .hc-zl-phu .hc-kenh::before { background: #fff; border-color: #fff; }
/* Mỗi số Zalo một màu (05/11/2026, anh: "chỉ có 1 màu khó phân biệt" → tô ĐẶC màu số, chữ trắng; không dùng color-mix để máy cũ cũng hiện đúng). */
.hc-kenh.hc-kenh-mau, .hc-ds.hc-zl .hc-dong-3 .hc-kenh.hc-kenh-mau, body:not(.theme-light) .hc-ds.hc-zl .hc-dong-3 .hc-kenh.hc-kenh-mau,
.hc-chat.hc-zl .hc-zl-phu .hc-kenh.hc-kenh-mau { color: #fff; border-color: var(--kenh-mau); background: var(--kenh-mau); box-shadow: none; font-weight: 700; }
.hc-kenh.hc-kenh-mau::before, .hc-chat.hc-zl .hc-zl-phu .hc-kenh.hc-kenh-mau::before { background: transparent; border-color: #fff; }
.hc-chat.hc-zl .hc-zl-phu .hc-kenh.hc-kenh-mau { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
/* Hàng lọc nhanh theo nhân viên (05/11/2026): mỗi bạn một nút màu số Zalo; đang lọc = tô đặc; điện thoại cuộn ngang. */
.hc-nv-loc { grid-area: nv; display: flex; gap: 6px; padding: 6px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border-color); }
.hc-nv-loc::-webkit-scrollbar { display: none; }
.hc-nv-nut { flex: none; min-height: 30px; padding: 0 12px; border: 1.5px solid var(--kenh-mau); border-radius: 15px; background: transparent; color: var(--kenh-mau); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
body:not(.theme-light) .hc-nv-nut { color: #fff; }
.hc-nv-nut:hover { background: var(--bg-input, rgba(127, 127, 127, .12)); }
.hc-nv-nut.is-bat, body:not(.theme-light) .hc-nv-nut.is-bat { background: var(--kenh-mau); color: #fff; }
.hc-nv-nut:focus-visible { outline: 2px solid var(--kenh-mau); outline-offset: 2px; }
@media (max-width: 700px) { .hc-nv-nut { min-height: 36px; } }
.hc-chat.hc-zl .hc-zl-phu .hc-sdt { flex: none; color: #fff; }
.hc-chat.hc-zl .hc-zl-phu .hc-sdt:hover { color: #fff; text-decoration: underline; }
.hc-chat.hc-zl .hc-zl-thanh .hc-chat-nut { gap: 0; }
.hc-chat.hc-zl .hc-zl-thanh .hc-chat-nut .hc-nut-ic { width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.hc-chat.hc-zl .hc-zl-thanh .hc-chat-nut .hc-nut-ic:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.hc-chat.hc-zl .hc-zl-thanh .hc-chat-nut .hc-nut-ic.is-bat { background: rgba(255, 255, 255, .24); color: #fff; }
.hc-chat.hc-zl .hc-zl-thanh .hc-chat-nut .hc-nut-ic:disabled { opacity: .45; background: transparent; }
.hc-chat.hc-zl .hc-zl-dai { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px; border-bottom: 1px solid var(--zl-vien); background: var(--zl-the); overflow-x: auto; scrollbar-width: none; }
.hc-chat.hc-zl .hc-zl-dai::-webkit-scrollbar { display: none; }
.hc-chat.hc-zl .hc-zl-dai > * { flex: none; }
.hc-chat.hc-zl .hc-zl-dai .hc-pc { margin-left: auto; }
.hc-chat.hc-zl .hc-zl-dai .hc-nut { min-height: 32px; border-radius: 999px; font-size: 13px; }
.hc-chat.hc-zl .hc-zl-dai .hc-nut.is-chinh { background: var(--zl-nut); border-color: var(--zl-nut); color: #fff; }
.hc-chat.hc-zl .hc-zl-dai .hc-nut:not(.is-chinh) { background: transparent; border-color: var(--zl-vien); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-zl-dai .hc-nut:not(.is-chinh):hover { background: var(--zl-hover); }
.hc-chat.hc-zl .hc-zl-dai .hc-nut-vuong { width: 32px; }
.hc-chat.hc-zl .hc-zl-dai .hc-pt-chip { min-height: 30px; border-radius: 999px; border-color: var(--zl-vien); background: var(--zl-pill); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-zl-dai .hc-pt-chip.is-toi { border-color: var(--zl-xanh); color: var(--zl-xanh); background: var(--zl-the); }
.hc-chat.hc-zl .hc-zl-dai .hc-nguon { cursor: pointer; }
.hc-chat.hc-zl .hc-zl-dai .hc-nguon.is-chua, .hc-chat.hc-zl .hc-zl-dai .hc-im { color: var(--zl-chu-mo); border-color: var(--zl-vien); }
.hc-chat.hc-zl .hc-zl-dai .hc-nguon-cong { width: 24px; height: 24px; border-radius: 999px; border-color: var(--zl-vien); background: var(--zl-pill); color: var(--zl-xanh); }
.hc-chat.hc-zl .hc-zl-dai .hc-nguon-cong:hover { border-color: var(--zl-xanh); background: var(--zl-xanh-nhat); }
/* Tin ghim nổi trên nền chat như Zalo: icon xanh · dòng đậm + dòng phụ · "+N ⌄" viền tròn */
.hc-chat.hc-zl .hc-zl-ghim { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: calc(100% - 20px); min-height: 56px; margin: 8px 10px -2px; padding: 7px 10px 7px 12px; border: 0; border-radius: 10px; background: var(--zl-the); color: var(--zl-chu); box-shadow: var(--zl-bong-do); font: inherit; text-align: left; cursor: pointer; }
.hc-chat.hc-zl .hc-zl-ghim:hover { background: var(--zl-the); filter: brightness(.985); }
.hc-chat.hc-zl .hc-zl-ghim-ic { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--zl-xanh); }
.hc-chat.hc-zl .hc-zl-ghim-nd { flex: 1; display: grid; gap: 1px; min-width: 0; }
.hc-chat.hc-zl .hc-zl-ghim-nd b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.hc-chat.hc-zl .hc-zl-ghim-nd > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--zl-chu-mo); line-height: 1.3; }
.hc-chat.hc-zl .hc-zl-ghim-them { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 30px; margin-left: 2px; padding: 0 9px 0 11px; border: 1px solid var(--zl-vien); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--zl-chu); box-shadow: -11px 0 0 -10px var(--zl-vien); }
.hc-chat.hc-zl .hc-zl-ghim-nd + .hc-zl-ghim-them { margin-left: 12px; }
.hc-chat.hc-zl .hc-zl-ghim-nd:has(+ .hc-zl-ghim-them) { padding-right: 12px; border-right: 1px solid var(--zl-vien); }
/* Vùng tin: mốc giờ viên thuốc xám chữ trắng; tin khách trắng trái, tin shop xanh rất nhạt phải, bo 10px, chữ 15px; "✓ Đã gửi" dưới tin cuối của shop */
.hc-chat.hc-zl .hc-tin-ds { gap: 6px; padding: 10px 12px 12px; background: var(--zl-nen); }
.hc-chat.hc-zl .hc-ngay-tach { margin: 8px 0 4px; }
.hc-chat.hc-zl .hc-ngay-tach span { padding: 3px 12px; border: 0; border-radius: 999px; background: var(--zl-moc-nen); color: #fff; font-size: 12.5px; font-weight: 500; }
.hc-chat.hc-zl .hc-tin { max-width: min(78%, 560px); }
.hc-chat.hc-zl .hc-tin.is-nhom-tiep { margin-top: -2px; }
.hc-chat.hc-zl .hc-tin-hang { gap: 2px; }
.hc-chat.hc-zl .hc-bong { padding: 9px 12px; border-radius: 10px; font-size: 15px; line-height: 1.4; color: var(--zl-chu); }
.hc-chat.hc-zl .hc-bong a { color: var(--zl-xanh); }
.hc-chat.hc-zl .hc-tin.is-khach .hc-bong, .hc-chat.hc-zl .hc-tin.is-khach.is-nhom-tiep .hc-bong { border: 1px solid var(--zl-vien-vao); border-radius: 10px; background: var(--zl-bong-vao); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-tin.is-shop .hc-bong, .hc-chat.hc-zl .hc-tin.is-shop.is-nhom-tiep .hc-bong { border: 1px solid var(--zl-vien-ra); border-radius: 10px; background: var(--zl-bong-ra); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-tin.is-shop .hc-tep-loi { color: var(--txt-bad); }
.hc-chat.hc-zl .hc-tin.is-ghi-chu .hc-bong { padding: 8px 12px; border: 1px dashed var(--zl-ghi-vien); border-radius: 10px; background: var(--zl-ghi-nen); color: var(--zl-chu); font-size: 13.5px; }
.hc-chat.hc-zl .hc-tin.is-ghi-chu .hc-bong b { color: var(--zl-ghi-chu); }
.hc-chat.hc-zl .hc-tin .hc-bong.is-tep { padding: 0; border: 0; background: transparent; box-shadow: none; }
.hc-chat.hc-zl .hc-tin .hc-bong.is-tep .hc-tep-chu { padding: 6px 10px 7px; border-radius: 10px; background: var(--zl-bong-vao); }
.hc-chat.hc-zl .hc-tin.is-shop .hc-bong.is-tep .hc-tep-chu { background: var(--zl-bong-ra); }
.hc-chat.hc-zl .hc-tep-anh, .hc-chat.hc-zl .hc-tep-anh img, .hc-chat.hc-zl .hc-tep-video { border-radius: 10px; }
.hc-chat.hc-zl .hc-tep-anh img { background: var(--zl-pill); }
.hc-chat.hc-zl .hc-the-tin, .hc-chat.hc-zl .hc-tep-nut, .hc-chat.hc-zl .hc-tep-cho { border-radius: 10px; border-color: var(--zl-vien-vao); background: var(--zl-bong-vao); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-the-nhan, .hc-chat.hc-zl .hc-the-mo { color: var(--zl-chu-mo); }
.hc-chat.hc-zl .hc-the-url { color: var(--zl-xanh); }
/* Thẻ cuộc gọi như app Zalo: nền bong bóng vào / ra; GỌI LẠI xanh đậm hơn --zl-xanh để đạt AA trên nền xanh nhạt tin shop (#0057e3 trên #e5efff 5,2:1;
   tối #7db4ff trên #1f3a64 5,3:1); icon nhỡ đỏ ≥ 3:1 cả hai theme (tối #ff6b6b) */
.hc-chat.hc-zl .hc-goi { border-color: var(--zl-vien-vao); background: var(--zl-bong-vao); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-tin.is-shop .hc-goi { border-color: var(--zl-vien-ra); background: var(--zl-bong-ra); }
.hc-chat.hc-zl .hc-goi-ic { background: var(--zl-xanh-nhat); color: var(--zl-xanh); }
.hc-chat.hc-zl .hc-goi.is-nho .hc-goi-ic { background: var(--zl-goi-nho-nen); color: var(--zl-goi-nho); }
.hc-chat.hc-zl .hc-goi-phu { color: var(--zl-chu-mo); }
.hc-chat.hc-zl a.hc-goi-lai { border-top-color: var(--zl-vien-vao); color: var(--zl-goi-lai); }
.hc-chat.hc-zl .hc-tin.is-shop .hc-goi-lai { border-top-color: var(--zl-vien-ra); }
.hc-chat.hc-zl a.hc-goi-lai:hover { background: var(--zl-hover-tin); }
.hc-chat.hc-zl .hc-tin-vao { align-items: flex-start; gap: 8px; }
.hc-chat.hc-zl .hc-tin-vao .hc-av { width: 32px; height: 32px; margin-top: 1px; font-size: 11px; background: var(--zl-pill); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-tin-phu { margin-top: 2px; padding: 0 4px; font-size: 11.5px; color: var(--zl-chu-mo); }
.hc-chat.hc-zl .hc-tin.is-khach .hc-tin-phu { padding-left: 44px; }
.hc-chat.hc-zl .hc-tin-phu .hc-mo { color: var(--zl-chu-mo); }
.hc-chat.hc-zl .hc-zl-tt { align-self: flex-end; display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: var(--zl-moc-nen); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.3; }
.hc-chat.hc-zl .hc-tin-them { border-radius: 50%; color: var(--zl-chu-mo); }
.hc-chat.hc-zl .hc-tin-them:hover { background: var(--zl-hover-tin); color: var(--zl-chu); }
.hc-trang.is-zl .hc-chat.hc-zl .hc-tin-moi { border-radius: 999px; background: var(--zl-nut); color: #fff; }
.hc-chat.hc-zl .hc-tin-cu .hc-nut, .hc-chat.hc-zl .hc-thu-lai-tin { border-radius: 999px; }
/* Ô soạn 1 hàng như Zalo: 😊 | Tin nhắn | ••• | ảnh | gửi (icon xanh, không nền). Lưới tiện ích ••• 6 ô vòng tròn màu như Zalo. */
.hc-chat.hc-zl .hc-soan { padding: 5px 8px; border-top: 1px solid var(--zl-vien); background: var(--zl-the); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-zl-soan-hang { display: flex; align-items: flex-end; gap: 0; padding: 1px 2px; border: 1.5px solid var(--zl-vien); border-radius: 24px; background: var(--zl-the); transition: box-shadow .18s cubic-bezier(.22, 1, .36, 1), background-color .18s ease; }
.hc-chat.hc-zl .hc-zl-soan-hang:has(textarea:focus), .hc-chat.hc-zl .hc-zl-soan-hang:has(textarea:focus-visible) { border-color: var(--zl-xanh); box-shadow: 0 0 0 2px var(--zl-xanh-nhat); }
.hc-chat.hc-zl .hc-zl-soan-hang:has(textarea[aria-invalid="true"]) { border-color: var(--txt-bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--txt-bad) 16%, transparent); }
.hc-chat.hc-zl .hc-zl-soan-hang .hc-nut-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; color: var(--zl-ic); transition: background-color .15s ease, color .15s ease, transform .14s cubic-bezier(.22, 1, .36, 1); }
.hc-chat.hc-zl .hc-zl-soan-hang .hc-nut-ic:hover { background: var(--zl-hover); color: var(--zl-chu); }
.hc-chat.hc-zl .hc-zl-soan-hang .hc-nut-ic:active:not(:disabled), .hc-chat.hc-zl .hc-soan .hc-zl-gui.hc-nut:active:not(:disabled), .hc-chat.hc-zl .hc-zl-thanh .hc-nut-ic:active:not(:disabled) { transform: scale(.9); }
.hc-chat.hc-zl .hc-zl-soan-hang .hc-nut-ic.is-bat { background: var(--zl-xanh-nhat); color: var(--zl-xanh); }
.hc-chat.hc-zl .hc-zl-soan-hang [data-hc="soan-them"] svg { transition: transform .22s cubic-bezier(.22, 1, .36, 1); }
.hc-chat.hc-zl .hc-zl-soan-hang [data-hc="soan-them"].is-bat svg { transform: rotate(90deg); }
.hc-chat.hc-zl .hc-zl-soan-hang .hc-nut-ic:disabled { opacity: .4; background: transparent; }
.hc-chat.hc-zl .hc-zl-soan-hang textarea { flex: 1; min-width: 0; height: 44px; min-height: 44px; max-height: 120px; margin: 0 2px; padding: 11px 6px; border: 0; border-radius: 0; background: transparent; color: var(--zl-chu); font-size: 16px; line-height: 22px; resize: none; box-shadow: none; overflow-y: hidden; box-sizing: border-box; }
.hc-chat.hc-zl .hc-zl-soan-hang textarea::placeholder { color: var(--zl-chu-mo); opacity: 1; }
html body .hc-chat.hc-zl .hc-zl-soan-hang textarea:focus, html body[data-itn-theme] .hc-chat.hc-zl .hc-zl-soan-hang textarea:focus, html body[data-itn-theme] .hc-chat.hc-zl .hc-zl-soan-hang textarea:focus-visible { outline: 0 !important; box-shadow: none !important; }
.hc-trang .hc-chat.hc-zl .hc-zl-soan-hang textarea[aria-invalid="true"] { border: 0; box-shadow: none; }
.hc-chat.hc-zl .hc-soan .hc-zl-gui.hc-nut { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--zl-xanh); font-size: 13px; gap: 4px; transition: background-color .15s ease, color .15s ease, transform .14s cubic-bezier(.22, 1, .36, 1); }
.hc-chat.hc-zl .hc-soan .hc-zl-gui.hc-nut:hover { background: var(--zl-xanh-nhat); filter: none; }
.hc-chat.hc-zl .hc-soan .hc-zl-gui.hc-nut:disabled { opacity: .4; background: transparent; }
.hc-chat.hc-zl .hc-soan .hc-zl-gui.hc-nut.is-chu { width: auto; padding: 0 12px 0 10px; border-radius: 22px; background: var(--zl-xanh-nhat); color: var(--zl-xanh); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hc-chat.hc-zl .hc-zl-gui-chu { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hc-chat.hc-zl .hc-soan .hc-o-loi { margin: 2px 8px 4px; }
@keyframes hc-zl-them-mo { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hc-zl-o-mo { from { opacity: 0; transform: translateY(8px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes hc-zl-man-vao { from { opacity: .82; } to { opacity: 1; } }
.hc-chat.hc-zl .hc-zl-them { display: grid; grid-template-columns: repeat(6, minmax(0, 96px)); justify-content: center; gap: 2px; margin: 4px -2px 0; padding: 10px 2px 6px; border-top: 1px solid var(--zl-vien); animation: hc-zl-them-mo .18s cubic-bezier(.22, 1, .36, 1); transform-origin: top center; }
.hc-chat.hc-zl .hc-zl-o { display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 0; min-height: 44px; padding: 6px 2px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--zl-chu); font: inherit; font-size: 12px; line-height: 1.2; text-align: center; cursor: pointer; animation: hc-zl-o-mo .22s cubic-bezier(.22, 1, .36, 1) both; transition: background-color .14s ease, transform .14s cubic-bezier(.22, 1, .36, 1); }
.hc-chat.hc-zl .hc-zl-o:nth-child(2) { animation-delay: .015s; }
.hc-chat.hc-zl .hc-zl-o:nth-child(3) { animation-delay: .03s; }
.hc-chat.hc-zl .hc-zl-o:nth-child(4) { animation-delay: .045s; }
.hc-chat.hc-zl .hc-zl-o:nth-child(5) { animation-delay: .06s; }
.hc-chat.hc-zl .hc-zl-o:nth-child(6) { animation-delay: .075s; }
.hc-chat.hc-zl .hc-zl-o:hover { background: var(--zl-hover); }
.hc-chat.hc-zl .hc-zl-o:active:not(:disabled) .hc-zl-o-vong { transform: scale(.91); }
.hc-chat.hc-zl .hc-zl-o:disabled { opacity: .45; cursor: default; background: transparent; }
.hc-chat.hc-zl .hc-zl-o-vong { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--zl-o-mau, var(--zl-nut)); color: #fff; transition: transform .15s cubic-bezier(.22, 1, .36, 1); }
.hc-chat.hc-zl .hc-zl-o.is-chup-anh { --zl-o-mau: #0ea5e9; }
.hc-chat.hc-zl .hc-zl-o.is-kep { --zl-o-mau: #1e7cf5; }
.hc-chat.hc-zl .hc-zl-o.is-thu-muc { --zl-o-mau: #7c5cf0; }
.hc-chat.hc-zl .hc-zl-o.is-mau { --zl-o-mau: #d97706; }
.hc-chat.hc-zl .hc-zl-o.is-phu-nhac { --zl-o-mau: #e03e3e; }
.hc-chat.hc-zl .hc-zl-o.is-phu-ghi-chu { --zl-o-mau: #0f9d6e; }
.hc-chat.hc-zl .hc-zl-o-ten { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hc-chat.hc-zl .hc-zl-hm { display: block; margin: 2px 8px 2px; padding: 0; font-size: 11.5px; color: var(--zl-chu-mo); text-align: right; }
.hc-chat.hc-zl .hc-mau { border-radius: 10px; animation: hc-zl-them-mo .16s cubic-bezier(.22, 1, .36, 1); }
.hc-chat.hc-zl .hc-khong-gui.is-chan { background: var(--zl-the); border-top-color: var(--zl-vien); color: var(--zl-chu-mo); }
.hc-trang.is-chuyen-chat .hc-tin-ds, .hc-trang.is-chuyen-ds .hc-list { animation: hc-zl-man-vao .16s cubic-bezier(.22, 1, .36, 1); }
/* Focus rõ trên nền xanh (viền trắng); trên nền sáng/tối dùng xanh Zalo */
.hc-trang.is-zl :is(.hc-zl-thanh, .hc-ds-dau) :is(button, a):focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.hc-trang.is-zl .hc-zl :is(.hc-dong, .hc-loc-nut, .hc-zl-ghim, .hc-zl-o, .hc-tin-them, .hc-zl-soan-hang .hc-nut-ic, .hc-zl-gui, .hc-goi-lai):focus-visible { outline: 2px solid var(--zl-xanh); outline-offset: -2px; }
@media (hover: hover) { .hc-chat.hc-zl .hc-zl-ghim, .hc-ds.hc-zl .hc-dong, .hc-chat.hc-zl .hc-zl-o { transition: background-color .12s, filter .12s; } }
@media (prefers-reduced-motion: reduce) {
  .hc-chat.hc-zl .hc-zl-ghim, .hc-ds.hc-zl .hc-dong, .hc-chat.hc-zl .hc-zl-o, .hc-chat.hc-zl .hc-zl-o-vong,
  .hc-chat.hc-zl .hc-zl-soan-hang, .hc-chat.hc-zl .hc-zl-soan-hang .hc-nut-ic, .hc-chat.hc-zl .hc-zl-soan-hang [data-hc="soan-them"] svg,
  .hc-chat.hc-zl .hc-soan .hc-zl-gui.hc-nut { transition: none; }
  .hc-chat.hc-zl .hc-zl-them, .hc-chat.hc-zl .hc-zl-o, .hc-chat.hc-zl .hc-mau, .hc-trang.is-chuyen-chat .hc-tin-ds, .hc-trang.is-chuyen-ds .hc-list { animation: none; }
}
/* Máy tính bảng 761–1279: tin rộng hơn một chút; vẫn hai cột */
@media (max-width: 1279px) { .hc-chat.hc-zl .hc-tin { max-width: 82%; } }
/* Điện thoại ≤760: một màn một lúc, tràn hết chiều ngang như app Zalo (bỏ viền/bo khung, bỏ đệm hai bên của shell); icon thanh xanh 44px */
@media (max-width: 760px) {
  body.itn-shell:has(.hc-trang.is-zl) .main-viewport { padding-left: 0 !important; padding-right: 0 !important; }
  body.itn-shell:has(.hc-trang.is-zl.is-xem-chat) .main-viewport { padding-top: 0 !important; }
  body.itn-shell:has(.hc-trang.is-zl.is-xem-chat) .main-viewport > main { padding-top: 0 !important; }
  .hc-trang.is-zl .hc-dau { padding: 0 10px; }
  .hc-trang.is-zl .hc-canh { margin-left: 10px; margin-right: 10px; }
  .hc-trang.is-zl .hc-khung, .hc-trang.is-zl .hc-khung.co-the { border: 0; border-radius: 0; }
  .hc-ds.hc-zl .hc-ds-dau { padding: 4px 4px 4px 6px; }
  .hc-ds.hc-zl .hc-tim { min-height: 44px; }
  .hc-ds.hc-zl .hc-ds-dau .hc-nut-ic { width: 44px; height: 44px; }
  .hc-ds.hc-zl .hc-loc { padding: 0 4px; scrollbar-width: none; }
  .hc-ds.hc-zl .hc-loc::-webkit-scrollbar { display: none; }
  .hc-ds.hc-zl .hc-loc .hc-loc-nut { height: 44px; min-width: 0; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; font-size: 14.5px; }
  .hc-ds.hc-zl .hc-loc .hc-loc-nut.is-bat { border-bottom-color: var(--zl-chu); background: transparent; box-shadow: none; }
  .hc-ds.hc-zl .hc-dong { min-height: 70px; padding: 8px 36px 8px 8px; }
  .hc-ds.hc-zl .hc-dong-ic { margin-right: 0; }
  .hc-ds.hc-zl .hc-dong-them { opacity: 1; top: 50%; bottom: auto; right: 0; width: 44px; height: 44px; border: 0; background: transparent; transform: translateY(-50%); }
  .hc-chat.hc-zl .hc-zl-thanh { min-height: 52px; padding: 0 2px 0 4px; gap: 4px; }
  .hc-chat.hc-zl .hc-zl-thanh .hc-zl-lui { margin: 0; }
  .hc-chat.hc-zl .hc-zl-thanh .hc-chat-ai { padding-left: 2px; }
  .hc-chat.hc-zl .hc-zl-thanh .hc-chat-ai h2 { font-size: 17px; }
  .hc-chat.hc-zl .hc-zl-thanh .hc-zl-phu .hc-sdt { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-block: -10px; }
  .hc-chat.hc-zl .hc-zl-thanh .hc-chat-nut .hc-nut-ic { flex: none; width: 44px; height: 44px; }
  .hc-chat.hc-zl .hc-zl-dai { padding: 4px 8px; }
  .hc-chat.hc-zl .hc-zl-dai .hc-nut { min-height: 44px; min-width: 44px; }
  .hc-chat.hc-zl .hc-zl-dai .hc-nguon-cong, .hc-nguon-cong { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
  .hc-canh .hc-link, .hc-loat-thanh .hc-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .hc-chat.hc-zl .hc-zl-dai .hc-nut-vuong { width: 44px; }   /* nút chuyển người xử lý: đủ 44px chạm */
  .hc-chat.hc-zl .hc-zl-ghim { width: calc(100% - 16px); margin: 8px 8px -2px; }
  .hc-chat.hc-zl .hc-tin-ds { padding: 8px 8px 10px; }
  .hc-chat.hc-zl .hc-tin { max-width: 84%; }
  .hc-chat.hc-zl .hc-soan { padding: 4px 4px; }
  .hc-chat.hc-zl .hc-zl-them { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 6px; padding: 10px 4px 8px; }
  .hc-chat.hc-zl .hc-tin-them { width: 44px; height: 44px; opacity: .75; }
}

/* 18/10/2026: bấm thẳng vào tên khách để sửa (cột thông tin + đầu khung chat). */
.hc-ten-bam { all: unset; box-sizing: content-box; display: inline-block; vertical-align: bottom; min-height: 22px; padding: 11px 0; margin: -11px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; border-radius: 4px; }
.hc-ten-bam:hover { text-decoration: underline dashed; text-underline-offset: 3px; }
.hc-ten-bam:focus-visible { outline: 2px solid var(--theme-accent-strong, #0071e3); outline-offset: 2px; }
.hc-nhan-cua { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; font-size: 12px; color: var(--text-muted); }
/* 18/10/2026: hàng lọc gọn + "Lọc khác" + bảng Sắp xếp bộ lọc (ấn giữ chip). */
.hc-loc-nut { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hc-loc-khac-muc.is-bat { color: var(--theme-accent-strong); font-weight: 650; }
.hc-loc-khac-muc .hc-loc-so { margin-left: auto; }
.hc-sx-ds { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; min-height: 40px; }
.hc-sx-dong { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px 0 2px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); }
.hc-sx-dong.is-noi { border-color: var(--theme-accent-strong); }
.hc-sx-dong.is-keo { box-shadow: 0 6px 18px rgba(0,0,0,.18); border-color: var(--theme-accent-strong); background: var(--theme-accent-soft, var(--bg-card)); }
.hc-sx-keo { flex: none; display: grid; place-items: center; width: 40px; min-height: 44px; font-size: 20px; line-height: 1; color: var(--text-muted); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.hc-sx-dong.is-keo .hc-sx-keo { cursor: grabbing; color: var(--theme-accent-strong); }
.hc-sx-ten { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.hc-sx-dong .hc-nut-ic-nho { font-size: 15px; }
.hc-sx-dong .hc-nut-ic-nho:disabled { opacity: .35; }
.hc-sx-co-dinh { flex: none; font-size: 12px; color: var(--text-muted); padding: 0 4px; }
.hc-sx-trong { border: 1px dashed var(--border-color); border-radius: 8px; padding: 10px; text-align: center; }
@media (max-width: 760px) { .hc-sx-dong .hc-nut-ic-nho { min-width: 40px; min-height: 40px; } }
.hc-pop.is-sx:not(.is-day) { min-width: min(92vw, 380px); max-width: min(94vw, 420px); }
.hc-pop.is-sx.is-day { min-width: 0; max-height: 86vh; }
/* Điện thoại: hàng chip cuộn ngang — "Lọc khác" ghim mép phải, luôn thấy. */
@media (max-width: 760px) {
  .hc-loc-nut.is-khac { position: sticky; right: -8px; z-index: 3; margin-left: auto; padding-right: 12px; background: var(--bg-card); box-shadow: -12px 0 8px -2px var(--bg-card), 8px 0 0 4px var(--bg-card); border-color: var(--border-color); }
  .hc-ds.hc-zl .hc-loc .hc-loc-nut.is-khac { background: var(--zl-ds-nen, var(--bg-card)); box-shadow: -12px 0 8px -2px var(--zl-ds-nen, var(--bg-card)), 8px 0 0 4px var(--zl-ds-nen, var(--bg-card)); }
}
@media (max-width: 1180px), (pointer: coarse) {
  .hc-loc-nut, .hc-nt-doi, .hc-nt-nut, .hc-soan-nut .hc-nut.is-chinh, .hc-soan-ic .hc-nut-ic, .hc-nut-gon { min-height: 44px; min-width: 44px; }
  .hc-loc-nut { height: 44px; padding: 0 10px; }
}
.hc-pop.is-sx .hc-pop-chan { position: sticky; bottom: 0; z-index: 1; margin: 4px -2px 0; padding: 8px 2px 2px; background: var(--bg-card); box-shadow: 0 -8px 12px -8px rgba(0,0,0,.18); }

/* ══ Gọi khách qua Messenger (anh Nghĩa duyệt 18/10/2026, migration 118) ══
   Nút gọi Messenger (chữ "M" xanh Facebook) ở đầu khung chat Facebook. Khung cuộc gọi #hc-cg nằm NGOÀI khung module (body) → vẽ lại Hộp chat /
   chuyển màn không mất cuộc gọi; luôn nền tối như màn gọi điện thoại (chữ trắng trên #0f172a ≥ 15:1, nút kết thúc trắng trên đỏ #dc2626 ≈ 4,8:1). */
.hc-goi-ms { position: relative; color: var(--hc-fb, #1877f2); }
.hc-goi-ms-dau { position: absolute; right: 4px; bottom: 6px; min-width: 13px; height: 13px; padding: 0 2px; border-radius: 7px; background: var(--hc-fb, #1877f2); color: #fff;
  font: 700 9px/13px system-ui, -apple-system, sans-serif; text-align: center; pointer-events: none; }
/* GỌI LẠI qua Messenger là <button> (gọi trong app) — cùng dáng a.hc-goi-lai. */
button.hc-goi-lai { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--border-color);
  background: transparent; color: var(--theme-accent); font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .04em; cursor: pointer; }
button.hc-goi-lai:hover { background: color-mix(in srgb, var(--theme-accent) 8%, transparent); }
.hc-cg { position: fixed; z-index: 10080; right: 16px; bottom: 16px; width: 340px; max-width: calc(100vw - 32px); min-height: 300px; display: grid; grid-template-rows: 1fr auto; gap: 14px;
  padding: 22px 16px 18px; border-radius: 16px; background: #0f172a; color: #f8fafc; box-shadow: 0 18px 48px rgba(0,0,0,.35); overflow: hidden; }
.hc-cg.is-video { height: min(560px, calc(100vh - 32px)); }
.hc-cg-xa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.hc-cg.is-video .hc-cg-xa { display: block; }
.hc-cg-gan { position: absolute; top: 12px; right: 12px; z-index: 2; width: 96px; height: 128px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.75); background: #111827; transform: scaleX(-1); }
.hc-cg-than { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 4px; text-align: center; min-width: 0; }
.hc-cg.is-video .hc-cg-than { align-content: start; justify-items: start; text-align: left; padding-right: 108px; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.hc-cg-av { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: #1877f2; color: #fff; font-weight: 700; font-size: 26px; }
.hc-cg.is-video .hc-cg-av { display: none; }
.hc-cg h2 { margin: 8px 0 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 700; color: #fff; }
.hc-cg-tt { margin: 0; font-size: 14px; color: #cbd5e1; }
.hc-cg-gio { margin: 0; min-height: 1.3em; font-size: 15px; font-variant-numeric: tabular-nums; color: #f1f5f9; }
.hc-cg-nut { position: relative; z-index: 1; display: flex; justify-content: center; gap: 20px; }
.hc-cg-n { width: 56px; height: 56px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; }
.hc-cg-n:hover { background: rgba(255,255,255,.28); }
.hc-cg-n.is-tat, .hc-cg-n.is-bat { background: #f8fafc; color: #0f172a; }
.hc-cg-n.is-cup { background: #dc2626; color: #fff; }
.hc-cg-n.is-cup:hover { background: #b91c1c; }
.hc-cg-n:disabled { opacity: .4; cursor: default; }
.hc-cg-n:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
@media (max-width: 760px) {
  .hc-cg { inset: 0; width: auto; max-width: none; min-height: 0; border-radius: 0; padding: calc(env(safe-area-inset-top, 0px) + 40px) 16px calc(env(safe-area-inset-bottom, 0px) + 32px); }
  .hc-cg.is-video { height: auto; }
  .hc-cg-gan { top: calc(env(safe-area-inset-top, 0px) + 12px); }
}
.hc-cg-hoi { position: fixed; inset: 0; z-index: 10090; display: grid; place-items: center; padding: 16px; }
.hc-cg-hoi-nen { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.hc-cg-hoi-hop { position: relative; width: min(420px, 100%); display: grid; gap: 10px; padding: 20px; border: 1px solid var(--border-color); border-radius: 12px;
  background: var(--bg-card); color: var(--text-main); box-shadow: 0 18px 48px rgba(0,0,0,.25); }
.hc-cg-hoi-hop h2 { margin: 0; font-size: 17px; }
.hc-cg-hoi-hop p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.hc-cg-hoi-phu { color: var(--text-muted); }
.hc-cg-hoi-nut { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.hc-ch-goi-gio { display: flex; flex-wrap: wrap; gap: 10px; }
.hc-ch-goi-gio .hc-o { flex: 1 1 120px; }

/* Quảng cáo iTN: luôn hiện nút, giữ cùng phông và điều khiển Hộp chat. */
.hc-loc-qc { min-width: 104px; }
.hc-qc-filter { display: grid; gap: 12px; }
.hc-qc-filter .hc-o, .hc-qc-grid .hc-o { min-width: 0; }
.hc-qc-filter select, .hc-qc-grid select, .hc-qc-grid input { width: 100%; min-width: 0; min-height: 44px; font: inherit; }
.hc-qc-confirm { padding-left: 18px; font-size: 12px; overflow-wrap: anywhere; }
.hc-qc-row { margin: 16px 0; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 12px; min-width: 0; }
.hc-qc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hc-qc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { .hc-qc-grid { grid-template-columns: minmax(0, 1fr); } }

/* 28/10 (anh Nghĩa "chữ to lên tí"): CHỈ phần kết bạn Zalo to hơn ~2px — bảng chọn số (lớp is-ket-ban), nút dưới tin, dòng Đã làm; không đổi bảng pop khác. */
.hc-pop.is-ket-ban h4 { font-size: 15px; }
.hc-pop.is-ket-ban .hc-pop-muc { font-size: 16px; min-height: 44px; }
.hc-pop.is-ket-ban .hc-ghi { font-size: 14.5px; line-height: 1.5; }
.hc-pop.is-ket-ban .hc-o-loi { font-size: 14px; }
.hc-ket-ban-sdt { font-size: 15px; min-height: 38px; }
.hc-ket-ban-sdt.is-da-gui, .hc-nut-ic.is-da-gui { opacity: .6; cursor: default; }
.hc-ket-ban-da { color: var(--txt-ok); font-weight: 600; }
.hc-pop.is-ket-ban .hc-pop-muc:disabled { opacity: .45; cursor: default; }

/* 28/10 (anh Nghĩa "đợi chỉnh phông và cỡ chữ bên pancake bằng với zalo"): khung chat + danh sách kênh Facebook / Pancake / Instagram dùng ĐÚNG cỡ chữ
   của khung Zalo (cùng một phông chữ hệ thống của app — Zalo không đổi phông, chỉ to hơn): bong bóng 14.5 → 15px/1.4, tên khách 14 → 15.5px (đậm 500 / mới 700),
   tin cuối 13 → 13.5px, giờ 11.5 → 12px, tiêu đề đầu khung 15.5 → 16.5px, mốc ngày 11.5 → 12.5px, ô soạn 14.5 → 16px. Bảng pop / thẻ / nút không đổi. */
.hc-chat:not(.hc-zl) .hc-bong { font-size: 15px; line-height: 1.4; }
.hc-chat:not(.hc-zl) .hc-chat-ai h2 { font-size: 16.5px; }
.hc-chat:not(.hc-zl) .hc-ngay-tach span { font-size: 12.5px; font-weight: 500; }
.hc-chat:not(.hc-zl) .hc-soan textarea { font-size: 16px; }
.hc-ds:not(.hc-zl) .hc-ten { font-size: 15.5px; font-weight: 500; }
.hc-ds:not(.hc-zl) .hc-dong.is-moi .hc-ten { font-weight: 700; }
.hc-ds:not(.hc-zl) .hc-cuoi { font-size: 13.5px; }
.hc-ds:not(.hc-zl) .hc-luc { font-size: 12px; }

/* ══ Chuẩn hoá cuộn mượt, ảo hoá danh sách / lịch sử tin, kéo thả tệp & phản hồi tương tác tức thì (< 100 ms) ══ */
.hc-chat { position: relative; }
.hc-ao-tren, .hc-ao-duoi { list-style: none; margin: 0; padding: 0; border: 0; pointer-events: none; }
.hc-ao-tin-tren, .hc-ao-tin-duoi { flex: 0 0 auto; width: 100%; margin: 0; padding: 0; pointer-events: none; }
.hc-tin-cu { position: sticky; top: 0; z-index: 3; flex: 0 0 auto; pointer-events: none; padding: 4px 0 6px; }
.hc-tin-cu > * { pointer-events: auto; }
.hc-tin-cu .hc-nut { background: var(--bg-card); box-shadow: 0 2px 10px rgba(15, 23, 42, .08); }
.hc-bong img[data-hc-anh-ngoai]:not([data-da-tai]) { min-width: 160px; min-height: 120px; background: color-mix(in srgb, var(--text-muted) 10%, transparent); border-radius: 8px; }

/* Vùng nhận kéo thả tệp rõ ràng trên khung chat */
.hc-keo-tha { position: absolute; inset: 8px; z-index: 9; display: grid; place-items: center; border: 2px dashed var(--theme-accent); border-radius: 12px;
  background: color-mix(in srgb, var(--bg-card) 92%, var(--theme-accent)); color: var(--text-main); pointer-events: none;
  opacity: 1; transform: scale(1); transition: opacity .12s ease-out, transform .12s cubic-bezier(.22, 1, .36, 1); }
.hc-keo-tha[hidden] { display: none !important; }
.hc-chat.is-keo-chan .hc-keo-tha { border-color: var(--danger, #dc2626); background: color-mix(in srgb, var(--bg-card) 94%, #dc2626); }
.hc-keo-tha-hop { display: grid; justify-items: center; gap: 6px; max-width: 340px; padding: 20px 24px; text-align: center; }
.hc-keo-tha-hop svg { color: var(--theme-accent); }
.hc-chat.is-keo-chan .hc-keo-tha-hop svg { color: var(--danger, #dc2626); }
.hc-keo-tha-hop p { margin: 0; font-size: 15px; font-weight: 700; }
.hc-keo-tha-hop span { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

/* Tách vùng cuộn lồng nhau & cử chỉ vuốt trên điện thoại; phản hồi bấm tức thì bằng transform/opacity (compositor-only, có thể ngắt ngay) */
.hc-list, [data-hc-cuon], .hc-the, [data-hc-mau-ds], [data-hc-pop-khung] { overscroll-behavior: contain; }
.hc-loc, .hc-nt-tab, .hc-soan-dk { touch-action: pan-x; overscroll-behavior-x: contain; }
.hc-dong, .hc-nut, .hc-nut-ic, .hc-loc-nut, .hc-nt-nut, .hc-tin-moi, .hc-tep-anh, .hc-luoi-o, .hc-pop-muc { touch-action: manipulation; }
.hc-nut, .hc-nut-ic, .hc-loc-nut, .hc-nt-nut, .hc-tin-moi, .hc-luoi-o {
  transition: transform .09s cubic-bezier(.22, 1, .36, 1), opacity .09s ease-out, background-color .11s ease-out, border-color .11s ease-out;
}
.hc-nut:active:not(:disabled), .hc-nut-ic:active:not(:disabled), .hc-loc-nut:active:not(:disabled), .hc-nt-nut:active:not(:disabled), .hc-luoi-o:active:not(:disabled) {
  transform: scale(.96);
}
.hc-tin-moi:active:not(:disabled) {
  transform: translateX(-50%) scale(.96);
}
.hc-dong-o .hc-dong { transition: background-color .1s ease-out, transform .09s cubic-bezier(.22, 1, .36, 1); }
.hc-dong-o .hc-dong:active { transform: scale(.992); }
.hc-tin-moi { animation: hc-tin-moi-vao .14s cubic-bezier(.22, 1, .36, 1); }
@keyframes hc-tin-moi-vao { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  .hc-trang *, .hc-ngan-goc * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* 28/10 (anh Nghĩa "Xoá mấy chữ lỗi trong ô soạn tin nhắn đi"): chữ gợi ý ô soạn KHÔNG BAO GIỜ xuống dòng / bị cắt nửa dòng trên điện thoại —
   gợi ý ngắn "Nhập tin nhắn…", hướng dẫn "gõ / để chèn câu mẫu" chuyển sang dòng .hc-soan-ghi (máy tính) + title; mọi ô soạn một dòng, dư thì "…". */
.hc-soan textarea::placeholder, .hc-zl-soan-hang textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 141 (anh Nghĩa 30/10/2026): Gửi tin hàng loạt — thanh chọn khách dưới hàng lọc, ô tick đầu dòng, ngăn Soạn tin / Đợt gửi. */
.hc-loat-thanh { grid-area: chon; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-bottom: 1px solid var(--border-color); background: var(--theme-accent-soft); font-size: 13px; color: var(--text-main); }
.hc-loat-thanh .hc-loat-dem { flex: 1; min-width: 0; line-height: 1.35; }
.hc-loat-thanh .hc-loat-dem b { font-variant-numeric: tabular-nums; }
.hc-loat-thanh .hc-link { flex: none; font-size: 13px; min-height: 32px; }
.hc-loat-thanh .hc-nut-gon { flex: none; }
.hc-dong-o.is-loat .hc-dong { grid-template-columns: 24px 44px minmax(0, 1fr); }
.hc-ds.hc-zl .hc-dong-o.is-loat .hc-dong { grid-template-columns: 24px 48px minmax(0, 1fr); }
.hc-dong-o.is-loat .hc-dong-them { display: none; }
.hc-loat-tick { flex: none; align-self: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--bg-card); display: grid; place-items: center; }
.hc-loat-tick.is-on { background: var(--theme-accent-strong); border-color: var(--theme-accent-strong); }
.hc-loat-tick.is-on::after { content: ""; width: 9px; height: 5px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.hc-loat-tick.is-khoa { border-style: dashed; opacity: .55; }
.hc-dong.is-loat-het { opacity: .6; }
.hc-dong-3 .hc-loat-het { display: inline-flex; white-space: nowrap; align-items: center; min-height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: 600; color: var(--txt-warn); border: 1px dashed currentColor; }
.hc-loat-so { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hc-loat-so-nut { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 4px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.hc-loat-so-nut:hover:not(:disabled) { background: var(--bg-card-hover, var(--bg-input)); }
.hc-loat-so-nut:disabled { opacity: .5; cursor: default; }
.hc-loat-so-g { display: grid; gap: 1px; min-width: 0; font-size: 14px; }
.hc-loat-so-g .hc-mo { font-size: 12.5px; }
.hc-loat textarea { width: 100%; min-height: 120px; padding: 10px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-input, var(--bg-card)); color: var(--text-main); font: inherit; font-size: 15px; line-height: 1.45; resize: vertical; }
.hc-loat-cc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hc-loat-cc .hc-loat-dem-chu { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.hc-loat-anh { position: relative; width: 96px; height: 96px; }
.hc-loat-anh img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-color); }
.hc-loat-anh .hc-nut-ic { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; min-height: 28px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border-color); }
.hc-loat-xem { padding: 10px; border-radius: 12px; background: var(--bg-input, var(--bg-card)); display: flex; }
.hc-loat-bong { margin-left: auto; max-width: 88%; padding: 8px 12px; border-radius: 16px 16px 4px 16px; background: var(--theme-accent-strong); color: #fff; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.hc-loat-bong img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 6px; }
.hc-loat-bong.is-nho { margin: 0; max-width: none; background: var(--bg-input, var(--bg-card)); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 10px; font-size: 13.5px; }
.hc-loat-nhip { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--theme-accent-soft); font-size: 12.5px; line-height: 1.45; }
.hc-loat-chan { position: sticky; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-color); background: var(--bg-card); }
.hc-loat-chan > .hc-nut { width: 100%; justify-content: center; min-height: 46px; }
.hc-loat-xn p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.45; }
.hc-loat-dot { list-style: none; margin: 0; padding: 0; }
.hc-loat-dot > li > button { display: grid; gap: 3px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border-color); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hc-loat-dot > li > button:hover { background: var(--bg-card-hover, var(--bg-input)); }
.hc-loat-dot-1 { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.hc-loat-dot-2 { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-loat-dot .hc-mo { font-size: 12.5px; }
.hc-loat-tien { display: grid; gap: 3px; }
.hc-loat-tien + .hc-loat-tien { margin-top: 8px; }
.hc-loat-tien .hc-mo { font-size: 12.5px; }
.hc-loat-bar { height: 8px; border-radius: 99px; background: var(--bg-input, var(--border-color)); overflow: hidden; }
.hc-loat-bar i { display: block; height: 100%; border-radius: 99px; background: var(--theme-accent-strong); }
.hc-loat-kh { list-style: none; margin: 0; padding: 0; }
.hc-loat-kh li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border-color); font-size: 13.5px; }
.hc-loat-kh li:last-child { border-bottom: 0; }
.hc-loat-kh-g { flex: 1; min-width: 0; display: grid; }
.hc-loat-kh-g b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-loat-kh-g .hc-mo, .hc-loat-kh li > .hc-mo { font-size: 12px; }
.hc-loat-kh li > .hc-mo { flex: none; text-align: right; }
.hc-loat-cham { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.hc-loat-kh li.is-da_gui .hc-loat-cham { background: var(--txt-ok); }
.hc-loat-kh li.is-loi .hc-loat-cham { background: var(--txt-bad); }
.hc-loat-kh li.is-dang_gui .hc-loat-cham { background: var(--theme-accent-strong); }
.hc-loat-kh li.is-bo_qua .hc-loat-cham { background: var(--txt-warn); }
.hc-loat .hc-o-loi { flex-wrap: nowrap; align-items: flex-start; margin: 2px 0 0; line-height: 1.4; }
.hc-loat .hc-o-loi > svg { flex: none; margin-top: 1px; }
.hc-loat-anh-ten { display: grid; place-items: center; width: 100%; height: 100%; padding: 6px; border: 1px dashed var(--border-color); border-radius: 10px; font-size: 11.5px; text-align: center; overflow-wrap: anywhere; color: var(--text-muted); }

/* 06/11: gắn ghi chú màu làm hàng tên bị nhóm nút ép hẹp; chip flex:none
   tràn sang nút. Chia hàng theo chiều rộng CỘT chat, giữ nguyên data-hc và quyền. */
@container (max-width: 760px) {
  .hc-chat:not(.hc-zl) .hc-chat-dau { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 6px 8px; gap: 4px; flex-shrink: 0; }
  .hc-chat:not(.hc-zl) .hc-chat-ai { grid-column: 1 / -1; grid-row: 1; }
  .hc-chat:not(.hc-zl) .hc-chat-dau > .hc-pc { grid-column: 1; grid-row: 2; }
  .hc-chat:not(.hc-zl) .hc-chat-nut { grid-column: 2; grid-row: 2; }
  .hc-chat:not(.hc-zl) .hc-chat-dau:has(> [data-hc="ve"]) { grid-template-columns: 44px minmax(0, 1fr) auto; padding-left: 2px; }
  .hc-chat:not(.hc-zl) .hc-chat-dau > [data-hc="ve"] { grid-column: 1; grid-row: 1 / 3; }
  .hc-chat:not(.hc-zl) .hc-chat-dau:has(> [data-hc="ve"]) > .hc-chat-ai { grid-column: 2 / -1; }
  .hc-chat:not(.hc-zl) .hc-chat-dau:has(> [data-hc="ve"]) > .hc-pc { grid-column: 2; }
  .hc-chat:not(.hc-zl) .hc-chat-dau:has(> [data-hc="ve"]) > .hc-chat-nut { grid-column: 3; }
  .hc-chat-ai p > :is(.hc-nguon, .hc-nhan-mau) { min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
}
