/* Centrix Live Chat – self-contained styles (no theme dependency). */
.clc {
	--clc-primary: #16a34a;
	--clc-header: #0f2a4a;
	--clc-primary-dark: color-mix(in srgb, var(--clc-primary) 78%, #000);
	--clc-primary-soft: color-mix(in srgb, var(--clc-primary) 12%, #fff);
	--clc-text: #1d2939;
	--clc-muted: #5b6b80;
	--clc-line: #e3e9f1;
	--clc-bg: #f4f7fb;
	--clc-red: #e5484d;
	position: fixed; right: 20px; bottom: 20px; z-index: 99990;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif; font-size: 15px; line-height: 1.5; color: var(--clc-text);
	-webkit-font-smoothing: antialiased;
}
.clc *, .clc *::before, .clc *::after { box-sizing: border-box; }
.clc [hidden] { display: none !important; }
.clc.clc-pos-left { right: auto; left: 20px; }
.clc .clc-ico { width: 20px; height: 20px; flex: none; }
.clc button { font-family: inherit; }
.clc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Launcher */
.clc-launcher { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 14px 20px 14px 16px; border: 0; border-radius: 999px; cursor: pointer; color: #fff; font-weight: 800; font-size: 15.5px; line-height: 1.2; background: var(--clc-primary); box-shadow: 0 10px 26px color-mix(in srgb, var(--clc-primary) 45%, transparent); transition: transform .15s, box-shadow .15s, background .15s; }
.clc-launcher:hover { transform: translateY(-2px); background: var(--clc-primary-dark); }
.clc-launcher .clc-ico { width: 24px; height: 24px; }
.clc-ico-close { display: none; }
.clc[data-state=open] .clc-ico-open { display: none; }
.clc[data-state=open] .clc-ico-close { display: block; }
.clc[data-state=open] .clc-launcher { padding: 14px; background: var(--clc-header); box-shadow: 0 8px 20px rgba(15, 42, 74, .35); }
.clc[data-state=open] .clc-launcher-text { display: none; }
.clc-badge, .clc-bar-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--clc-red); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.clc-badge { position: absolute; top: -6px; right: -4px; }

/* Mobile bar (hidden on desktop) */
.clc-bar { display: none; }

/* Panel */
.clc-panel { position: absolute; right: 0; bottom: 72px; width: 380px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 42, 74, .28); border: 1px solid var(--clc-line); animation: clc-in .2s ease-out; }
.clc-pos-left .clc-panel { right: auto; left: 0; }
@keyframes clc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.clc-header { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; color: #fff; background: linear-gradient(110deg, var(--clc-header) 0%, color-mix(in srgb, var(--clc-header) 70%, var(--clc-primary)) 130%); }
.clc-avatar { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.clc-avatar .clc-ico { width: 24px; height: 24px; }
.clc-dot { position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; border: 2px solid var(--clc-header); }
.clc.is-online .clc-dot { background: #22c55e; }
.clc-header-text { flex: 1; min-width: 0; }
.clc .clc-header h2 { color: #fff; font-size: 17px; line-height: 1.3; margin: 0; padding: 0; font-weight: 800; letter-spacing: 0; text-transform: none; }
.clc .clc-header p { margin: 0; font-size: 12.5px; opacity: .85; color: #fff; }
.clc-icon-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.clc-icon-btn:hover { background: rgba(255, 255, 255, .22); }

/* Form */
.clc-form { flex: 1; overflow-y: auto; padding: 16px 18px 18px; margin: 0; }
.clc-intro { font-size: 14px; color: var(--clc-muted); margin: 0 0 12px; }
.clc-field { margin: 0 0 11px; }
.clc-field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--clc-header); margin: 0 0 4px; }
.clc-field label span { color: var(--clc-red); }
.clc-field small { color: var(--clc-muted); font-weight: 500; }
.clc .clc-field input, .clc .clc-field textarea { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 1px solid #cfd8e4; border-radius: 10px; font: inherit; font-size: 15px; color: var(--clc-text); background: #fff; box-shadow: none; resize: vertical; min-height: 0; }
.clc .clc-field input:focus, .clc .clc-field textarea:focus, .clc .clc-compose textarea:focus { outline: 0; border-color: var(--clc-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clc-primary) 18%, transparent); }
.clc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.clc-error { margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px; background: #fdecec; color: #a52226; font-size: 13.5px; }
.clc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0; padding: 12px 18px; border: 2px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 15px; line-height: 1.2; color: #fff; background: var(--clc-primary); text-decoration: none; transition: background .15s; }
.clc-btn:hover { background: var(--clc-primary-dark); color: #fff; }
.clc-btn.is-loading { opacity: .7; pointer-events: none; }
.clc-btn-outline { width: auto; display: inline-flex; padding: 7px 16px; font-size: 14px; color: var(--clc-primary); background: #fff; border-color: var(--clc-primary); }
.clc-btn-outline:hover { background: var(--clc-primary-soft); color: var(--clc-primary-dark); }
.clc-legal { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; font-size: 12px; color: var(--clc-muted); line-height: 1.45; }
.clc-legal .clc-ico { width: 14px; height: 14px; color: var(--clc-primary); margin-top: 1px; }
.clc-legal a { color: var(--clc-primary); }

/* Conversation */
.clc-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--clc-bg); }
.clc-messages { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.clc-msg { display: flex; flex-direction: column; max-width: 82%; }
.clc-bubble { padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.clc-msg time { font-size: 11px; color: var(--clc-muted); margin-top: 3px; }
.clc-who { font-size: 11.5px; font-weight: 700; color: var(--clc-header); margin: 0 0 3px 4px; }
.clc-msg-visitor { align-self: flex-end; align-items: flex-end; }
.clc-msg-visitor .clc-bubble { background: var(--clc-primary); color: #fff; border-bottom-right-radius: 4px; }
.clc-msg-agent { align-self: flex-start; }
.clc-msg-agent .clc-bubble { background: #fff; color: var(--clc-text); border: 1px solid var(--clc-line); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(15, 42, 74, .06); }
.clc-msg-agent time { margin-left: 4px; }
.clc-msg-system { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; color: #3b4a5e; background: #e6edf6; padding: 7px 12px; border-radius: 10px; }
.clc-ended { text-align: center; padding: 10px 14px; background: #fff; border-top: 1px solid var(--clc-line); font-size: 13.5px; color: var(--clc-muted); }
.clc-ended p { margin: 0 0 6px; }
.clc-wait { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #fff; border-top: 1px solid var(--clc-line); font-size: 13.5px; color: var(--clc-header); }
.clc-wait .clc-ico { color: var(--clc-primary); margin-top: 1px; }
.clc-wait p { margin: 0; }
.clc-wait-off { display: none; }
.clc:not(.is-online) .clc-wait-off { display: inline; }
.clc-compose { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px; background: #fff; border-top: 1px solid var(--clc-line); }
.clc .clc-compose textarea { flex: 1; min-height: 42px; max-height: 120px; margin: 0; padding: 10px 12px; border: 1px solid #cfd8e4; border-radius: 12px; font: inherit; font-size: 15px; resize: none; line-height: 1.4; box-shadow: none; background: #fff; color: var(--clc-text); }
.clc-send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; padding: 0; border: 0; border-radius: 12px; background: var(--clc-primary); color: #fff; cursor: pointer; }
.clc-send:hover { background: var(--clc-primary-dark); }
.clc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 8px; background: #fff; }
.clc-foot .clc-error { flex: 1; margin: 0; }
.clc-end { margin-left: auto; padding: 2px 0; border: 0; background: none; color: var(--clc-muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.clc-end[data-confirm] { color: var(--clc-red); }

/* Shortcode button */
.clc-open-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0; border-radius: 10px; background: var(--clc-primary, #16a34a); color: #fff; font-weight: 700; cursor: pointer; }
.clc-open-btn .clc-ico { width: 18px; height: 18px; }

/* ---------- Phones & tablets ---------- */
@media (max-width: 960px) {
	.clc-mobile-bar .clc-launcher, .clc-mobile-none .clc-launcher { display: none; }
	.clc-mobile-bar { left: 12px; right: 12px; bottom: 12px; }
	.clc-mobile-bar .clc-bar { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px 18px; border: 0; border-radius: 14px; background: var(--clc-primary); color: #fff; font-weight: 800; font-size: 16.5px; cursor: pointer; box-shadow: 0 10px 26px color-mix(in srgb, var(--clc-primary) 45%, transparent); }
	.clc-mobile-bar .clc-bar .clc-ico { width: 24px; height: 24px; }
	.clc-mobile-bar[data-state=open] .clc-bar { visibility: hidden; }
	.clc-mobile-bar .clc-panel { right: 0; left: auto; bottom: 0; }
	body.clc-has-bar { padding-bottom: 76px; }
	.clc-mobile-bubble .clc-launcher-text { display: none; }
	.clc-mobile-bubble .clc-launcher { padding: 15px; }
	/* A theme bar that already opens the chat (e.g. FixNest) replaces ours. */
	.clc.clc-external-bar .clc-bar, .clc.clc-external-bar .clc-launcher { display: none; }
}
@media (max-width: 520px) {
	.clc { right: 12px; bottom: 12px; }
	.clc-pos-left { left: 12px; }
	.clc .clc-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
	.clc[data-state=open] .clc-launcher, .clc[data-state=open] .clc-bar { display: none; }
	body.clc-lock { overflow: hidden; }
	.clc .clc-field input, .clc .clc-field textarea, .clc .clc-compose textarea { font-size: 16px; } /* no iOS zoom */
}
@media print { .clc { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .clc-panel { animation: none; } .clc-launcher { transition: none; } }
