#itaia-root {
	position: fixed; bottom: 20px; z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--itaia-accent: #2563eb;
	--itaia-accent-2: #7c3aed;
}
#itaia-root.itaia-bottom-right { right: 20px; }
#itaia-root.itaia-bottom-left { left: 20px; }

/* Floating toggle button */
#itaia-toggle {
	width: 60px; height: 60px; border-radius: 50%; border: none;
	background: linear-gradient(135deg, var(--itaia-accent), var(--itaia-accent-2));
	color: #fff; cursor: pointer;
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
	display: flex; align-items: center; justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	animation: itaia-pulse 2.4s ease-in-out infinite;
}
#itaia-toggle:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(37, 99, 235, 0.5); }

.itaia-ai-badge {
	font-weight: 400; font-size: 16px; letter-spacing: 0.3px; color: #fff;
	display: inline-flex; align-items: center; gap: 2px; line-height: 1;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.itaia-ai-badge-sm { font-size: 13px; }
.itaia-ai-star { font-size: 1em; display: inline-block; }

@keyframes itaia-pulse {
	0%, 100% { box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); }
	50% { box-shadow: 0 6px 26px rgba(37, 99, 235, 0.65); }
}

/* Panel */
#itaia-panel {
	width: 432px; max-width: 94vw; height: 600px; max-height: 84vh;
	background: #f7f8fb; border-radius: 18px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
	display: flex; flex-direction: column; overflow: hidden;
	position: absolute; bottom: 74px;
	border: 1px solid rgba(15, 23, 42, 0.06);
	animation: itaia-pop 0.18s ease-out;
}
@keyframes itaia-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
#itaia-root.itaia-bottom-right #itaia-panel { right: 0; }
#itaia-root.itaia-bottom-left #itaia-panel { left: 0; }
.itaia-hidden { display: none !important; }

/* Header */
#itaia-header {
	background: linear-gradient(135deg, var(--itaia-accent), var(--itaia-accent-2));
	color: #fff; padding: 14px 16px;
	display: flex; justify-content: space-between; align-items: center;
}
.itaia-header-title { display: flex; align-items: center; gap: 10px; }
.itaia-avatar {
	width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.2);
	display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.itaia-header-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.itaia-header-sub { font-size: 11px; opacity: 0.85; line-height: 1.3; margin-top: 1px; }
.itaia-header-actions { display: flex; align-items: center; gap: 4px; }
.itaia-header-actions button {
	background: rgba(255,255,255,0.16); border: none; color: #fff;
	width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
	font-size: 15px; display: flex; align-items: center; justify-content: center;
	transition: background 0.15s ease;
}
.itaia-header-actions button:hover { background: rgba(255,255,255,0.3); }

/* Messages */
#itaia-messages {
	flex: 1; overflow-y: auto; padding: 14px; font-size: 13.5px;
	display: flex; flex-direction: column; gap: 4px;
	scrollbar-width: thin;
}
#itaia-messages::-webkit-scrollbar { width: 6px; }
#itaia-messages::-webkit-scrollbar-thumb { background: #d8dce6; border-radius: 3px; }

.itaia-msg { margin-bottom: 4px; line-height: 1.45; display: flex; }
.itaia-msg.bot { justify-content: flex-start; }
.itaia-msg.user { justify-content: flex-end; }
.itaia-bubble {
	display: inline-block; padding: 9px 13px; border-radius: 14px; max-width: 82%;
	box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}
.itaia-msg.bot .itaia-bubble {
	background: #fff; color: #1f2937; border-bottom-left-radius: 4px;
}
.itaia-msg.user .itaia-bubble {
	background: linear-gradient(135deg, var(--itaia-accent), var(--itaia-accent-2));
	color: #fff; border-bottom-right-radius: 4px;
}

