#sc-widget-bubble {
	position: fixed;
	bottom: 24px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--sc-accent, #2563eb);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}
#sc-widget-bubble:hover {
	transform: scale(1.06);
}
#sc-widget-bubble.sc-pos-right {
	right: 24px;
}
#sc-widget-bubble.sc-pos-left {
	left: 24px;
}
#sc-widget-bubble img {
	width: 32px;
	height: 32px;
}

#sc-widget-panel {
	position: fixed;
	bottom: 92px;
	width: 360px;
	height: 500px;
	max-height: 80vh;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	
	/* Smooth open/close transitions */
	opacity: 0;
	visibility: hidden;
	transform: translateY(15px) scale(0.98);
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
	pointer-events: none;
	
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: var(--sc-font, inherit);
	z-index: 999999;
}
#sc-widget-panel.sc-pos-right {
	right: 24px;
}
#sc-widget-panel.sc-pos-left {
	left: 24px;
}
#sc-widget-panel.sc-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}
#sc-widget-header {
	background: var(--sc-accent, #2563eb);
	color: #fff;
	padding: 12px 16px;
	font-weight: 600;
}
#sc-widget-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	font-size: 15px;
}
#sc-widget-messages .sc-msg {
	margin-bottom: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	padding: 10px 14px;
	border-radius: 16px;
	max-width: 85%;
	width: fit-content;
	animation: scMsgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scMsgFadeIn {
	0% { opacity: 0; transform: translateY(8px); }
	100% { opacity: 1; transform: translateY(0); }
}
#sc-widget-messages .sc-msg-bot {
	color: #111827;
	background: #f3f4f6;
	border-bottom-left-radius: 4px;
}
#sc-widget-messages .sc-msg-user {
	color: #fff;
	background: var(--sc-accent, #2563eb);
	margin-left: auto;
	border-bottom-right-radius: 4px;
}
#sc-widget-form {
	display: flex;
	border-top: 1px solid #e5e7eb;
}
#sc-widget-input {
	flex: 1;
	border: none;
	padding: 14px;
	font-size: 15px;
	font-family: inherit;
}
#sc-widget-input:focus {
	outline: none;
}
#sc-widget-send {
	border: none;
	background: var(--sc-accent, #2563eb);
	color: #fff;
	padding: 0 16px;
	cursor: pointer;
	font-family: inherit;
}

@media (max-width: 420px) {
	#sc-widget-panel {
		width: calc(100vw - 32px);
		right: 16px !important;
		left: 16px !important;
	}
	#sc-widget-bubble.sc-pos-right {
		right: 16px;
	}
	#sc-widget-bubble.sc-pos-left {
		left: 16px;
	}
}

.sc-typing-dots {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 20px;
}
.sc-typing-dots span {
	width: 6px;
	height: 6px;
	background-color: currentColor;
	border-radius: 50%;
	opacity: 0.6;
	animation: sc-bouncing 1.4s infinite ease-in-out both;
}
.sc-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.sc-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes sc-bouncing {
	0%, 80%, 100% { transform: scale(0); }
	40% { transform: scale(1); }
}

#sc-widget-tooltip {
	position: fixed;
	bottom: 95px;
	right: 24px;
	background: #fff;
	color: #111827;
	padding: 12px 16px;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	font-family: var(--sc-font, inherit);
	font-size: 14px;
	z-index: 999998;
	pointer-events: none;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	max-width: 260px;
	line-height: 1.4;
}
#sc-widget-tooltip.sc-visible {
	opacity: 1;
	transform: translateY(0);
}
#sc-widget-tooltip.sc-pos-left {
	right: auto;
	left: 24px;
}
#sc-widget-tooltip::after {
	content: '';
	position: absolute;
	bottom: -5px;
	right: 26px;
	width: 10px;
	height: 10px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 4px 4px 4px rgba(0,0,0,0.05);
}
#sc-widget-tooltip.sc-pos-left::after {
	right: auto;
	left: 26px;
}
