.cst-chatbot {
	--cst-color: #613524;
	--cst-height: 520px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	box-sizing: border-box;
}
.cst-chatbot *,
.cst-chatbot *::before,
.cst-chatbot *::after {
	box-sizing: border-box;
}
.cst-chatbot [hidden] {
	display: none !important;
}

/* Panel */
.cst-panel {
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #1f2933;
	border: 1px solid #e3e6ea;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}
.cst-inline .cst-panel {
	height: var(--cst-height);
	max-width: 100%;
}

.cst-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--cst-color);
	color: #fff;
	font-weight: 600;
}
.cst-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

/* Mensajes */
.cst-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f6f7f9;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.cst-msg {
	display: flex;
}
.cst-msg.cst-user {
	justify-content: flex-end;
}
.cst-bubble {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.cst-bot .cst-bubble {
	background: #fff;
	border: 1px solid #e3e6ea;
	border-bottom-left-radius: 4px;
}
.cst-user .cst-bubble {
	background: var(--cst-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.cst-typing .cst-bubble {
	opacity: 0.6;
	letter-spacing: 2px;
}

/* Enlaces */
.cst-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 8px;
}
.cst-chatbot a.cst-link {
	display: inline-block;
	padding: 7px 12px;
	border-radius: 8px;
	background: var(--cst-color);
	color: #fff !important;
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}
.cst-chatbot a.cst-link:hover,
.cst-chatbot a.cst-link:focus {
	filter: brightness(1.12);
}

/* Botones rápidos */
.cst-chips {
	display: flex;
	gap: 6px;
	padding: 8px 12px;
	overflow-x: auto;
	background: #fff;
	border-top: 1px solid #e3e6ea;
	scrollbar-width: thin;
}
.cst-chips:empty {
	display: none;
}
.cst-chatbot .cst-chip {
	flex: 0 0 auto;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--cst-color);
	background: var(--cst-color);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}
.cst-chatbot .cst-chip:hover,
.cst-chatbot .cst-chip:focus {
	background: var(--cst-color);
	color: #fff;
	filter: brightness(1.15);
}

/* Formulario */
.cst-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e3e6ea;
	background: #fff;
	margin: 0;
}
.cst-chatbot .cst-input {
	flex: 1;
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid #cfd4da;
	border-radius: 999px;
	font-size: 15px;
	background: #fff;
	color: #1f2933;
}
.cst-chatbot .cst-input:focus {
	outline: 2px solid var(--cst-color);
	outline-offset: 0;
	border-color: transparent;
}
.cst-chatbot .cst-send {
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--cst-color);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.cst-chatbot .cst-send:hover {
	filter: brightness(1.12);
}
.cst-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Modo flotante */
.cst-floating {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
}
.cst-floating .cst-launcher {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: 0;
	background: var(--cst-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	margin-left: auto;
}
.cst-floating .cst-launcher:hover {
	filter: brightness(1.12);
}
.cst-floating .cst-panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	width: 360px;
	height: min(540px, calc(100vh - 110px));
}
.cst-floating.cst-open .cst-launcher {
	display: none;
}
.cst-floating.cst-open .cst-panel {
	bottom: 0;
	height: min(540px, calc(100vh - 40px));
}

@media (max-width: 480px) {
	.cst-floating {
		right: 12px;
		bottom: 12px;
	}
	.cst-floating .cst-panel,
	.cst-floating.cst-open .cst-panel {
		width: calc(100vw - 24px);
		height: min(560px, calc(100vh - 24px));
	}
}

@media (prefers-reduced-motion: no-preference) {
	.cst-floating .cst-panel {
		animation: cst-pop 0.18s ease-out;
	}
	@keyframes cst-pop {
		from { opacity: 0; transform: translateY(8px); }
		to { opacity: 1; transform: none; }
	}
}
