.spc-chatbot,
.spc-chatbot * {
	box-sizing: border-box;
}

.spc-chatbot {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: #172033;
}

.spc-chatbot__launcher {
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: #1f6feb;
	color: #fff;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.24);
	cursor: pointer;
	display: grid;
	place-items: center;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.spc-chatbot__launcher:hover,
.spc-chatbot__launcher:focus-visible {
	background: #185abc;
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.3);
	transform: translateY(-1px);
	outline: none;
}

.spc-chatbot__launcher-icon {
	width: 30px;
	height: 30px;
	fill: currentColor;
}

.spc-chatbot__panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: min(380px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 110px));
	background: #fff;
	border: 1px solid #d7dce5;
	border-radius: 8px;
	box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

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

.spc-chatbot__header {
	display: flex;
	flex: 0 0 auto;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	background: #3f5762;
	color: #fff;
}

.spc-chatbot__header h2 {
	margin: 0;
	font-size: 17px;
	line-height: 1.25;
	letter-spacing: 0;
}

.spc-chatbot__header p {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: #dbe4f0;
}

.spc-chatbot__close {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
}

.spc-chatbot__close:hover,
.spc-chatbot__close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

.spc-chatbot__privacy,
.spc-chatbot__survey,
.spc-chatbot__lead {
	flex: 0 0 auto;
	margin: 0;
	padding: 10px 14px;
	font-size: 12px;
	line-height: 1.4;
	background: #f6f8fb;
	border-bottom: 1px solid #e4e8ef;
	color: #506070;
}

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

.spc-chatbot__survey form {
	display: grid;
	gap: 8px;
}

.spc-chatbot__survey-fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.spc-chatbot__survey label {
	display: grid;
	gap: 4px;
	color: #344256;
}

.spc-chatbot__survey select {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	color: #172033;
	font: inherit;
	font-size: 12px;
	padding: 7px;
}

.spc-chatbot__survey-actions {
	display: flex;
	gap: 8px;
}

.spc-chatbot__survey-actions button {
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	color: #1f3654;
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
	padding: 7px 10px;
}

.spc-chatbot__survey-actions button[type="submit"] {
	border-color: #1f6feb;
	background: #1f6feb;
	color: #fff;
}

.spc-chatbot__messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fbfcfe;
}

.spc-chatbot__message {
	max-width: 88%;
	margin: 0;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
}

.spc-chatbot__message--assistant {
	align-self: flex-start;
	margin-right: auto;
	background: #eef3fb;
	color: #172033;
}

.spc-chatbot__message p,
.spc-chatbot__message ul {
	margin: 0 0 8px;
}

.spc-chatbot__message p:last-child,
.spc-chatbot__message ul:last-child {
	margin-bottom: 0;
}

.spc-chatbot__message ul {
	padding-left: 18px;
}

.spc-chatbot__message li + li {
	margin-top: 4px;
}

.spc-chatbot__message--assistant a,
.spc-chatbot__message--error a {
	color: #155bc3;
	font-weight: 700;
	text-decoration: underline;
}

.spc-chatbot__message--assistant a:hover,
.spc-chatbot__message--assistant a:focus-visible,
.spc-chatbot__message--error a:hover,
.spc-chatbot__message--error a:focus-visible {
	color: #0f3f8c;
	outline: none;
}

.spc-chatbot__message--user {
	align-self: flex-end;
	margin-left: auto;
	background: #1f6feb;
	color: #fff;
}

.spc-chatbot__message--user a {
	color: #fff;
	font-weight: 700;
	text-decoration: underline;
}

.spc-chatbot__message--error {
	align-self: flex-start;
	margin-right: auto;
	background: #fff1f0;
	color: #8a1f11;
	border: 1px solid #ffd4ce;
}

.spc-chatbot__message--loading {
	color: #58677a;
	font-style: italic;
}

.spc-chatbot__quick-replies {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 10px 14px;
	border-top: 1px solid #e4e8ef;
	background: #fff;
}