/* Typing indicator */
.itaia-typing .itaia-bubble { display: flex; gap: 4px; padding: 12px 14px; }
.itaia-typing .itaia-dot {
	width: 6px; height: 6px; border-radius: 50%; background: #9ca3af;
	animation: itaia-blink 1.2s infinite ease-in-out;
}
.itaia-typing .itaia-dot:nth-child(2) { animation-delay: 0.15s; }
.itaia-typing .itaia-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes itaia-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Product cards */
.itaia-products { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 10px; }
.itaia-product {
	background: #fff; border: 1px solid #eef0f4; border-radius: 12px;
	transition: border-color 0.15s ease; overflow: hidden;
}
.itaia-product:hover { border-color: var(--itaia-accent); }
.itaia-product-link { display: flex; gap: 10px; padding: 10px; text-decoration: none; color: #1f2937; }
.itaia-product-link img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: #f1f2f6; flex-shrink: 0; }
.itaia-pinfo { flex: 1; min-width: 0; }
.itaia-pname { font-weight: 600; font-size: 13px; }
.itaia-pprice { font-size: 12px; color: #6b7280; margin-top: 1px; }
.itaia-preasons { font-size: 10.5px; color: var(--itaia-accent); margin-top: 3px; font-weight: 600; }
.itaia-oos { font-size: 10.5px; color: #dc2626; margin-top: 3px; font-weight: 600; }

.itaia-spec-list {
	margin: 6px 0 0; padding: 0; font-size: 11.5px; color: #4b5563; list-style: none;
	border: 1px solid #eef0f4; border-radius: 8px; overflow: hidden;
}
.itaia-spec-list li { padding: 5px 8px; }
.itaia-spec-list li:nth-child(even) { background: #f9fafb; }
.itaia-spec-row {
	display: flex; align-items: baseline; gap: 10px;
}
.itaia-spec-label {
	flex: 0 0 38%; color: #6b7280; font-weight: 600; font-size: 10.5px;
	text-transform: uppercase; letter-spacing: 0.2px; overflow-wrap: break-word;
}
.itaia-spec-value {
	flex: 1 1 auto; color: #1f2937; font-weight: 500; text-align: right; overflow-wrap: break-word;
}

.itaia-readmore {
	display: block; padding: 0 10px 10px; font-size: 12px; font-weight: 600;
	color: var(--itaia-accent); text-decoration: none;
}
.itaia-readmore:hover { text-decoration: underline; }

.itaia-ask-btn {
	display: block; width: 100%; padding: 8px 10px; border: none; border-top: 1px solid #eef0f4;
	background: #f7f8fb; color: var(--itaia-accent); font-size: 12px; font-weight: 600;
	cursor: pointer; text-align: center; transition: background 0.15s ease;
}
.itaia-ask-btn:hover { background: #eef2ff; }

/* Pinned product banner */
#itaia-pinned {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 7px 12px; background: #eef2ff; border-top: 1px solid #e5e7eb;
	font-size: 11.5px; color: #374151;
}
#itaia-pinned-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#itaia-pinned-clear {
	border: none; background: none; color: var(--itaia-accent); font-size: 11px; font-weight: 700;
	cursor: pointer; flex-shrink: 0; padding: 2px 4px;
}
#itaia-pinned-clear:hover { text-decoration: underline; }

/* Input row */
#itaia-form { display: flex; align-items: center; gap: 6px; padding: 10px; background: #fff; border-top: 1px solid #eef0f4; }
#itaia-input {
	flex: 1; border: 1px solid #e5e7eb; border-radius: 20px; padding: 9px 14px;
	font-size: 13.5px; outline: none; transition: border-color 0.15s ease;
}
#itaia-input:focus { border-color: var(--itaia-accent); }
#itaia-form button {
	border: none; background: linear-gradient(135deg, var(--itaia-accent), var(--itaia-accent-2));
	color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
	display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
	transition: transform 0.12s ease;
}
#itaia-form button:hover { transform: scale(1.06); }

@media (max-width: 420px) {
	#itaia-panel { width: 96vw; height: 80vh; bottom: 72px; }
}

/* Multi-line replies (spec lists, "does it include…" answers) */
.itaia-bubble { white-space: pre-line; word-break: break-word; }

/* Numbered option label + action buttons on result cards */
.itaia-pnum {
	display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
	color: #fff; background: var(--itaia-accent); border-radius: 6px; padding: 1px 6px; margin-bottom: 3px;
}
.itaia-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.itaia-actions .itaia-readmore { margin-top: 0; }
.itaia-ask {
	border: 1px solid var(--itaia-accent); background: #fff; color: var(--itaia-accent);
	font-size: 12px; font-weight: 600; border-radius: 14px; padding: 4px 11px; cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.itaia-ask:hover { background: var(--itaia-accent); color: #fff; }

/* "Asking about" banner */
#itaia-focus {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	background: #eef2ff; border-bottom: 1px solid #dfe5fb; padding: 7px 12px; font-size: 12px; color: #374151;
}
#itaia-focus .itaia-focus-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#itaia-focus button {
	flex-shrink: 0; border: none; background: none; color: var(--itaia-accent); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0;
}
#itaia-focus button:hover { text-decoration: underline; }

/* "Show N more options" reveal button */
.itaia-showmore {
	display: block; width: 100%; margin-top: 4px; padding: 8px; border-radius: 10px;
	border: 1px dashed #c7cbd4; background: #fff; color: var(--itaia-accent);
	font-size: 12px; font-weight: 600; cursor: pointer;
}
.itaia-showmore:hover { background: #f5f7ff; border-color: var(--itaia-accent); }

/* Contact / WhatsApp / live-chat action links attached to a reply */
.itaia-linkrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.itaia-linkbtn {
	display: inline-flex; align-items: center; justify-content: center;
	flex: 0 0 auto; box-sizing: border-box; height: 30px;
	border: 1px solid var(--itaia-accent); background: #fff; color: var(--itaia-accent);
	font-size: 12px; font-weight: 600; line-height: 1; border-radius: 15px; padding: 0 13px; cursor: pointer;
	text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
	transition: background 0.15s ease, color 0.15s ease;
}
.itaia-linkbtn:hover { background: var(--itaia-accent); color: #fff; }

/* "New search" button at the bottom of a results list */
.itaia-newsearch {
	display: block; width: 100%; margin-top: 8px; padding: 9px; border-radius: 10px;
	border: none; background: #eef2ff; color: var(--itaia-accent);
	font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.itaia-newsearch:hover { background: #e0e7ff; }
