#stcb-root {
	--stcb-color: #0b6fa4;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: #1c1c1c;
}

#stcb-root *,
#stcb-root *::before,
#stcb-root *::after {
	box-sizing: border-box;
}

#stcb-root [hidden] {
	display: none !important;
}

#stcb-root button {
	font: inherit;
	cursor: pointer;
	border: 0;
	margin: 0;
}

#stcb-root .stcb-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-left: auto;
	padding: 0;
	border-radius: 50%;
	background: var(--stcb-color);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

#stcb-root .stcb-toggle:hover {
	transform: scale(1.06);
}

#stcb-root button:focus-visible,
#stcb-root .stcb-input:focus-visible {
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}

#stcb-root .stcb-panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	margin-bottom: 14px;
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

#stcb-root .stcb-header {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 10px 12px 16px;
	background: var(--stcb-color);
	color: #fff;
}

#stcb-root .stcb-title {
	flex: 1;
	min-width: 0;
	font-size: 16px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

#stcb-root .stcb-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
}

#stcb-root .stcb-icon:hover {
	background: rgba(255, 255, 255, 0.2);
}

#stcb-root .stcb-log {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #f4f5f7;
}

#stcb-root .stcb-msg {
	max-width: 86%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

#stcb-root .stcb-assistant {
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

#stcb-root .stcb-user {
	align-self: flex-end;
	border-bottom-right-radius: 4px;
	background: var(--stcb-color);
	color: #fff;
}

#stcb-root .stcb-error {
	align-self: center;
	max-width: 100%;
	background: #fdecea;
	color: #8a1c13;
	font-size: 14px;
	text-align: center;
}

#stcb-root .stcb-msg a {
	color: inherit;
	text-decoration: underline;
}

#stcb-root .stcb-typing {
	display: flex;
	gap: 5px;
	padding: 14px 13px;
}

#stcb-root .stcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa0a6;
	animation: stcb-blink 1.2s infinite ease-in-out;
}

#stcb-root .stcb-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

#stcb-root .stcb-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes stcb-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

#stcb-root .stcb-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 10px;
	border-top: 1px solid #e3e5e8;
	background: #fff;
}

#stcb-root .stcb-input {
	flex: 1;
	min-width: 0;
	min-height: 40px;
	max-height: 96px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid #c9ccd1;
	border-radius: 12px;
	background: #fff;
	color: #1c1c1c;
	font: inherit;
	/* 16px keeps iOS Safari from zooming the page when the field is focused */
	font-size: 16px;
	line-height: 1.35;
	resize: none;
	box-shadow: none;
}

#stcb-root .stcb-send {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 12px;
	background: var(--stcb-color);
	color: #fff;
}

#stcb-root .stcb-send:disabled {
	opacity: 0.5;
	cursor: default;
}

#stcb-root .stcb-notice {
	padding: 0 12px 8px;
	background: #fff;
	color: #6b7075;
	font-size: 11.5px;
	text-align: center;
}

@media (max-width: 480px) {
	#stcb-root {
		right: 12px;
		bottom: 12px;
	}

	#stcb-root.stcb-open {
		left: 12px;
	}

	#stcb-root .stcb-panel {
		width: 100%;
		max-width: none;
		height: calc(100vh - 100px);
		height: calc(100dvh - 100px);
		max-height: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	#stcb-root .stcb-toggle,
	#stcb-root .stcb-typing span {
		transition: none;
		animation: none;
	}
}