.spc-chatbot__quick-replies:empty {
	display: none;
}

.spc-chatbot__quick-replies button {
	flex: 0 0 auto;
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	background: #fff;
	color: #1f3654;
	cursor: pointer;
	font-size: 12px;
	line-height: 1.2;
	padding: 8px 10px;
}

.spc-chatbot__quick-replies button:hover,
.spc-chatbot__quick-replies button:focus-visible {
	border-color: #1f6feb;
	color: #1f6feb;
	outline: none;
}

.spc-chatbot__links {
	flex: 0 0 auto;
	padding: 10px 14px;
	border-top: 1px solid #e4e8ef;
	background: #fff;
	display: grid;
	gap: 6px;
}

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

.spc-chatbot__links-title {
	font-size: 12px;
	font-weight: 700;
	color: #506070;
}

.spc-chatbot__links a {
	font-size: 13px;
	color: #1f6feb;
	text-decoration: none;
}

.spc-chatbot__links a:hover,
.spc-chatbot__links a:focus-visible {
	text-decoration: underline;
	outline: none;
}

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

.spc-chatbot__lead {
	max-height: min(360px, 46vh);
	overflow-y: auto;
}

.spc-chatbot__lead-form {
	display: grid;
	gap: 10px;
	margin-top: 10px;
}

.spc-chatbot__lead-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.spc-chatbot__lead-form label {
	display: grid;
	gap: 4px;
	font-size: 12px;
	color: #344256;
}

.spc-chatbot__lead-form input,
.spc-chatbot__lead-form select,
.spc-chatbot__lead-form textarea {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	padding: 8px;
	font: inherit;
	font-size: 13px;
	background: #fff;
	color: #172033;
}

.spc-chatbot__lead-form textarea {
	resize: vertical;
}

.spc-chatbot__lead-form input:focus,
.spc-chatbot__lead-form select:focus,
.spc-chatbot__lead-form textarea:focus {
	border-color: #1f6feb;
	box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.16);
	outline: none;
}

.spc-chatbot__consent {
	grid-template-columns: auto 1fr;
	align-items: start;
}

.spc-chatbot__consent input {
	width: auto;
	margin-top: 2px;
}

.spc-chatbot__lead-form button {
	border: 0;
	border-radius: 8px;
	background: #172033;
	color: #fff;
	cursor: pointer;
	font-weight: 700;
	padding: 10px 12px;
}

.spc-chatbot__lead-form button:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.spc-chatbot__lead-status {
	font-size: 12px;
	line-height: 1.4;
	color: #1f6b3a;
}

.spc-chatbot__form {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	align-items: flex-end;
	padding: 12px;
	border-top: 1px solid #e4e8ef;
	background: #fff;
}

.spc-chatbot__form textarea {
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	resize: none;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 10px;
	font: inherit;
	font-size: 14px;
	line-height: 1.35;
	color: #172033;
}

.spc-chatbot__form textarea:focus {
	border-color: #1f6feb;
	box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.18);
	outline: none;
}

.spc-chatbot__form button {
	min-height: 42px;
	border: 0;
	border-radius: 8px;
	background: #1f6feb;
	color: #fff;
	cursor: pointer;
	font-weight: 700;
	padding: 0 14px;
}

.spc-chatbot__form button:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

@media (max-width: 480px) {
	.spc-chatbot {
		right: 12px;
		bottom: 12px;
	}

	.spc-chatbot__panel {
		position: fixed;
		right: 12px;
		left: 12px;
		top: 16px;
		bottom: 86px;
		width: auto;
		height: auto;
		max-height: none;
	}

	.spc-chatbot__header {
		padding: 14px;
	}

	.spc-chatbot__messages {
		padding: 12px;
	}

	.spc-chatbot__lead-grid {
		grid-template-columns: 1fr;
	}

	.spc-chatbot__survey-fields {
		grid-template-columns: 1fr;
	}
}
