.sid-chat {
	--sid-chat-ink: #172033;
	--sid-chat-muted: #5b6475;
	--sid-chat-canvas: #f4f6f9;
	--sid-chat-surface: #fff;
	--sid-chat-success: #16875a;
	--sid-chat-error: #c93636;
	--sid-chat-space-xs: 4px;
	--sid-chat-space-sm: 8px;
	--sid-chat-space-md: 12px;
	--sid-chat-space-lg: 16px;
	--sid-chat-space-xl: 24px;
	--sid-chat-launcher-height: 52px;
	--sid-chat-launcher-gap: 24px;
	--sid-chat-launcher-bottom: var(--sid-chat-offset-bottom, 24px);
	--sid-chat-z-widget: 12000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	color: var(--sid-chat-ink);
}

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

.sid-chat button,
.sid-chat textarea,
.sid-chat input {
	font: inherit;
}

.sid-chat__sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.sid-chat__launcher-wrap {
	position: fixed;
	right: 24px;
	right: var(--sid-chat-offset-horizontal, 24px);
	bottom: 24px;
	bottom: var(--sid-chat-launcher-bottom, 24px);
	z-index: 12000;
	right: clamp(0px, var(--sid-chat-offset-horizontal, 24px), calc(100vw - 180px));
	z-index: var(--sid-chat-z-widget);
	display: flex;
	align-items: center;
	gap: var(--sid-chat-space-md);
	pointer-events: auto;
}

.sid-chat--left .sid-chat__launcher-wrap {
	right: auto;
	left: 24px;
	left: var(--sid-chat-offset-horizontal, 24px);
	left: clamp(0px, var(--sid-chat-offset-horizontal, 24px), calc(100vw - 180px));
	flex-direction: row-reverse;
}

.sid-chat__teaser {
	max-width: 260px;
	padding: 10px 12px;
	border-radius: 12px;
	color: var(--sid-chat-ink);
	background: var(--sid-chat-surface);
	box-shadow: 0 4px 12px rgb(23 32 51 / 14%);
	opacity: 0;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(6px);
	transition: opacity 220ms ease-out, transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.sid-chat--left .sid-chat__teaser { transform: translateX(-6px); }
.sid-chat__teaser.is-visible { opacity: 1; transform: translateX(0); }
.sid-chat__teaser[hidden] { display: none; }

.sid-chat__launcher {
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	max-width: 180px;
	height: 52px;
	padding: 0 18px 0 14px;
	border: 0;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 999px;
	color: var(--sid-chat-on-accent);
	background: var(--sid-chat-accent);
	box-shadow: 0 8px 24px rgb(23 32 51 / 18%), 0 2px 6px rgb(23 32 51 / 12%);
	cursor: pointer;
	pointer-events: auto;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
	transition: background-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms cubic-bezier(.22, 1, .36, 1);
}

.sid-chat__launcher::before,
.sid-chat__launcher::after {
	--sid-chat-wave-start: scale(.72, .48);
	content: "";
	position: absolute;
	top: -20px;
	right: -20px;
	bottom: -20px;
	left: -20px;
	inset: -20px;
	z-index: -1;
	border-radius: 999px;
	background: var(--sid-chat-accent);
	filter: blur(7px);
	opacity: 0;
	pointer-events: none;
	transform: var(--sid-chat-wave-start);
	transform-origin: center;
	animation: sid-chat-attention-wave 6.4s cubic-bezier(.22, 1, .36, 1) infinite;
}

.sid-chat__launcher::after { animation-delay: 1.15s; }

.sid-chat__launcher[aria-expanded="true"]::before,
.sid-chat__launcher[aria-expanded="true"]::after {
	animation: none;
	opacity: 0;
}

.sid-chat__launcher-icon {
	display: block;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
}

.sid-chat__launcher-icon--close { display: none; }
.sid-chat__launcher[aria-expanded="true"] .sid-chat__launcher-icon--chat { display: none; }
.sid-chat__launcher[aria-expanded="true"] .sid-chat__launcher-icon--close { display: block; }

.sid-chat__launcher-label {
	overflow: hidden;
	font-size: .9375rem;
	font-weight: 650;
	line-height: 1;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.sid-chat__launcher:active { transform: scale(.975); }

.sid-chat__launcher-badge {
	position: absolute;
	top: -3px;
	right: -3px;
	width: 14px;
	height: 14px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--sid-chat-error);
}

@media (hover: hover) and (pointer: fine) {
	.sid-chat__launcher:hover {
		background: var(--sid-chat-accent-hover);
		box-shadow: 0 10px 28px rgb(23 32 51 / 20%), 0 3px 7px rgb(23 32 51 / 13%);
		transform: translateY(-2px);
	}
}

.sid-chat__panel {
	position: fixed;
	right: 24px;
	bottom: calc(var(--sid-chat-offset-bottom, 24px) + var(--sid-chat-launcher-height) + var(--sid-chat-launcher-gap));
	bottom: calc(var(--sid-chat-launcher-bottom) + var(--sid-chat-launcher-height) + var(--sid-chat-launcher-gap));
	z-index: 12000;
	z-index: var(--sid-chat-z-widget);
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: 380px;
	max-width: calc(100vw - 32px);
	width: min(380px, calc(100vw - 32px));
	height: 560px;
	max-height: calc(100vh - var(--sid-chat-offset-bottom, 24px) - var(--sid-chat-launcher-height) - var(--sid-chat-launcher-gap) - 16px);
	height: min(560px, calc(100dvh - var(--sid-chat-launcher-bottom) - var(--sid-chat-launcher-height) - var(--sid-chat-launcher-gap) - 16px));
	overflow: hidden;
	border-radius: 16px;
	background: var(--sid-chat-surface);
	box-shadow: 0 4px 8px rgb(23 32 51 / 22%);
	animation: sid-chat-open 180ms cubic-bezier(.22, 1, .36, 1);
}

.sid-chat--left .sid-chat__panel {
	right: auto;
	left: 24px;
}

.sid-chat__panel[hidden] { display: none; }

.sid-chat__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--sid-chat-space-md);
	padding: var(--sid-chat-space-lg);
	color: var(--sid-chat-on-header);
	background: var(--sid-chat-header);
}

