#osc-chat-root,
#osc-chat-root * {
	box-sizing: border-box;
}

#osc-chat-root[hidden],
#osc-chat-root [hidden] {
	display: none !important;
}

#osc-chat-root {
	--osc-css-ready: 1;
	position: fixed;
	z-index: var(--osc-z, 999999);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	width: auto;
	max-width: calc(100vw - 24px);
	font-family: inherit;
	font-size: var(--osc-font-size, 15px);
	line-height: 1.45;
	color: var(--osc-text, #182033);
	pointer-events: none;
	isolation: isolate;
}

#osc-chat-root.osc-position-bottom-right {
	right: max(var(--osc-x, 24px), env(safe-area-inset-right));
	bottom: max(var(--osc-y, 24px), env(safe-area-inset-bottom));
}

#osc-chat-root.osc-position-bottom-left {
	left: max(var(--osc-x, 24px), env(safe-area-inset-left));
	bottom: max(var(--osc-y, 24px), env(safe-area-inset-bottom));
	align-items: flex-start;
}

#osc-chat-root.osc-position-top-right {
	right: max(var(--osc-x, 24px), env(safe-area-inset-right));
	top: max(var(--osc-y, 24px), env(safe-area-inset-top));
	flex-direction: column-reverse;
}

#osc-chat-root.osc-position-top-left {
	left: max(var(--osc-x, 24px), env(safe-area-inset-left));
	top: max(var(--osc-y, 24px), env(safe-area-inset-top));
	align-items: flex-start;
	flex-direction: column-reverse;
}

#osc-chat-root button,
#osc-chat-root textarea,
#osc-chat-root a {
	font: inherit;
}

#osc-chat-root button {
	cursor: pointer;
}

#osc-chat-root .osc-launcher {
	position: relative;
	display: grid;
	place-items: center;
	width: var(--osc-launcher, 64px);
	height: var(--osc-launcher, 64px);
	padding: 0;
	overflow: visible;
	border: 3px solid var(--osc-launcher-border, var(--osc-border, #dbe3ef)) !important;
	border-radius: 50%;
	background: var(--osc-accent, #2563eb);
	box-shadow: var(--osc-shadow, 0 24px 64px rgba(15, 23, 42, .24));
	color: #fff;
	pointer-events: auto;
	transition: transform 160ms ease, box-shadow 160ms ease;
}

#osc-chat-root .osc-launcher:hover {
	transform: translateY(-2px) scale(1.025);
}

#osc-chat-root .osc-launcher:focus-visible,
#osc-chat-root button:focus-visible,
#osc-chat-root a:focus-visible {
	outline: 3px solid var(--osc-accent, #2563eb);
	outline: 3px solid color-mix(in srgb, var(--osc-accent, #2563eb) 42%, white);
	outline-offset: 3px;
}

#osc-chat-root .osc-avatar {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
}

#osc-chat-root .osc-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#osc-chat-root .osc-avatar svg {
	width: 50%;
	height: 50%;
	fill: currentColor;
}

#osc-chat-root .osc-unread {
	position: absolute;
	top: 0;
	right: 0;
	width: 14px;
	height: 14px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #ef4444;
}

