/* Clientager admin screens. Self-contained (no WordPress button/form styles) and scoped to .clientager-wrap. */

/* Other plugins' notices are removed server-side on these screens; this catches ones injected by script. */
#wpbody-content > .notice,
#wpbody-content > .updated,
#wpbody-content > .error,
#wpbody-content > .update-nag,
.clientager-wrap .notice,
.clientager-wrap .updated,
.clientager-wrap .update-nag { display: none !important; }

.clientager-wrap {
	--cg-brand: #2f54eb;
	--cg-brand-600: #2443c9;
	--cg-brand-50: #eef2ff;
	--cg-ink: #0f172a;
	--cg-ink-2: #334155;
	--cg-muted: #64748b;
	--cg-faint: #94a3b8;
	--cg-line: #e6e8ef;
	--cg-bg: #f6f7fb;
	--cg-ok: #0f9d58;
	--cg-ok-50: #e7f6ee;
	--cg-warn: #b45309;
	--cg-warn-50: #fff4e5;
	--cg-bad: #c62828;
	--cg-bad-50: #fdecec;
	--cg-radius: 14px;
	--cg-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
	margin: 16px 20px 0 2px;
	max-width: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--cg-ink);
	font-size: 14px;
	line-height: 1.5;
}
.clientager-wrap *,
.clientager-wrap *::before,
.clientager-wrap *::after { box-sizing: border-box; }
.clientager-wrap [hidden] { display: none !important; }
.clientager-wrap a { color: var(--cg-brand); }
.clientager-wrap a:focus { box-shadow: none; outline: none; }
.clientager-wrap a:focus-visible,
.clientager-wrap button:focus-visible,
.clientager-wrap input:focus-visible { outline: 3px solid rgba(47, 84, 235, 0.35); outline-offset: 2px; }
.clientager-wrap .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.clientager-app {
	background: var(--cg-bg);
	border: 1px solid var(--cg-line);
	border-radius: 18px;
	overflow: hidden;
}
.cg-icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