.sid-chat__header h2 {
	margin: 0;
	color: inherit;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.25;
}

.sid-chat__header p {
	margin: var(--sid-chat-space-xs) 0 0;
	color: var(--sid-chat-on-header);
	opacity: .9;
	font-size: .8125rem;
}

.sid-chat__online-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #8ce0bd;
}

.sid-chat__close {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: -8px -8px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: var(--sid-chat-on-header);
	background: transparent;
	cursor: pointer;
}

.sid-chat__close:hover { background: rgb(0 0 0 / 12%); }

.sid-chat__messages {
	display: flex;
	flex-direction: column;
	gap: var(--sid-chat-space-md);
	overflow-y: auto;
	padding: var(--sid-chat-space-lg);
	background: var(--sid-chat-canvas);
	overscroll-behavior: contain;
}

.sid-chat__message {
	align-self: flex-start;
	max-width: 86%;
	padding: 10px 12px 8px;
	border-radius: 12px;
	color: var(--sid-chat-ink);
	background: #fff;
}

.sid-chat__message--visitor {
	align-self: flex-end;
	color: var(--sid-chat-on-message);
	background: var(--sid-chat-message);
	border-bottom-right-radius: 4px;
}

.sid-chat__message--admin { border-bottom-left-radius: 4px; }

