#sagassist-root {
	--sagtom-brand: #e31b23;
	--sagtom-ink: #171717;
	--sagtom-soft: #f4f5f7;
	--sagtom-line: #e7e7e7;
	--sagtom-gold: #e9c879;
	position: static !important;
	width: 0 !important;
	height: 0 !important;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color-scheme: light;
}

#sagassist-root *,
#sagassist-root *::before,
#sagassist-root *::after {
	box-sizing: border-box;
}

html.sagassist-welcome-open,
html.sagassist-welcome-open body {
	overflow: hidden !important;
	overscroll-behavior: none;
}

.sagtom-ai-backdrop {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147482999;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background:
		radial-gradient(circle at 72% 18%, rgba(227, 27, 35, 0.18), transparent 32%),
		linear-gradient(135deg, rgba(6, 8, 11, 0.72), rgba(18, 21, 26, 0.62));
	backdrop-filter: blur(7px) saturate(0.78);
	-webkit-backdrop-filter: blur(7px) saturate(0.78);
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease;
}

.sagtom-ai-backdrop.is-open {
	opacity: 1;
	pointer-events: auto;
}

#sagassist-root.is-welcome-active .sagtom-ai-launcher {
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
}

.sagtom-ai-launcher {
	position: fixed !important;
	top: 50%;
	right: auto !important;
	bottom: auto !important;
	left: 16px !important;
	z-index: 2147483001;
	display: grid;
	width: 54px;
	height: 54px;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 50%;
	overflow: visible;
	border: 1px solid rgba(255, 255, 255, 0.34);
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 42%),
		var(--sagtom-brand);
	color: #fff;
	box-shadow:
		0 13px 34px rgba(0, 0, 0, 0.24),
		0 0 0 6px rgba(227, 27, 35, 0.11);
	cursor: pointer;
	appearance: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transform: translateY(-50%);
	transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease, visibility 160ms;
	animation: sagtom-ai-launcher-pulse 3.2s ease-in-out infinite;
}

.sagtom-ai-launcher:hover {
	transform: translateY(calc(-50% - 2px));
	box-shadow:
		0 16px 38px rgba(0, 0, 0, 0.29),
		0 0 0 9px rgba(227, 27, 35, 0.13);
}

.sagtom-ai-launcher::after {
	position: absolute;
	top: 50%;
	left: calc(100% + 12px);
	width: max-content;
	max-width: 150px;
	padding: 7px 10px;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 10px;
	background: rgba(18, 18, 20, 0.92);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
	color: #fff;
	content: attr(data-label);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.01em;
	opacity: 0;
	pointer-events: none;
	transform: translate(-5px, -50%);
	transition: opacity 150ms ease, transform 150ms ease;
	white-space: nowrap;
}

.sagtom-ai-launcher:hover::after,
.sagtom-ai-launcher:focus-visible::after {
	opacity: 1;
	transform: translate(0, -50%);
}

@keyframes sagtom-ai-launcher-pulse {
	0%,
	100% {
		box-shadow:
			0 13px 34px rgba(0, 0, 0, 0.24),
			0 0 0 6px rgba(227, 27, 35, 0.09);
	}
	50% {
		box-shadow:
			0 13px 34px rgba(0, 0, 0, 0.24),
			0 0 0 10px rgba(227, 27, 35, 0.02);
	}
}

.sagtom-ai-panel.is-open + .sagtom-ai-launcher {
	pointer-events: none;
	opacity: 0;
}

.sagtom-ai-unread {
	position: absolute;
	top: -4px;
	right: -3px;
	display: grid;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	place-items: center;
	border: 2px solid #fff;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
}

.sagtom-ai-unread[hidden] {
	display: none;
}

.sagtom-ai-launcher:focus-visible,
.sagtom-ai-close:focus-visible,
.sagtom-ai-send:focus-visible {
	outline: 3px solid rgba(227, 27, 35, 0.28);
	outline-offset: 3px;
}

.sagtom-ai-launcher svg,
.sagtom-ai-close svg,
.sagtom-ai-send svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