#osc-chat-root .osc-teaser {
	position: absolute;
	right: calc(var(--osc-launcher, 64px) + 12px);
	bottom: 8px;
	display: flex;
	align-items: center;
	min-width: 180px;
	max-width: min(280px, calc(100vw - var(--osc-launcher, 64px) - 48px));
	overflow: hidden;
	border: var(--osc-border-width, 1px) solid var(--osc-teaser-border, var(--osc-border, #dbe3ef));
	border-radius: calc(var(--osc-radius, 18px) * .75);
	background: var(--osc-teaser-bg, var(--osc-bg, #fff));
	box-shadow: var(--osc-shadow, 0 16px 40px rgba(15, 23, 42, .2));
	pointer-events: auto;
	animation: osc-fade var(--osc-duration, 240ms) both;
}

#osc-chat-root.osc-position-bottom-left .osc-teaser,
#osc-chat-root.osc-position-top-left .osc-teaser {
	right: auto;
	left: calc(var(--osc-launcher, 64px) + 12px);
}

#osc-chat-root.osc-position-top-left .osc-teaser,
#osc-chat-root.osc-position-top-right .osc-teaser {
	top: 8px;
	bottom: auto;
}

#osc-chat-root .osc-teaser-text {
	flex: 1;
	padding: 13px 8px 13px 15px;
	border: 0;
	background: transparent;
	color: var(--osc-teaser-text, var(--osc-text, #182033));
	text-align: left;
}

#osc-chat-root .osc-teaser-close {
	width: 34px;
	align-self: stretch;
	border: 0;
	background: transparent;
	color: var(--osc-teaser-close, var(--osc-muted, #64748b));
	font-size: 20px;
}

#osc-chat-root .osc-panel {
	display: flex;
	flex-direction: column;
	width: min(var(--osc-width, 380px), calc(100vw - 24px));
	max-width: min(var(--osc-max-width, 440px), calc(100vw - 24px));
	min-height: 0;
	max-height: min(680px, calc(100vh - var(--osc-y, 24px) - 24px));
	overflow: hidden;
	border: var(--osc-border-width, 1px) solid var(--osc-border, #dbe3ef);
	border-radius: var(--osc-radius, 18px);
	background: var(--osc-bg, #fff);
	box-shadow: var(--osc-shadow, 0 24px 64px rgba(15, 23, 42, .24));
	pointer-events: auto;
	transform-origin: bottom right;
	transition: width var(--osc-duration, 240ms) ease, height var(--osc-duration, 240ms) ease;
}

#osc-chat-root.osc-position-bottom-left .osc-panel,
#osc-chat-root.osc-position-top-left .osc-panel {
	transform-origin: bottom left;
}

#osc-chat-root.osc-size-auto .osc-panel {
	height: auto;
}

#osc-chat-root.osc-size-responsive .osc-panel {
	width: min(88vw, var(--osc-max-width, 440px));
	height: min(64vh, 560px);
}

#osc-chat-root.osc-size-custom .osc-panel {
	width: min(var(--osc-width, 380px), calc(100vw - 24px));
	height: min(var(--osc-height, 560px), calc(100vh - var(--osc-y, 24px) - 24px));
}

#osc-chat-root.osc-expand-on-chat.osc-has-conversation .osc-panel {
	width: min(var(--osc-expanded-width, 440px), calc(100vw - 24px));
}

#osc-chat-root.osc-size-auto:not(.osc-has-conversation) .osc-messages {
	flex: 0 1 auto;
	min-height: 0;
	max-height: 240px;
}

#osc-chat-root.osc-size-auto.osc-expand-on-chat.osc-has-conversation .osc-panel {
	height: min(var(--osc-height, 560px), calc(100vh - var(--osc-y, 24px) - 24px));
}

#osc-chat-root.osc-animation-fade .osc-panel.is-opening {
	animation: osc-fade var(--osc-duration, 240ms) both;
}

#osc-chat-root.osc-animation-slide .osc-panel.is-opening {
	animation: osc-slide var(--osc-duration, 240ms) both;
}

#osc-chat-root.osc-animation-scale .osc-panel.is-opening {
	animation: osc-scale var(--osc-duration, 240ms) both;
}

#osc-chat-root .osc-header {
	display: flex;
	align-items: center;
	gap: 11px;
	flex: 0 0 var(--osc-header-height, 60px);
	height: var(--osc-header-height, 60px);
	min-height: var(--osc-header-height, 60px);
	padding: 4px 13px;
	background: var(--osc-header, #172033);
	color: var(--osc-header-text, #fff);
}

#osc-chat-root .osc-avatar-small {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border: 2px solid rgba(255, 255, 255, .28);
	border-radius: 50%;
	background: var(--osc-accent, #2563eb);
}

#osc-chat-root .osc-header-copy {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
}

