/* Crezly AI Analyst widget. Namespaced .cai- to stay clear of Houzez. */

#crezly-ai-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cai-fab {
	background: #2d5a8e;
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 13px 22px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 22px rgba(0, 0, 0, .22);
}

.cai-fab:hover {
	background: #24486f;
}

.cai-panel {
	width: 400px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 96px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .26);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cai-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: #2d5a8e;
	color: #fff;
	font-size: 14px;
}

.cai-plan {
	display: block;
	font-size: 11px;
	opacity: .8;
	font-weight: 400;
	margin-top: 2px;
}

.cai-x {
	background: none;
	border: 0;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.cai-scroll {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f8fa;
}

.cai-empty {
	color: #6b7280;
	font-size: 13px;
}

.cai-suggest {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 12px;
}

.cai-chip {
	text-align: left;
	background: #fff;
	border: 1px solid #dfe3e8;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 12.5px;
	color: #2d5a8e;
	cursor: pointer;
}

.cai-chip:hover {
	border-color: #2d5a8e;
}

.cai-msg {
	margin-bottom: 12px;
	display: flex;
	flex-direction: column;
}

.cai-user {
	align-items: flex-end;
}

.cai-bubble {
	max-width: 88%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 13.5px;
	line-height: 1.5;
	word-wrap: break-word;
}

.cai-user .cai-bubble {
	background: #2d5a8e;
	color: #fff;
	border-bottom-right-radius: 3px;
}

.cai-assistant .cai-bubble {
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 3px;
}

.cai-bubble p {
	margin: 0 0 8px;
}

.cai-bubble p:last-child {
	margin-bottom: 0;
}

.cai-list {
	margin: 0 0 8px;
	padding-left: 18px;
}

.cai-list li {
	margin-bottom: 4px;
}

.cai-bubble a {
	color: #2d5a8e;
	text-decoration: underline;
}

.cai-sources {
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #8b95a3;
	margin-bottom: 3px;
}

.cai-upgrade {
	display: inline-block;
	margin-top: 7px;
	background: #2d5a8e;
	color: #fff;
	padding: 7px 14px;
	border-radius: 7px;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	align-self: flex-start;
}

.cai-thinking span {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 3px;
	border-radius: 50%;
	background: #9aa3b0;
	animation: cai-blink 1.3s infinite;
}

.cai-thinking span:nth-child(2) {
	animation-delay: .2s;
}

.cai-thinking span:nth-child(3) {
	animation-delay: .4s;
}

@keyframes cai-blink {
	0%, 80%, 100% { opacity: .25; }
	40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.cai-thinking span { animation: none; opacity: .6; }
}

.cai-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}

.cai-form textarea {
	flex: 1;
	resize: none;
	border: 1px solid #dfe3e8;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13.5px;
	font-family: inherit;
	max-height: 90px;
}

.cai-form button {
	background: #2d5a8e;
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 0 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.cai-form button:disabled {
	background: #b9c2cd;
	cursor: default;
}

.cai-disc {
	margin: 0;
	padding: 6px 12px 9px;
	font-size: 10px;
	color: #9aa3b0;
	background: #fff;
	text-align: center;
}

@media (max-width: 480px) {
	#crezly-ai-root {
		right: 12px;
		bottom: 12px;
	}

	.cai-panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 90px);
	}
}

.cai-panel-guest {
	height: auto;
	max-height: calc(100vh - 96px);
}

.cai-signin {
	display: block;
	flex: 1;
	text-align: center;
	background: #2d5a8e;
	color: #fff;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
}

.cai-signin:hover {
	background: #24486f;
	color: #fff;
}

.cai-upsell {
	align-self: flex-start;
	margin-top: 8px;
	background: #fff;
	border: 1px solid #dbe3ec;
	border-left: 3px solid #2d5a8e;
	border-radius: 8px;
	padding: 10px 12px;
	max-width: 88%;
}

.cai-upsell-head {
	font-size: 12.5px;
	font-weight: 700;
	color: #2d5a8e;
	margin-bottom: 5px;
}

.cai-upsell-list {
	margin: 0 0 9px;
	padding-left: 16px;
	font-size: 12.5px;
	color: #374151;
}

.cai-upsell-list li {
	margin-bottom: 2px;
}
