/* ==========================================================================
   Zetlink Unified Chat — one design for customers, publishers, visitors & team
   ========================================================================== */
.zt-chat,
.zt-chat * { box-sizing: border-box; }

.zt-chat {
	--ztc-primary: #6455F7;
	--ztc-primary-dark: #4F46E5;
	--ztc-primary-soft: #EEF2FF;
	--ztc-bg: #ffffff;
	--ztc-surface: #F8FAFC;
	--ztc-border: #E2E8F0;
	--ztc-text: #0F172A;
	--ztc-muted: #64748B;
	--ztc-faint: #94A3B8;
	--ztc-ok: #22C55E;
	--ztc-warn: #F59E0B;
	--ztc-warn-bg: #FEF3C7;
	--ztc-danger: #EF4444;
	--ztc-radius: 16px;
	--ztc-shadow: 0 18px 50px rgba(15, 23, 42, .22);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ztc-text);
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 2147483000;
}
.zt-chat[hidden] { display: none !important; }

/* ---------- bubble ---------- */
.zt-chat__bubble {
	position: relative;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--ztc-primary), var(--ztc-primary-dark));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 12px 30px rgba(100, 85, 247, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .18s ease, box-shadow .18s ease;
}
.zt-chat__bubble:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(100, 85, 247, .5); }
.zt-chat__bubble svg { width: 26px; height: 26px; transition: opacity .15s, transform .15s; position: absolute; }
.zt-chat__bubble-x { opacity: 0; transform: rotate(-90deg) scale(.6); }
.zt-chat--open .zt-chat__bubble-ic { opacity: 0; transform: rotate(90deg) scale(.6); }
.zt-chat--open .zt-chat__bubble-x { opacity: 1; transform: none; }
.zt-chat--docked .zt-chat__bubble { display: none; }
.zt-chat__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--ztc-danger);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.zt-chat__badge[hidden] { display: none; }
.zt-chat__badge.is-waiting { background: var(--ztc-warn); color: #1f2937; }
@keyframes ztc-ring { 0% { box-shadow: 0 0 0 0 rgba(100,85,247,.55); } 100% { box-shadow: 0 0 0 18px rgba(100,85,247,0); } }
.zt-chat__bubble.is-pulse { animation: ztc-ring 1.4s ease-out 2; }

/* ---------- panel ---------- */
.zt-chat__panel {
	position: fixed;
	right: 22px;
	bottom: 92px;
	width: 390px;
	height: min(680px, calc(100vh - 116px));
	background: var(--ztc-bg);
	border-radius: var(--ztc-radius);
	box-shadow: var(--ztc-shadow);
	border: 1px solid var(--ztc-border);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(.98);
	transition: opacity .18s ease, transform .18s ease;
	pointer-events: none;
}
.zt-chat__panel[hidden] { display: none; }
.zt-chat--open .zt-chat__panel { opacity: 1; transform: none; pointer-events: auto; }
.zt-chat--team .zt-chat__panel { width: 820px; height: min(720px, calc(100vh - 116px)); }
.zt-chat--expanded .zt-chat__panel { right: 18px; bottom: 18px; top: 18px; left: 18px; width: auto; height: auto; }
.zt-chat--expanded .zt-chat__bubble { display: none; }

/* docked (Messages page) */
.zt-chat--docked { position: static; }
.zt-chat--docked .zt-chat__panel {
	position: relative;
	right: auto;
	bottom: auto;
	width: 100%;
	height: calc(100vh - 190px);
	min-height: 560px;
	opacity: 1;
	transform: none;
	pointer-events: auto;
	box-shadow: 0 6px 24px rgba(15, 23, 42, .07);
}
.zt-chat-page-wrap { width: 100%; }
#zt-chat-page { min-height: 400px; }
.zt-chat-page-loading { padding: 40px; text-align: center; color: #94A3B8; font-size: 13px; }

/* ---------- header ---------- */
.zt-chat__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: linear-gradient(135deg, var(--ztc-primary), var(--ztc-primary-dark));
	color: #fff;
	flex-shrink: 0;
}
.zt-chat__head-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255,255,255,.18);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	overflow: hidden;
	flex-shrink: 0;
}
.zt-chat__head-avatar img { width: 100%; height: 100%; object-fit: cover; }
.zt-chat__head-avatar svg { width: 20px; height: 20px; }
.zt-chat__head-text { flex: 1 1 auto; min-width: 0; }
.zt-chat__head-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zt-chat__head-sub { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.zt-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ztc-ok); display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.zt-chat__dot.is-off { background: #cbd5e1; }
.zt-chat__dot.is-wait { background: var(--ztc-warn); }
.zt-chat__head-actions { display: flex; gap: 4px; flex-shrink: 0; }
.zt-chat__ibtn {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 9px;
	background: rgba(255,255,255,.14);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}
.zt-chat__ibtn:hover { background: rgba(255,255,255,.26); }
.zt-chat__ibtn svg { width: 17px; height: 17px; }
.zt-chat__ibtn.is-dark { background: var(--ztc-surface); color: var(--ztc-muted); border: 1px solid var(--ztc-border); }
.zt-chat__ibtn.is-dark:hover { background: #eef2ff; color: var(--ztc-primary); }

/* ---------- banners ---------- */
.zt-chat__banner {
	padding: 9px 14px;
	font-size: 12px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	border-bottom: 1px solid var(--ztc-border);
}
.zt-chat__banner.is-wait { background: var(--ztc-warn-bg); color: #92400E; }
.zt-chat__banner.is-ok { background: #DCFCE7; color: #166534; }
.zt-chat__banner.is-muted { background: var(--ztc-surface); color: var(--ztc-muted); }
.zt-chat__banner.is-closed { background: #F1F5F9; color: #475569; }
.zt-chat__banner[hidden] { display: none; }
.zt-chat__spin { width: 14px; height: 14px; border: 2px solid rgba(146,64,14,.25); border-top-color: #92400E; border-radius: 50%; animation: ztc-spin .9s linear infinite; flex-shrink: 0; }
@keyframes ztc-spin { to { transform: rotate(360deg); } }

/* ---------- tabs (team) ---------- */
.zt-chat__tabs { display: flex; border-bottom: 1px solid var(--ztc-border); background: var(--ztc-bg); flex-shrink: 0; }
.zt-chat__tab {
	flex: 1 1 0;
	padding: 10px 6px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: var(--ztc-muted);
	font-weight: 600;
	font-size: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: color .15s, border-color .15s;
}
.zt-chat__tab:hover { color: var(--ztc-text); }
.zt-chat__tab.is-active { color: var(--ztc-primary); border-bottom-color: var(--ztc-primary); }
.zt-chat__pill {
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #E2E8F0;
	color: #475569;
	font-size: 10px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.zt-chat__pill.is-hot { background: var(--ztc-danger); color: #fff; }
.zt-chat__pill.is-warn { background: var(--ztc-warn); color: #1f2937; }
.zt-chat__pill[hidden] { display: none; }

/* ---------- body layouts ---------- */
.zt-chat__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.zt-chat__split { flex: 1 1 auto; min-height: 0; display: flex; }
.zt-chat__col-list { width: 300px; flex-shrink: 0; border-right: 1px solid var(--ztc-border); display: flex; flex-direction: column; min-height: 0; background: var(--ztc-bg); }
.zt-chat--expanded .zt-chat__col-list, .zt-chat--docked .zt-chat__col-list { width: 340px; }
.zt-chat__col-thread { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--ztc-surface); }

/* list tools */
.zt-chat__tools { padding: 10px 10px 6px; display: flex; gap: 6px; flex-shrink: 0; }
.zt-chat__search { flex: 1 1 auto; min-width: 0; height: 34px; border: 1px solid var(--ztc-border); border-radius: 9px; padding: 0 10px 0 32px; font-size: 12px; background: var(--ztc-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center / 15px; outline: none; color: var(--ztc-text); }
.zt-chat__search:focus { border-color: var(--ztc-primary); background-color: #fff; }
.zt-chat__chips { display: flex; gap: 5px; padding: 0 10px 8px; flex-wrap: wrap; flex-shrink: 0; }
.zt-chat__chip { border: 1px solid var(--ztc-border); background: #fff; color: var(--ztc-muted); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; cursor: pointer; }
.zt-chat__chip.is-active { background: var(--ztc-primary-soft); border-color: #c7d2fe; color: var(--ztc-primary); }

/* conversation list */
.zt-chat__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.zt-chat__item {
	display: flex;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid #F1F5F9;
	cursor: pointer;
	transition: background .12s;
	position: relative;
}
.zt-chat__item:hover { background: var(--ztc-surface); }
.zt-chat__item.is-active { background: var(--ztc-primary-soft); }
.zt-chat__item.is-waiting::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ztc-warn); }
.zt-chat__avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
	color: #312e81;
	font-weight: 700;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
	position: relative;
}
.zt-chat__avatar img { width: 100%; height: 100%; object-fit: cover; }
.zt-chat__avatar .zt-chat__dot { position: absolute; right: 0; bottom: 0; box-shadow: 0 0 0 2px #fff; }
.zt-chat__item-main { flex: 1 1 auto; min-width: 0; }
.zt-chat__item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.zt-chat__item-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zt-chat__item-time { font-size: 10px; color: var(--ztc-faint); flex-shrink: 0; }
.zt-chat__item-prev { font-size: 12px; color: var(--ztc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.zt-chat__item.has-unread .zt-chat__item-prev { color: var(--ztc-text); font-weight: 600; }
.zt-chat__item-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.zt-chat__tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #E2E8F0; color: #475569; text-transform: uppercase; letter-spacing: .3px; }
.zt-chat__tag.is-waiting { background: var(--ztc-warn-bg); color: #92400E; }
.zt-chat__tag.is-active { background: #DCFCE7; color: #166534; }
.zt-chat__tag.is-closed { background: #F1F5F9; color: #64748B; }
.zt-chat__tag.is-assigned { background: var(--ztc-primary-soft); color: var(--ztc-primary); text-transform: none; }
.zt-chat__empty { padding: 34px 16px; text-align: center; color: var(--ztc-faint); font-size: 12.5px; }
.zt-chat__more { display: block; width: calc(100% - 20px); margin: 8px 10px; padding: 8px; border: 1px dashed var(--ztc-border); background: #fff; color: var(--ztc-muted); border-radius: 9px; cursor: pointer; font-size: 12px; }

/* thread header (team) */
.zt-chat__thead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--ztc-border); flex-shrink: 0; }
.zt-chat__thead-text { flex: 1 1 auto; min-width: 0; }
.zt-chat__thead-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zt-chat__thead-name a { color: inherit; text-decoration: none; }
.zt-chat__thead-name a:hover { color: var(--ztc-primary); }
.zt-chat__thead-sub { font-size: 11px; color: var(--ztc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zt-chat__thead-actions { display: flex; gap: 5px; flex-shrink: 0; }
.zt-chat__btn {
	height: 30px;
	padding: 0 11px;
	border-radius: 8px;
	border: 1px solid var(--ztc-border);
	background: #fff;
	color: var(--ztc-text);
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.zt-chat__btn:hover { border-color: #c7d2fe; color: var(--ztc-primary); background: var(--ztc-primary-soft); }
.zt-chat__btn.is-primary { background: var(--ztc-primary); border-color: var(--ztc-primary); color: #fff; }
.zt-chat__btn.is-primary:hover { background: var(--ztc-primary-dark); }
.zt-chat__btn.is-danger:hover { border-color: #fecaca; color: var(--ztc-danger); background: #fef2f2; }
.zt-chat__btn svg { width: 14px; height: 14px; }
.zt-chat__btn[disabled] { opacity: .5; cursor: default; }
.zt-chat__back { display: none; }

/* order filter bar */
.zt-chat__orderbar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: #fff; border-bottom: 1px solid var(--ztc-border); flex-shrink: 0; }
.zt-chat__orderbar[hidden] { display: none; }
.zt-chat__orderbar label { font-size: 11px; color: var(--ztc-muted); font-weight: 600; white-space: nowrap; }
.zt-chat__select { flex: 1 1 auto; min-width: 0; height: 30px; border: 1px solid var(--ztc-border); border-radius: 8px; background: var(--ztc-surface); font-size: 12px; padding: 0 8px; color: var(--ztc-text); outline: none; }
.zt-chat__select:focus { border-color: var(--ztc-primary); }
.zt-chat__orderlink { font-size: 11px; color: var(--ztc-primary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.zt-chat__orderlink:hover { text-decoration: underline; }

/* ---------- messages ---------- */
.zt-chat__msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 6px; background: var(--ztc-surface); }
.zt-chat__day { align-self: center; font-size: 10.5px; color: var(--ztc-faint); background: #fff; border: 1px solid var(--ztc-border); border-radius: 999px; padding: 2px 10px; margin: 8px 0 4px; font-weight: 600; }
.zt-chat__row { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.zt-chat__row.is-me { align-self: flex-end; align-items: flex-end; }
.zt-chat__row.is-sys { align-self: center; align-items: center; max-width: 92%; }
.zt-chat__row + .zt-chat__row.is-cont { margin-top: -2px; }
.zt-chat__who { font-size: 10.5px; color: var(--ztc-muted); font-weight: 600; margin: 4px 6px 2px; }
.zt-chat__bub {
	background: #fff;
	border: 1px solid var(--ztc-border);
	color: var(--ztc-text);
	border-radius: 14px;
	border-top-left-radius: 5px;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.55;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
	box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.zt-chat__row.is-me .zt-chat__bub { background: var(--ztc-primary); border-color: var(--ztc-primary); color: #fff; border-radius: 14px; border-top-right-radius: 5px; }
.zt-chat__row.is-sys .zt-chat__bub { background: #F1F5F9; border-color: #E2E8F0; color: #475569; font-size: 12px; border-radius: 10px; text-align: center; }
.zt-chat__bub a { color: inherit; text-decoration: underline; }
.zt-chat__ochip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 10.5px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--ztc-primary-soft);
	color: var(--ztc-primary);
	text-decoration: none !important;
	margin-bottom: 5px;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.zt-chat__row.is-me .zt-chat__ochip { background: rgba(255,255,255,.2); color: #fff; }
.zt-chat__ochip svg { width: 11px; height: 11px; flex-shrink: 0; }
.zt-chat__att { display: block; margin-top: 6px; }
.zt-chat__att img { max-width: 240px; max-height: 200px; border-radius: 10px; display: block; border: 1px solid rgba(0,0,0,.08); }
.zt-chat__file { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px; background: rgba(15,23,42,.06); text-decoration: none !important; font-size: 12px; font-weight: 600; color: inherit; }
.zt-chat__row.is-me .zt-chat__file { background: rgba(255,255,255,.18); }
.zt-chat__file svg { width: 14px; height: 14px; flex-shrink: 0; }
.zt-chat__meta { font-size: 10px; color: var(--ztc-faint); margin: 3px 6px 0; display: flex; align-items: center; gap: 4px; }
.zt-chat__ticks { font-size: 11px; letter-spacing: -2px; color: var(--ztc-faint); }
.zt-chat__ticks.is-seen { color: var(--ztc-primary); }
.zt-chat__row.is-pending .zt-chat__bub { opacity: .7; }
.zt-chat__row.is-failed .zt-chat__bub { border-color: var(--ztc-danger); }
.zt-chat__hint { text-align: center; color: var(--ztc-faint); font-size: 12px; padding: 26px 10px; margin: auto; }

/* ---------- composer ---------- */
.zt-chat__composer { border-top: 1px solid var(--ztc-border); background: #fff; padding: 8px 10px 10px; flex-shrink: 0; }
.zt-chat__composer[hidden] { display: none; }
.zt-chat__ctx { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; color: var(--ztc-muted); flex-wrap: wrap; }
.zt-chat__ctx[hidden] { display: none; }
.zt-chat__ctx-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ztc-primary-soft); color: var(--ztc-primary); border-radius: 999px; padding: 2px 8px 2px 10px; font-weight: 700; }
.zt-chat__ctx-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.zt-chat__file-chip { display: inline-flex; align-items: center; gap: 6px; background: #F1F5F9; color: #475569; border-radius: 999px; padding: 2px 8px 2px 10px; font-weight: 600; max-width: 220px; }
.zt-chat__file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zt-chat__file-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.zt-chat__input-row { display: flex; align-items: flex-end; gap: 6px; }
.zt-chat__ta {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 40px;
	max-height: 140px;
	resize: none;
	border: 1px solid var(--ztc-border);
	border-radius: 12px;
	padding: 9px 12px;
	font: inherit;
	font-size: 13px;
	line-height: 1.45;
	color: var(--ztc-text);
	background: var(--ztc-surface);
	outline: none;
	overflow-y: auto;
}
.zt-chat__ta:focus { border-color: var(--ztc-primary); background: #fff; }
.zt-chat__send {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 12px;
	background: var(--ztc-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background .15s, transform .1s;
}
.zt-chat__send:hover { background: var(--ztc-primary-dark); }
.zt-chat__send:active { transform: scale(.96); }
.zt-chat__send[disabled] { opacity: .45; cursor: default; }
.zt-chat__send svg { width: 18px; height: 18px; }
.zt-chat__tool { width: 36px; height: 40px; border: 0; background: transparent; color: var(--ztc-faint); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 10px; flex-shrink: 0; }
.zt-chat__tool:hover { color: var(--ztc-primary); background: var(--ztc-primary-soft); }
.zt-chat__tool svg { width: 19px; height: 19px; }
.zt-chat__tool.is-on { color: var(--ztc-primary); }
.zt-chat__composer input[type=file] { display: none; }
.zt-chat__menu { position: relative; }
.zt-chat__pop {
	position: absolute;
	bottom: 44px;
	left: 0;
	width: 300px;
	max-height: 260px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--ztc-border);
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(15,23,42,.16);
	z-index: 5;
	padding: 6px;
}
.zt-chat__pop[hidden] { display: none; }
.zt-chat__pop-title { font-size: 10.5px; font-weight: 700; color: var(--ztc-faint); text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px 4px; }
.zt-chat__pop-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--ztc-text); }
.zt-chat__pop-item:hover { background: var(--ztc-surface); }
.zt-chat__pop-item.is-active { background: var(--ztc-primary-soft); color: var(--ztc-primary); }
.zt-chat__pop-item small { color: var(--ztc-faint); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zt-chat__pop-item b { font-weight: 700; white-space: nowrap; }
.zt-chat__pop-item .zt-chat__tag { margin-left: auto; }
.zt-chat__error { color: var(--ztc-danger); font-size: 11.5px; padding: 4px 2px 0; }
.zt-chat__error:empty { display: none; }

/* ---------- visitor start form ---------- */
.zt-chat__start { padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.zt-chat__start h4 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.zt-chat__start p { margin: 0 0 6px; color: var(--ztc-muted); font-size: 12.5px; }
.zt-chat__field { height: 40px; border: 1px solid var(--ztc-border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 13px; background: var(--ztc-surface); outline: none; color: var(--ztc-text); }
.zt-chat__field:focus { border-color: var(--ztc-primary); background: #fff; }
textarea.zt-chat__field { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.zt-chat__start .zt-chat__btn.is-primary { height: 42px; justify-content: center; font-size: 13px; border-radius: 10px; }

/* ---------- new chat (team) ---------- */
.zt-chat__newchat { padding: 10px; border-bottom: 1px solid var(--ztc-border); background: #fff; }
.zt-chat__newchat[hidden] { display: none; }
.zt-chat__results { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.zt-chat__result { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.zt-chat__result:hover { background: var(--ztc-surface); }
.zt-chat__result .zt-chat__avatar { width: 30px; height: 30px; font-size: 12px; }
.zt-chat__result-name { font-size: 12.5px; font-weight: 600; }
.zt-chat__result-mail { font-size: 11px; color: var(--ztc-faint); }

/* ---------- toast ---------- */
.zt-chat__toast { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); background: #0F172A; color: #fff; font-size: 12px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 8px 20px rgba(0,0,0,.25); z-index: 6; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; }
.zt-chat__toast.is-on { opacity: 1; }
.zt-chat__jump { position: absolute; left: 50%; bottom: 82px; transform: translateX(-50%); background: var(--ztc-primary); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 0; cursor: pointer; box-shadow: 0 8px 20px rgba(100,85,247,.4); z-index: 6; }
.zt-chat__jump[hidden] { display: none; }
.zt-chat__col-thread, .zt-chat__body { position: relative; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
	.zt-chat--team .zt-chat__panel { width: calc(100vw - 44px); }
	.zt-chat__split { position: relative; }
	.zt-chat__col-list { width: 100%; border-right: 0; }
	.zt-chat__col-thread { position: absolute; inset: 0; background: var(--ztc-surface); transform: translateX(100%); transition: transform .2s ease; z-index: 2; }
	.zt-chat__split.is-thread .zt-chat__col-thread { transform: none; }
	.zt-chat__back { display: inline-flex; }
}
@media (max-width: 640px) {
	.zt-chat { right: 14px; bottom: 14px; }
	.zt-chat__panel, .zt-chat--team .zt-chat__panel, .zt-chat--expanded .zt-chat__panel {
		position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0;
	}
	.zt-chat--docked .zt-chat__panel { position: relative; inset: auto; height: calc(100vh - 140px); min-height: 480px; border-radius: 12px; }
	.zt-chat--open .zt-chat__bubble { display: none; }
	.zt-chat__row { max-width: 90%; }
	body.zt-chat-lock { overflow: hidden; }
}
