/* Chat assistant */
.spc-chat {
	--c-ink: #12355b;
	--c-deep: #0b2236;
	--c-teal: #17bca5;
	--c-teal-ink: #0f766e;
	--c-line: #e3edf3;
	--c-muted: #5b6b7f;
	--c-bg: #f5f9fc;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	color: var(--c-ink);
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.spc-chat button {
	font: inherit;
}

.spc-chat :focus-visible {
	outline: 3px solid var(--c-teal);
	outline-offset: 2px;
}

/* Launcher */
.spc-chat-open {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 56px;
	padding: 0 1.4rem 0 1.1rem;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #16b8a5 0%, #0f6c86 100%);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 16px 36px rgba(15, 108, 134, 0.35);
	cursor: pointer;
	transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.spc-chat-open:hover {
	transform: translateY(-2px);
	box-shadow: 0 20px 42px rgba(15, 108, 134, 0.42);
}

.spc-chat.is-open .spc-chat-open {
	display: none;
}

/* Panel */
.spc-chat-panel {
	display: flex;
	flex-direction: column;
	width: min(400px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 40px));
	overflow: hidden;
	border: 1px solid #d6e6f4;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 30px 80px rgba(11, 34, 54, 0.28);
}

.spc-chat-panel[hidden] {
	display: none;
}

.spc-chat-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.9rem 0.75rem 0.9rem 1rem;
	background: linear-gradient(135deg, var(--c-ink) 0%, var(--c-deep) 100%);
	color: #fff;
}

.spc-chat-title {
	flex: 1;
	min-width: 0;
}

.spc-chat-title strong {
	display: block;
	font-size: 1rem;
}

.spc-chat-title strong {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.spc-chat-title small {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin-top: 1px;
	color: #b7d7e8;
	font-size: 0.8125rem;
	line-height: 1.3;
	white-space: nowrap;
}

.spc-chat-title i {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #34d399;
	box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.spc-chat-ic {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease-out, border-color 0.15s ease-out;
}

.spc-chat-ic + .spc-chat-ic {
	margin-left: 0.15rem;
}

.spc-chat-ic:hover {
	border-color: rgba(255, 255, 255, 0.32);
	background: rgba(255, 255, 255, 0.18);
}

.spc-chat-ic svg {
	display: block;
}

/* Avatar */
.spc-av {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--c-line);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(18, 51, 84, 0.08);
}

.spc-av img {
	width: 19px;
	height: auto;
}

.spc-av--lg {
	width: 42px;
	height: 42px;
	border: 0;
}

.spc-av--lg img {
	width: 27px;
}

/* Messages */
.spc-chat-log {
	flex: 1;
	padding: 1.1rem 0.9rem 0.5rem;
	overflow-y: auto;
	background: var(--c-bg);
	scroll-behavior: smooth;
}

.spc-row {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	margin: 0 0 0.85rem;
}

.spc-row--user {
	justify-content: flex-end;
}

.spc-msg {
	max-width: 85%;
	padding: 0.7rem 0.95rem;
	border-radius: 16px;
	overflow-wrap: anywhere;
}

.spc-row--bot .spc-msg {
	border: 1px solid var(--c-line);
	border-bottom-left-radius: 5px;
	background: #fff;
	box-shadow: 0 2px 6px rgba(18, 51, 84, 0.04);
}

.spc-row--user .spc-msg {
	border-bottom-right-radius: 5px;
	background: var(--c-ink);
	color: #fff;
}

.spc-msg p {
	margin: 0 0 0.45rem;
}

.spc-msg p:last-child {
	margin-bottom: 0;
}

.spc-msg ul {
	margin: 0.2rem 0 0.5rem;
	padding-left: 1.15rem;
}

.spc-msg a {
	color: var(--c-teal-ink);
	font-weight: 600;
}

/* Typing dots */
.spc-typing .spc-msg {
	display: inline-flex;
	gap: 5px;
	padding: 0.85rem 1rem;
}

.spc-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9fb3c8;
	animation: spc-dot 1.2s infinite ease-in-out;
}

.spc-typing i:nth-child(2) {
	animation-delay: 0.15s;
}

.spc-typing i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes spc-dot {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.5;
	}

	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

/* Plugin cards */
.spc-pcards {
	display: grid;
	gap: 0.6rem;
	margin-top: 0.7rem;
}

