/* Creality Energy Chat widget */
.cec-root {
	--cec-accent: #f5a623;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

/* Bubble */
.cec-bubble {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--cec-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}
.cec-bubble:hover { transform: scale(1.08); }

/* Panel */
.cec-panel {
	display: none;
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	flex-direction: column;
}
.cec-open .cec-panel { display: flex; }

/* Header */
.cec-header {
	background: var(--cec-accent);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.cec-header-title { font-weight: 700; font-size: 16px; }
.cec-header-sub { font-size: 12px; opacity: 0.9; display: flex; align-items: center; gap: 5px; }
.cec-dot { width: 8px; height: 8px; border-radius: 50%; background: #4cd964; display: inline-block; }
.cec-header-actions { display: flex; gap: 6px; align-items: center; }
.cec-lang {
	background: rgba(255, 255, 255, 0.22);
	border: none;
	color: #fff;
	border-radius: 6px;
	padding: 4px 9px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}
.cec-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

/* Messages */
.cec-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f8fa;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.cec-msg {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.cec-bot {
	background: #fff;
	color: #222;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.cec-user {
	background: var(--cec-accent);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

/* Typing dots */
.cec-typing { display: flex; gap: 4px; padding: 13px; }
.cec-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #bbb;
	animation: cec-blink 1.2s infinite;
}
.cec-typing span:nth-child(2) { animation-delay: 0.2s; }
.cec-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cec-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Suggestions */
.cec-suggest { padding: 0 14px 4px; background: #f7f8fa; display: flex; flex-wrap: wrap; gap: 6px; }
.cec-chip {
	background: #fff;
	border: 1px solid var(--cec-accent);
	color: #333;
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 12.5px;
	cursor: pointer;
}
.cec-chip:hover { background: var(--cec-accent); color: #fff; }

/* Lead bar */
.cec-leadbar { background: #f7f8fa; padding: 8px 14px; }
.cec-quote-btn {
	width: 100%;
	background: #1c2b39;
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 10px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.cec-quote-btn:hover { opacity: 0.92; }

/* Input bar */
.cec-inputbar {
	display: flex;
	border-top: 1px solid #e7e9ee;
	background: #fff;
	padding: 10px;
	gap: 8px;
}
.cec-input {
	flex: 1;
	border: 1px solid #dcdfe6;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	outline: none;
}
.cec-input:focus { border-color: var(--cec-accent); }
.cec-send {
	background: var(--cec-accent);
	border: none;
	color: #fff;
	border-radius: 10px;
	width: 44px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Lead form */
.cec-leadform {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
	background: #fff;
	border-top: 1px solid #e7e9ee;
}
.cec-lead-title { font-weight: 700; font-size: 15px; color: #1c2b39; }
.cec-leadform input,
.cec-leadform textarea {
	border: 1px solid #dcdfe6;
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 13.5px;
	font-family: inherit;
	outline: none;
}
.cec-leadform input:focus,
.cec-leadform textarea:focus { border-color: var(--cec-accent); }
.cec-lf-submit {
	background: var(--cec-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 10px;
	font-weight: 700;
	cursor: pointer;
}
.cec-lf-cancel {
	background: none;
	border: none;
	color: #888;
	font-size: 12.5px;
	cursor: pointer;
	text-decoration: underline;
}

@media (max-width: 480px) {
	.cec-panel { width: calc(100vw - 32px); height: 70vh; }
}
