.automaton-ia-widget {
	--automaton-ia-primary: #823daa;
	--automaton-ia-primary-strong: #6f00c8;
	--automaton-ia-primary-soft: rgba(130, 61, 170, 0.13);
	--automaton-ia-primary-line: rgba(130, 61, 170, 0.32);
	--automaton-ia-ink: #243447;
	position: relative;
	z-index: 1070;
}

.automaton-ia-fab {
	align-items: center;
	background: linear-gradient(145deg, #a350d0 0%, #7d19b5 48%, #5e008f 100%);
	border: 1px solid rgba(255, 255, 255, 0.52);
	border-radius: 50%;
	bottom: 8px;
	box-shadow: 0 12px 28px rgba(111, 0, 200, 0.34), 0 4px 10px rgba(56, 10, 83, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.32);
	color: #fff;
	display: flex;
	height: 45px;
	justify-content: center;
	position: fixed;
	right: 8px;
	transition: box-shadow 180ms ease, transform 180ms ease;
	width: 45px;
	z-index: 1072;
}

.automaton-ia-fab:before {
	animation: automaton-ia-fab-pulse 2.8s ease-out infinite;
	border: 2px solid rgba(130, 61, 170, 0.38);
	border-radius: inherit;
	content: "";
	inset: -1px;
	pointer-events: none;
	position: absolute;
}

.automaton-ia-fab:hover,
.automaton-ia-fab:focus {
	background: linear-gradient(145deg, #ae5bd7 0%, #8621bf 48%, #65009a 100%);
	box-shadow: 0 15px 34px rgba(111, 0, 200, 0.42), 0 5px 12px rgba(56, 10, 83, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.36);
	color: #fff;
	outline: none;
	transform: translateY(-2px) scale(1.03);
}

.automaton-ia-fab:active {
	transform: translateY(0) scale(0.97);
}

.automaton-ia-symbol {
	animation: automaton-ia-symbol-breathe 3.6s ease-in-out infinite;
	align-items: center;
	display: flex;
	height: 40px;
	justify-content: center;
	position: relative;
	width: 40px;
}

.automaton-ia-symbol img {
	filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.78));
	height: 34px;
	object-fit: contain;
	position: relative;
	width: auto;
	z-index: 2;
}

.automaton-ia-symbol__orbit {
	animation: automaton-ia-orbit-spin 4.6s linear infinite;
	border: 1.5px solid rgba(255, 255, 255, 0.68);
	border-bottom-color: rgba(174, 234, 255, 0.2);
	border-left-color: transparent;
	border-radius: 50%;
	height: 27px;
	position: absolute;
	transform-origin: center;
	width: 39px;
	z-index: 1;
}

.automaton-ia-symbol__spark {
	animation: automaton-ia-spark 2.4s ease-in-out infinite;
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 0 6px rgba(255, 255, 255, 0.92);
	height: 8px;
	position: absolute;
	right: 1px;
	top: 1px;
	transform-origin: center;
	width: 2px;
	z-index: 3;
}

.automaton-ia-symbol__spark:after {
	background: inherit;
	border-radius: inherit;
	content: "";
	height: 2px;
	left: -3px;
	position: absolute;
	top: 3px;
	width: 8px;
}

@keyframes automaton-ia-fab-pulse {
	0%, 42% {
		opacity: 0.65;
		transform: scale(1);
	}
	78%, 100% {
		opacity: 0;
		transform: scale(1.34);
	}
}

@keyframes automaton-ia-symbol-breathe {
	0%, 100% {
		transform: scale(0.97);
	}
	50% {
		transform: scale(1.04);
	}
}

@keyframes automaton-ia-orbit-spin {
	from {
		transform: rotate(-28deg);
	}
	to {
		transform: rotate(332deg);
	}
}

