#aica-widget-root {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--aica-color: #2563eb;
}

.aica-bubble {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--aica-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
	transition: transform 0.15s ease;
}
.aica-bubble:hover {
	transform: scale(1.06);
}
.aica-bubble svg {
	width: 28px;
	height: 28px;
}

.aica-window {
	display: none;
	flex-direction: column;
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 340px;
	max-width: 90vw;
	height: 460px;
	max-height: 70vh;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.25);
	overflow: hidden;
}
.aica-window.aica-open {
	display: flex;
}

.aica-header {
	background: var(--aica-color);
	color: #fff;
	padding: 10px 8px 10px 16px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.aica-header-logo {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}
.aica-header-title {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.aica-header button {
	background: none;
	border: none;
	color: #fff;
	font-size: 26px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 1;
	flex-shrink: 0;
}

.aica-messages {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fa;
}

.aica-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	max-width: 95%;
	align-self: flex-start;
}
.aica-msg-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}
.aica-msg-row .aica-msg {
	max-width: 100%;
}

.aica-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.4;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
}
.aica-msg a {
	word-break: break-all;
}
.aica-msg.aica-user {
	align-self: flex-end !important;
	background: var(--aica-color) !important;
	color: #fff !important;
	border-bottom-right-radius: 3px;
}
.aica-msg.aica-assistant {
	align-self: flex-start !important;
	background: #e9eaee !important;
	color: #1a1a1a !important;
	border-bottom-left-radius: 3px;
}
.aica-msg.aica-typing {
	font-style: italic;
	color: #888;
	background: transparent;
	padding: 0 4px;
}

.aica-footer-row {
	padding: 6px 14px;
	text-align: center;
	border-top: 1px solid #eee;
	background: #fff;
	flex-shrink: 0;
}
.aica-footer-row a {
	font-size: 12px;
	color: var(--aica-color);
	text-decoration: none;
}
.aica-footer-row a:hover {
	text-decoration: underline;
}

.aica-lead-form {
	padding: 12px 14px;
	border-top: 1px solid #eee;
	background: #fbfbfc;
	flex-shrink: 0;
}
.aica-lead-form input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	margin-bottom: 6px;
	outline: none;
}
.aica-lead-form input:focus {
	border-color: var(--aica-color);
}
.aica-lead-form textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	margin-bottom: 6px;
	outline: none;
	font-family: inherit;
	resize: vertical;
}
.aica-lead-form textarea:focus {
	border-color: var(--aica-color);
}
.aica-lead-error {
	color: #c0392b;
	font-size: 12px;
	margin-bottom: 6px;
}
.aica-lead-actions {
	display: flex;
	gap: 8px;
}
.aica-lead-actions button {
	flex: 1;
	border: none;
	border-radius: 8px;
	padding: 8px 0;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
#aica-lead-submit {
	background: var(--aica-color);
	color: #fff;
}
.aica-lead-cancel {
	background: #eee;
	color: #333;
}

.aica-input-row {
	display: flex;
	border-top: 1px solid #e5e5e5;
	padding: 10px;
	gap: 8px;
	flex-shrink: 0;
	background: #fff;
}
.aica-input-row input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
}
.aica-input-row input:focus {
	border-color: var(--aica-color);
}
.aica-input-row button {
	background: var(--aica-color);
	color: #fff;
	border: none;
	border-radius: 20px;
	padding: 0 16px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}
.aica-input-row button:disabled {
	opacity: 0.6;
	cursor: default;
}

#aica-attach-btn {
	background: none;
	border: 1px solid #ddd;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	padding: 0;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
	cursor: pointer;
	margin-top: 10px !important;
}
#aica-attach-btn svg {
	width: 18px;
	height: 18px;
}
#aica-attach-btn:hover {
	border-color: var(--aica-color);
	color: var(--aica-color);
}

.aica-image-preview {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-top: 1px solid #eee;
	background: #fafafa;
	font-size: 12px;
	color: #666;
	flex-shrink: 0;
}
.aica-image-preview img {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	object-fit: cover;
}
.aica-image-preview button {
	background: #eee;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	line-height: 1;
	cursor: pointer;
	font-size: 14px;
	color: #333;
}

.aica-msg-image {
	display: block;
	max-width: 100%;
	border-radius: 10px;
	margin-bottom: 6px;
}

@media (max-width: 480px) {
	.aica-window {
		width: 92vw;
		right: -4px;
	}
}
