.saia-bot-root {
	position: fixed;
	bottom: 1.5rem;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--saia-bot-primary: #2563eb;
	--saia-bot-surface: #ffffff;
	--saia-bot-text: #0f172a;
}

.saia-bot-root.saia-bot-mode-embed {
	position: relative;
	bottom: auto;
	left: auto;
	right: auto;
	width: 100%;
	max-width: none;
	z-index: auto;
	margin: 0;
}

.saia-bot-root.saia-bot-mode-embed .saia-bot-panel {
	position: relative;
	bottom: auto;
	width: 100%;
	max-height: none;
	border-radius: var(--saia-bot-radius, 18px);
	box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
	border: 1px solid rgba(15, 23, 42, 0.08);
}

.saia-bot-root.saia-bot-mode-embed .saia-bot-panel[hidden] {
	display: block;
}

.saia-bot-root.saia-bot-mode-embed[data-saia-bot-toggle="hidden"] .saia-bot-toggle {
	display: none;
}

.saia-bot-root.saia-bot-side-right {
	right: 1.5rem;
}

.saia-bot-root.saia-bot-side-left {
	left: 1.5rem;
}

.saia-bot-toggle {
	width: 56px;
	height: 56px;
	border-radius: 999px;
	border: 0;
	background: var(--saia-bot-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.saia-bot-toggle:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.45);
	outline-offset: 3px;
}

.saia-bot-toggle:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 34px rgba(37, 99, 235, 0.4);
}

.saia-bot-toggle .saia-bot-toggle-icon::before {
	content: "";
	width: 20px;
	height: 18px;
	display: block;
	background: currentColor;
	mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 24 24"%3E%3Cpath d="M12 3c5.08 0 9 3 9 6.72 0 2.66-1.9 4.94-4.7 5.98-.23.09-.3.22-.3.43v1.87c0 .51-.52.81-.95.54l-2.59-1.63c-.24-.15-.53-.15-.77 0l-2.59 1.63c-.43.27-.95-.03-.95-.54v-1.87c0-.21-.07-.34-.3-.43C4.9 14.66 3 12.38 3 9.72 3 6 6.92 3 12 3z"/%3E%3C/svg%3E') center/contain no-repeat;
}

