.tps-chatbot,
.tps-chatbot * {
	box-sizing: border-box;
}

.tps-chatbot {
	--tps-primary: #2563eb;
	--tps-secondary: #06b6d4;
	--tps-bg: #f8fafc;
	--tps-text: #0f172a;
	--tps-muted: #64748b;
	--tps-border: #e2e8f0;
	position: fixed;
	z-index: 999999;
	bottom: 24px;
	font-family: Inter, Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--tps-text);
}

.tps-chatbot-right {
	right: 24px;
}

.tps-chatbot-left {
	left: 24px;
}

.tps-chatbot__launcher {
	position: relative;
	display: grid;
	width: 64px;
	height: 64px;
	place-items: center;
	border: 0;
	border-radius: 24px;
	color: #fff;
	background: linear-gradient(135deg, var(--tps-primary), var(--tps-secondary));
	box-shadow: 0 22px 50px rgba(37, 99, 235, 0.34);
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	overflow: hidden;
}

.tps-chatbot__launcher:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 28px 65px rgba(37, 99, 235, 0.42);
}

.tps-chatbot__launcher svg,
.tps-chatbot__send svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tps-chatbot__pulse {
	position: absolute;
	inset: -5px;
	border-radius: 28px;
	border: 1px solid rgba(6, 182, 212, 0.45);
	animation: tpsPulse 2s infinite;
}

