/* Circuitra AI — pinned in the header chat drawer (uses the engine's own row/thread classes; these are additions only) */

.cai-pin-row {
	position: relative;
	border-bottom: 1px solid rgba(19, 138, 196, 0.18);
	background: linear-gradient(90deg, rgba(19, 138, 196, 0.10), transparent 70%);
}

.cai-pin-avatar {
	overflow: hidden;
}

.cai-pin-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cai-pin-avatar--icon {
	display: grid !important;
	place-items: center;
	background: linear-gradient(135deg, #138ac4, #6366f1) !important;
	color: #fff !important;
	font-size: 18px;
}

.cai-pin-online {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #1a1f33;
	background: #22c55e;
}

.ch-chat-row-avatar-wrap {
	position: relative;
}

.cai-pin-icon {
	color: #138ac4;
	font-size: 14px;
	opacity: 0.85;
}

/* Thread pane */
.cai-pin-thread {
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.cai-pin-head {
	cursor: default;
}

.cai-pin-clear {
	margin-left: auto;
	padding: 6px 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #8b90a3;
	cursor: pointer;
}

.cai-pin-clear:hover {
	color: #e6e8ef;
	background: rgba(255, 255, 255, 0.06);
}

.cai-pin-messages {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cai-pin-msg {
	display: flex;
	flex-direction: column;
	max-width: 82%;
}

.cai-pin-msg.is-user {
	align-self: flex-end;
	align-items: flex-end;
}

.cai-pin-msg.is-ai {
	align-self: flex-start;
}

.cai-pin-bubble {
	line-height: 1.55;
	word-break: break-word;
}

.cai-pin-msg.is-user .cai-pin-bubble {
	background: #138ac4;
	border-color: #138ac4;
	color: #fff;
}

.cai-pin-bubble ol,
.cai-pin-bubble ul {
	margin: 6px 0 6px 18px;
	padding: 0;
}

.cai-pin-bubble code {
	padding: 1px 5px;
	border-radius: 4px;
	background: rgba(19, 138, 196, 0.14);
	color: #7dd3fc;
	font-size: 12px;
}

.cai-pin-code {
	position: relative;
	margin: 8px 0;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(19, 138, 196, 0.25);
}

.cai-pin-code-lang {
	padding: 3px 10px;
	background: rgba(19, 138, 196, 0.15);
	color: #7dd3fc;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.cai-pin-code pre {
	margin: 0;
	padding: 12px 14px;
	background: #0d1117;
	overflow-x: auto;
	font-size: 12px;
	line-height: 1.6;
}

.cai-pin-code pre code {
	padding: 0;
	background: none;
	color: #e2e8f0;
}

.cai-pin-code-copy {
	position: absolute;
	top: 6px;
	right: 6px;
	padding: 2px 8px;
	border-radius: 5px;
	border: 1px solid rgba(19, 138, 196, 0.3);
	background: rgba(19, 138, 196, 0.15);
	color: #7dd3fc;
	font-size: 10px;
	cursor: pointer;
}

/* Products + recommendations */
.cai-pin-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 8px;
	width: 100%;
	max-width: 380px;
	margin-top: 8px;
}

.cai-pin-product {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
	color: inherit;
	font-size: 11.5px;
	text-decoration: none;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.cai-pin-product:hover {
	border-color: #138ac4;
	transform: translateY(-2px);
}

.cai-pin-product img,
.cai-pin-product-noimg {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

.cai-pin-product-noimg {
	display: grid;
	place-items: center;
	background: rgba(19, 138, 196, 0.08);
	color: #7dd3fc;
	font-size: 22px;
}

.cai-pin-product span {
	padding: 6px 8px;
	line-height: 1.3;
}

.cai-pin-recs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	font-size: 12px;
}

.cai-pin-recs > span {
	color: #8b90a3;
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.cai-pin-recs a {
	padding: 3px 10px;
	border-radius: 99px;
	border: 1px solid rgba(19, 138, 196, 0.35);
	color: #7dd3fc;
	text-decoration: none;
}

.cai-pin-recs a:hover {
	background: #138ac4;
	color: #fff;
}

/* Typing dots */
.cai-pin-typing {
	display: inline-flex;
	gap: 4px;
}

.cai-pin-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #8b90a3;
	animation: cai-pin-bounce 1.2s ease infinite;
}

.cai-pin-typing span:nth-child(2) { animation-delay: 0.18s; }
.cai-pin-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes cai-pin-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
	40% { transform: translateY(-4px); opacity: 1; }
}

/* Mobile preview list */
.cai-pin-mobile-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 8px;
	margin-bottom: 4px;
	border-radius: 10px;
	border: 1px solid rgba(19, 138, 196, 0.25);
	background: rgba(19, 138, 196, 0.08);
	color: inherit;
	text-decoration: none;
}

.cai-pin-mobile-avatar {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: 50%;
}

.cai-pin-mobile-avatar.cai-pin-avatar--icon {
	font-size: 16px;
}

.cai-pin-mobile-lines {
	display: grid;
	flex: 1;
	font-size: 13px;
}

.cai-pin-mobile-lines span {
	color: #8b90a3;
	font-size: 11.5px;
}