#aia-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

#aia-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: #2271b1;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transition: transform .15s, background .15s;
}

#aia-toggle:hover {
	background: #135e96;
	transform: scale(1.06);
}

#aia-panel {
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 480px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#aia-head {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #2271b1;
	color: #fff;
	padding: 12px 14px;
}

#aia-title {
	font-weight: 600;
	font-size: 15px;
}

#aia-statusline {
	font-size: 11px;
	opacity: .85;
	margin-left: auto;
	margin-right: 4px;
}

#aia-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}

#aia-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: #f4f6f8;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.aia-bubble {
	max-width: 82%;
	padding: 8px 12px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.aia-bubble .aia-who {
	display: block;
	font-size: 10px;
	opacity: .6;
	margin-bottom: 2px;
}

.aia-user {
	align-self: flex-end;
	background: #2271b1;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.aia-bot,
.aia-operator {
	align-self: flex-start;
	background: #fff;
	color: #1d2327;
	border: 1px solid #e2e4e7;
	border-bottom-left-radius: 4px;
}

.aia-operator {
	background: #f0f6fb;
	border-color: #c5d9ed;
}

.aia-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-self: flex-start;
	max-width: 85%;
}

.aia-actions input {
	padding: 7px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	font-size: 13px;
}

.aia-btn {
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 13px;
}

.aia-btn:hover {
	background: #135e96;
}

.aia-btn-alt {
	background: #fff;
	color: #2271b1;
	border: 1px solid #2271b1;
}

#aia-inputbar {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e2e4e7;
	background: #fff;
}

#aia-input {
	flex: 1;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 14px;
}

#aia-send {
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 8px;
	width: 42px;
	cursor: pointer;
	font-size: 15px;
}

#aia-send:disabled,
#aia-input:disabled {
	opacity: .6;
	cursor: default;
}

.aia-dots i {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px;
	border-radius: 50%;
	background: #8c8f94;
	animation: aia-blink 1.2s infinite;
}

.aia-dots i:nth-child(2) { animation-delay: .2s; }
.aia-dots i:nth-child(3) { animation-delay: .4s; }

@keyframes aia-blink {
	0%, 80%, 100% { opacity: .25; }
	40% { opacity: 1; }
}

@media (max-width: 480px) {
	#aia-panel {
		width: calc(100vw - 24px);
		height: 70vh;
		right: -8px;
		bottom: -8px;
	}
}