/* ---------- App bar ---------- */
.cg-appbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--cg-line);
}
.cg-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cg-brand .cg-logo { width: 40px; height: 40px; }
.clientager-wrap .cg-title { margin: 0; padding: 0; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--cg-ink); letter-spacing: -0.01em; }
.cg-business { display: block; color: var(--cg-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cg-pill {
	display: inline-flex; align-items: center; gap: 8px; flex: none;
	padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
	background: #f1f5f9; color: var(--cg-ink-2); border: 1px solid var(--cg-line);
}
.cg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cg-faint); display: inline-block; }
.cg-pill.is-live { background: var(--cg-ok-50); color: #0b6b3c; border-color: #bfe6d0; }
.cg-pill.is-live .cg-dot { background: var(--cg-ok); box-shadow: 0 0 0 3px rgba(15, 157, 88, 0.18); animation: cg-pulse 2s infinite; }
.cg-pill.is-ready { background: var(--cg-brand-50); color: var(--cg-brand-600); border-color: #d6defd; }
.cg-pill.is-ready .cg-dot { background: var(--cg-brand); }
.cg-pill.is-preview { background: var(--cg-warn-50); color: var(--cg-warn); border-color: #fbdcb3; }
.cg-pill.is-preview .cg-dot { background: #f59e0b; }

/* ---------- Tabs ---------- */
.cg-tabs { display: flex; gap: 6px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--cg-line); overflow-x: auto; }
.clientager-wrap .cg-tab {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
	color: var(--cg-ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}
.clientager-wrap .cg-tab .cg-icon { width: 17px; height: 17px; color: var(--cg-muted); }
.clientager-wrap .cg-tab:hover { background: #f1f5f9; color: var(--cg-ink); }
.clientager-wrap .cg-tab.is-active { background: var(--cg-brand); color: #fff; box-shadow: 0 4px 12px rgba(47, 84, 235, 0.25); }
.clientager-wrap .cg-tab.is-active .cg-icon { color: #fff; }

/* ---------- Layout ---------- */
.cg-body { padding: 24px; display: grid; gap: 20px; }
.cg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
/* Cards of different heights flow down two columns without gaps (Settings tab). */
.cg-grid.is-flow { display: block; column-count: 2; column-gap: 20px; }
.cg-grid.is-flow > .cg-card { break-inside: avoid; margin-bottom: 20px; }
.cg-card {
	background: #fff; border: 1px solid var(--cg-line); border-radius: var(--cg-radius);
	box-shadow: var(--cg-shadow); padding: 24px; min-width: 0;
}
.cg-card.cg-flush { padding: 0; overflow: hidden; }
.cg-pad { padding: 24px 24px 8px; }
.cg-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.cg-card-icon {
	width: 40px; height: 40px; border-radius: 11px; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--cg-brand-50); color: var(--cg-brand);
}
.cg-card-icon .cg-icon { width: 20px; height: 20px; }
.clientager-wrap .cg-h2 { margin: 2px 0 0; padding: 0; font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--cg-ink); }
.clientager-wrap .cg-sub { margin: 4px 0 0; color: var(--cg-muted); font-size: 13.5px; }
.clientager-wrap .cg-help { margin: 12px 0 0; color: var(--cg-muted); font-size: 12.5px; }
.cg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- Buttons & inputs ---------- */
.clientager-wrap .cg-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
	font: inherit; font-weight: 600; font-size: 14px; line-height: 1; text-decoration: none; cursor: pointer;
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s; white-space: nowrap;
}
.clientager-wrap .cg-btn:active { transform: translateY(1px); }
.clientager-wrap .cg-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.clientager-wrap .cg-btn-primary { background: var(--cg-brand); color: #fff; box-shadow: 0 1px 2px rgba(47, 84, 235, 0.3); }
.clientager-wrap .cg-btn-primary:hover:not(:disabled) { background: var(--cg-brand-600); color: #fff; }
.clientager-wrap .cg-btn-secondary { background: #fff; color: var(--cg-ink); border-color: #d5d9e4; }
.clientager-wrap .cg-btn-secondary:hover:not(:disabled) { border-color: var(--cg-brand); color: var(--cg-brand); }
.clientager-wrap .cg-btn-ghost { background: transparent; color: var(--cg-ink-2); }
.clientager-wrap .cg-btn-ghost:hover { background: #f1f5f9; color: var(--cg-ink); }
.clientager-wrap .cg-btn-danger { background: #fff; color: var(--cg-bad); border-color: #f2b8b8; }
.clientager-wrap .cg-btn-danger:hover:not(:disabled) { background: var(--cg-bad-50); }

.clientager-wrap .cg-input {
	height: 42px; width: 100%; padding: 0 14px; margin: 0;
	border: 1px solid #d5d9e4; border-radius: 10px; background: #fff; color: var(--cg-ink);
	font: inherit; font-size: 14px; box-shadow: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.clientager-wrap .cg-input:focus { border-color: var(--cg-brand); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.15); outline: none; }
.clientager-wrap .cg-input:disabled { background: #f8fafc; color: var(--cg-faint); }
.clientager-wrap .cg-code { letter-spacing: 0.4em; font-size: 18px; font-weight: 600; max-width: 220px; }
.cg-label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--cg-ink); }
.cg-inline { display: flex; gap: 10px; }
.cg-form { margin-top: 22px; }

/* Feedback inside cards */
.clientager-msg:empty { display: none; }
.clientager-msg { margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; background: #f1f5f9; color: var(--cg-ink-2); }
.clientager-msg.is-success { background: var(--cg-ok-50); color: #0b6b3c; }
.clientager-msg.is-error { background: var(--cg-bad-50); color: #9b1c1c; }
.clientager-msg.is-info { background: var(--cg-brand-50); color: var(--cg-brand-600); }
.clientager-msg .cg-btn { margin-left: 8px; height: 34px; }
.cg-alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; border: 1px solid; }
.cg-alert.is-info { background: var(--cg-brand-50); border-color: #d6defd; color: var(--cg-brand-600); }
.cg-alert.is-warning { background: var(--cg-warn-50); border-color: #fbdcb3; color: var(--cg-warn); }
.cg-alert.is-error { background: var(--cg-bad-50); border-color: #f2b8b8; color: #9b1c1c; }
.cg-alert.is-success { background: var(--cg-ok-50); border-color: #bfe6d0; color: #0b6b3c; }

/* ---------- Connect hero ---------- */
.cg-card.cg-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; padding: 36px; }
.cg-eyebrow {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
	background: var(--cg-brand-50); color: var(--cg-brand-600); font-size: 12.5px; font-weight: 600;
}
.cg-eyebrow .cg-icon { width: 15px; height: 15px; }
.clientager-wrap .cg-hero-title { margin: 14px 0 0; padding: 0; font-size: 27px; line-height: 1.2; font-weight: 750; letter-spacing: -0.02em; color: var(--cg-ink); }
.clientager-wrap .cg-lead { margin: 10px 0 0; color: var(--cg-muted); font-size: 15px; max-width: 52ch; }
.clientager-wrap .cg-steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.clientager-wrap .cg-steps li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.cg-step-n {
	width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
	background: var(--cg-brand); color: #fff; font-weight: 700; font-size: 13px;
}
.cg-steps li > div strong { display: block; font-size: 14px; }
.cg-steps li > div span { color: var(--cg-muted); font-size: 13px; }
.clientager-wrap .cg-legal { margin: 18px 0 0; color: var(--cg-faint); font-size: 12px; }

.cg-hero-art {
	position: relative; border-radius: 16px; padding: 28px 26px;
	background: radial-gradient(120% 90% at 100% 0%, #dfe6ff 0%, #eef2ff 45%, #f7f8ff 100%);
	display: flex; align-items: center; justify-content: center; min-height: 360px;
}
.cg-mock { width: 100%; max-width: 330px; background: #fff; border-radius: 14px; box-shadow: 0 18px 40px rgba(30, 41, 99, 0.16); overflow: hidden; border: 1px solid #e3e8fb; }
.cg-mock-bar { display: flex; align-items: center; gap: 5px; padding: 9px 12px; background: #f6f7fb; border-bottom: 1px solid var(--cg-line); }
.cg-mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: #d7dbe6; }
.cg-mock-bar span { margin-left: 8px; font-size: 11px; color: var(--cg-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-mock-chat { padding: 14px; display: grid; gap: 9px; }
.cg-mock-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f7; }
.cg-mock-head .cg-mock-logo { width: 30px; height: 30px; }
.cg-mock-head strong { display: block; font-size: 12.5px; }
.cg-mock-head span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--cg-muted); }
.cg-mock-head .cg-dot { width: 6px; height: 6px; background: var(--cg-ok); }
.cg-mock-msg { max-width: 82%; padding: 8px 11px; border-radius: 12px; font-size: 12.5px; line-height: 1.4; }
.cg-mock-msg.is-visitor { justify-self: end; background: var(--cg-brand); color: #fff; border-bottom-right-radius: 4px; }
.cg-mock-msg.is-ai { justify-self: start; background: #f1f4f9; color: var(--cg-ink); border-bottom-left-radius: 4px; }
.cg-mock-typing { display: inline-flex; gap: 4px; padding: 10px 12px; background: #f1f4f9; border-radius: 12px; border-bottom-left-radius: 4px; justify-self: start; }
.cg-mock-typing i, .cg-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9aa3b5; animation: cg-bounce 1.2s infinite; }
.cg-mock-typing i:nth-child(2), .cg-dots i:nth-child(2) { animation-delay: 0.15s; }
.cg-mock-typing i:nth-child(3), .cg-dots i:nth-child(3) { animation-delay: 0.3s; }
.cg-float {
	position: absolute; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px;
	background: #fff; box-shadow: 0 10px 24px rgba(30, 41, 99, 0.14); font-size: 12px; font-weight: 600; color: var(--cg-ink);
}
.cg-float .cg-icon { width: 16px; height: 16px; color: var(--cg-ok); }
.cg-float-a { top: 18px; right: 16px; }
.cg-float-b { bottom: 18px; left: 16px; }
.cg-float-b .cg-icon { color: var(--cg-brand); }

/* ---------- Stepper ---------- */
.cg-card.cg-stepper-card { padding: 22px 24px; }
.clientager-wrap .cg-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.clientager-wrap .cg-stepper li { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.cg-stepper li:not(:last-child)::after {
	content: ""; position: absolute; top: 16px; left: 44px; right: 8px; height: 2px; background: var(--cg-line); border-radius: 2px;
}
.cg-stepper li.is-done:not(:last-child)::after { background: var(--cg-ok); }
.cg-stepper-dot {
	position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; flex: none;
	display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
	background: #fff; border: 2px solid var(--cg-line); color: var(--cg-muted);
}
.cg-stepper-dot .cg-icon { width: 16px; height: 16px; }
.cg-stepper li.is-done .cg-stepper-dot { background: var(--cg-ok); border-color: var(--cg-ok); color: #fff; }
.cg-stepper li.is-current .cg-stepper-dot { border-color: var(--cg-brand); color: var(--cg-brand); box-shadow: 0 0 0 4px var(--cg-brand-50); }
.cg-stepper li > div { min-width: 0; }
.cg-stepper li > div strong { display: block; font-size: 13.5px; }
.cg-stepper li > div span { display: block; color: var(--cg-muted); font-size: 12.5px; }
.cg-stepper li.is-current > div strong { color: var(--cg-brand-600); }

/* ---------- Plan stats ---------- */
.cg-stats { display: grid; border: 1px solid var(--cg-line); border-radius: 12px; overflow: hidden; }
.cg-stat { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 13.5px; }
.cg-stat + .cg-stat { border-top: 1px solid var(--cg-line); }
.cg-stat span { color: var(--cg-muted); }
.cg-stat strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.cg-usage { margin-top: 16px; }
.cg-usage-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--cg-muted); margin-bottom: 6px; }
.cg-usage-top strong { color: var(--cg-ink); }
.cg-meter { display: block; height: 7px; border-radius: 999px; background: #e9edf5; overflow: hidden; }
.cg-meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cg-brand), #6b87ff); transition: width 0.3s; }
.cg-usage + .cg-usage { margin-top: 12px; }
.cg-usage.is-near .cg-meter > span { background: #f59e0b; }
.cg-usage.is-near .cg-usage-top strong { color: var(--cg-warn); }
.cg-usage.is-full .cg-meter > span { background: var(--cg-bad); }
.cg-usage.is-full .cg-usage-top strong { color: var(--cg-bad); }

/* ---------- Upsell & danger ---------- */
.cg-card.cg-upsell { display: flex; align-items: center; gap: 20px; background: linear-gradient(120deg, #ffffff 0%, #f3f6ff 100%); }
.cg-upsell-icons { display: flex; flex: none; }
.cg-upsell-icons span {
	width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(30, 41, 99, 0.12); color: var(--cg-brand);
}
.cg-upsell-icons span + span { margin-left: -10px; }
.cg-upsell-icons span:nth-child(2) { color: #128c4b; }
.cg-upsell-icons span:nth-child(3) { color: #e8590c; }
.cg-upsell-text { flex: 1; min-width: 0; }
.cg-card.cg-danger { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: #f4c7c7; }
.cg-danger-text { min-width: 0; }

/* ---------- Chat ---------- */
.cg-card.cg-chat-card { padding: 0; overflow: hidden; }
.cg-chat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.cg-chat-top .cg-card-head { margin-bottom: 0; }
.cg-chat-card > .cg-alert { margin: 16px 24px 0; }
.cg-counter { flex: none; width: 230px; padding: 10px 12px; border: 1px solid var(--cg-line); border-radius: 12px; background: #fafbfe; }
.cg-counter-text { display: block; font-size: 12.5px; font-weight: 600; color: var(--cg-ink-2); margin-bottom: 7px; }
.cg-chat {
	margin: 18px 24px 0; height: 420px; overflow-y: auto; padding: 18px; border-radius: 14px;
	background: #f8f9fc; border: 1px solid var(--cg-line); display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
}
.cg-chat.is-readonly { height: auto; max-height: 620px; margin-bottom: 24px; }
.cg-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.cg-avatar {
	width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 700; background: var(--cg-brand); color: #fff;
}
.cg-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cg-bubble time { display: block; margin-top: 4px; font-size: 11px; opacity: 0.7; }
.cg-msg.is-agent .cg-bubble, .cg-msg.is-staff .cg-bubble { background: #fff; border: 1px solid var(--cg-line); color: var(--cg-ink); border-bottom-left-radius: 5px; }
.cg-msg.is-customer { align-self: flex-end; flex-direction: row-reverse; }
.cg-msg.is-customer .cg-avatar { background: #e2e8f0; color: var(--cg-ink-2); }
.cg-msg.is-customer .cg-bubble { background: var(--cg-brand); color: #fff; border-bottom-right-radius: 5px; }
.cg-chat.is-readonly .cg-msg.is-customer { align-self: flex-start; flex-direction: row; }
.cg-chat.is-readonly .cg-msg.is-customer .cg-bubble { background: #fff; color: var(--cg-ink); border: 1px solid var(--cg-line); border-radius: 16px; border-bottom-left-radius: 5px; }
.cg-chat.is-readonly .cg-msg.is-agent, .cg-chat.is-readonly .cg-msg.is-staff { align-self: flex-end; flex-direction: row-reverse; }
.cg-chat.is-readonly .cg-msg.is-agent .cg-bubble, .cg-chat.is-readonly .cg-msg.is-staff .cg-bubble { background: var(--cg-brand-50); border-color: #d6defd; border-radius: 16px; border-bottom-right-radius: 5px; }
.cg-msg.is-staff .cg-avatar { background: var(--cg-ink-2); }
.cg-msg.is-notice { align-self: center; max-width: 90%; }
.cg-msg.is-notice .cg-bubble { background: var(--cg-warn-50); color: var(--cg-warn); border: 1px solid #fbdcb3; font-size: 13px; }
.cg-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.cg-composer { display: flex; gap: 10px; padding: 14px 24px 0; position: sticky; bottom: 0; background: #fff; }
.clientager-wrap .cg-send { width: 46px; padding: 0; height: 42px; flex: none; }
.cg-send .cg-icon { width: 18px; height: 18px; }
.cg-locked {
	display: flex; align-items: center; gap: 14px; margin: 16px 24px 0; padding: 16px 18px; border-radius: 14px;
	background: linear-gradient(120deg, #eef2ff, #f7f8ff); border: 1px solid #d6defd;
}
.cg-locked-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--cg-brand); box-shadow: var(--cg-shadow); }
.cg-locked > div { flex: 1; min-width: 0; }
.cg-locked strong { display: block; }
.cg-locked span { color: var(--cg-muted); font-size: 13px; }
.cg-chat-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 24px 22px; color: var(--cg-muted); font-size: 13px; }
.cg-chat-card > .cg-locked:last-child,
.cg-chat-card > .cg-composer:last-child { margin-bottom: 24px; padding-bottom: 0; }
.cg-chat-card > .clientager-msg { margin: 0 24px 22px; }

/* ---------- The chat window: inline on Preview, a floating bubble on Chat widget ---------- */
.cg-grow { flex: 1; }
.cg-stage { --cw: #0a0a0a; }
.cg-stage[hidden] { display: none !important; }
.cg-stage.is-inline { display: flex; justify-content: center; margin: 18px 24px 0; padding: 28px 16px; border-radius: 14px; background: var(--cg-bg); border: 1px solid var(--cg-line); }
.cg-stage.is-inline .cg-wpanel { width: 380px; max-width: 100%; height: 560px; animation: none; }

/* Fixed to the bottom corner of the admin screen, like the chat on the website. Clears the admin menu on the left. */
.cg-stage.is-floating {
	position: fixed; bottom: var(--cy, 24px); right: var(--cx, 24px); z-index: 99990; display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
	pointer-events: none;
}
.cg-stage.is-floating > * { pointer-events: auto; }
/* The distances from the edges (--cx, --cy) start after the admin menu on the left. */
.cg-stage.is-floating.is-left { right: auto; left: calc(160px + var(--cx, 24px)); align-items: flex-start; }
.folded .cg-stage.is-floating.is-left { left: calc(36px + var(--cx, 24px)); }
.cg-stage.is-floating .cg-wpanel { width: 370px; height: min(560px, calc(100vh - 32px - var(--cy, 24px) - 56px - 14px - 24px)); min-height: 320px; }

/* The chat window and button, drawn like the website chat (src/lib/widget-script.ts on the server). */
.clientager-wrap .cg-wlaunch {
	width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0; margin: 0;
	background: var(--cw); color: #fff; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	display: flex; align-items: center; justify-content: center; transition: transform 0.15s;
}
.clientager-wrap .cg-wlaunch:hover { transform: scale(1.05); }
.clientager-wrap .cg-wlaunch:focus-visible { outline: 3px solid var(--cg-brand); outline-offset: 3px; }
.cg-wlaunch svg { width: 26px; height: 26px; }
.cg-wpanel {
	position: relative; background: #fff; color: #111; border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
	display: flex; flex-direction: column; overflow: hidden; animation: cg-pop 0.2s ease-out;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.cg-wpanel[hidden] { display: none; }
.cg-whead { background: var(--cw); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 600; flex: none; }
.cg-whead span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clientager-wrap .cg-wclose { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.clientager-wrap .cg-wlist { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f7f8; }
.cg-wlist .cg-msg { max-width: 82%; gap: 0; }
.cg-wlist .cg-avatar { display: none; }
.cg-wlist .cg-bubble { padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.cg-wlist .cg-msg.is-agent .cg-bubble { background: #fff; border: 1px solid #e5e7eb; color: #111; border-radius: 14px; }
.cg-wlist .cg-msg.is-customer .cg-bubble { background: var(--cw); color: #fff; border-radius: 14px; }
.cg-wlist .cg-msg.is-notice { align-self: center; }
.cg-wlist .cg-msg.is-notice .cg-bubble { background: none; border: 0; color: #6b7280; font-size: 12px; text-align: center; padding: 2px 6px; }
.cg-qq { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; max-width: 92%; }
.clientager-wrap .cg-qq button {
	border: 1px solid var(--cw); background: #fff; color: #111; border-radius: 999px; padding: 7px 12px; margin: 0;
	font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; text-align: start;
}
.clientager-wrap .cg-qq button:hover:not(:disabled) { background: #f3f4f6; }
.clientager-wrap .cg-qq button:disabled { opacity: 0.5; cursor: not-allowed; }
.cg-wform { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; background: #fff; flex: none; }
.clientager-wrap .cg-wform input, .cg-wform .cg-winput {
	flex: 1; min-width: 0; height: 42px; border: 1px solid #d1d5db; border-radius: 10px; padding: 0 12px; margin: 0;
	font-size: 15px; background: #fff; color: #111; box-shadow: none; display: flex; align-items: center;
}
.cg-wform .cg-winput { color: #9ca3af; font-size: 14px; }
.clientager-wrap .cg-wform input:focus { border-color: var(--cw); box-shadow: none; outline: none; }
.clientager-wrap .cg-wform button, .cg-wbtn {
	border: 0; border-radius: 10px; background: var(--cw); color: #fff; padding: 0 14px; font: inherit; font-size: 14px; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
}
.clientager-wrap .cg-wform button:disabled { opacity: 0.5; cursor: not-allowed; }
.cg-wfoot { text-align: center; font-size: 11px; color: #9ca3af; padding: 4px 0 8px; background: #fff; flex: none; }
.cg-who { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; background: #fff; }
.clientager-wrap .cg-who p { margin: 0 0 4px; font-size: 14px; color: #374151; line-height: 1.4; }
.cg-who label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #374151; }
.cg-who label small { font-weight: 400; color: #9ca3af; }
.cg-who .cg-winput { height: 40px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; }
.clientager-wrap .cg-who .cg-wbtn { padding: 12px 14px; margin-top: 4px; font-size: 15px; }
.cg-who-note { font-size: 11.5px; color: #9ca3af; text-align: center; }

/* ---------- Chat widget settings ---------- */
.cg-wsettings-wrap { max-width: none; padding-bottom: 110px; } /* room so the floating preview bubble never covers the save bar */
.cg-preview-row { margin-bottom: 22px; background: #fafbfe; }
.cg-wsettings { display: block; }
/* One section per topic: heading and explanation on the left, its settings on the right (stacked on small screens). */
.cg-wsec { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 18px 48px; padding: 30px 0; border-top: 1px solid var(--cg-line); }
.cg-wsec:first-child { border-top: 0; padding-top: 6px; }
.cg-wsec-head h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; color: var(--cg-ink); }
.cg-wsec-head p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--cg-muted); }
.cg-wsec-body { display: grid; gap: 26px; min-width: 0; }
.cg-wsec-body .cg-field { margin: 0; }
.cg-wsave { position: sticky; bottom: 0; z-index: 2; display: grid; gap: 8px; margin: 0 -24px -24px; padding: 16px 24px; background: #fff; border-top: 1px solid var(--cg-line); border-radius: 0 0 var(--cg-radius, 16px) var(--cg-radius, 16px); }
@media (max-width: 900px) { .cg-wsec { grid-template-columns: 1fr; gap: 14px; padding: 24px 0; } }
.clientager-wrap .cg-wsettings fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.clientager-wrap .cg-wsettings legend { padding: 0; }
.cg-wsettings .cg-help { margin-top: 6px; }
.cg-wsettings .cg-help-top { margin: 0 0 10px; }
.cg-wsettings .cg-actions { margin-top: 0; }
.clientager-wrap textarea.cg-input { height: auto; padding: 10px 14px; line-height: 1.45; resize: vertical; min-height: 64px; }
.clientager-wrap select.cg-input { padding-right: 28px; max-width: none; }
.cg-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: #f1f5f9; border: 1px solid var(--cg-line); }
.cg-seg label { position: relative; cursor: pointer; }
.cg-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cg-offsets .cg-seg { margin-bottom: 12px; }
.cg-stat .cg-addon { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
.cg-stat .cg-addon strong { color: var(--cg-ink); font-weight: 600; }
.cg-stat .cg-addon small { color: var(--cg-muted); font-size: 12px; }
.cg-cards { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 4px; }
.cg-pcard { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 6px 8px 6px 6px; }
.cg-pcard img { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.cg-pcard-b { flex: 1; min-width: 0; font-size: 13px; }
.cg-pcard-b a { display: block; font-weight: 600; color: #111; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cg-pcard-b a:hover { text-decoration: underline; }
.cg-pcard-b span { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
.cg-pcard-a { flex: 0 0 auto; }
.cg-pcard-a button { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 6px 12px; border: 1px solid var(--cw); background: var(--cw); color: #fff; white-space: nowrap; cursor: pointer; font-family: inherit; }
.cg-pcard-a button:disabled { opacity: 0.7; cursor: default; }
.cg-checks { display: flex; flex-direction: column; gap: 10px; }
.cg-apps-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--cg-line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cg-apps-note p { margin: 0; font-size: 13px; color: var(--cg-ink-2); flex: 1 1 240px; }
/* Chat button icon tiles. */
.cg-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.cg-icons label { position: relative; cursor: pointer; }
.cg-icons input { position: absolute; opacity: 0; pointer-events: none; }
.cg-icons label > span { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--cg-line); background: #fff; color: var(--cg-ink); font-size: 13px; font-weight: 600; transition: border-color 0.15s, box-shadow 0.15s; }
.cg-icons label:hover > span { border-color: #cbd5e1; }
.cg-icons input:checked + span { border-color: var(--cg-brand); box-shadow: 0 0 0 3px var(--cg-brand-50); color: var(--cg-brand); }
.cg-icons input:focus-visible + span { outline: 2px solid var(--cg-brand); outline-offset: 2px; }
.cg-icon-own { margin-top: 12px; }
.cg-icon-own[hidden] { display: none; }
.cg-inline-row { display: flex; gap: 8px; }
.cg-inline-row .cg-input { flex: 1; min-width: 0; }
.cg-hi-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; margin-top: 10px; }
.cg-hi-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--cg-ink-2); }
.cg-hi-wide { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--cg-ink-2); margin: 10px 0 4px; }
.cg-wlaunch img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; }
/* The greeting bubble next to the chat button (like .hi in the website chat). */
.clientager-wrap .cg-whi { position: relative; max-width: 260px; background: #fff; color: #111; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px 30px 12px 14px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); }
.clientager-wrap .cg-whi span { cursor: pointer; }
.clientager-wrap .cg-whi[hidden], .cg-stage.is-open .cg-whi { display: none; }
.clientager-wrap .cg-whi-x { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: #9ca3af; font-size: 18px; line-height: 1; cursor: pointer; padding: 2px; }
.clientager-wrap .cg-btn-sm { margin-top: 10px; padding: 6px 10px; font-size: 13px; }
.cg-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.cg-sliders[hidden] { display: none; }
.cg-slider { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--cg-ink, #0f172a); }
.cg-slider span { display: flex; justify-content: space-between; gap: 8px; }
.cg-slider output { color: var(--cg-muted, #64748b); font-variant-numeric: tabular-nums; }
.cg-slider input[type="range"] { width: 100%; margin: 0; accent-color: var(--cg-brand, #2f54eb); }
.cg-seg span { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--cg-ink-2); }
.cg-seg input:checked + span { background: #fff; color: var(--cg-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.cg-seg input:focus-visible + span { outline: 3px solid rgba(47, 84, 235, 0.35); }
.cg-color { display: flex; gap: 10px; align-items: center; max-width: 260px; }
.clientager-wrap .cg-color input[type="color"] { width: 46px; height: 42px; padding: 3px; border: 1px solid #d5d9e4; border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
.cg-color .cg-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.cg-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; }
.clientager-wrap .cg-check input { margin: 2px 0 0; }
.cg-check small { display: block; font-weight: 400; color: var(--cg-muted); font-size: 12.5px; margin-top: 2px; }
.cg-needs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cg-needs label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--cg-muted); }
.cg-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- Inbox list ---------- */
.clientager-wrap .cg-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--cg-line); }
.clientager-wrap .cg-list li { margin: 0; }
.clientager-wrap .cg-list li + li { border-top: 1px solid var(--cg-line); }
.clientager-wrap .cg-row { display: flex; align-items: center; gap: 14px; padding: 14px 24px; text-decoration: none; color: inherit; transition: background 0.12s; }
.clientager-wrap .cg-row:hover { background: #f8f9fc; }
.cg-initials {
	width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
	background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #3730a3; font-weight: 700; font-size: 13.5px;
}
.cg-initials.is-lg { width: 44px; height: 44px; }
.cg-row-main { flex: 1; min-width: 0; }
.cg-row-top { display: flex; align-items: center; gap: 8px; }
.cg-row-top strong { color: var(--cg-ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-row-text { display: block; color: var(--cg-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cg-row-time { flex: none; color: var(--cg-faint); font-size: 12px; }
.cg-channel { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef2f7; color: var(--cg-ink-2); flex: none; }
.cg-channel.is-website { background: var(--cg-brand-50); color: var(--cg-brand-600); }
.cg-channel.is-whatsapp { background: #e6f7ee; color: #0b7a43; }
.cg-channel.is-email { background: #fff1e6; color: #b4500b; }
.cg-channel.is-phone { background: #f3e8ff; color: #6b21a8; }
.cg-channel.is-sms { background: #e0f2fe; color: #075985; }
.clientager-wrap .cg-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; color: var(--cg-ink-2); }
.clientager-wrap .cg-back:hover { color: var(--cg-brand); }

/* ---------- Empty ---------- */
.cg-empty { text-align: center; padding: 40px 24px 48px; }
.cg-empty-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--cg-brand-50); color: var(--cg-brand); }
.cg-empty-icon .cg-icon { width: 26px; height: 26px; }
.clientager-wrap .cg-empty h3 { margin: 14px 0 4px; font-size: 15px; color: var(--cg-ink); }
.clientager-wrap .cg-empty p { margin: 0 auto; color: var(--cg-muted); max-width: 42ch; }

/* ---------- Leads table ---------- */
.cg-table-wrap { overflow-x: auto; border-top: 1px solid var(--cg-line); margin-top: 8px; }
.clientager-wrap .cg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cg-table th { text-align: left; padding: 11px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cg-muted); background: #fafbfe; font-weight: 600; border-bottom: 1px solid var(--cg-line); }
.cg-table td { padding: 12px 16px; border-bottom: 1px solid var(--cg-line); vertical-align: middle; color: var(--cg-ink-2); }
.cg-table tr:last-child td { border-bottom: 0; }
.cg-table tbody tr:hover td { background: #fafbfe; }
.cg-table th:first-child, .cg-table td:first-child { padding-left: 24px; }
.cg-contact { display: flex; align-items: center; gap: 10px; }
.cg-contact .cg-initials { width: 34px; height: 34px; font-size: 12px; }
.cg-contact strong { display: block; color: var(--cg-ink); }
.cg-contact a { font-size: 12.5px; text-decoration: none; }
.cg-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-nowrap { white-space: nowrap; }
.cg-badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef2f7; color: var(--cg-ink-2); }
.cg-badge.is-new { background: var(--cg-brand-50); color: var(--cg-brand-600); }
.cg-badge.is-won, .cg-badge.is-booked, .cg-badge.is-converted { background: var(--cg-ok-50); color: #0b6b3c; }
.cg-badge.is-lost { background: var(--cg-bad-50); color: #9b1c1c; }
.cg-badge.is-contacted, .cg-badge.is-qualified { background: var(--cg-warn-50); color: var(--cg-warn); }

/* ---------- Settings ---------- */
.cg-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--cg-line); border-radius: 12px; }
.cg-switch-row strong { display: block; }
.cg-switch-row span { color: var(--cg-muted); font-size: 13px; }
.clientager-wrap .cg-switch {
	position: relative; width: 48px; height: 28px; flex: none; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
	background: #cbd5e1; transition: background 0.2s; display: inline-block;
}
.clientager-wrap .cg-switch > span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.clientager-wrap .cg-switch[aria-checked="true"] { background: var(--cg-ok); }
.clientager-wrap .cg-switch[aria-checked="true"] > span { transform: translateX(20px); }
.clientager-wrap .cg-switch.is-disabled { opacity: 0.5; cursor: not-allowed; }
.clientager-wrap .cg-switch:disabled { opacity: 0.6; }
.clientager-wrap .cg-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.clientager-wrap .cg-chips li { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #f1f5f9; color: var(--cg-muted); border: 1px solid var(--cg-line); }
.clientager-wrap .cg-chips li.is-on { background: var(--cg-ok-50); color: #0b6b3c; border-color: #bfe6d0; }
.cg-chips .cg-icon { width: 14px; height: 14px; }

/* ---------- Motion ---------- */
@keyframes cg-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cg-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes cg-pulse { 0% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0.35); } 70% { box-shadow: 0 0 0 7px rgba(15, 157, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0); } }
@media (prefers-reduced-motion: reduce) {
	.clientager-wrap *, .clientager-wrap *::before, .clientager-wrap *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
	.auto-fold .cg-stage.is-floating.is-left { left: calc(36px + var(--cx, 24px)); }
	.cg-card.cg-hero { grid-template-columns: 1fr; padding: 26px; }
	.cg-hero-art { min-height: 300px; }
}
@media (max-width: 782px) {
	.clientager-wrap { margin: 10px 10px 0 0; }
	.cg-appbar { padding: 14px 16px; }
	.cg-tabs { padding: 10px 12px; }
	.cg-body { padding: 14px; gap: 14px; }
	.cg-grid { grid-template-columns: 1fr; gap: 14px; }
	.cg-grid.is-flow { column-count: 1; }
	.cg-grid.is-flow > .cg-card { margin-bottom: 14px; }
	.cg-card { padding: 18px; }
	.cg-pad { padding: 18px 18px 6px; }
	.clientager-wrap .cg-hero-title { font-size: 22px; }
	.cg-hero-art { display: none; }
	.cg-inline { flex-direction: column; }
	.clientager-wrap .cg-stepper { grid-template-columns: 1fr 1fr; row-gap: 18px; }
	.cg-stepper li::after { display: none; }
	.cg-chat-top { flex-direction: column; padding: 18px 18px 0; }
	.cg-counter { width: 100%; }
	.cg-chat { margin: 14px 18px 0; height: 380px; padding: 12px; }
	.cg-stage.is-inline { margin: 14px 18px 0; padding: 0; border: 0; background: none; }
	.cg-stage.is-inline .cg-wpanel { width: 100%; height: 520px; }
	.cg-stage.is-floating { bottom: var(--cy, 16px); right: var(--cx, 16px); }
	.cg-stage.is-floating.is-left, .folded .cg-stage.is-floating.is-left, .auto-fold .cg-stage.is-floating.is-left { right: auto; left: var(--cx, 16px); }
	.cg-stage.is-floating .cg-wpanel { position: fixed; left: 12px; right: 12px; bottom: calc(var(--cy, 16px) + 72px); width: auto; height: auto; top: 58px; min-height: 0; }
	.cg-needs, .cg-quick { grid-template-columns: 1fr; }
	.cg-msg { max-width: 92%; }
	.cg-composer { padding: 12px 18px 0; }
	.cg-locked { flex-wrap: wrap; margin: 14px 18px 0; }
	.cg-chat-foot { padding: 12px 18px 18px; flex-wrap: wrap; justify-content: flex-start; }
	.cg-card.cg-upsell, .cg-card.cg-danger { flex-direction: column; align-items: flex-start; }
	.clientager-wrap .cg-row { padding: 12px 18px; }
	.cg-table th:first-child, .cg-table td:first-child { padding-left: 18px; }
	.cg-pill { padding: 5px 10px; font-size: 12px; }
}
.cg-reply { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.cg-reply textarea { flex: 1; resize: vertical; min-height: 44px; }

/* Requests (tickets) */
.cg-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cg-seg a { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--cg-ink-2); text-decoration: none; }
.cg-seg a.is-on { background: #fff; color: var(--cg-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.cg-seg a:focus-visible { outline: 3px solid rgba(47, 84, 235, 0.35); }
.cg-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--cg-bad, #c62828); color: #fff; font-size: 11px; font-weight: 700; }
.cg-search { display: flex; gap: 8px; padding: 0 24px 16px; }
.cg-search .cg-input { flex: 1; min-width: 0; }
.cg-tickets { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--cg-line); }
.cg-ticket { margin: 0; border-bottom: 1px solid var(--cg-line); }
.cg-ticket:last-child { border-bottom: 0; }
.cg-ticket.is-done .cg-ticket-row { opacity: 0.72; }
.cg-ticket-row { display: flex; align-items: center; gap: 10px; padding: 13px 24px; cursor: pointer; list-style: none; }
.cg-ticket-row::-webkit-details-marker { display: none; }
.cg-ticket-row:hover { background: #f8fafc; }
.cg-ticket-row:focus-visible { outline: 3px solid rgba(47, 84, 235, 0.35); outline-offset: -3px; }
.cg-ticket-who { flex: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--cg-ink); }
.cg-ticket-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--cg-ink-2); }
.cg-ticket-order { flex: none; font-size: 12.5px; font-weight: 600; color: var(--cg-ink-2); }
.cg-ticket-row .cg-badge, .cg-ticket-row .cg-kind, .cg-ticket-row .cg-row-time { flex: none; }
.cg-urgent { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cg-bad, #c62828); }
.cg-chev { flex: none; width: 8px; height: 8px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(45deg); margin: 0 2px 3px 4px; transition: transform 0.15s; }
details[open] > .cg-ticket-row .cg-chev { transform: rotate(225deg); margin-bottom: -3px; }
details[open] > .cg-ticket-row { background: #f8fafc; }
.cg-ticket-body { padding: 4px 24px 18px; background: #f8fafc; }
.cg-kind { display: inline-flex; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: #eef2f7; color: var(--cg-ink-2); }
.cg-kind.is-complaint { background: var(--cg-bad-50, #fef2f2); color: #9b1c1c; }
.cg-kind.is-booking { background: var(--cg-brand-50, #eef2ff); color: var(--cg-brand-600, #2f54eb); }
.cg-badge.is-open { background: var(--cg-warn-50, #fffbeb); color: var(--cg-warn, #b45309); }
.cg-badge.is-in-progress { background: var(--cg-brand-50, #eef2ff); color: var(--cg-brand-600, #2f54eb); }
.cg-badge.is-resolved { background: var(--cg-ok-50, #ecfdf5); color: #0b6b3c; }
.cg-ticket-text { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--cg-ink); white-space: pre-line; }
.cg-ticket-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--cg-muted, #64748b); }
.cg-ticket-meta a { color: var(--cg-brand-600, #2f54eb); text-decoration: none; }
.cg-notes { list-style: none; margin: 12px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--cg-line); display: grid; gap: 6px; font-size: 13px; color: var(--cg-ink-2); }
.cg-notes span { display: block; font-size: 12px; color: var(--cg-muted, #64748b); }
.cg-ticket-act { margin-top: 12px; display: grid; gap: 8px; }
.cg-ticket-act .cg-input { background: #fff; }
.cg-ticket-act .cg-actions { margin-top: 0; }
.cg-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cg-ink-2); }
@media (max-width: 700px) {
	.cg-ticket-row { flex-wrap: wrap; padding: 12px 16px; }
	.cg-ticket-line { flex-basis: 100%; order: 9; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
	.cg-ticket-row .cg-row-time { margin-left: auto; }
	.cg-ticket-body { padding: 4px 16px 16px; }
	.cg-search { padding: 0 16px 14px; }
}

/* Contact form (form.js) settings and preview */
.cg-form-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 8px; padding: 14px 16px; border-radius: 12px; background: var(--cg-brand-50, #eef2ff); }
.cg-form-steps p { margin: 0; flex: 1 1 360px; font-size: 13.5px; color: var(--cg-ink-2); line-height: 1.5; }
.cg-form-steps code { font-size: 12.5px; background: #fff; padding: 2px 6px; border-radius: 6px; }
.cg-form-steps .cg-help { flex-basis: 100%; margin: 0; }
.cg-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1180px) { .cg-form-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); align-items: start; } .cg-form-grid .cg-wsec { grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); gap: 14px 28px; } }
.cg-form-fields { display: grid; gap: 10px; }
.cg-form-field { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px; align-items: end; }
.cg-form-field label { display: grid; gap: 6px; }
.cg-form-preview { position: sticky; top: 16px; padding-top: 30px; }
.cg-form-canvas { margin-top: 8px; padding: 24px; border: 1px solid var(--cg-line); border-radius: 14px; background: #fff; color: #1f2937; font-size: 15px; }
@media (max-width: 600px) { .cg-form-field { grid-template-columns: 1fr; } .cg-form-canvas { padding: 16px; } }

/* Email look: logo and sign-off */
.cg-elook { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cg-line); display: grid; gap: 8px; }
.cg-elook .cg-actions { margin-top: 0; }
.cg-elook-logo { display: flex; align-items: center; min-height: 64px; padding: 12px 16px; border: 1px dashed var(--cg-line); border-radius: 12px; background: #fff; }
.cg-elook-logo img { max-height: 44px; max-width: 220px; object-fit: contain; }
.cg-elook textarea { min-height: 64px; }

/* "Enjoying Clientager?" */
.cg-review { background: linear-gradient(90deg, var(--cg-brand-50, #eef2ff), #fff); }
.cg-review-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.cg-review-step > div:first-child { display: grid; gap: 2px; }
.cg-review-step strong { font-size: 15px; color: var(--cg-ink); }
.cg-review-step span { font-size: 13.5px; color: var(--cg-ink-2); }
.cg-review-step .cg-actions { margin-top: 0; }
.cg-review-step textarea { flex-basis: 100%; }
.cg-review-step[hidden], .cg-review[hidden] { display: none; }

/* Lead status picker */
.cg-lead-status { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; padding: 4px 24px 4px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: #eef2f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 11px; color: var(--cg-ink-2); }
.cg-lead-status.is-new { background-color: var(--cg-brand-50, #eef2ff); color: var(--cg-brand-600, #2f54eb); }
.cg-lead-status.is-contacted, .cg-lead-status.is-qualified { background-color: var(--cg-warn-50, #fffbeb); color: var(--cg-warn, #b45309); }
.cg-lead-status.is-won { background-color: var(--cg-ok-50, #ecfdf5); color: #0b6b3c; }
.cg-lead-status.is-lost { background-color: var(--cg-bad-50, #fef2f2); color: #9b1c1c; }
.cg-lead-status:focus-visible { outline: 3px solid rgba(47, 84, 235, 0.35); }

/* Settings: a menu of sections on the left, one section at a time on the right (tabs on top on small screens). */
.cg-settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.cg-subnav { position: sticky; top: 46px; display: flex; flex-direction: column; gap: 4px; padding: 10px; background: #fff; border: 1px solid var(--cg-line); border-radius: var(--cg-radius); box-shadow: var(--cg-shadow); }
.clientager-wrap .cg-subnav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--cg-ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.clientager-wrap .cg-subnav-item .cg-icon { width: 18px; height: 18px; color: var(--cg-muted); flex: none; }
.clientager-wrap .cg-subnav-item:hover { background: #f1f5f9; color: var(--cg-ink); }
.clientager-wrap .cg-subnav-item:focus-visible { outline: 2px solid var(--cg-brand); outline-offset: 1px; box-shadow: none; }
.clientager-wrap .cg-subnav-item.is-active { background: var(--cg-brand-50); color: var(--cg-brand); font-weight: 600; }
.clientager-wrap .cg-subnav-item.is-active .cg-icon { color: var(--cg-brand); }
.clientager-wrap .cg-subnav-item[data-section="site"] { margin-top: 6px; border-top: 1px solid var(--cg-line); border-radius: 0 0 10px 10px; padding-top: 14px; }
.cg-panels { min-width: 0; max-width: 860px; }
.cg-panel { display: none; }
.cg-panel.is-active { display: flex; flex-direction: column; gap: 20px; animation: cg-panel-in .18s ease-out; }
.cg-panel > .cg-card { margin: 0; padding: 26px 28px; }
@keyframes cg-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 960px) {
	.cg-settings { grid-template-columns: 1fr; gap: 16px; }
	.cg-subnav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
	.clientager-wrap .cg-subnav-item[data-section="site"] { margin: 0; border-top: 0; border-radius: 10px; padding-top: 10px; }
	.cg-panel > .cg-card { padding: 20px; }
}

/* Moving between screens without reloading the page. */
.clientager-app.is-loading .cg-body { opacity: .55; pointer-events: none; transition: opacity .15s; }
@media (prefers-reduced-motion: reduce) { .cg-panel.is-active { animation: none; } }

/* Two equal fields side by side (AI email limits). */
.clientager-wrap .cg-hi-row.is-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .clientager-wrap .cg-hi-row.is-even { grid-template-columns: 1fr; } }

/* Quick-add buttons for page rules (Chat widget → Where the chat shows). */
.clientager-wrap .cg-chips-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Help */
.cg-help-email { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.cg-help-email a { color: var(--cg-brand-600); text-decoration: none; }
.cg-help-email a:hover { text-decoration: underline; }
.cg-help-sub { margin: 22px 0 0; font-size: 13px; font-weight: 600; color: var(--cg-ink-2); }
.cg-help-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.cg-help-line { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cg-help-kind { font-size: 11.5px; color: var(--cg-muted, #64748b); }
.cg-help-text { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-help-list .cg-badge, .cg-help-list .cg-row-time { flex: none; }

/* Simple card forms (alerts, AI limits, email look, help): even spacing between labels, fields, notes and buttons */
.cg-stack > * + * { margin-top: 18px; }
.cg-stack .cg-label { margin: 0 0 8px; }
.cg-stack > .cg-label + .cg-input { margin-top: 0; }
.cg-stack > .cg-help, .cg-stack .cg-field > .cg-help { margin-top: 8px; }
.cg-stack > .cg-help + * { margin-top: 20px; }
.cg-stack > .cg-check { display: flex; align-items: flex-start; }
.cg-stack > .cg-check + .cg-check { margin-top: 12px; }
.cg-stack > .cg-check + .cg-help { margin-top: 14px; }
.cg-elook.cg-stack { display: block; }
.cg-stack > .cg-hi-row { margin-top: 0; }
.cg-stack > .cg-hi-row + * { margin-top: 20px; }
.cg-stack > .cg-actions { margin-top: 22px; }
.cg-stack > .clientager-msg { margin-top: 14px; }
.cg-stack .cg-hi-row label { gap: 8px; }
.clientager-wrap .cg-stack > fieldset.cg-checks { margin-top: 22px; gap: 14px; }
/* Contact form fields: room between one field and the next */
.cg-form-fields { gap: 20px; }
@media (max-width: 600px) { .cg-form-field { gap: 8px; } }

/* WhatsApp card (Settings → Chat & websites) */
.cg-wa-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cg-wa-list li { display: flex; align-items: flex-start; gap: 10px; margin: 0; line-height: 1.5; color: var(--cg-ink-2, #334155); }
.cg-wa-list svg { flex-shrink: 0; margin-top: 2px; color: var(--cg-ok, #0f9d58); }
#clientager-wa .cg-switch-row { margin-top: 4px; }
#clientager-wa .cg-badge { white-space: nowrap; }
#clientager-wa .cg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
#clientager-wa > .cg-help { margin-top: 14px; }
#clientager-wa .clientager-msg:empty, #clientager-wa .cg-note:empty { display: none; }
#clientager-wa .clientager-msg, #clientager-wa .cg-note { margin-top: 16px; }
.cg-wa-button { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--cg-line, #e6e8ef); }
.cg-wa-button.cg-stack > .cg-hi-row { margin-top: 20px; gap: 16px; }
.cg-wa-button .cg-hi-row label > span { font-weight: 500; color: var(--cg-ink, #0f172a); }
.cg-wa-button.cg-stack > .cg-actions { margin-top: 20px; }
.cg-wa-cost { margin-top: 20px !important; padding-top: 16px; border-top: 1px dashed var(--cg-line, #e6e8ef); line-height: 1.55; }
@media (max-width: 600px) {
  #clientager-wa .cg-actions > .cg-btn { flex: 1 1 100%; justify-content: center; }
  #clientager-wa .cg-switch-row { align-items: flex-start; }
}
