.aicm-widget {
	max-width: 640px;
	margin: 28px 0;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.aicm-widget-header {
	background: var(--aicm-brand-color, #1a1a2e);
	color: #fff;
	padding: 12px 16px;
	font-weight: 600;
	font-size: 15px;
}

.aicm-widget-messages {
	max-height: 340px;
	overflow-y: auto;
	padding: 14px 16px;
	background: #fafafa;
}

.aicm-msg {
	margin-bottom: 14px;
	line-height: 1.5;
	font-size: 14px;
}

.aicm-msg-user {
	text-align: right;
}

.aicm-msg-user .aicm-bubble {
	display: inline-block;
	background: var(--aicm-brand-color, #1a1a2e);
	color: #fff;
	padding: 8px 12px;
	border-radius: 12px 12px 2px 12px;
	max-width: 80%;
}

.aicm-msg-ai .aicm-bubble {
	display: inline-block;
	background: #fff;
	border: 1px solid #e0e0e0;
	padding: 8px 12px;
	border-radius: 12px 12px 12px 2px;
	max-width: 90%;
}

.aicm-msg-error .aicm-bubble {
	background: #fdeaea;
	border: 1px solid #f3b8b8;
	color: #a33;
}

.aicm-monetize-box {
	margin-top: 8px;
	padding: 10px 12px;
	background: #fff8e6;
	border: 1px dashed #e0b84d;
	border-radius: 8px;
	font-size: 13px;
}

.aicm-block-product {
	display: flex;
	gap: 12px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 10px;
	align-items: center;
}

.aicm-product-img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}

.aicm-product-info {
	flex: 1;
	min-width: 0;
}

.aicm-product-name {
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 2px;
}

.aicm-product-desc {
	font-size: 12px;
	color: #666;
	margin-bottom: 4px;
}

.aicm-product-price {
	font-weight: 700;
	color: #1a1a2e;
	font-size: 14px;
	margin-bottom: 6px;
}

.aicm-product-btn {
	display: inline-block;
	background: var(--aicm-brand-color, #1a1a2e);
	color: #fff !important;
	padding: 6px 14px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 13px;
}

.aicm-widget-form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	background: #fff;
	border-top: 1px solid #eee;
}

.aicm-widget-form input[type="text"] {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
}

.aicm-widget-form button {
	background: var(--aicm-brand-color, #1a1a2e);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}

.aicm-widget-form button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.aicm-typing {
	font-style: italic;
	color: #999;
	font-size: 13px;
}

/* ---------- Floating Bubble ---------- */

.aicm-floating-wrap {
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aicm-floating-wrap.aicm-pos-bottom-right {
	right: 20px;
}

.aicm-floating-wrap.aicm-pos-bottom-left {
	left: 20px;
}

.aicm-bubble-toggle {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--aicm-brand-color, #1a1a2e);
	color: #fff;
	border: none;
	font-size: 26px;
	line-height: 58px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0,0,0,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

.aicm-bubble-toggle:hover {
	transform: scale(1.06);
}

.aicm-bubble-greeting {
	position: absolute;
	bottom: 72px;
	right: 0;
	background: #fff;
	padding: 10px 30px 10px 14px;
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.18);
	font-size: 13px;
	white-space: nowrap;
	max-width: 220px;
	white-space: normal;
}

.aicm-pos-bottom-left .aicm-bubble-greeting {
	right: auto;
	left: 0;
}

.aicm-greeting-close {
	position: absolute;
	top: 4px;
	right: 6px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 14px;
	color: #999;
	line-height: 1;
}

.aicm-floating-panel {
	position: absolute;
	bottom: 72px;
	right: 0;
	width: 340px;
	max-width: 88vw;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 34px rgba(0,0,0,0.22);
	display: none;
	flex-direction: column;
}

.aicm-pos-bottom-left .aicm-floating-panel {
	right: auto;
	left: 0;
}

.aicm-floating-panel.aicm-open {
	display: flex;
}

.aicm-floating-panel .aicm-widget {
	box-shadow: none;
	border: none;
	border-radius: 0;
	margin: 0;
}

.aicm-floating-panel .aicm-widget-messages {
	max-height: 320px;
}

@media (max-width: 480px) {
	.aicm-floating-panel {
		width: 92vw;
	}
}