.sid-chat__message p {
	margin: 0;
	color: inherit;
	font-size: .9375rem;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.sid-chat__message-image {
	display: block;
	margin-bottom: 6px;
	border-radius: 8px;
	overflow: hidden;
	background: rgb(0 0 0 / 6%);
}

.sid-chat__message-image img {
	display: block;
	width: auto;
	max-width: min(240px, 100%);
	height: auto;
	max-height: 280px;
	object-fit: contain;
}

.sid-chat__message time {
	display: block;
	margin-top: 3px;
	color: var(--sid-chat-muted);
	font-size: .6875rem;
	text-align: right;
}

.sid-chat__message--visitor time { color: inherit; opacity: .76; }
.sid-chat__greeting time { display: none; }

.sid-chat__form {
	display: grid;
	gap: var(--sid-chat-space-sm);
	padding: var(--sid-chat-space-md) var(--sid-chat-space-lg) var(--sid-chat-space-lg);
	border-top: 1px solid #dfe3ea;
	background: #fff;
}

.sid-chat__form[hidden],
.sid-chat__closed[hidden],
.sid-chat__consent[hidden] { display: none; }

.sid-chat__form textarea {
	width: 100%;
	min-height: 60px;
	max-height: 120px;
	padding: 10px 12px;
	resize: vertical;
	border: 1px solid #aeb6c4;
	border-radius: 8px;
	color: var(--sid-chat-ink);
	background: #fff;
}

.sid-chat__form textarea::placeholder { color: #667085; opacity: 1; }
.sid-chat__form textarea:disabled { color: var(--sid-chat-muted); background: #eef1f5; }

.sid-chat__attachment-tools {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
}

.sid-chat__attachment-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.sid-chat__attach {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #aeb6c4;
	border-radius: 8px;
	color: var(--sid-chat-ink);
	background: #fff;
	cursor: pointer;
}

.sid-chat__attach:hover { background: #f3f5f8; }
.sid-chat__attachment-input:disabled + .sid-chat__attach { opacity: .58; cursor: wait; }
.sid-chat__attachment-input:focus-visible + .sid-chat__attach {
	outline: 3px solid #6ea0f8;
	outline: 3px solid color-mix(in srgb, var(--sid-chat-accent), #fff 35%);
	outline-offset: 2px;
}

.sid-chat__attachment-preview {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) 44px;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border: 1px solid #dfe3ea;
	border-radius: 10px;
	background: var(--sid-chat-canvas);
}

.sid-chat__attachment-preview[hidden] { display: none; }

.sid-chat__attachment-thumb {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 8px;
	color: var(--sid-chat-muted);
	background: #e7eaf0;
}

.sid-chat__attachment-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sid-chat__attachment-thumb img[hidden],
.sid-chat__attachment-fallback[hidden] { display: none; }

.sid-chat__attachment-details { min-width: 0; }
.sid-chat__attachment-details strong,
.sid-chat__attachment-details span { display: block; }
.sid-chat__attachment-details strong {
	overflow: hidden;
	color: var(--sid-chat-ink);
	font-size: .75rem;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.sid-chat__attachment-details span {
	margin-top: 2px;
	color: var(--sid-chat-muted);
	font-size: .6875rem;
	line-height: 1.3;
}

.sid-chat__attachment-remove {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	color: var(--sid-chat-muted);
	background: transparent;
	cursor: pointer;
}

.sid-chat__attachment-remove:hover { color: var(--sid-chat-error); background: #fff; }
.sid-chat__attachment-remove:disabled { opacity: .58; cursor: wait; }

.sid-chat__honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.sid-chat__consent {
	position: relative;
	display: grid;
	grid-template-columns: 18px minmax(0, 1fr);
	gap: var(--sid-chat-space-sm);
	align-items: start;
	color: var(--sid-chat-muted);
	font-size: .75rem;
	line-height: 1.35;
}

.sid-chat .sid-chat__consent input[type="checkbox"] {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 18px;
	height: 18px;
	margin: 0 !important;
	opacity: 0 !important;
	cursor: pointer;
}

.sid-chat__consent-box {
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1px solid #8b95a5;
	border-radius: 4px;
	color: var(--sid-chat-on-accent);
	background: #fff;
	pointer-events: none;
}

.sid-chat__consent-box svg {
	display: block;
	width: 13px;
	height: 13px;
	opacity: 0;
}

.sid-chat__consent input[type="checkbox"]:checked + .sid-chat__consent-box {
	border-color: var(--sid-chat-accent);
	background: var(--sid-chat-accent);
}

.sid-chat__consent input[type="checkbox"]:checked + .sid-chat__consent-box svg { opacity: 1; }

.sid-chat__consent input[type="checkbox"]:focus-visible + .sid-chat__consent-box {
	outline: 3px solid #6ea0f8;
	outline: 3px solid color-mix(in srgb, var(--sid-chat-accent), #fff 35%);
	outline-offset: 2px;
}

.sid-chat__consent a { color: var(--sid-chat-accent-hover); text-decoration: underline; }

.sid-chat__form-footer {
	display: flex;
	align-items: center;
	gap: var(--sid-chat-space-sm);
}

.sid-chat__status {
	flex: 1;
	margin: 0;
	color: var(--sid-chat-success);
	font-size: .75rem;
	line-height: 1.35;
}

.sid-chat__status:empty { display: none; }
.sid-chat__status.is-error { color: var(--sid-chat-error); }

.sid-chat__send,
.sid-chat__new-dialog {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sid-chat-space-sm);
	min-height: 44px;
	padding: 9px 14px;
	border: 0;
	border-radius: 8px;
	color: var(--sid-chat-on-accent);
	font-weight: 600;
	background: var(--sid-chat-accent);
	cursor: pointer;
	transition: background-color 180ms ease-out;
}

.sid-chat__send { margin-left: auto; }

.sid-chat__send:hover,
.sid-chat__new-dialog:hover { background: var(--sid-chat-accent-hover); }

.sid-chat__send:disabled,
.sid-chat__new-dialog:disabled {
	opacity: .62;
	cursor: wait;
}

.sid-chat__send.is-loading svg { animation: sid-chat-pulse 800ms ease-in-out infinite alternate; }

.sid-chat__closed {
	padding: var(--sid-chat-space-lg);
	border-top: 1px solid #dfe3ea;
	background: #fff;
	text-align: center;
}

.sid-chat__closed p { margin: 0 0 var(--sid-chat-space-md); color: var(--sid-chat-muted); }

.sid-chat button:focus-visible,
.sid-chat textarea:focus-visible,
.sid-chat input:focus-visible,
.sid-chat a:focus-visible {
	outline: 3px solid #6ea0f8;
	outline: 3px solid color-mix(in srgb, var(--sid-chat-accent), #fff 35%);
	outline-offset: 2px;
}

@keyframes sid-chat-open {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes sid-chat-pulse {
	from { opacity: .45; }
	to { opacity: 1; }
}

@keyframes sid-chat-attention-wave {
	0%, 46% {
		opacity: 0;
		transform: var(--sid-chat-wave-start);
	}
	54% { opacity: .13; }
	72% { opacity: .075; }
	88%, 100% {
		opacity: 0;
		transform: scale(1);
	}
}

@supports (height: 100dvh) and (bottom: clamp(0px, 1px, 2px)) {
	.sid-chat {
		--sid-chat-launcher-bottom: clamp(0px, var(--sid-chat-offset-bottom, 24px), calc(100dvh - var(--sid-chat-launcher-height)));
	}
}

@media (min-width: 601px) {
	.sid-chat__form textarea { height: 60px; }
}

@media (max-width: 600px) {
	.sid-chat { --sid-chat-launcher-height: 56px; }

	.sid-chat__launcher-wrap {
		right: 24px;
		right: var(--sid-chat-offset-horizontal, 24px);
		right: clamp(0px, var(--sid-chat-offset-horizontal, 24px), calc(100vw - 56px));
		bottom: 24px;
		bottom: var(--sid-chat-launcher-bottom, 24px);
	}

	.sid-chat--left .sid-chat__launcher-wrap {
		right: auto;
		left: 24px;
		left: var(--sid-chat-offset-horizontal, 24px);
		left: clamp(0px, var(--sid-chat-offset-horizontal, 24px), calc(100vw - 56px));
	}

	.sid-chat__launcher {
		width: 56px;
		height: 56px;
		padding: 0;
		border-radius: 16px;
	}

	.sid-chat__launcher::before,
	.sid-chat__launcher::after { --sid-chat-wave-start: scale(.58); }

	.sid-chat__launcher-label,
	.sid-chat__teaser { display: none; }

	.sid-chat__panel {
		inset: auto 0 0;
		width: 100%;
		height: 90vh;
		max-height: 720px;
		height: min(90dvh, 720px);
		border-radius: 16px 16px 0 0;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.sid-chat--left .sid-chat__panel { left: 0; }

	.sid-chat-is-open { overflow: hidden; }
	.sid-chat-is-open .sid-chat__launcher-wrap { visibility: hidden; }
	.sid-chat__form-footer { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
	.sid-chat__panel { animation: none; }
	.sid-chat__launcher::before,
	.sid-chat__launcher::after { animation: none; opacity: 0; }
	.sid-chat__launcher,
	.sid-chat__teaser,
	.sid-chat__send,
	.sid-chat__new-dialog { transition: none; }
	.sid-chat__send.is-loading svg { animation: none; }
}
