#atvc-widget {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#atvc-widget button {
	box-sizing: border-box !important;
	margin: 0 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	line-height: normal !important;
}

#atvc-bubble {
	width: 60px !important;
	height: 60px !important;
	min-width: 60px !important;
	min-height: 60px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: var(--atvc-color, #2563eb);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	transition: transform 0.15s ease;
	flex-shrink: 0;
}

#atvc-bubble:hover {
	transform: scale(1.06);
}

#atvc-window {
	position: fixed;
	bottom: 96px;
	right: 24px;
	width: 340px;
	max-width: calc(100vw - 32px);
	height: 460px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
}

#atvc-window.atvc-open {
	display: flex;
}

#atvc-header {
	background: var(--atvc-color, #2563eb);
	color: #fff;
	padding: 14px 16px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#atvc-close {
	width: 28px !important;
	height: 28px !important;
	padding: 0 !important;
	background: none;
	border: none;
	color: #fff;
	font-size: 20px;
	cursor: pointer;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

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

.atvc-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
}

.atvc-msg-user {
	align-self: flex-end;
	background: var(--atvc-color, #2563eb);
	color: #fff;
	border-bottom-right-radius: 3px;
}

.atvc-msg-assistant {
	align-self: flex-start;
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 3px;
}

.atvc-msg-assistant a {
	color: var(--atvc-color, #2563eb);
	font-weight: 600;
	word-break: break-all;
}

.atvc-msg-error {
	align-self: center;
	color: #b91c1c;
	font-size: 13px;
}

#atvc-typing {
	align-self: flex-start;
	font-size: 13px;
	color: #6b7280;
	display: none;
	padding: 0 4px;
}

#atvc-input-row {
	display: flex;
	align-items: center;
	border-top: 1px solid #e5e7eb;
	padding: 8px;
	gap: 8px;
}

#atvc-input {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
	resize: none;
}

#atvc-send {
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	min-height: 38px !important;
	padding: 0 !important;
	background: var(--atvc-color, #2563eb);
	color: #fff;
	border: none;
	border-radius: 50% !important;
	cursor: pointer;
	font-size: 16px;
	flex-shrink: 0;
	flex-grow: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

#atvc-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@media (prefers-color-scheme: dark) {
	#atvc-window {
		background: #1f2430;
	}
	#atvc-messages {
		background: #171b24;
	}
	.atvc-msg-assistant {
		background: #262c3a;
		color: #e5e7eb;
		border-color: #333a4a;
	}
	#atvc-input-row {
		border-top-color: #333a4a;
	}
	#atvc-input {
		background: #262c3a;
		color: #e5e7eb;
		border-color: #333a4a;
	}
}