.tps-chatbot__panel {
	position: absolute;
	right: 0;
	bottom: 82px;
	display: flex;
	width: min(410px, calc(100vw - 32px));
	height: min(680px, calc(100vh - 120px));
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(226, 232, 240, 0.9);
	border-radius: 28px;
	background: #fff;
	box-shadow: 0 28px 90px rgba(15, 23, 42, 0.24);
	opacity: 0;
	transform: translateY(18px) scale(0.96);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.tps-chatbot-left .tps-chatbot__panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.tps-chatbot.is-open .tps-chatbot__panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.tps-chatbot__header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px;
	color: #fff;
	background: radial-gradient(circle at 20% 0%, rgba(6, 182, 212, 0.6), transparent 36%), linear-gradient(135deg, #0f172a, var(--tps-primary));
}

.tps-chatbot__avatar {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	border-radius: 18px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.16);
	box-shadow: 0 12px 28px rgba(6, 182, 212, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tps-chatbot__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tps-chatbot__header h2 {
	margin: 0;
	font-size: 16px;
	line-height: 1.25;
	font-weight: 850;
	color: #fff;
}

.tps-chatbot__header p {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 5px 0 0;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.78);
}

.tps-chatbot__header p span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.tps-chatbot__reset,
.tps-chatbot__close {
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 14px;
	color: #fff;
	background: rgba(255, 255, 255, 0.13);
	font-size: 25px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.tps-chatbot__reset {
	display: grid;
	margin-left: auto;
	place-items: center;
}

.tps-chatbot__reset svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tps-chatbot__close:hover {
	background: rgba(255, 255, 255, 0.22);
}

.tps-chatbot__reset:hover {
	background: rgba(255, 255, 255, 0.22);
}

.tps-chatbot__messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	background: linear-gradient(180deg, var(--tps-bg), #fff);
	scroll-behavior: smooth;
}

.tps-chatbot__message {
	display: flex;
	margin-bottom: 13px;
}

.tps-chatbot__message span {
	max-width: 84%;
	padding: 12px 14px;
	border-radius: 18px;
	font-size: 14px;
	line-height: 1.55;
	white-space: pre-wrap;
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.tps-chatbot__message--bot span {
	border: 1px solid var(--tps-border);
	border-top-left-radius: 8px;
	background: #fff;
	color: var(--tps-text);
}

.tps-chatbot__message--user {
	justify-content: flex-end;
}

.tps-chatbot__message--user span {
	border-top-right-radius: 8px;
	color: #fff;
	background: linear-gradient(135deg, var(--tps-primary), var(--tps-secondary));
}

.tps-chatbot__typing-message {
	align-items: flex-end;
	gap: 8px;
}

.tps-chatbot__message-avatar {
	display: grid;
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	place-items: center;
	overflow: hidden;
	border: 1px solid #dbeafe;
	border-radius: 12px;
	color: #fff;
	background: linear-gradient(135deg, #0f172a, var(--tps-primary));
	font-size: 9px;
	font-weight: 900;
	box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.tps-chatbot__message-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tps-chatbot__typing-message .tps-chatbot__typing-bubble {
	display: flex;
	width: auto;
	min-width: 62px;
	max-width: none;
	gap: 5px;
	align-items: center;
	padding: 12px 14px;
	border: 1px solid var(--tps-border);
	border-radius: 18px;
	border-top-left-radius: 8px;
	background: #fff;
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.tps-chatbot__typing-bubble i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--tps-primary);
	animation: tpsTyping 1s infinite ease-in-out;
}

.tps-chatbot__typing-bubble i:nth-child(2) {
	animation-delay: 0.12s;
	background: var(--tps-secondary);
}

.tps-chatbot__typing-bubble i:nth-child(3) {
	animation-delay: 0.24s;
}

.tps-chatbot__quick {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 12px 14px;
	border-top: 1px solid var(--tps-border);
	background: #fff;
}

.tps-chatbot__quick button {
	flex: 0 0 auto;
	border: 1px solid #dbeafe;
	border-radius: 999px;
	padding: 9px 12px;
	color: var(--tps-primary);
	background: #eff6ff;
	font-size: 12px;
	font-weight: 800;
	cursor: pointer;
	transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tps-chatbot__quick button:hover {
	transform: translateY(-1px);
	border-color: var(--tps-secondary);
	background: #ecfeff;
}

.tps-chatbot__typing {
	gap: 5px;
	align-items: center;
	padding: 0 18px 12px;
	background: #fff;
}

.tps-chatbot__typing:not([hidden]) {
	display: flex;
}

.tps-chatbot__typing span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tps-primary);
	animation: tpsTyping 1s infinite ease-in-out;
}

.tps-chatbot__typing span:nth-child(2) {
	animation-delay: 0.12s;
	background: var(--tps-secondary);
}

.tps-chatbot__typing span:nth-child(3) {
	animation-delay: 0.24s;
}

.tps-chatbot__lead {
	margin: 0 14px 12px;
	padding: 14px;
	border: 1px solid #dbeafe;
	border-radius: 20px;
	background: #f8fbff;
}

.tps-chatbot__lead-message {
	display: block;
}

.tps-chatbot__lead-message .tps-chatbot__lead {
	width: 100%;
	max-width: 100%;
	margin: 0 0 13px;
}

.tps-chatbot__lead-inline {
	box-shadow: 0 14px 34px rgba(37, 99, 235, 0.08);
}

.tps-chatbot__lead form {
	display: grid;
	gap: 9px;
}

.tps-chatbot__lead input,
.tps-chatbot__lead textarea {
	width: 100%;
	border: 1px solid var(--tps-border);
	border-radius: 14px;
	padding: 10px 12px;
	color: var(--tps-text);
	background: #fff;
	font-size: 13px;
	outline: none;
}

.tps-chatbot__lead textarea {
	min-height: 76px;
	resize: vertical;
}

.tps-chatbot__lead button {
	border: 0;
	border-radius: 14px;
	padding: 11px 14px;
	color: #fff;
	background: linear-gradient(135deg, var(--tps-primary), var(--tps-secondary));
	font-weight: 850;
	cursor: pointer;
}

.tps-chatbot__footer {
	padding: 14px;
	border-top: 1px solid var(--tps-border);
	background: #fff;
}

.tps-chatbot__form {
	display: flex;
	gap: 10px;
}

.tps-chatbot__input {
	min-width: 0;
	flex: 1;
	border: 1px solid var(--tps-border);
	border-radius: 18px;
	padding: 13px 14px;
	color: var(--tps-text);
	background: var(--tps-bg);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tps-chatbot__input:focus {
	border-color: var(--tps-primary);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.tps-chatbot__send {
	display: grid;
	width: 48px;
	height: 48px;
	place-items: center;
	border: 0;
	border-radius: 18px;
	color: #fff;
	background: linear-gradient(135deg, var(--tps-primary), var(--tps-secondary));
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.tps-chatbot__send:disabled {
	opacity: 0.6;
	cursor: wait;
}

.tps-chatbot__whatsapp {
	display: flex;
	justify-content: center;
	margin-top: 10px;
	border-radius: 16px;
	padding: 12px 14px;
	color: #075e54;
	background: #dcfce7;
	font-size: 13px;
	font-weight: 900;
	text-decoration: none;
	transition: transform 0.2s ease, background 0.2s ease;
}

.tps-chatbot__whatsapp:hover {
	transform: translateY(-1px);
	background: #bbf7d0;
}

.tps-chatbot__whatsapp.is-disabled {
	display: none;
}

@keyframes tpsPulse {
	0% {
		opacity: 0.8;
		transform: scale(0.96);
	}
	100% {
		opacity: 0;
		transform: scale(1.22);
	}
}

@keyframes tpsTyping {
	0%, 80%, 100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-4px);
	}
}

@media (max-width: 520px) {
	.tps-chatbot {
		right: 16px;
		bottom: 16px;
		left: 16px;
	}

	.tps-chatbot__launcher {
		margin-left: auto;
		width: 58px;
		height: 58px;
		border-radius: 22px;
	}

	.tps-chatbot-left .tps-chatbot__launcher {
		margin-right: auto;
		margin-left: 0;
	}

	.tps-chatbot__panel,
	.tps-chatbot-left .tps-chatbot__panel {
		right: 0;
		left: 0;
		bottom: 74px;
		width: 100%;
		height: min(660px, calc(100dvh - 100px));
		border-radius: 24px;
	}

	.tps-chatbot__header {
		gap: 10px;
		padding: 14px;
	}

	.tps-chatbot__avatar {
		width: 42px;
		height: 42px;
		flex-basis: 42px;
		border-radius: 15px;
	}

	.tps-chatbot__header h2 {
		font-size: 14px;
	}

	.tps-chatbot__messages {
		padding: 14px;
	}

	.tps-chatbot__quick {
		padding: 10px;
	}

	.tps-chatbot__footer {
		padding: 10px;
	}
}

@media (max-width: 360px) {
	.tps-chatbot {
		right: 10px;
		left: 10px;
		bottom: 10px;
	}

	.tps-chatbot__panel,
	.tps-chatbot-left .tps-chatbot__panel {
		bottom: 68px;
		height: calc(100dvh - 86px);
		border-radius: 20px;
	}

	.tps-chatbot__reset,
	.tps-chatbot__close {
		width: 34px;
		height: 34px;
		border-radius: 12px;
	}
}
