#avi-widget-root, #avi-widget-root * {
	box-sizing: border-box;
}

#avi-widget-root {
	--avi-color: #2563eb;
	--avi-color-dark: color-mix(in srgb, var(--avi-color) 75%, black);
	--avi-whatsapp-color: #38bdf8;
	--avi-whatsapp-text-color: #ffffff;
	--avi-opacity: 0.2;
	--avi-bg-color: #0b1220;
	--avi-user-color: #2563eb;
	--avi-user-text-color: #ffffff;
	--avi-assistant-color: #ffffff;
	--avi-assistant-text-color: #23262e;
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#avi-widget-root.avi-pos-right {
	right: 20px;
}

#avi-widget-root.avi-pos-left {
	left: 20px;
}

#avi-widget-root .avi-bubble {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--avi-color) 0%, var(--avi-color-dark) 100%);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 0;
	margin: 0;
	box-shadow: 0 10px 28px rgba(0,0,0,0.35), 0 0 24px color-mix(in srgb, var(--avi-color) 55%, transparent);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#avi-widget-root .avi-bubble:hover {
	transform: scale(1.06);
	box-shadow: 0 14px 32px rgba(0,0,0,0.3);
}

#avi-widget-root .avi-bubble.avi-has-avatar {
	width: auto;
	height: 150px;
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}

#avi-widget-root .avi-bubble.avi-has-avatar:hover {
	transform: scale(1.04);
	box-shadow: none;
}

#avi-widget-root .avi-bubble-avatar {
	width: auto;
	height: 100%;
	max-width: none;
	max-height: none;
	border-radius: 0;
	object-fit: contain;
	display: block;
	filter: drop-shadow(0 10px 18px rgba(0,0,0,0.28));
}

#avi-widget-root .avi-header-info {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
}

#avi-widget-root .avi-header-avatar {
	width: 34px;
	height: 34px;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #fff;
	display: block;
	border: 2px solid color-mix(in srgb, var(--avi-color) 65%, white);
	box-shadow: 0 0 12px color-mix(in srgb, var(--avi-color) 55%, transparent);
}

#avi-widget-root .avi-panel {
	position: absolute;
	bottom: 76px;
	width: 368px;
	max-width: calc(100vw - 40px);
	height: 528px;
	max-height: calc(100vh - 140px);
	background: color-mix(in srgb, var(--avi-bg-color) calc(var(--avi-opacity) * 100%), transparent);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-radius: 22px;
	border: 1px solid color-mix(in srgb, var(--avi-color) 45%, transparent);
	box-shadow: 0 20px 56px rgba(0,0,0,0.45), 0 0 0 1px color-mix(in srgb, var(--avi-color) 18%, transparent), 0 0 36px color-mix(in srgb, var(--avi-color) 30%, transparent);
	color: #f1f5f9;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(18px) scale(0.97);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

#avi-widget-root.avi-pos-right .avi-panel {
	right: 0;
}

#avi-widget-root.avi-pos-left .avi-panel {
	left: 0;
}

#avi-widget-root.avi-has-avatar .avi-panel {
	bottom: 160px;
}

#avi-widget-root.avi-open .avi-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

#avi-widget-root .avi-header {
	background: transparent;
	border-bottom: 1px solid color-mix(in srgb, var(--avi-color) 30%, transparent);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#avi-widget-root .avi-header-title {
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	font-weight: 700;
	font-size: 15.5px;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#avi-widget-root .avi-close {
	background: rgba(255,255,255,0.14);
	border: none;
	color: #fff;
	font-size: 14px;
	width: 28px;
	height: 28px;
	min-width: 28px;
	min-height: 28px;
	max-width: 28px;
	max-height: 28px;
	border-radius: 50%;
	flex-shrink: 0;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

#avi-widget-root .avi-close:hover {
	background: rgba(255,255,255,0.26);
}

#avi-widget-root .avi-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 11px;
	background: transparent;
}

#avi-widget-root .avi-msg {
	display: flex;
	max-width: 86%;
}

#avi-widget-root .avi-msg-user {
	align-self: flex-end;
	justify-content: flex-end;
}

#avi-widget-root .avi-msg-assistant {
	align-self: flex-start;
}

#avi-widget-root .avi-msg-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.5;
	word-wrap: break-word;
}

#avi-widget-root .avi-msg-user .avi-msg-bubble {
	background: var(--avi-user-color);
	color: var(--avi-user-text-color);
	border-bottom-right-radius: 5px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}

