
/* AI Chat Field
 * -------------------------- */

.tc-field[data-field-type="ai_chat"] .tc-ai-chat {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 320px;
	overflow-y: auto;
	padding: 8px;
	margin-bottom: 8px;
	background: #f6f6f6;
	border-radius: 6px;
}

.tc-ai-chat .tc-ai-chat-row {
	display: flex;
	max-width: 85%;
}

.tc-ai-chat .tc-ai-chat-row .tc-ai-chat-bubble {
	padding: 8px 12px;
	border-radius: 12px;
	line-height: 1.4;
	word-break: break-word;
}

/* user — accent bubble, aligned to the start side (right under RTL) */
.tc-ai-chat .tc-ai-chat-row-user {
	align-self: flex-start;
}

.tc-ai-chat .tc-ai-chat-row-user .tc-ai-chat-bubble {
	background: #2f6fed;
	color: #fff;
}

/* assistant — light bubble, aligned to the opposite side */
.tc-ai-chat .tc-ai-chat-row-assistant {
	align-self: flex-end;
}

.tc-ai-chat .tc-ai-chat-row-assistant .tc-ai-chat-bubble {
	background: #fff;
	border: 1px solid #e0e0e0;
	color: #222;
}

/* tool — centered muted pill, optional working spinner */
.tc-ai-chat .tc-ai-chat-row-tool {
	align-self: center;
	max-width: 95%;
}

.tc-ai-chat .tc-ai-chat-row-tool .tc-ai-chat-bubble {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 2px 8px;
	background: transparent;
	color: #888;
	font-size: 12px;
}

.tc-ai-chat .tc-ai-chat-spinner {
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid #ccc;
	border-top-color: #2f6fed;
	border-radius: 50%;
	animation: tc-ai-chat-spin 0.8s linear infinite;
}

@keyframes tc-ai-chat-spin {
	to { transform: rotate(360deg); }
}