.sagtom-ai-panel {
	position: fixed !important;
	top: var(--sagassist-panel-center, 50%);
	right: auto !important;
	bottom: auto !important;
	left: 82px !important;
	z-index: 2147483000;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: min(370px, calc(100vw - 110px)) !important;
	height: min(510px, var(--sagassist-panel-max-height, calc(100vh - 24px))) !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	overscroll-behavior: contain;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.98);
	box-shadow:
		0 30px 90px rgba(0, 0, 0, 0.3),
		0 2px 10px rgba(0, 0, 0, 0.08);
	opacity: 0;
	transform: translateY(calc(-50% + 12px)) scale(0.98);
	transform-origin: center left;
	visibility: hidden;
	transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.sagtom-ai-panel.is-open {
	opacity: 1;
	transform: translateY(-50%) scale(1);
	visibility: visible;
}

@media (min-width: 769px) {
	#sagassist-root.is-welcome-active .sagtom-ai-panel {
		top: var(--sagassist-panel-center, 50%) !important;
		right: auto !important;
		left: 50% !important;
		width: min(420px, calc(100vw - 32px)) !important;
		height: min(570px, var(--sagassist-panel-max-height, calc(100vh - 24px))) !important;
		border-color: rgba(255, 255, 255, 0.28);
		border-radius: 24px;
		box-shadow:
			0 42px 120px rgba(0, 0, 0, 0.44),
			0 0 0 1px rgba(255, 255, 255, 0.13);
		transform: translate(-50%, calc(-50% + 12px)) scale(0.98);
		transform-origin: center;
	}

	#sagassist-root.is-welcome-active .sagtom-ai-panel.is-open {
		transform: translate(-50%, -50%) scale(1);
	}
}

.sagtom-ai-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 68px;
	padding: 12px 14px;
	overflow: hidden;
	background:
		radial-gradient(circle at 12% 0, rgba(227, 27, 35, 0.42), transparent 45%),
		linear-gradient(135deg, #121316 0%, #1c1d21 62%, #101114 100%);
	color: #fff;
	isolation: isolate;
}

.sagtom-ai-header::after {
	position: absolute;
	right: -28px;
	bottom: -52px;
	z-index: -1;
	width: 120px;
	height: 120px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 50%;
	box-shadow: 0 0 0 16px rgba(255, 255, 255, 0.025);
	content: "";
}

.sagtom-ai-identity {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 11px;
}

.sagtom-ai-avatar {
	position: relative;
	display: grid;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	place-items: center;
	border-radius: 13px;
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 48%),
		var(--sagtom-brand);
	color: #fff;
	font-size: 20px;
	font-weight: 800;
	box-shadow:
		0 8px 20px rgba(0, 0, 0, 0.22),
		inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.sagtom-ai-avatar span {
	line-height: 1;
}

.sagtom-ai-avatar i {
	position: absolute;
	top: -7px;
	right: -6px;
	display: grid;
	width: 18px;
	height: 18px;
	place-items: center;
	border: 2px solid #191a1d;
	border-radius: 50%;
	background: var(--sagtom-gold);
	color: #151515;
	font-size: 9px;
	font-style: normal;
	line-height: 1;
}

