#cfai-chatbot-root {
	--cfai-accent: #E74021;
	--cfai-text: #254467;
	--cfai-surface-tint: #FBEEE7;
	position: fixed;
	z-index: 2147483000; /* third-party chat widgets (Tawk included) often use near-max z-index to always stay on top */
	bottom: 20px;
	font-family: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#cfai-chatbot-root.cfai-position-bottom-right { right: 20px; }
#cfai-chatbot-root.cfai-position-bottom-left { left: 20px; }
#cfai-chatbot-root.cfai-position-bottom-center { left: 50%; transform: translateX(-50%); }

.cfai-bubble {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: var(--cfai-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(231,64,33,0.35);
	display: flex;
	align-items: center;
	justify-content: center;
}
.cfai-bubble:focus {
	outline: 2px solid var(--cfai-accent);
	outline-offset: 2px;
}

.cfai-bubble-icon { display: flex; }
.cfai-bubble-icon img,
.cfai-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.cfai-panel {
	display: none;
	flex-direction: column;
	position: absolute;
	bottom: 70px;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(37,68,103,0.22);
	overflow: hidden;
}

#cfai-chatbot-root.cfai-position-bottom-left .cfai-panel { right: auto; left: 0; }
#cfai-chatbot-root.cfai-position-bottom-center .cfai-panel { right: auto; left: 50%; transform: translateX(-50%); }

.cfai-panel.cfai-open { display: flex; }

.cfai-header {
	background: var(--cfai-accent);
	color: #fff;
	padding: 14px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 700;
}

.cfai-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	opacity: 0.85;
}

.cfai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: #FFFCFA;
}

.cfai-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.cfai-row-user {
	justify-content: flex-end;
}

.cfai-avatar {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--cfai-accent);
	color: var(--cfai-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-top: 16px;
}

.cfai-message-col {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 82%;
}

.cfai-sender-name {
	font-size: 12px;
	font-weight: 600;
	color: #A99183;
	padding-left: 2px;
}

.cfai-message {
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
}

.cfai-row-user .cfai-message {
	max-width: 82%;
}

.cfai-message-assistant {
	background: var(--cfai-surface-tint);
	color: var(--cfai-text);
	border-top-left-radius: 4px;
}

.cfai-message-user {
	background: var(--cfai-accent);
	color: #fff;
	border-top-right-radius: 4px;
}

.cfai-message-file a {
	color: inherit;
	text-decoration: underline;
}

.cfai-typing span {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 3px;
	border-radius: 50%;
	background: #C98A6E;
	animation: cfai-blink 1.2s infinite;
}
.cfai-typing span:nth-child(2) { animation-delay: 0.2s; }
.cfai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cfai-blink {
	0%, 80%, 100% { opacity: 0.2; }
	40% { opacity: 1; }
}

.cfai-input-row {
	display: flex;
	align-items: center;
	border-top: 1px solid #F1E9E3;
	padding: 10px;
	gap: 6px;
}

.cfai-attach {
	background: none;
	border: none;
	color: #A99183;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	cursor: pointer;
}
.cfai-attach:hover { background: #FBEEE7; color: var(--cfai-accent); }

.cfai-input {
	flex: 1;
	border: 1px solid #E7DED7;
	border-radius: 999px;
	padding: 9px 15px;
	font-size: 14px;
	font-family: inherit;
	color: var(--cfai-text);
}
.cfai-input:focus { outline: 2px solid var(--cfai-accent); outline-offset: 1px; }

.cfai-send {
	background: var(--cfai-accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	width: 38px;
	height: 38px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
}

.cfai-disclosure {
	text-align: center;
	font-size: 11px;
	color: #A99183;
	padding: 4px 0 8px;
}