.saia-bot-panel {
	position: absolute;
	bottom: 64px;
	width: min(360px, calc(100vw - 2rem));
	background: var(--saia-bot-surface);
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
	border-radius: var(--saia-bot-radius, 18px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: min(520px, calc(100vh - 5rem));
}

.saia-bot-messages-viewport {
	position: relative;
	flex: 1;
	overflow-y: auto;
	padding-right: 6px;
	scrollbar-width: thin;
}

.saia-bot-messages-viewport::-webkit-scrollbar {
	width: 6px;
}

.saia-bot-messages-viewport::-webkit-scrollbar-thumb {
	background: rgba(15, 23, 42, 0.18);
	border-radius: 999px;
}

.saia-bot-root.saia-bot-fold-enabled {
	--saia-bot-fold-height: 360px;
}

.saia-bot-root.saia-bot-fold-enabled .saia-bot-messages-viewport {
	max-height: var(--saia-bot-fold-height);
}

.saia-bot-panel[hidden] {
	display: none;
}

.saia-bot-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.25rem;
	background: linear-gradient(135deg, var(--saia-bot-primary), #1d4ed8);
	color: #fff;
}

.saia-bot-header-identity {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.saia-bot-header-logo {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.2);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.saia-bot-header h2 {
	margin: 0;
	font-size: 1.1rem;
}

.saia-bot-header-subtitle {
	margin: 0;
	font-size: 0.85rem;
	color: rgba(255,255,255,0.8);
}

.saia-bot-header-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.saia-bot-header-actions button {
	background: transparent;
	border: 0;
	color: inherit;
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 0.35rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.saia-bot-header-actions button:hover,
.saia-bot-header-actions button:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	outline: none;
}

.saia-bot-messages {
	flex: 1;
	padding: 1rem 1.1rem;
	overflow-y: auto;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	scroll-behavior: smooth;
}

.saia-bot-message {
	display: flex;
	gap: 0.6rem;
}

.saia-bot-message.assistant .saia-bot-message-bubble {
	background: #fff;
	color: var(--saia-bot-text);
	border-radius: 16px 16px 16px 6px;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.saia-bot-message.user {
	justify-content: flex-end;
}

.saia-bot-message.user .saia-bot-message-bubble {
	background: var(--saia-bot-primary);
	color: #fff;
	border-radius: 16px 16px 6px 16px;
}

.saia-bot-message-bubble {
	padding: 0.75rem 0.9rem;
	max-width: 80%;
	font-size: 0.92rem;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
}

.saia-bot-message-attachments {
	margin-top: 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.saia-bot-message-attachments a {
	background: rgba(37, 99, 235, 0.1);
	color: inherit;
	padding: 0.4rem 0.6rem;
	border-radius: 8px;
	text-decoration: none;
	border: 1px dashed rgba(37, 99, 235, 0.3);
	font-size: 0.85rem;
}

.saia-bot-message-links a {
	color: inherit;
	text-decoration: underline;
	word-break: break-word;
}

.saia-bot-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0.75rem 1.1rem 0;
}

.saia-bot-quick-reply {
	background: rgba(15, 23, 42, 0.05);
	border: 0;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.85rem;
	color: var(--saia-bot-text);
}

.saia-bot-quick-reply:focus-visible {
	outline: 2px solid var(--saia-bot-primary);
	outline-offset: 2px;
}

.saia-bot-input {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	padding: 0.8rem 1rem 1rem;
	background: #fff;
	border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.saia-bot-input textarea {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	border-radius: 12px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	padding: 0.65rem 0.75rem;
	resize: vertical;
	font-size: 0.95rem;
}

.saia-bot-input textarea:focus-visible {
	outline: 2px solid var(--saia-bot-primary);
	outline-offset: 1px;
}

.saia-bot-clear-history {
	border: 0;
	background: rgba(15, 23, 42, 0.05);
	color: var(--saia-bot-text);
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	cursor: pointer;
}

.saia-bot-clear-history:hover {
	background: rgba(37, 99, 235, 0.12);
}

.saia-bot-clear-history:focus-visible {
	outline: 2px solid var(--saia-bot-primary);
	outline-offset: 2px;
}

.saia-bot-clear-history__icon::before {
	content: "";
	width: 16px;
	height: 16px;
	display: block;
	background: currentColor;
	mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"%3E%3Cpath d="M17.66 5.66a1 1 0 0 0-1.41 0L12 9.91 7.75 5.66a1 1 0 0 0-1.41 1.41L10.59 11l-4.25 4.25a1 1 0 1 0 1.41 1.41L12 12.41l4.25 4.25a1 1 0 1 0 1.41-1.41L13.41 11l4.25-4.25a1 1 0 0 0 0-1.41Z"/%3E%3C/svg%3E') center/contain no-repeat;
}

.saia-bot-send {
	border: 0;
	border-radius: 12px;
	height: 42px;
	width: 42px;
	background: var(--saia-bot-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.saia-bot-send-icon::before {
	content: "";
	width: 18px;
	height: 18px;
	display: block;
	background: currentColor;
	mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23fff" viewBox="0 0 24 24"%3E%3Cpath d="m3.4 20.4 17.3-7.2a1 1 0 0 0 0-1.8L3.4 4.2c-.7-.3-1.4.3-1.2 1l1.8 6.6c.1.4.4.7.8.7h8.8c.2 0 .3.2.2.3l-.2.2-8.8 1.8c-.4.1-.7.4-.8.8l-1.8 6.6c-.2.7.5 1.3 1.2 1z"/%3E%3C/svg%3E') center/contain no-repeat;
}

.saia-bot-typing {
	font-size: 0.85rem;
	color: rgba(15, 23, 42, 0.6);
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.saia-bot-typing::after {
	content: "";
	width: 30px;
	height: 10px;
	background: radial-gradient(circle,currentColor 25%,transparent 26%) left/10px 100% no-repeat;
	animation: saia-bot-bounce 1.2s both infinite;
	opacity: 0.7;
}

@keyframes saia-bot-bounce {
	0%{transform:translateX(0)}
	50%{transform:translateX(10px)}
	100%{transform:translateX(0)}
}

.saia-bot-highlight-ring {
	position: relative;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.45) !important;
	transition: box-shadow 0.3s ease;
}

.saia-bot-highlight-badge {
	position: absolute;
	top: -2.5rem;
	left: 0;
	background: var(--saia-bot-primary);
	color: #fff;
	padding: 0.35rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
	transform: translateY(10px);
	opacity: 0;
	animation: saia-bot-badge 3s forwards;
}

@keyframes saia-bot-badge {
	0% { opacity: 0; transform: translateY(10px); }
	10% { opacity: 1; transform: translateY(0); }
	90% { opacity: 1; }
	100% { opacity: 0; transform: translateY(-6px); }
}

.saia-bot-tooltip {
	position: absolute;
	background: rgba(15, 23, 42, 0.85);
	color: #fff;
	padding: 0.4rem 0.6rem;
	border-radius: 6px;
	font-size: 0.75rem;
	z-index: 9999;
}

.saia-bot-hidden {
	display: none !important;
}

.saia-bot-root.saia-bot-fold-enabled .saia-bot-messages {
	overflow: visible;
	padding-bottom: 2.25rem;
}

.saia-bot-fold-indicator {
	display: none;
	position: sticky;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	padding: 0.5rem 0.75rem 0.65rem;
	border: 0;
	background: linear-gradient(0deg, var(--saia-bot-surface, #ffffff) 65%, rgba(255, 255, 255, 0) 100%);
	color: var(--saia-bot-text, #0f172a);
	font-size: 0.8rem;
	font-weight: 500;
	gap: 0.35rem;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.saia-bot-fold-indicator:focus-visible {
	outline: 2px solid var(--saia-bot-primary);
	outline-offset: 2px;
}

.saia-bot-root.saia-bot-fold-enabled .saia-bot-fold-indicator {
	display: flex;
}

.saia-bot-fold-indicator__icon::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	background: currentColor;
	margin-top: -2px;
	mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"%3E%3Cpath d="M12 17a1 1 0 0 1-.71-.29l-5-5a1 1 0 0 1 1.42-1.42L12 14.59l4.29-4.3a1 1 0 1 1 1.42 1.42l-5 5A1 1 0 0 1 12 17Z"/%3E%3C/svg%3E') center/contain no-repeat;
}