#avi-widget-root .avi-msg-assistant .avi-msg-bubble {
	background: var(--avi-assistant-color);
	color: var(--avi-assistant-text-color);
	border-bottom-left-radius: 5px;
	box-shadow: 0 2px 10px rgba(15,23,42,0.07);
}

#avi-widget-root .avi-msg-bubble a {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
	word-break: break-word;
}

#avi-widget-root .avi-msg-assistant .avi-msg-bubble a {
	color: var(--avi-color);
}

#avi-widget-root .avi-msg-bubble strong {
	font-weight: 800;
}

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

#avi-widget-root .avi-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

#avi-widget-root .avi-typing span:nth-child(3) {
	animation-delay: 0.4s;
	margin-right: 0;
}

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

#avi-widget-root .avi-cta-row {
	display: flex;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid color-mix(in srgb, var(--avi-color) 22%, transparent);
	background: color-mix(in srgb, var(--avi-bg-color) calc(var(--avi-opacity) * 100%), transparent);
}

#avi-widget-root .avi-cta {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-align: center;
	padding: 9px 10px;
	border-radius: 999px;
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none;
	border: 1px solid transparent;
	color: #333;
	box-shadow: 0 2px 8px rgba(15,23,42,0.06);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#avi-widget-root .avi-cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(15,23,42,0.12);
}

#avi-widget-root .avi-cta-icon {
	width: 14px;
	height: 14px;
	flex: none;
}

#avi-widget-root .avi-cta-whatsapp {
	background: var(--avi-whatsapp-color);
	color: var(--avi-whatsapp-text-color);
	box-shadow: 0 0 14px color-mix(in srgb, var(--avi-whatsapp-color) 40%, transparent);
}

#avi-widget-root .avi-cta-calendar {
	background: var(--avi-color);
	color: #fff;
	box-shadow: 0 0 14px color-mix(in srgb, var(--avi-color) 40%, transparent);
}

#avi-widget-root .avi-cta-row.avi-pulse .avi-cta {
	animation: avi-cta-pulse 0.65s ease 2;
}

@keyframes avi-cta-pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); box-shadow: 0 0 0 5px color-mix(in srgb, var(--avi-color) 25%, transparent); }
	100% { transform: scale(1); }
}

#avi-widget-root .avi-form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid color-mix(in srgb, var(--avi-color) 22%, transparent);
	background: transparent;
}

#avi-widget-root .avi-input {
	flex: 1;
	resize: none;
	border: 1px solid #e4e6ec;
	background: #f6f7fb;
	border-radius: 999px;
	padding: 11px 16px;
	margin: 0;
	font-size: 13.5px;
	font-family: inherit;
	max-height: 110px;
	outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

#avi-widget-root .avi-input:focus {
	border-color: var(--avi-color);
	background: #fff;
}

#avi-widget-root .avi-send {
	background: linear-gradient(135deg, var(--avi-color) 0%, var(--avi-color-dark) 100%);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	min-width: 38px;
	min-height: 38px;
	max-width: 38px;
	max-height: 38px;
	flex: none;
	margin: 0;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 14px color-mix(in srgb, var(--avi-color) 45%, transparent);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#avi-widget-root .avi-send svg {
	width: 17px;
	height: 17px;
	min-width: 17px;
	min-height: 17px;
	flex: none;
	display: block;
}

#avi-widget-root .avi-send:hover:not(:disabled) {
	transform: scale(1.06);
}

#avi-widget-root .avi-send:disabled {
	opacity: 0.5;
	cursor: default;
	box-shadow: none;
}

@media (max-width: 480px) {
	#avi-widget-root .avi-panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 120px);
		bottom: 74px;
	}

	/* Keep the avatar at its original, smaller size on mobile — only the
	   desktop bubble grows (see base .avi-has-avatar rule above). */
	#avi-widget-root .avi-bubble.avi-has-avatar {
		height: 108px;
	}

	#avi-widget-root.avi-has-avatar .avi-panel {
		bottom: 112px;
	}

	#avi-widget-root.avi-pos-right, #avi-widget-root.avi-pos-left {
		right: 12px;
		left: 12px;
	}

	#avi-widget-root.avi-pos-right .avi-panel,
	#avi-widget-root.avi-pos-left .avi-panel {
		right: 0;
		left: 0;
		margin: 0 auto;
	}
}