.spc-pcard {
	padding: 0.75rem;
	border: 1px solid #d6e6f4;
	border-radius: 14px;
	background: linear-gradient(180deg, #fbfdff 0%, #f3f9fd 100%);
}

.spc-pcard-top {
	display: flex;
	gap: 0.65rem;
	align-items: center;
	color: inherit !important;
	text-decoration: none;
}

.spc-pcard-ic {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1px solid #d6e6f4;
	border-radius: 12px;
	background: #fff;
}

.spc-pcard-ic img {
	width: 38px;
	height: auto;
}

.spc-pcard-txt strong {
	display: block;
	color: var(--c-ink);
	font-size: 0.9375rem;
	line-height: 1.3;
}

.spc-pcard-txt small {
	display: -webkit-box;
	overflow: hidden;
	color: var(--c-muted);
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.spc-card-price {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0.6rem 0 0.55rem;
	font-size: 0.75rem;
	font-weight: 700;
}

.spc-card-price,
.spc-card-price em {
	color: var(--c-teal-ink);
}

.spc-card-price em {
	padding: 0 0 0 0.45rem;
	border-left: 1px solid #c7e3dd;
	color: #2563eb;
	font-style: normal;
}

.spc-pcard-btns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.35rem;
}

.spc-pcard-btns .spc-btn {
	justify-content: center;
	padding: 0 0.4rem;
	white-space: nowrap;
}

.spc-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	min-height: 34px;
	padding: 0 0.85rem;
	border: 1px solid #c4d6e6;
	border-radius: 999px;
	background: #fff;
	color: var(--c-ink) !important;
	font-size: 0.8125rem;
	font-weight: 700 !important;
	text-decoration: none;
}

.spc-btn:hover {
	border-color: var(--c-ink);
}

.spc-btn--buy {
	border: 0;
	background: linear-gradient(135deg, #16b8a5 0%, #0f6c86 100%);
	color: #fff !important;
}

.spc-btn--buy:hover {
	filter: brightness(1.06);
}

.spc-btn--demo {
	border-color: var(--c-ink);
	background: var(--c-ink);
	color: #fff !important;
}

/* Sources and feedback */
.spc-src {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.6rem !important;
	font-size: 0.8125rem;
}

.spc-src span {
	color: var(--c-muted);
}

.spc-src a {
	padding: 0.15rem 0.65rem;
	border-radius: 999px;
	background: #e6f6f3;
	font-weight: 600;
	text-decoration: none;
}

.spc-fb {
	margin: 0.55rem 0 0 !important;
	padding-top: 0.5rem;
	border-top: 1px solid var(--c-line);
	color: var(--c-muted);
	font-size: 0.8125rem;
}

.spc-fb button {
	margin-left: 0.35rem;
	padding: 0.1rem 0.7rem;
	border: 1px solid #c4d6e6;
	border-radius: 999px;
	background: #fff;
	color: var(--c-ink);
	font-size: 0.8125rem;
	cursor: pointer;
}

.spc-fb button:hover {
	border-color: var(--c-teal-ink);
}

/* Starter questions */
.spc-chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0 0.9rem 0.7rem 3.1rem;
	background: var(--c-bg);
}

.spc-chat-chips:empty {
	display: none;
}

.spc-chat-chips button {
	padding: 0.4rem 0.85rem;
	border: 1px solid #b9dcd5;
	border-radius: 999px;
	background: #fff;
	color: var(--c-teal-ink);
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
}

.spc-chat-chips button:hover {
	border-color: var(--c-teal-ink);
	background: #effaf7;
}

/* Input */
.spc-chat-form {
	display: flex;
	gap: 0.5rem;
	align-items: flex-end;
	padding: 0.75rem 0.75rem 0.5rem;
	border-top: 1px solid var(--c-line);
	background: #fff;
}

.spc-chat-form textarea {
	flex: 1;
	box-sizing: border-box;
	min-height: 46px;
	max-height: 120px;
	padding: 0.7rem 0.9rem;
	border: 1px solid #c4d6e6;
	border-radius: 14px;
	background: #fbfdff;
	color: var(--c-ink);
	font: inherit;
	resize: none;
}

.spc-chat-form textarea:focus {
	border-color: var(--c-teal-ink);
	background: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(23, 188, 165, 0.2);
}

.spc-chat-form button svg {
	display: block;
}

.spc-chat-form button {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, #16b8a5 0%, #0f6c86 100%);
	color: #fff;
	cursor: pointer;
}

.spc-chat-foot {
	margin: 0;
	padding: 0 1rem 0.7rem;
	background: #fff;
	color: var(--c-muted);
	font-size: 0.75rem;
	text-align: center;
}

.spc-chat-foot a {
	color: var(--c-teal-ink);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.spc-typing i,
	.spc-chat-open {
		animation: none;
		transition: none;
	}
}

/* Phones: full screen */
@media (max-width: 480px) {
	.spc-chat {
		right: 12px;
		bottom: 12px;
	}

	.spc-chat.is-open {
		inset: 0;
	}

	.spc-chat-panel {
		width: 100vw;
		height: 100dvh;
		border: 0;
		border-radius: 0;
	}

	.spc-chat-open span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.spc-chat-open {
		width: 58px;
		padding: 0;
		justify-content: center;
	}

	.spc-chat-chips {
		padding-left: 0.9rem;
	}
}

html.spc-chat-lock,
html.spc-chat-lock body {
	overflow: hidden;
}