#osc-chat-root .osc-header-copy strong {
	overflow: hidden;
	font-size: 1.04em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#osc-chat-root .osc-header-copy span {
	display: flex;
	align-items: center;
	gap: 6px;
	opacity: .8;
	font-size: .78em;
}

#osc-chat-root .osc-header-copy i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
}

#osc-chat-root .osc-icon-button {
	display: grid;
	place-items: center;
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: rgba(255, 255, 255, .88);
	font-size: 24px;
}

#osc-chat-root .osc-icon-button:hover {
	background: rgba(255, 255, 255, .13);
}

#osc-chat-root .osc-icon-button svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

#osc-chat-root .osc-messages {
	display: flex;
	flex: 1 1 auto;
	min-height: 96px;
	padding: 18px 16px 8px;
	overflow-x: hidden;
	overflow-y: auto;
	flex-direction: column;
	gap: 11px;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}

#osc-chat-root .osc-message {
	display: flex;
	max-width: 88%;
	flex-direction: column;
	align-self: flex-start;
}

#osc-chat-root .osc-message.is-user {
	align-self: flex-end;
}

#osc-chat-root .osc-message-label {
	margin: 0 5px 3px;
	color: var(--osc-muted, #64748b);
	font-size: .72em;
}

#osc-chat-root .osc-message.is-user .osc-message-label {
	text-align: right;
}

#osc-chat-root .osc-message-content {
	padding: 10px 13px;
	border-radius: 14px 14px 14px 4px;
	background: var(--osc-assistant-bg, #f1f5f9);
	color: var(--osc-assistant-text, #182033);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

#osc-chat-root .osc-message.is-user .osc-message-content {
	border-radius: 14px 14px 4px 14px;
	background: var(--osc-user-bg, #2563eb);
	color: var(--osc-user-text, #fff);
}

#osc-chat-root .osc-message-content a {
	color: inherit;
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 2px;
}

#osc-chat-root .osc-typing .osc-message-content {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 54px;
	height: 38px;
}

#osc-chat-root .osc-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--osc-muted, #64748b);
	animation: osc-dot 1.1s infinite ease-in-out;
}

#osc-chat-root .osc-typing i:nth-child(2) {
	animation-delay: 140ms;
}

#osc-chat-root .osc-typing i:nth-child(3) {
	animation-delay: 280ms;
}

#osc-chat-root .osc-starters {
	display: flex;
	padding: 4px 14px 10px;
	overflow-x: auto;
	gap: 7px;
	scrollbar-width: thin;
}

#osc-chat-root .osc-starter {
	flex: 0 0 auto;
	max-width: 240px;
	padding: 7px 10px;
	border: 1px solid var(--osc-border, #dbe3ef);
	border-radius: 999px;
	background: var(--osc-bg, #fff);
	color: var(--osc-accent, #2563eb);
	font-size: .8em;
	white-space: nowrap;
}

#osc-chat-root .osc-starter:hover {
	background: var(--osc-assistant-bg, #f1f5f9);
}

#osc-chat-root .osc-cta {
	display: block;
	margin: 2px 14px 10px;
	padding: 9px 12px;
	border-radius: 10px;
	background: var(--osc-accent, #2563eb);
	color: #fff;
	font-weight: 650;
	text-align: center;
	text-decoration: none;
}

#osc-chat-root .osc-form {
	padding: 8px 11px 9px;
	border-top: 1px solid var(--osc-border, #dbe3ef);
	background: var(--osc-bg, #fff);
}

#osc-chat-root .osc-error {
	margin: 0 0 8px;
	padding: 8px 10px;
	border-radius: 8px;
	background: #fef2f2;
	color: #991b1b;
	font-size: .78em;
}

#osc-chat-root .osc-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 5px 5px 5px 9px;
	border: 1px solid var(--osc-border, #dbe3ef);
	border-radius: 12px;
	background: var(--osc-input-bg, #fff);
}

#osc-chat-root .osc-composer:focus-within {
	border-color: var(--osc-accent, #2563eb);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--osc-accent, #2563eb) 18%, transparent);
}

#osc-chat-root .osc-input {
	flex: 1;
	width: 100%;
	min-height: 26px;
	max-height: 112px;
	padding: 4px 0;
	resize: none;
	overflow-y: hidden;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--osc-input-text, #182033);
	line-height: 1.35;
}

#osc-chat-root .osc-input:focus,
#osc-chat-root .osc-input:focus-visible {
	border: 0;
	outline: 0;
	box-shadow: none;
}

#osc-chat-root .osc-input::placeholder {
	color: var(--osc-muted, #64748b);
}

#osc-chat-root .osc-send {
	display: grid;
	place-items: center;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 9px;
	background: var(--osc-accent, #2563eb);
	color: #fff;
}

#osc-chat-root .osc-send:disabled {
	cursor: wait;
	opacity: .55;
}