.sagtom-ai-title-wrap {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.sagtom-ai-title {
	overflow: hidden;
	font-size: 16px;
	letter-spacing: -0.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sagtom-ai-status {
	color: rgba(255, 255, 255, 0.7);
	font-size: 12px;
}

.sagtom-ai-status::before {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 6px;
	border-radius: 50%;
	background: #34c759;
	content: "";
}

.sagtom-ai-status.is-human::before {
	background: #ffb020;
}

.sagtom-ai-close {
	display: grid;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.09);
	background: rgba(255, 255, 255, 0.07);
	color: #fff;
	cursor: pointer;
	appearance: none;
	transition: background 150ms ease;
}

.sagtom-ai-close:hover {
	background: rgba(255, 255, 255, 0.18);
}

.sagtom-ai-close svg {
	width: 21px;
	height: 21px;
}

.sagtom-ai-conversation {
	overflow-x: hidden;
	overflow-y: auto;
	padding: 15px 13px 8px;
	background:
		radial-gradient(circle at 100% 0, rgba(227, 27, 35, 0.07), transparent 34%),
		linear-gradient(180deg, #fafafa 0%, #ffffff 38%);
	scroll-behavior: smooth;
	scrollbar-color: #d8d8d8 transparent;
	scrollbar-width: thin;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.sagtom-ai-welcome-card {
	position: relative;
	margin: 0 0 13px;
	padding: 17px 16px 15px;
	overflow: hidden;
	border: 1px solid rgba(227, 27, 35, 0.1);
	border-radius: 18px;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(247, 244, 244, 0.95));
	box-shadow: 0 13px 34px rgba(24, 24, 27, 0.08);
}

.sagtom-ai-welcome-card::after {
	position: absolute;
	top: -58px;
	right: -54px;
	width: 130px;
	height: 130px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(227, 27, 35, 0.16), transparent 68%);
	content: "";
	pointer-events: none;
}

.sagtom-ai-welcome-kicker {
	position: relative;
	z-index: 1;
	display: block;
	margin-bottom: 6px;
	color: var(--sagtom-brand);
	font-size: 10px;
	font-weight: 850;
	letter-spacing: 0.14em;
}

.sagtom-ai-welcome-heading {
	position: relative;
	z-index: 1;
	display: block;
	max-width: 290px;
	color: #151518;
	font-size: 21px;
	font-weight: 780;
	letter-spacing: -0.035em;
	line-height: 1.16;
}

.sagtom-ai-welcome-copy {
	position: relative;
	z-index: 1;
	max-width: 335px;
	margin: 9px 0 12px;
	color: #55565b;
	font-size: 12.5px;
	line-height: 1.5;
}

.sagtom-ai-welcome-trust {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	color: #68696e;
	font-size: 10.5px;
	font-weight: 650;
}

.sagtom-ai-welcome-trust span:first-child {
	color: #8e6b18;
}

.sagtom-ai-row {
	display: flex;
	margin: 0 0 9px;
}

.sagtom-ai-row-user {
	justify-content: flex-end;
}

.sagtom-ai-bubble {
	max-width: 84%;
	padding: 10px 12px;
	border-radius: 16px 16px 16px 5px;
	border: 1px solid rgba(0, 0, 0, 0.035);
	background: #f0f1f3;
	color: var(--sagtom-ink);
	font-size: 14px;
	overflow-wrap: anywhere;
}

.sagtom-ai-row-user .sagtom-ai-bubble {
	border-color: transparent;
	border-radius: 16px 16px 5px 16px;
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent 42%),
		var(--sagtom-brand);
	color: #fff;
	box-shadow: 0 8px 20px rgba(227, 27, 35, 0.14);
}

.sagtom-ai-bubble p {
	margin: 0;
	padding: 0;
}

.sagtom-ai-bubble p + p {
	margin-top: 7px;
}

.sagtom-ai-typing {
	display: flex;
	min-width: 58px;
	align-items: center;
	gap: 5px;
}

.sagtom-ai-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #8c8c8c;
	animation: sagtom-ai-bounce 1.1s infinite ease-in-out;
}

.sagtom-ai-typing span:nth-child(2) {
	animation-delay: 120ms;
}

.sagtom-ai-typing span:nth-child(3) {
	animation-delay: 240ms;
}

@keyframes sagtom-ai-bounce {
	0%,
	60%,
	100% {
		transform: translateY(0);
	}
	30% {
		transform: translateY(-4px);
	}
}

.sagtom-ai-form {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	padding: 10px 11px;
	gap: 8px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	background: rgba(255, 255, 255, 0.98);
	margin: 0 !important;
}

.sagtom-ai-input {
	display: block;
	width: 100%;
	min-height: 41px;
	max-height: 112px;
	margin: 0;
	padding: 10px 12px;
	resize: none;
	border: 1px solid #d7d7da;
	border-radius: 14px;
	background: #f7f7f8;
	box-shadow: none;
	color: var(--sagtom-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1.35;
	appearance: none;
}

.sagtom-ai-input[readonly] {
	opacity: 0.82;
}

.sagtom-ai-input:focus {
	border-color: var(--sagtom-brand);
	outline: 0;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(227, 27, 35, 0.09);
}

.sagtom-ai-send {
	display: grid;
	width: 41px;
	height: 41px;
	padding: 0;
	place-items: center;
	border: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 14px;
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.19), transparent 44%),
		var(--sagtom-brand);
	color: #fff;
	box-shadow: 0 8px 18px rgba(227, 27, 35, 0.22);
	cursor: pointer;
	appearance: none;
	touch-action: manipulation;
}

.sagtom-ai-send:disabled {
	cursor: wait;
	opacity: 0.58;
}

.sagtom-ai-send svg {
	width: 20px;
	height: 20px;
}

.sagtom-ai-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
}

