:root {
	--ttg-brand: #8636F8;
	--ttg-brand-dark: #5b1fd6;
}

#ttg-chatbot-root {
	position: fixed;
	z-index: 999999;
	bottom: 24px;
	right: 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#ttg-chatbot-root * {
	box-sizing: border-box;
}

.ttg-chat-bubble {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--ttg-brand), var(--ttg-brand-dark));
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease;
	border: none;
}

.ttg-chat-bubble:hover {
	transform: scale(1.06);
}

.ttg-chat-panel {
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: 70vh;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.ttg-chat-panel.ttg-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.ttg-chat-header {
	background: linear-gradient(135deg, var(--ttg-brand), var(--ttg-brand-dark));
	color: #fff;
	padding: 14px 16px;
	font-weight: 600;
	font-size: 15px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
}

.ttg-chat-header button {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}

.ttg-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #faf9fc;
}

.ttg-chat-body {
	display: none;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.ttg-precapture {
	display: none;
	flex-direction: column;
	gap: 12px;
	padding: 20px 18px;
	flex: 1;
	background: #faf9fc;
}

.ttg-precapture-intro {
	margin: 0 0 4px;
	font-size: 14px;
	color: #444;
	line-height: 1.4;
}

.ttg-precapture form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ttg-precapture input {
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 14px;
	outline: none;
	width: 100%;
}

.ttg-precapture input:focus {
	border-color: var(--ttg-brand);
}

.ttg-precapture-error {
	color: #d33;
	font-size: 12.5px;
	min-height: 16px;
}

.ttg-precapture button[type="submit"] {
	background: linear-gradient(135deg, var(--ttg-brand), var(--ttg-brand-dark));
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ttg-msg {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.ttg-msg-user {
	background: var(--ttg-brand);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.ttg-msg-assistant {
	background: #fff;
	color: #1f1f1f;
	border: 1px solid #ececec;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
}

.ttg-typing {
	padding: 12px 14px;
}

.ttg-typing span {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 3px;
	background: #999;
	border-radius: 50%;
	animation: ttg-blink 1.2s infinite ease-in-out;
}

.ttg-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.ttg-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

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

.ttg-chat-whatsapp {
	padding: 8px 16px;
	text-align: center;
	border-top: 1px solid #f0f0f0;
	background: #fff;
	flex-shrink: 0;
}

.ttg-chat-whatsapp a {
	color: #25D366;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.ttg-chat-input-row {
	display: flex;
	border-top: 1px solid #ececec;
	padding: 10px;
	gap: 8px;
	background: #fff;
	flex-shrink: 0;
}

.ttg-chat-input-row input {
	flex: 1;
	border: 1px solid #e2e2e2;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 14px;
	outline: none;
}

.ttg-chat-input-row input:focus {
	border-color: var(--ttg-brand);
}

.ttg-chat-input-row button {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var(--ttg-brand);
	color: #fff;
	cursor: pointer;
	font-size: 16px;
	flex-shrink: 0;
}

.ttg-chat-input-row button:disabled {
	opacity: 0.6;
	cursor: default;
}

@media (max-width: 480px) {
	.ttg-chat-panel {
		width: calc(100vw - 24px);
		right: -12px;
	}
}
