.supc {
	--supc-accent: #2f6b4f;
	--supc-text: #1d2327;
	--supc-muted: #646970;
	--supc-bg: #fff;
	--supc-bot-bg: #f1f3f2;
	--supc-border: #dcdfdd;
	--supc-radius: 16px;

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--supc-text);
}

.supc *,
.supc *::before,
.supc *::after {
	box-sizing: border-box;
}

.supc [hidden] {
	display: none !important;
}

/*
 * Reset form controls so theme button and input styles can't leak in.
 */
.supc button,
.supc input,
.supc textarea {
	-webkit-appearance: none !important;
	appearance: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-style: normal !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	transform: none !important;
	float: none !important;
}

.supc button {
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease !important;
}

.supc button::before,
.supc button::after {
	content: none !important;
	display: none !important;
}

.supc svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Launcher */

.supc .supc-launcher {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 58px !important;
	height: 58px !important;
	margin-left: auto !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--supc-accent) !important;
	color: #fff !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22) !important;
}

.supc .supc-launcher:hover {
	opacity: 0.92;
}

.supc .supc-launcher svg {
	width: 26px;
	height: 26px;
}

.supc .supc-launcher .supc-icon-close,
.supc.is-open .supc-launcher .supc-icon-chat {
	display: none;
}

.supc.is-open .supc-launcher .supc-icon-close {
	display: block;
}

/* Panel */

.supc-panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 40px);
	height: min(620px, calc(100vh - 120px));
	margin-bottom: 14px;
	overflow: hidden;
	border-radius: var(--supc-radius);
	background: var(--supc-bg);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.supc-header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--supc-accent);
	color: #fff;
}

.supc-header-actions {
	display: flex;
	flex: 0 0 auto;
	gap: 4px;
}

.supc-heading {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.supc-heading strong {
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.supc-heading span {
	font-size: 12px;
	opacity: 0.85;
}

.supc .supc-close {
	display: flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 36px;
	width: 36px !important;
	height: 36px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: #fff !important;
}

.supc .supc-close:hover {
	background: rgba(255, 255, 255, 0.18) !important;
}

/* Messages */

.supc-log {
	position: relative;
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.supc-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: var(--supc-radius);
	overflow-wrap: anywhere;
}

.supc-msg--bot {
	align-self: flex-start;
	border-bottom-left-radius: 6px;
	background: var(--supc-bot-bg);
}

.supc-msg--customer {
	align-self: flex-end;
	border-bottom-right-radius: 6px;
	background: var(--supc-accent);
	color: #fff;
}

.supc-msg a {
	color: inherit;
	text-decoration: underline;
}

.supc-typing {
	display: flex;
	gap: 4px;
	padding: 14px 16px;
}

.supc-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--supc-muted);
	opacity: 0.4;
	animation: supc-blink 1s infinite;
}

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

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

@keyframes supc-blink {
	50% {
		opacity: 1;
	}
}

/* Options and forms */

.supc-controls {
	flex: 0 0 auto;
	max-height: 50%;
	overflow-y: auto;
	padding: 0 16px;
}

.supc-controls:not(:empty) {
	padding-top: 4px;
	padding-bottom: 14px;
}

.supc-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.supc .supc-option {
	display: inline-block !important;
	width: auto !important;
	height: auto !important;
	padding: 8px 14px !important;
	border: 1px solid var(--supc-accent) !important;
	border-radius: 999px !important;
	background: var(--supc-bg) !important;
	color: var(--supc-accent) !important;
	font-size: 14px !important;
	text-align: left !important;
	white-space: normal !important;
}

.supc .supc-option:hover,
.supc .supc-option:focus-visible {
	background: var(--supc-accent) !important;
	color: #fff !important;
}

.supc .supc-back {
	border-color: var(--supc-border) !important;
	color: var(--supc-muted) !important;
}

.supc .supc-back:hover,
.supc .supc-back:focus-visible {
	background: var(--supc-bot-bg) !important;
	color: var(--supc-text) !important;
}

.supc-form {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 4px 0 0;
	padding: 12px;
	border: 1px solid var(--supc-border);
	border-radius: var(--supc-radius);
}

.supc-field {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
}

.supc .supc-field input,
.supc .supc-field textarea {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	padding: 8px 12px !important;
	border: 1px solid var(--supc-border) !important;
	border-radius: 10px !important;
	background: #fff !important;
	color: var(--supc-text) !important;
}

.supc .supc-field textarea {
	resize: vertical;
}

.supc .supc-field input:focus,
.supc .supc-field textarea:focus,
.supc .supc-input:focus {
	outline: 2px solid var(--supc-accent) !important;
	outline-offset: -1px;
	border-color: transparent !important;
}

.supc-error {
	margin: 0;
	color: #b32d2e;
	font-size: 13px;
}

.supc-form-actions {
	display: flex;
	gap: 8px;
	margin-top: 2px;
}

.supc .supc-submit {
	display: block !important;
	flex: 1 1 auto;
	width: auto !important;
	height: auto !important;
	padding: 11px 14px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--supc-accent) !important;
	color: #fff !important;
	font-weight: 600 !important;
}

.supc .supc-cancel {
	display: block !important;
	flex: 0 0 auto;
	width: auto !important;
	height: auto !important;
	padding: 11px 16px !important;
	border: 1px solid var(--supc-border) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--supc-muted) !important;
}

.supc .supc-cancel:hover {
	background: var(--supc-bot-bg) !important;
	color: var(--supc-text) !important;
}

.supc .supc-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.supc-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Composer */

.supc-composer {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 12px;
	border-top: 1px solid var(--supc-border);
}

.supc .supc-input {
	flex: 1 1 auto;
	width: auto !important;
	height: 42px !important;
	padding: 0 16px !important;
	border: 1px solid var(--supc-border) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--supc-text) !important;
}

.supc .supc-send {
	display: flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 42px;
	width: 42px !important;
	height: 42px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--supc-accent) !important;
	color: #fff !important;
}

.supc .supc-send svg {
	width: 18px;
	height: 18px;
}

.supc .supc-input:disabled,
.supc .supc-send:disabled {
	opacity: 0.5;
	cursor: default;
}

.supc button:focus-visible {
	outline: 2px solid var(--supc-accent) !important;
	outline-offset: 2px;
}

.supc .supc-header button:focus-visible {
	outline-color: #fff !important;
}

@media (max-width: 480px) {
	.supc {
		right: 14px;
		bottom: 14px;
	}

	.supc.is-open {
		inset: 0;
	}

	.supc.is-open .supc-panel {
		width: 100%;
		max-width: none;
		height: 100%;
		margin: 0;
		border-radius: 0;
	}

	.supc.is-open .supc-launcher {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.supc button,
	.supc-typing span {
		transition: none !important;
		animation: none;
	}
}