@keyframes automaton-ia-spark {
	0%, 58%, 100% {
		opacity: 0.45;
		transform: scale(0.75) rotate(0deg);
	}
	72% {
		opacity: 1;
		transform: scale(1.12) rotate(90deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.automaton-ia-fab:before,
	.automaton-ia-symbol,
	.automaton-ia-symbol__orbit,
	.automaton-ia-symbol__spark {
		animation: none;
	}
}

.automaton-ia-badge {
	align-items: center;
	background: #d94444;
	border: 2px solid #fff;
	border-radius: 50%;
	display: flex;
	font-size: 11px;
	font-weight: 700;
	height: 22px;
	justify-content: center;
	position: absolute;
	right: -3px;
	top: -3px;
	width: 22px;
}

.automaton-ia-drawer {
	background: #fff;
	border-left: 1px solid #dfe4ea;
	bottom: 0;
	box-shadow: -16px 0 40px rgba(34, 45, 57, 0.18);
	display: flex;
	flex-direction: column;
	max-width: calc(100vw - 24px);
	position: fixed;
	right: 0;
	top: 0;
	transform: translateX(104%);
	transition: transform 180ms ease;
	width: 460px;
	z-index: 1071;
}

.automaton-ia-widget.is-open .automaton-ia-drawer {
	transform: translateX(0);
}

.automaton-ia-widget.is-open .automaton-ia-fab {
	display: none;
}

.automaton-ia-drawer-header {
	align-items: center;
	background: linear-gradient(135deg, #fbf8fd 0%, #fff 68%);
	border-bottom: 1px solid #e8edf2;
	display: flex;
	flex-shrink: 0;
	justify-content: space-between;
	min-height: 76px;
	padding: 12px 16px;
	position: relative;
}

.automaton-ia-drawer-header:after {
	background: linear-gradient(90deg, var(--automaton-ia-primary), rgba(174, 234, 255, 0.72), transparent 82%);
	bottom: -1px;
	content: "";
	height: 2px;
	left: 0;
	position: absolute;
	width: 58%;
}

.automaton-ia-drawer-brand {
	align-items: center;
	display: flex;
	gap: 11px;
	min-width: 0;
}

.automaton-ia-drawer-avatar {
	align-items: center;
	background: linear-gradient(145deg, #a350d0 0%, #7d19b5 48%, #5e008f 100%);
	border: 1px solid rgba(111, 0, 200, 0.18);
	border-radius: 8px;
	box-shadow: 0 5px 13px rgba(111, 0, 200, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.3);
	display: flex;
	flex: 0 0 40px;
	height: 40px;
	justify-content: center;
}

.automaton-ia-drawer-avatar img {
	filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.56));
	height: 29px;
	object-fit: contain;
	width: auto;
}

.automaton-ia-drawer-copy {
	min-width: 0;
}

.automaton-ia-drawer-title {
	align-items: center;
	display: flex;
	gap: 8px;
}

.automaton-ia-drawer-title strong {
	color: var(--automaton-ia-ink);
	display: block;
	font-size: 16px;
	line-height: 1.2;
}

.automaton-ia-drawer-title > span {
	align-items: center;
	background: var(--automaton-ia-primary-soft);
	border-radius: 999px;
	color: var(--automaton-ia-primary-strong);
	display: inline-flex;
	font-size: 9px;
	font-weight: 700;
	gap: 4px;
	padding: 3px 6px;
	text-transform: uppercase;
}

.automaton-ia-drawer-title > span i {
	background: var(--automaton-ia-primary);
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(130, 61, 170, 0.12);
	display: block;
	height: 5px;
	width: 5px;
}

.automaton-ia-drawer-copy small {
	color: #6b7785;
	display: block;
	font-size: 11px;
	line-height: 1.25;
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.automaton-ia-drawer-header button,
.automaton-ia-drawer-footer button {
	align-items: center;
	background: #f1f4f7;
	border: 0;
	border-radius: 50%;
	color: #435466;
	display: flex;
	height: 36px;
	justify-content: center;
	width: 36px;
}

.automaton-ia-drawer-header button:hover,
.automaton-ia-drawer-footer button:hover {
	background: var(--automaton-ia-primary);
	color: #fff;
}

.automaton-ia-drawer-body {
	background: #f7f9fb;
	flex: 1;
	min-height: 0;
	overscroll-behavior: contain;
	overflow-y: auto;
	padding: 16px;
	scrollbar-color: rgba(130, 61, 170, 0.34) transparent;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
}

.automaton-ia-drawer-body::-webkit-scrollbar {
	width: 8px;
}

.automaton-ia-drawer-body::-webkit-scrollbar-thumb {
	background: rgba(130, 61, 170, 0.28);
	border: 2px solid transparent;
	border-radius: 999px;
	background-clip: padding-box;
}

.automaton-ia-drawer-body::-webkit-scrollbar-thumb:hover {
	background: rgba(130, 61, 170, 0.46);
	background-clip: padding-box;
}

.automaton-ia-drawer-footer {
	align-items: flex-end;
	background: #fff;
	border-top: 1px solid #e8edf2;
	display: flex;
	flex-shrink: 0;
	gap: 10px;
	padding: 12px;
}

.automaton-ia-drawer-footer textarea {
	background: #f7f9fb;
	border: 1px solid #dfe4ea;
	border-radius: 6px;
	color: #243447;
	flex: 1;
	min-height: 42px;
	padding: 9px 10px;
	resize: none;
}

.automaton-ia-drawer-footer textarea:focus {
	border-color: var(--automaton-ia-primary);
	box-shadow: 0 0 0 2px var(--automaton-ia-primary-soft);
	outline: none;
}

.automaton-ia-msg {
	border-radius: 8px;
	margin-bottom: 10px;
	padding: 10px 12px;
}

.automaton-ia-msg strong,
.automaton-ia-msg span {
	display: block;
}

.automaton-ia-msg strong {
	margin-bottom: 4px;
}

.automaton-ia-msg-assistente {
	background: #fff;
	border: 1px solid #e4e9ef;
	color: var(--automaton-ia-ink);
}

.automaton-ia-msg-usuario {
	background: var(--automaton-ia-primary);
	color: #fff;
	margin-left: 38px;
}

.automaton-ia-validacao-head {
	align-items: flex-start;
	background: #fff;
	border: 1px solid #e4e9ef;
	border-left: 4px solid var(--automaton-ia-primary);
	border-radius: 8px;
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
	padding: 12px;
}

.automaton-ia-validacao-head.is-danger {
	border-left-color: var(--automaton-ia-primary-strong);
}

.automaton-ia-validacao-head i {
	color: var(--automaton-ia-primary);
	font-size: 20px;
	margin-top: 2px;
}

.automaton-ia-validacao-head.is-danger i {
	color: var(--automaton-ia-primary-strong);
}

.automaton-ia-validacao-head strong,
.automaton-ia-validacao-head span {
	display: block;
}

.automaton-ia-validacao-head span {
	color: #687789;
	margin-top: 3px;
}

.automaton-ia-validacao-card {
	background: #fff;
	border: 1px solid #e4e9ef;
	border-radius: 8px;
	margin-bottom: 12px;
	padding: 12px;
}

.automaton-ia-validacao-card.is-danger {
	border-color: var(--automaton-ia-primary-line);
}

.automaton-ia-validacao-topo {
	display: flex;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 10px;
}

.automaton-ia-validacao-topo strong {
	color: var(--automaton-ia-ink);
	font-size: 13px;
	line-height: 1.35;
}

.automaton-ia-validacao-topo span {
	color: #6b7785;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	white-space: nowrap;
}

.automaton-ia-validacao-grid {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-bottom: 10px;
}

.automaton-ia-validacao-grid div {
	background: #f8f5fb;
	border-radius: 6px;
	padding: 8px;
}

.automaton-ia-validacao-grid small {
	color: #6b7785;
	display: block;
	font-size: 10px;
	text-transform: uppercase;
}

.automaton-ia-validacao-grid b {
	color: var(--automaton-ia-ink);
	display: block;
	font-size: 13px;
	margin-top: 2px;
}

.automaton-ia-validacao-card ul {
	margin: 0 0 10px 17px;
	padding: 0;
}

.automaton-ia-validacao-card li {
	color: #435466;
	margin-bottom: 5px;
}

.automaton-ia-justificativa-label {
	color: var(--automaton-ia-primary-strong);
	display: block;
	font-size: 12px;
	font-weight: 700;
	margin-bottom: 5px;
}

.automaton-ia-justificativa {
	background: #fff;
	border: 1px solid var(--automaton-ia-primary-line);
	border-radius: 6px;
	padding: 8px;
	resize: vertical;
	width: 100%;
}

.automaton-ia-justificativa:focus {
	border-color: var(--automaton-ia-primary);
	box-shadow: 0 0 0 2px var(--automaton-ia-primary-soft);
	outline: none;
}

.automaton-ia-justificativa.is-invalid {
	border-color: #d94444;
	box-shadow: 0 0 0 2px rgba(217, 68, 68, 0.12);
}

.automaton-ia-widget .btn-material-primary {
	background: var(--automaton-ia-primary);
	border-color: var(--automaton-ia-primary);
}

.automaton-ia-widget .btn-material-primary:hover,
.automaton-ia-widget .btn-material-primary:focus {
	background: var(--automaton-ia-primary-strong);
	border-color: var(--automaton-ia-primary-strong);
}

.automaton-ia-validacao-acoes {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.automaton-ia-validacao-acoes .btn-material {
	align-items: center;
	display: inline-flex;
	gap: 6px;
}

.automaton-ia-validacao-acoes + .automaton-ia-msg {
	margin-top: 16px;
}

.automaton-ia-page .automaton-ia-lista {
	min-height: 120px;
}

.automaton-ia-page .automaton-ia-summary {
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.automaton-ia-page .automaton-ia-row {
	border-bottom: 1px solid #edf0f4;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	padding: 10px 0;
}

.automaton-ia-page .automaton-ia-row:last-child {
	border-bottom: 0;
}

.automaton-ia-page .automaton-ia-row strong {
	color: #333;
	display: block;
}

.automaton-ia-page .automaton-ia-row small {
	color: #777;
	display: block;
	margin-top: 3px;
}

.automaton-ia-page .automaton-ia-chip {
	background: rgba(130, 61, 170, 0.12);
	border-radius: 4px;
	color: #823daa;
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 7px;
	text-transform: uppercase;
	white-space: nowrap;
}

.automaton-ia-page .automaton-ia-resposta {
	background: #f8f9fb;
	border: 1px solid #e8ebf0;
	border-radius: 6px;
	margin-top: 12px;
	min-height: 62px;
	padding: 12px;
}

.automaton-ia-page .automaton-ia-resposta pre {
	background: #fff;
	border-color: #e8ebf0;
	color: #333;
	margin: 10px 0 0;
	max-height: 320px;
	overflow: auto;
	white-space: pre-wrap;
}

@media (max-width: 1199px) {
	.automaton-ia-page .automaton-ia-summary {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.automaton-ia-page .automaton-ia-summary {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 420px) {
	.automaton-ia-fab {
		bottom: 16px;
		right: 16px;
	}

	.automaton-ia-drawer {
		max-width: 100vw;
		width: 100vw;
	}

	.automaton-ia-validacao-acoes {
		display: grid;
		grid-template-columns: 1fr;
	}

	.automaton-ia-page .automaton-ia-summary {
		grid-template-columns: 1fr;
	}
}