@media (max-width: 768px) {
	.sagtom-ai-launcher {
		top: var(--sagassist-panel-center, 50%);
		right: auto !important;
		left: max(8px, env(safe-area-inset-left)) !important;
		width: 52px;
		height: 52px;
	}

	.sagtom-ai-launcher::after {
		display: none;
	}

	.sagtom-ai-panel {
		top: var(--sagassist-panel-top, max(8px, env(safe-area-inset-top))) !important;
		right: auto !important;
		bottom: auto !important;
		left: var(--sagassist-panel-left, 50%) !important;
		width: var(--sagassist-panel-width, calc(100vw - 16px)) !important;
		min-width: 0 !important;
		max-width: var(--sagassist-panel-width, calc(100vw - 16px)) !important;
		height: min(480px, var(--sagassist-panel-max-height, calc(100dvh - 24px))) !important;
		max-height: var(--sagassist-panel-max-height, calc(100dvh - 24px)) !important;
		border-radius: 16px;
		transform: translate(-50%, 10px) scale(0.98);
		transform-origin: top center;
	}

	.sagtom-ai-panel.is-open {
		transform: translate(-50%, 0) scale(1);
	}

	.sagtom-ai-header {
		min-height: 64px;
		padding: 10px 12px;
	}

	.sagtom-ai-conversation {
		min-height: 0;
		padding: 12px 11px 5px;
	}

	.sagtom-ai-form {
		padding: 9px;
		padding-bottom: max(9px, env(safe-area-inset-bottom));
	}

	.sagtom-ai-bubble {
		max-width: 90%;
		font-size: 13.5px;
	}

	.sagtom-ai-welcome-card {
		padding: 15px 14px 13px;
		border-radius: 16px;
	}

	.sagtom-ai-welcome-heading {
		font-size: 19px;
	}

	.sagtom-ai-input {
		font-size: 16px;
	}
}

@media (max-height: 520px) {
	.sagtom-ai-panel {
		height: var(--sagassist-panel-max-height, calc(100vh - 16px)) !important;
	}

	.sagtom-ai-header {
		min-height: 58px;
		padding: 8px 11px;
	}

	.sagtom-ai-avatar {
		flex-basis: 36px;
		width: 36px;
		height: 36px;
	}
}

@media (max-width: 380px) {
	.sagtom-ai-launcher {
		width: 48px;
		height: 48px;
	}

	.sagtom-ai-panel {
		right: auto !important;
		left: var(--sagassist-panel-left, 50%) !important;
		width: var(--sagassist-panel-width, calc(100vw - 12px)) !important;
		max-width: var(--sagassist-panel-width, calc(100vw - 12px)) !important;
		border-radius: 14px;
	}

	.sagtom-ai-header {
		min-height: 58px;
		padding: 8px 9px;
	}

	.sagtom-ai-identity {
		gap: 8px;
	}

	.sagtom-ai-avatar {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
		border-radius: 10px;
		font-size: 17px;
	}

	.sagtom-ai-title {
		font-size: 14px;
	}

	.sagtom-ai-status {
		overflow: hidden;
		max-width: 205px;
		font-size: 10px;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.sagtom-ai-close {
		width: 34px;
		height: 34px;
	}

	.sagtom-ai-conversation {
		padding: 10px 9px 4px;
	}

	.sagtom-ai-welcome-card {
		margin-bottom: 10px;
		padding: 13px 12px 12px;
	}

	.sagtom-ai-welcome-heading {
		max-width: 250px;
		font-size: 17px;
	}

	.sagtom-ai-welcome-copy {
		margin-block: 7px 9px;
		font-size: 11.5px;
	}

	.sagtom-ai-welcome-trust {
		gap: 4px 9px;
		font-size: 9.5px;
	}

	.sagtom-ai-form {
		padding: 7px;
		gap: 6px;
	}

	.sagtom-ai-send {
		width: 40px;
		height: 40px;
	}
}

@media (max-height: 420px) {
	.sagtom-ai-header {
		min-height: 50px;
		padding-block: 6px;
	}

	.sagtom-ai-avatar {
		flex-basis: 32px;
		width: 32px;
		height: 32px;
	}

	.sagtom-ai-status {
		display: none;
	}

	.sagtom-ai-input {
		min-height: 39px;
		max-height: 72px;
		padding-block: 8px;
	}

	.sagtom-ai-send {
		width: 39px;
		height: 39px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sagtom-ai-panel,
	.sagtom-ai-backdrop,
	.sagtom-ai-launcher,
	.sagtom-ai-typing span {
		animation: none;
		transition: none;
	}
}
