/* Trang Chat Zalo — một giao diện co giãn: máy tính 3 cột, điện thoại từng màn một
   (body.view-list / view-chat / view-info quyết định màn nào đang hiện). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #006db7; --primary-dark: #005a99; --primary-light: #e0f0fb;
  --bg: #f1f5f9; --surface: #fff; --border: #e2e8f0;
  --text: #0f172a; --text-2: #475569; --text-3: #94a3b8;
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
  --note-bg: #fff7d6; --note-border: #f1d27a;
  --radius: 10px;
}
html, body { height: 100%; }
/* Trang chat KHÔNG cho phóng to cả trang (chủ shop yêu cầu 24/09/2026): gõ chữ xong
   iPhone tự zoom mà không tự thu lại. pan-x pan-y = manipulation bỏ pinch-zoom → chặn
   cả chụm 2 ngón lẫn chạm đúp phóng to, vẫn cuộn bình thường. Ảnh thì phóng to riêng
   trong khung xem ảnh (.z-viewer tự xử lý cử chỉ). Xem thêm viewport + gesturestart. */
html, *, *::before, *::after { touch-action: pan-x pan-y; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--primary); }

.z-muted { color: var(--text-3); }
.z-pad { padding: 16px; }
.z-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; outline: none;
}
.z-input:focus { border-color: var(--primary); }
.z-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap;
}
.z-btn:hover { background: #f8fafc; }
.z-btn:disabled { opacity: .5; cursor: default; }
.z-btn-sm { padding: 5px 10px; font-size: 13px; }
.z-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.z-btn-primary:hover { background: var(--primary-dark); }
.z-btn-ok { color: var(--ok); border-color: #bbf7d0; }
.z-btn-danger { color: var(--danger); border-color: #fecaca; }
.z-icon-btn {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
}
.z-icon-btn:hover { background: rgba(0,0,0,.05); }

/* ─── Cổng: chưa đăng nhập / không có quyền ─────────────────────────── */
.z-gate { height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.z-gate-card { background: #fff; border-radius: 14px; padding: 28px 24px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.z-gate-logo { height: 44px; margin-bottom: 12px; }
.z-gate-card h2 { font-size: 18px; margin-bottom: 8px; }
.z-gate-card p { color: var(--text-2); margin-bottom: 18px; line-height: 1.5; }

/* ─── Khung chính ───────────────────────────────────────────────────── */
.z-app { height: 100%; display: flex; flex-direction: column; }
.z-top {
  height: 52px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: var(--primary); color: #fff;
  padding-top: env(safe-area-inset-top);
}
.z-top .z-icon-btn { color: #fff; }
.z-top .z-icon-btn:hover { background: rgba(255,255,255,.15); }
.z-top-title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.z-conn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  max-width: 55vw; overflow: hidden; text-overflow: ellipsis;
}
.z-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.z-conn.ok .z-conn-dot { background: #4ade80; }
.z-conn.warn .z-conn-dot { background: #fbbf24; }
.z-conn.bad { background: #fee2e2; color: var(--danger); }
.z-conn.bad .z-conn-dot { background: var(--danger); }
.z-banner { padding: 8px 14px; font-size: 13px; background: #fff7ed; color: #9a3412; border-bottom: 1px solid #fed7aa; line-height: 1.4; }
.z-banner.bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.z-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr 300px; }
.z-list-col, .z-chat-col, .z-info-col { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.z-list-col { border-right: 1px solid var(--border); }
.z-info-col { border-left: 1px solid var(--border); overflow-y: auto; }
.z-chat-col { background: #eef2f7; position: relative; }

/* ─── Danh sách hội thoại ───────────────────────────────────────────── */
.z-list-tools { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.z-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.z-filters::-webkit-scrollbar { display: none; }
/* Máy tính dùng chuột không vuốt ngang được → cho các nút xuống dòng */
@media (hover: hover) and (pointer: fine) {
  .z-filters { flex-wrap: wrap; overflow-x: visible; }
}
.z-chip {
  flex-shrink: 0; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.z-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.z-chip-select { appearance: none; padding-right: 11px; max-width: 150px; }
.z-list { flex: 1; overflow-y: auto; }
.z-item {
  display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; position: relative;
}
.z-item:hover { background: #f8fafc; }
.z-item.active { background: var(--primary-light); }
.z-item-body { flex: 1; min-width: 0; }
.z-item-row { display: flex; align-items: center; gap: 6px; }
.z-item-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-item.unread .z-item-name { font-weight: 800; }
.z-item-time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.z-item-preview { font-size: 13px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.z-item.unread .z-item-preview { color: var(--text); font-weight: 600; }
.z-item-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.z-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.z-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: var(--text-2); }
.z-tag.need { background: #fff7ed; color: #c2410c; }
.z-tag.mine { background: var(--primary-light); color: var(--primary-dark); }
.z-tag.cust { background: #ecfdf5; color: #047857; }
.z-list-more, .z-list-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: 13px; }
/* Tìm theo nội dung tin: tiêu đề mục + kết quả */
.z-sect { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); background: #f8fafc; border-bottom: 1px solid #f1f5f9; position: sticky; top: 0; z-index: 1; }
.z-sect-opt { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; text-transform: none; letter-spacing: 0; cursor: pointer; color: var(--text-2); }
.z-sect-opt input { margin: 0; }
.z-hit-body { font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.z-hit-body b { color: var(--text); background: #fef3c7; border-radius: 3px; padding: 0 1px; }
.z-hit-who { font-weight: 600; color: var(--text-3); }
.z-hit-who.in { color: #047857; }
.z-hit-who.note { color: #b45309; }
.z-msg.z-hl .z-bubble { animation: zhl 2.5s ease-out; }
@keyframes zhl { 0%, 60% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: none; } }

.z-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: #cbd5e1; color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.z-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Khung chat ────────────────────────────────────────────────────── */
.z-empty-chat { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); }
.z-empty-chat svg { width: 48px; height: 48px; stroke-width: 1.4; }
.z-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.z-chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--border); }
.z-chat-head .z-avatar { width: 38px; height: 38px; font-size: 15px; }
.z-chat-who { flex: 1; min-width: 0; cursor: pointer; }
.z-chat-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-chat-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-chat-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.z-msgs { flex: 1; overflow-y: auto; padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 3px; overscroll-behavior: contain; }
.z-day { align-self: center; font-size: 11.5px; color: var(--text-2); background: rgba(255,255,255,.8); padding: 3px 10px; border-radius: 999px; margin: 10px 0 6px; }
.z-loadold { align-self: center; font-size: 12px; color: var(--text-3); padding: 6px; }
.z-gapnote { align-self: center; font-size: 12px; color: #9a3412; background: #fff7ed; padding: 4px 10px; border-radius: 8px; margin: 6px 0; text-align: center; }

.z-msg { display: flex; flex-direction: column; max-width: 76%; }
.z-msg.in { align-self: flex-start; align-items: flex-start; }
.z-msg.out { align-self: flex-end; align-items: flex-end; }
.z-msg + .z-msg.gap { margin-top: 8px; }
.z-bubble {
  padding: 8px 12px; border-radius: 14px; line-height: 1.42; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.z-msg.out .z-bubble { background: #d6ebfb; }
.z-msg.failed .z-bubble, .z-msg.unknown .z-bubble { box-shadow: 0 0 0 1.5px #fca5a5; }
.z-bubble.recalled { font-style: italic; color: var(--text-3); background: transparent; box-shadow: 0 0 0 1px var(--border); }
.z-bubble.photo { padding: 3px; background: transparent; box-shadow: none; }
.z-bubble.photo img { display: block; max-width: min(260px, 60vw); max-height: 320px; border-radius: 12px; cursor: zoom-in; background: #e2e8f0; min-width: 80px; min-height: 60px; object-fit: cover; }
.z-bubble.photo .z-caption { padding: 4px 8px 2px; white-space: pre-wrap; }
.z-bubble.special { color: var(--text-2); font-style: italic; }
.z-img-missing { padding: 18px 14px; font-size: 12px; color: var(--text-3); background: #fff; border-radius: 12px; }
.z-quote { font-size: 12px; color: var(--text-2); border-left: 3px solid #93c5fd; padding: 2px 8px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.z-meta { font-size: 11px; color: var(--text-3); margin: 2px 4px 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.z-st-failed, .z-st-unknown { color: var(--danger); font-weight: 600; }
.z-st-delivered { color: var(--ok); }
.z-retry { font-size: 11px; font-weight: 700; color: var(--primary); text-decoration: underline; }
/* Nút "Thu hồi": máy tính hiện khi rê chuột vào tin, điện thoại hiện khi chạm vào tin. */
.z-recall { font-size: 11px; font-weight: 600; color: var(--danger); padding: 0 2px; display: none; }
.z-recall:hover { text-decoration: underline; }
.z-msg.act .z-recall { display: inline; }
@media (hover: hover) { .z-msg:hover .z-recall { display: inline; } }
.z-newmsg {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 150px; z-index: 5;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 16px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ─── Ô soạn tin ────────────────────────────────────────────────────── */
.z-composer { background: #fff; border-top: 1px solid var(--border); padding: 6px 10px 8px; position: relative; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.z-compose-row { display: flex; align-items: flex-end; gap: 4px; }
.z-text {
  flex: 1; min-width: 0; resize: none; border: 1px solid var(--border); border-radius: 18px;
  padding: 8px 14px; max-height: 140px; line-height: 1.4; outline: none; background: #fff;
  font-size: 15px;
}
.z-text:focus { border-color: var(--primary); }
.z-send { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.z-send:disabled { background: #cbd5e1; cursor: default; }
.z-send svg { width: 18px; height: 18px; }
.z-hint { font-size: 11px; color: var(--text-3); margin: 4px 0 0 84px; }
.z-lock { padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; background: #fef2f2; color: #991b1b; font-size: 13px; line-height: 1.4; }
.z-upload-preview { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 6px; background: #f8fafc; border-radius: 8px; font-size: 13px; }
.z-upload-preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }
.z-upload-preview .z-grow { flex: 1; min-width: 0; }

.z-quick {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 10;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 8px; max-height: 50vh; display: flex; flex-direction: column; gap: 6px;
}
.z-quick-list { overflow-y: auto; }
.z-quick-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; }
.z-quick-item:hover { background: #f1f5f9; }
.z-quick-item b { display: block; font-size: 13px; }
.z-quick-item span { display: block; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Cột thông tin ─────────────────────────────────────────────────── */
.z-info-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.z-info-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.z-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.z-card h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-bottom: 8px; }
.z-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.z-kv span:first-child { color: var(--text-3); flex-shrink: 0; }
.z-link-actions { display: flex; gap: 8px; margin-top: 10px; }
.z-kv span:last-child { text-align: right; overflow-wrap: anywhere; }
.z-racket { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 4px; }
.z-racket-title { font-size: 13px; font-weight: 600; padding: 3px 0; overflow-wrap: anywhere; }

/* Ghi chú nội bộ (chỉ nhân viên thấy) */
.z-notes { background: var(--note-bg); border-color: var(--note-border); }
.z-note-input {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 58px; max-height: 200px;
  font: inherit; font-size: 14px; line-height: 1.4; padding: 8px 10px;
  border: 1px solid var(--note-border); border-radius: 8px; background: #fff;
}
.z-note-input:focus { outline: none; border-color: #d4a72c; box-shadow: 0 0 0 2px rgba(241,210,122,.45); }
.z-note-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 12px; }
.z-note-actions .z-btn { padding: 6px 12px; font-size: 13px; }
.z-note-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.z-note { background: #fff; border: 1px solid var(--note-border); border-radius: 8px; padding: 7px 10px; }
.z-note-head { font-size: 11.5px; font-weight: 700; color: #a16207; margin-bottom: 2px; }
.z-note-body { font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.z-profile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.z-profile .z-avatar { width: 64px; height: 64px; font-size: 24px; }
.z-profile-name { font-weight: 700; font-size: 16px; }
.z-warn-box { font-size: 12.5px; line-height: 1.45; padding: 10px; border-radius: 8px; background: #fff7ed; color: #9a3412; }

/* ─── Hộp thoại / xem ảnh / toast ───────────────────────────────────── */
.z-modal { position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.z-modal-card { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; }
.z-modal-head { display: flex; align-items: center; padding: 12px 12px 8px 18px; }
.z-modal-title { flex: 1; font-weight: 700; font-size: 16px; }
.z-modal-body { padding: 4px 18px 18px; overflow-y: auto; }
.z-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.z-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.z-row .z-grow { flex: 1; min-width: 0; }
.z-row small { display: block; color: var(--text-3); font-size: 12px; }
.z-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.z-field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.z-field textarea { min-height: 90px; resize: vertical; }
.z-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.z-switch input { opacity: 0; width: 0; height: 0; }
.z-switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: .15s; cursor: pointer; }
.z-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; }
.z-switch input:checked + span { background: var(--ok); }
.z-switch input:checked + span::after { transform: translateX(18px); }
.z-switch input:disabled + span { opacity: .6; cursor: default; }
.z-viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; overflow: hidden; user-select: none; -webkit-user-select: none; }
.z-viewer, .z-viewer * { touch-action: none; }
/* Chừa khoảng trên/dưới bằng nhau cho nút Đóng + dòng gợi ý: ảnh dọc (ảnh chụp màn hình
   nền trắng) trước đây phủ lên nút ✕ trắng → nhìn như không có nút. Đệm phải ĐỐI XỨNG vì
   zvSet/zvZoomAt tính theo tâm khung. Ảnh phóng to vẫn tràn ra vùng đệm bình thường. */
.z-viewer { padding: calc(64px + env(safe-area-inset-top)) 8px; }
.z-viewer img { max-width: 100%; max-height: 100%; transform-origin: center center; will-change: transform; cursor: zoom-in; -webkit-user-drag: none; }
.z-viewer.zoomed img { cursor: grab; }
.z-viewer-close { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top)); right: 12px; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 21px; background: rgba(0,0,0,.65); border: 1.5px solid rgba(255,255,255,.85); color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.z-viewer-close b { font-size: 18px; line-height: 1; }
.z-viewer-close:hover { background: rgba(0,0,0,.85); }
.z-viewer-hint { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.6); font-size: 12px; pointer-events: none; transition: opacity .3s; }
.z-viewer.zoomed .z-viewer-hint { opacity: 0; }
.z-toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); z-index: 70;
  background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; text-align: center;
}
.z-toast.show { opacity: 1; transform: translate(-50%, 0); }
.z-toast.error { background: var(--danger); }

/* ─── Máy tính vừa: gộp cột thông tin vào nút ⓘ ─────────────────────── */
.z-only-mobile { display: none !important; }
@media (max-width: 1180px) {
  .z-main { grid-template-columns: 320px 1fr; }
  .z-info-col { display: none; }
  body.view-info .z-info-col {
    display: flex; position: fixed; right: 0; top: 52px; bottom: 0; width: 320px; z-index: 20;
    box-shadow: -8px 0 24px rgba(0,0,0,.12);
  }
}
/* ─── Điện thoại: mỗi lúc một màn ───────────────────────────────────── */
@media (max-width: 760px) {
  .z-only-mobile { display: inline-flex !important; }
  .z-only-desktop { display: none !important; }
  .z-main { grid-template-columns: 1fr; }
  .z-list-col, .z-chat-col { display: none; }
  body.view-list .z-list-col { display: flex; }
  body.view-chat .z-chat-col { display: flex; }
  body.view-info .z-info-col { display: flex; position: static; width: auto; box-shadow: none; border: none; }
  body.view-chat .z-top, body.view-info .z-top { display: none; }
  body.view-chat .z-banner, body.view-info .z-banner { display: none; }
  .z-info-head.z-only-mobile { display: flex !important; }
  .z-msg { max-width: 86%; }
  .z-chat-head { padding: 6px 8px; gap: 6px; }
  .z-chat-actions .z-btn-sm { padding: 5px 8px; font-size: 12px; }
  .z-newmsg { bottom: 130px; }
  .z-conn { max-width: 50vw; }
}

/* Cột thông tin: màn rộng luôn hiện nên ẩn nút ⓘ; màn vừa hiện dạng trượt có nút đóng. */
@media (min-width: 1181px) { #zInfoBtn { display: none; } }
@media (max-width: 1180px) { body.view-info .z-info-head.z-only-mobile { display: flex !important; } }

/* Tab Dung lượng (cài đặt chat) */
.z-st-big { display: flex; flex-direction: column; margin-bottom: 8px; }
.z-st-big b { font-size: 24px; color: var(--primary); line-height: 1.2; }
.z-st-big span { font-size: 12.5px; color: var(--text-3); }
.z-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: 4px; }
.z-bar i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.z-bar.warn i { background: #f59e0b; }
.z-bar.bad i { background: var(--danger); }
.z-st-select { width: auto; padding: 6px 8px; font-size: 13px; flex-shrink: 0; }
.z-st-progress { margin-top: 8px; font-size: 13px; color: var(--primary); font-weight: 600; }

/* Tin đã thu hồi — bản admin xem lại nội dung gốc */
.z-bubble.recalled.seen { font-style: normal; color: var(--text-2); background: repeating-linear-gradient(135deg, #f8fafc 0 6px, #f1f5f9 6px 12px); box-shadow: none; border: 1px dashed #cbd5e1; }
.z-rc-tag { font-size: 11px; font-weight: 600; color: var(--danger); margin-bottom: 3px; white-space: normal; }
.z-rc-text { text-decoration: line-through; text-decoration-color: rgba(100,116,139,.55); }
.z-bubble.recalled.seen img { display: block; max-width: 160px; max-height: 160px; border-radius: 8px; opacity: .7; cursor: zoom-in; margin: 2px 0; }

/* Danh thiếp Zalo (khách gửi số điện thoại / liên hệ) */
.z-bubble.z-contact { min-width: 190px; white-space: normal; }
.z-card-head { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.z-card-name { font-weight: 700; font-size: 15px; }
.z-card-row { display: flex; align-items: center; gap: 10px; }
.z-card-main { flex: 1; min-width: 0; }
.z-card-ava { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.z-card-qr { width: 48px; height: 48px; flex-shrink: 0; border-radius: 6px; background: #fff; cursor: zoom-in; }
.z-card-phone { display: inline-block; margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--primary); text-decoration: none; letter-spacing: .3px; }
.z-card-copy { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--primary); border: 1px solid var(--primary); border-radius: 999px; padding: 1px 9px; vertical-align: 2px; }
.z-card-nophone { margin-top: 4px; font-size: 12px; color: var(--text-3); font-style: italic; }