#osc-chat-root .osc-send svg {
	width: 19px;
	height: 19px;
	fill: currentColor;
}

#osc-chat-root .osc-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

#osc-chat-root .osc-form-meta {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 5px;
	color: var(--osc-muted, #64748b);
	font-size: .66em;
}

#osc-chat-root .osc-form-meta span:last-child {
	text-align: right;
}

#osc-chat-root .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(1px, 1px, 1px, 1px) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@keyframes osc-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes osc-slide {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes osc-scale {
	from { opacity: 0; transform: scale(.94); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes osc-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 600px) {
	#osc-chat-root {
		max-width: calc(100vw - 32px);
	}

	#osc-chat-root.osc-position-bottom-right,
	#osc-chat-root.osc-position-top-right {
		right: max(8px, env(safe-area-inset-right));
	}

	#osc-chat-root.osc-position-bottom-left,
	#osc-chat-root.osc-position-top-left {
		left: max(8px, env(safe-area-inset-left));
	}

	#osc-chat-root .osc-panel {
		max-width: calc(100vw - 32px);
		max-height: calc(100vh - 24px - env(safe-area-inset-bottom));
	}

	#osc-chat-root.osc-size-responsive .osc-panel {
		width: calc(100vw - 32px);
		height: min(64vh, 520px);
	}

	#osc-chat-root.osc-size-custom .osc-panel {
		width: min(var(--osc-width, 380px), calc(100vw - 32px));
		height: min(var(--osc-height, 560px), calc(100vh - 24px - env(safe-area-inset-bottom)));
	}

	#osc-chat-root.osc-expand-on-chat.osc-has-conversation .osc-panel {
		width: min(var(--osc-expanded-width, 440px), calc(100vw - 32px));
	}

	#osc-chat-root.osc-size-auto.osc-expand-on-chat.osc-has-conversation .osc-panel {
		height: min(var(--osc-height, 560px), 64vh);
	}

	#osc-chat-root .osc-message {
		max-width: 92%;
	}
}

@supports (height: 100dvh) {
	#osc-chat-root .osc-panel {
		max-height: min(680px, calc(100dvh - var(--osc-y, 24px) - 24px));
	}

	#osc-chat-root.osc-size-auto.osc-expand-on-chat.osc-has-conversation .osc-panel,
	#osc-chat-root.osc-size-custom .osc-panel {
		height: min(var(--osc-height, 560px), calc(100dvh - var(--osc-y, 24px) - 24px));
	}

	@media (max-width: 600px) {
		#osc-chat-root .osc-panel {
			max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
		}

		#osc-chat-root.osc-size-responsive .osc-panel {
			height: min(64dvh, 520px);
		}

		#osc-chat-root.osc-size-auto.osc-expand-on-chat.osc-has-conversation .osc-panel {
			height: min(var(--osc-height, 560px), 64dvh);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	#osc-chat-root *,
	#osc-chat-root *::before,
	#osc-chat-root *::after {
		scroll-behavior: auto !important;
		animation-duration: 1ms !important;
		transition-duration: 1ms !important;
	}
}
