.aiscb-widget {
	--aiscb-primary: #2563eb;
	--aiscb-bg: #ffffff;
	--aiscb-text: #1f2937;
	--aiscb-bubble-user: #2563eb;
	--aiscb-bubble-user-text: #ffffff;
	--aiscb-bubble-bot: #f1f5f9;
	--aiscb-bubble-bot-text: #1f2937;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	box-sizing: border-box;
}
.aiscb-widget * { box-sizing: border-box; }

.aiscb-widget.aiscb-theme-whatsapp {
	--aiscb-primary: #25D366;
	--aiscb-bubble-user: #DCF8C6;
	--aiscb-bubble-user-text: #111b21;
	--aiscb-bubble-bot: #ffffff;
	--aiscb-bubble-bot-text: #111b21;
}

/* Embedded layout: fills its container */
.aiscb-layout-embedded .aiscb-panel {
	display: flex;
	flex-direction: column;
	height: 480px;
	max-height: 70vh;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	background: var(--aiscb-bg);
}

/* Popup layout: floating launcher + panel */
.aiscb-layout-popup {
	position: fixed;
	bottom: 24px;
	z-index: 99999;
}
.aiscb-layout-popup.aiscb-rtl { left: 24px; }
.aiscb-layout-popup.aiscb-ltr { right: 24px; }

.aiscb-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--aiscb-primary);
	color: #fff;
	border: none;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.aiscb-layout-popup .aiscb-panel {
	position: absolute;
	bottom: 74px;
	width: 340px;
	height: 460px;
	max-height: 70vh;
	display: flex;
	flex-direction: column;
	border-radius: 14px;
	overflow: hidden;
	background: var(--aiscb-bg);
	box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.aiscb-layout-popup.aiscb-rtl .aiscb-panel { left: 0; }
.aiscb-layout-popup.aiscb-ltr .aiscb-panel { right: 0; }
.aiscb-panel-hidden { display: none !important; }

/* Small floating close icon over the messages — always reachable without a
   title bar, so the chat has an obvious way out wherever the visitor is,
   without adding a colored header they didn't want. */
.aiscb-layout-popup .aiscb-messages { padding-top: 36px; }
.aiscb-panel-close {
	position: absolute;
	top: 8px;
	inset-inline-end: 8px;
	z-index: 5;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	border: none;
	border-radius: 50%;
	background: rgba(0,0,0,0.08);
	color: var(--aiscb-text);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.aiscb-panel-close:hover { background: rgba(0,0,0,0.16); }

/* Typing indicator: three dots bouncing in sequence, so a slow reply never
   reads as the widget being stuck. */
.aiscb-typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 10px 14px;
}
.aiscb-typing-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.35;
	animation: aiscb-typing-bounce 1.2s infinite ease-in-out;
}
.aiscb-typing-dot:nth-child(1) { animation-delay: 0s; }
.aiscb-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.aiscb-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiscb-typing-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
	30% { transform: translateY(-4px); opacity: 1; }
}

.aiscb-messages {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--aiscb-theme-whatsapp, transparent);
}
.aiscb-theme-whatsapp .aiscb-messages {
	background-image: linear-gradient(#e5ddd5, #e5ddd5);
}

.aiscb-msg {
	max-width: 80%;
	padding: 8px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
}
.aiscb-msg-user {
	align-self: flex-end;
	background: var(--aiscb-bubble-user);
	color: var(--aiscb-bubble-user-text);
	border-bottom-right-radius: 4px;
}
.aiscb-rtl .aiscb-msg-user {
	align-self: flex-start;
	border-bottom-right-radius: 14px;
	border-bottom-left-radius: 4px;
}
.aiscb-msg-assistant {
	align-self: flex-start;
	background: var(--aiscb-bubble-bot);
	color: var(--aiscb-bubble-bot-text);
	border-bottom-left-radius: 4px;
}
.aiscb-rtl .aiscb-msg-assistant {
	align-self: flex-end;
	border-bottom-left-radius: 14px;
	border-bottom-right-radius: 4px;
}
.aiscb-msg a { color: inherit; text-decoration: underline; }

.aiscb-input-row {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.aiscb-input {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	font-size: 14px;
	outline: none;
}
.aiscb-send {
	padding: 8px 16px;
	border: none;
	border-radius: 20px;
	background: var(--aiscb-primary);
	color: #fff;
	cursor: pointer;
	font-size: 14px;
}

/* Honeypot: present in the DOM (bots fill every field) but invisible and
   unreachable to a real visitor — off-canvas, not display:none (some bots
   skip display:none fields, none skip an off-screen one that still renders). */
.aiscb-honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.aiscb-cta-wrap {
	align-self: stretch;
	display: flex;
	justify-content: center;
	padding: 4px 0;
}
.aiscb-cta-btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 24px;
	background: var(--aiscb-primary);
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.aiscb-cta-btn:hover { filter: brightness(1.08); }

.aiscb-quick-replies {
	align-self: stretch;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 2px 0;
}
.aiscb-quick-reply-btn {
	padding: 7px 14px;
	border-radius: 16px;
	border: 1.5px solid var(--aiscb-primary);
	background: transparent;
	color: var(--aiscb-primary);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.aiscb-quick-reply-btn:hover {
	background: var(--aiscb-primary);
	color: #fff;
}

.aiscb-lead-form {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-self: stretch;
}
.aiscb-lead-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.aiscb-lead-input {
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
}
.aiscb-lead-actions { display: flex; gap: 8px; margin-top: 4px; }
.aiscb-lead-submit {
	flex: 1;
	padding: 6px 10px;
	border: none;
	border-radius: 8px;
	background: var(--aiscb-primary);
	color: #fff;
	cursor: pointer;
	font-size: 13px;
}
.aiscb-lead-skip {
	padding: 6px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 13px;
}
