/* nhanhieu.ai/app - chặng 4: màn Tương tác + Khách hàng tiềm năng (dùng biến màu app.js đổ vào) */
.tt-cap-nhat { display: block; font-size: 12px; color: var(--chu-phu); margin-top: 4px; line-height: 1.3; }
.tt-cap-nhat:empty { display: none; }

/* Toxic Bouncer ở đầu màn Tương tác: 3 mức 2 - 1 - 0 và chỉ số, không có lời bị lọc */
.toxic-pwa { margin: 14px 0 16px; padding: 16px; border-radius: var(--bo-goc); background: var(--mat); border: 1px solid var(--vien); display: flex; flex-direction: column; gap: 12px; }
.toxic-dau { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.toxic-dau h3 { margin: 2px 0 0; color: var(--chu); font-size: 16px; line-height: 1.25; }
.toxic-dau > p { max-width: 230px; color: var(--chu-phu); font-size: 12px; line-height: 1.45; text-align: right; }
.toxic-nhan { color: var(--chu-phu); font-size: 12px; font-weight: 400; }
.toxic-che-do { display: grid; gap: 8px; }
.toxic-the { width: 100%; min-height: 76px; padding: 11px 12px; border: 1px solid var(--vien); border-radius: 16px; background: var(--mat2); color: var(--chu); cursor: pointer; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; text-align: left; }
.toxic-the input { width:22px; height:22px; accent-color:var(--nhan); }
.toxic-the.dang-chon { border: 2px solid var(--nhan-chu); background: color-mix(in srgb, var(--nhan) 13%, var(--mat2)); }
.toxic-the:disabled { opacity: .65; cursor: wait; }
.toxic-chu { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.toxic-chu strong { font-size: 14px; line-height: 1.35; }
.toxic-chu small { width: 100%; color: var(--chu-phu); font-size: 12px; line-height: 1.4; }
.toxic-dem { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.toxic-dem div { padding: 12px; border-radius: 16px; background: var(--mat2); border: 1px solid var(--vien); display: flex; flex-direction: column; gap: 2px; }
.toxic-dem strong { color: var(--chu); font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.toxic-dem span, .toxic-rieng-tu { color: var(--chu-phu); font-size: 12px; line-height: 1.4; }
.toxic-rieng-tu { margin: 0; }
@media (max-width: 430px) { .toxic-dau { display: block; } .toxic-dau > p { max-width: none; margin-top: 5px; text-align: left; } }

/* Trợ lý trực comment và inbox: tóm tắt ngoài màn, cấu hình 6 bước trong dialog */
.tltt-tom { margin: 0 0 16px; padding: 16px; border-radius: var(--bo-goc); border: 1px solid var(--vien-sang); background: var(--mat); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tltt-tom h3, .tltt-dau h3 { margin: 2px 0 4px; color: var(--chu); font-size: 16px; line-height: 1.35; text-wrap: pretty; }
.tltt-tom > div > p:last-child { color: var(--chu-phu); font-size: 12px; line-height: 1.45; }
.tltt-tom .nut { flex: none; }
.tltt-can-nguoi { margin: -6px 0 16px; padding: 11px 13px; border-radius: 12px; color: var(--vang); background: color-mix(in srgb, var(--vang) 10%, var(--mat)); border: 1px solid color-mix(in srgb, var(--vang) 35%, var(--vien)); font-size: 12px; font-weight: 400; }
.tltt-hop { width: min(760px, calc(100% - 24px)); max-height: min(850px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--vien); border-radius: 16px; color: var(--chu); background: var(--nen); box-shadow: 0 30px 80px rgba(0,0,0,.55); overflow: auto; }
.tltt-hop::backdrop { background: rgba(2,7,18,.78); backdrop-filter: blur(8px); }
.tltt-dau, .tltt-chan { position: sticky; z-index: 2; background: color-mix(in srgb, var(--nen) 92%, transparent); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.tltt-chan { bottom: 0; border-top: 1px solid var(--vien); justify-content: flex-end; }
.tltt-buoc { padding: 14px 18px 0; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; }
.tltt-buoc button { min-width: 0; padding: 8px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--chu-phu); cursor: pointer; display: grid; place-items: center; gap: 4px; font: inherit; }
.tltt-buoc button b { width: 27px; height: 27px; border-radius: 99px; border: 1px solid var(--vien); display: grid; place-items: center; font-size: 12px; }
.tltt-buoc button span { font-size: 12px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.tltt-buoc button[aria-selected="true"] { color: var(--chu); background: var(--tint); }
.tltt-buoc button[aria-selected="true"] b { background: var(--nhan); border-color: var(--nhan); color: var(--tren-chinh); }
.tltt-trang { min-height: 420px; padding: 20px 18px 28px; display: flex; flex-direction: column; gap: 13px; }
.tltt-trang > h4, .tltt-trang h4 { margin: 0; color: var(--chu); font-size: 16px; line-height: 1.4; }
.tltt-luoi, .tltt-kenh { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.tltt-kenh { grid-template-columns: repeat(3, minmax(0,1fr)); }
.tltt-tick, .tltt-chon { min-height: 58px; padding: 11px 12px; border-radius: 16px; border: 1px solid var(--vien); background: var(--mat); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.tltt-tick input, .tltt-chon input { width: 20px; height: 20px; flex: none; accent-color: var(--nhan); }
.tltt-tick span, .tltt-chon span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tltt-tick b, .tltt-chon b { color: var(--chu); font-size: 14px; line-height: 1.3; }
.tltt-tick small, .tltt-chon small { color: var(--chu-phu); font-size: 12px; line-height: 1.35; }
.tltt-truong { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--chu); font-size: 12px; font-weight: 400; }
.tltt-truong textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.tltt-thu { margin-top: 2px; padding: 14px; border-radius: 16px; background: var(--mat); border: 1px solid var(--vien); display: flex; flex-direction: column; gap: 12px; }
.tltt-kq { min-height: 0; color: var(--chu); font-size: 14px; line-height: 1.5; }
.tltt-kq:not(:empty) { padding: 13px; border-radius: 12px; background: var(--tint); border: 1px solid color-mix(in srgb, var(--nhan) 30%, var(--vien)); }
.tltt-kq p { margin: 5px 0; color: var(--chu); }
.tltt-kq small { color: var(--chu-phu); }
.tltt-free { padding: 11px 13px; border-radius: 12px; color: var(--vang); background: color-mix(in srgb, var(--vang) 10%, var(--mat)); border: 1px solid color-mix(in srgb, var(--vang) 35%, var(--vien)); font-size: 12px; line-height: 1.45; }
.tt-ai { padding: 11px; border-radius: 12px; background: var(--tint); border: 1px solid color-mix(in srgb, var(--nhan) 35%, var(--vien)); display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.tt-ai.can-nguoi { background: color-mix(in srgb, var(--vang) 8%, var(--mat)); border-color: color-mix(in srgb, var(--vang) 45%, var(--vien)); }
.tt-ai .tt-ai-chu { width: 100%; min-height: 68px; resize: vertical; line-height: 1.45; }
.tt-ai small { color: var(--chu-phu); font-size: 12px; }

@media (max-width: 560px) {
  .tltt-hop { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .tltt-buoc { overflow-x: auto; grid-template-columns: repeat(6, 72px); }
  .tltt-luoi, .tltt-kenh { grid-template-columns: 1fr; }
  .tltt-tom { align-items: flex-end; }
  .tltt-tom .nut { padding-inline: 12px; }
}

/* tab Comment - Tin nhắn */
.tt-tab { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--mat); border: 1px solid var(--vien); border-radius: 999px; }
.tt-tab button {
  flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: none; color: var(--chu-phu);
  font-weight: 400; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; line-height: 1;
}

.tt-so { font-weight: 400; }

/* ô tìm + nút nói */
.tt-tim { display: flex; gap: 8px; align-items: center; }
.tt-tim .tim { flex: 1; min-width: 0; }
.tt-tim .nut-mic { flex: none; padding: 0 14px; }
.nut-mic.dang-nghe { background: var(--chinh); color: var(--tren-chinh); border-color: var(--chinh); }

/* logo kênh: nền sáng tròn để logo đen (TikTok, Threads) vẫn đọc được trên nền tối */
.tt-kenh { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #fff; flex: none; }
.tt-kenh img { width: 15px; height: 15px; display: block; }
.the-nhan .tt-kenh { width: 22px; height: 22px; margin-left: -6px; }

/* khối nguồn: chờ nối kênh / đang kéo / lỗi */
.tt-nguon { margin-top: 14px; padding: 16px; border-radius: var(--bo-goc); background: var(--tint); border: 1px solid var(--vien); display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--chu); line-height: 1.5; }
.tt-nguon-tieu { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--chu); }
.tt-nguon-tieu svg { color: var(--nhan-chu); }
.tt-nguon-mon { font-size: 12px; color: var(--chu-phu); overflow-wrap: anywhere; }
.tt-nguon-mon b { color: var(--chu); }
.tt-lam-moi { align-self: flex-start; }

/* thẻ */
.tt-ds { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tt-the { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo-goc); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tt-the.moi { border-color: color-mix(in srgb, var(--chinh-chu) 55%, var(--vien)); }
.tt-dong1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tt-ten { font-weight: 400; font-size: 14px; color: var(--chu); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-luc { margin-left: auto; font-size: 12px; color: var(--chu-phu); white-space: nowrap; }
.tt-cham { width: 9px; height: 9px; border-radius: 99px; background: var(--nhan); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--nhan) 25%, transparent); }
.tt-dai-y { font-weight: 400; font-size: 14px; line-height: 1.4; color: var(--chu); overflow-wrap: anywhere; }
.tt-dai-y.cho { font-weight: 400; color: var(--chu-phu); font-style: italic; font-size: 14px; }
.tt-nhan { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-nhan:empty { display: none; }
.tt-nhom { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--mat2); color: var(--chu); font-size: 12px; font-weight: 400; line-height: 1; }
.tt-nhom.vang { color: var(--vang); background: color-mix(in srgb, var(--vang) 14%, var(--mat)); }
.tt-nhom.do { color: var(--do); background: rgba(252,165,165,.10); }
.tt-nhom.xanh { color: var(--nhan-chu); background: var(--tint); }
.tt-nhom.tn { color: var(--vang); background: none; border: 1px solid color-mix(in srgb, var(--vang) 60%, transparent); }
.tt-hanh .tt-sang-kh { color: var(--vang); border-color: color-mix(in srgb, var(--vang) 50%, var(--vien)); }
.tt-goc { font-size: 14px; color: var(--chu-phu); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tt-the.mo .tt-goc { -webkit-line-clamp: unset; display: block; }
.tt-bai { font-size: 12px; color: var(--chu-phu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-tra-loi { border-left: 2px solid var(--chinh-chu); padding: 2px 0 2px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-tra-loi p { font-size: 14px; color: var(--chu); line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tt-the.mo .tt-tra-loi p { -webkit-line-clamp: unset; display: block; }
.tt-nho { font-size: 12px; font-weight: 400; color: var(--chinh-chu); }
.tt-chua-tra-loi { font-size: 12px; color: var(--vang); font-weight: 400; }
.tt-form-tra-loi { display: flex; align-items: center; gap: 8px; }
.tt-o-tra-loi { flex: 1; min-width: 0; min-height: 44px; }
.tt-gui-tra-loi { flex: none; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 430px) { .tt-form-tra-loi { align-items: stretch; } .tt-gui-tra-loi { padding-inline: 14px; } }
.tt-hanh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tt-hanh .nut { padding: 0 14px; font-size: 14px; }
.tt-hanh .nut svg { width: 18px; height: 18px; }
.tt-hanh a.nut { text-decoration: none; }

/* nút «Đã xem hết»: giữa đáy, nổi trên thanh điều hướng */
.tt-day { position: sticky; bottom: calc(var(--dh-cao) + 12px + env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; margin-top: 14px; z-index: 3; }
.tt-xem-het { pointer-events: auto; box-shadow: 0 6px 20px rgba(0,0,0,.45); min-height: 48px; }

/* khách hàng tiềm năng */
.kh-dau { align-items: flex-start; }
.kh-av { width: 40px; height: 40px; border-radius: 999px; flex: none; display: grid; place-items: center; background: var(--tint); color: var(--chu); font-weight: 400; border: 1px solid var(--vien); }
.kh-chu { flex: 1; min-width: 0; }
.kh-phu { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--chu-phu); margin-top: 2px; }
.kh-phu .tt-kenh { width: 20px; height: 20px; border-radius: 8px; }
.kh-phu .tt-kenh img { width: 13px; height: 13px; }
.kh-do { flex: none; display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 400; line-height: 1; background: var(--mat2); color: var(--chu); }
.kh-do.nong { background: var(--vang); color: #1a1405; }
.kh-do.am { background: color-mix(in srgb, var(--chinh) 30%, var(--mat)); color: var(--chu); }
.kh-the[data-do="nong"] { border-color: color-mix(in srgb, var(--vang) 55%, var(--vien)); }
.kh-the.xong { opacity: .78; }
.kh-the.soi { outline: 2px solid var(--vang); outline-offset: 2px; }
.kh-cau { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--mat2); font-size: 14px; color: var(--chu); line-height: 1.5; overflow-wrap: anywhere; position: relative; padding-left: 30px; }
.kh-cau::before { content: "\201C"; position: absolute; left: 10px; top: 2px; font-size: 16px; color: var(--vang); line-height: 1; font-weight: 600; }
.kh-ds { margin: 0; display: grid; gap: 6px; }
.kh-ds div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; font-size: 14px; line-height: 1.45; }
.kh-ds dt { color: var(--chu-phu); font-weight: 400; font-size: 12px; }
.kh-ds dd { margin: 0; color: var(--chu); overflow-wrap: anywhere; min-width: 0; }
.kh-ghi { display: flex; gap: 8px; align-items: flex-end; }
.kh-ghi .truong { flex: 1; min-width: 0; gap: 6px; }
.kh-ghi .nut-mic { flex: none; padding: 0 14px; }
.kh-o-ghi { min-height: 44px; font-size: 14px; }

/* chấm mới trên nút menu ≡ + số trên mục menu */
#nut-menu, #nut-menu-dau { position: relative; }
#nut-menu.co-moi::after, #nut-menu-dau.co-moi::after { content: ""; position: absolute; top: 9px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 99px; background: var(--nhan); border: 2px solid var(--mat); }
#nut-menu-dau.co-moi::after { top: 6px; right: 6px; border-color: var(--nen); }

/* khung tóm nhanh bên phải: chỉ máy rộng */
.tt-phai { display: none; }
@media (min-width: 600px) {
  .tt-phai:not([hidden]) { display: block; height: 100%; overflow-y: auto; padding: 24px; }
  .tt-day { bottom: 16px; }
}
.tt-phai-than { max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.tt-phai-tieu { font-size: 12px; font-weight: 400; color: var(--chu-phu); margin-top: 10px; }
.tt-phai-so { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tt-phai-so div { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo-goc); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.tt-phai-so b { font-size: 16px; line-height: 1; color: var(--chu); }
.tt-phai-so .nong b { color: var(--vang); }
.tt-phai-so span { font-size: 12px; color: var(--chu-phu); line-height: 1.3; }
.tt-phai-nhom, .tt-phai-kh { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tt-phai-nhom li { display: grid; grid-template-columns: 130px 1fr 32px; align-items: center; gap: 10px; font-size: 14px; color: var(--chu); }
.tt-phai-nhom .vach { height: 10px; border-radius: 99px; background: var(--mat2); overflow: hidden; }
.tt-phai-nhom .vach i { display: block; height: 100%; border-radius: 99px; background: var(--chinh-chu); }
.tt-phai-nhom b { text-align: right; }
.tt-phai-kh button { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border-radius: var(--bo-goc); background: var(--mat); border: 1px solid color-mix(in srgb, var(--vang) 45%, var(--vien)); cursor: pointer; color: var(--chu); min-height: 44px; }
.tt-phai-kh span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-phai-kh b { font-size: 16px; }
.tt-phai-kh small { font-size: 12px; color: var(--chu-phu); line-height: 1.4; }
/* Trung tâm Kênh & Trực */
.kt-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:5px;margin:14px 0 18px;background:var(--the,#181824);border:1px solid var(--vien,rgba(255,255,255,.1));border-radius:16px}
.kt-tabs button{min-width:0;border:0;border-radius:12px;padding:10px 6px;background:transparent;color:var(--chu-phu,#aaa);font:400 12px/1.2 "Be Vietnam Pro",sans-serif;white-space:nowrap}

.kt-panel[hidden]{display:none!important}.kt-dan-form{display:grid;gap:14px;max-width:760px}.kt-che-do{display:flex;gap:18px;border:1px solid var(--vien,rgba(255,255,255,.12));border-radius:16px;padding:14px}.kt-che-do legend{padding:0 6px;font-weight:400}.kt-che-do label{display:flex;align-items:center;gap:7px}
@media(max-width:520px){.kt-tabs button{font-size:12px;padding-inline:3px}.kt-che-do{flex-direction:column;gap:10px}}
