#scb-widget {
	--scb-color: #2563eb;
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#scb-toggle {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: none;
	background: var(--scb-color);
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

#scb-toggle .scb-icon-close { display: none; }
#scb-widget.scb-open #scb-toggle .scb-icon-chat { display: none; }
#scb-widget.scb-open #scb-toggle .scb-icon-close { display: inline; }

#scb-panel {
	position: absolute;
	bottom: 72px;
	right: 0;
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 460px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#scb-header {
	background: var(--scb-color);
	color: #fff;
	padding: 14px 16px;
	font-weight: 600;
	font-size: 15px;
}

#scb-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fa;
}

.scb-msg { display: flex; }
.scb-msg-user { justify-content: flex-end; }
.scb-msg-assistant { justify-content: flex-start; }

.scb-bubble {
	max-width: 80%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
}

.scb-msg-user .scb-bubble {
	background: var(--scb-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.scb-msg-assistant .scb-bubble {
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}

.scb-typing { display: flex; gap: 4px; align-items: center; padding: 12px 13px; }
.scb-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: #9ca3af;
	animation: scb-bounce 1.2s infinite ease-in-out;
}
.scb-typing span:nth-child(2) { animation-delay: 0.15s; }
.scb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes scb-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

#scb-form {
	display: flex;
	border-top: 1px solid #e5e7eb;
	padding: 10px;
	gap: 8px;
	background: #fff;
}

#scb-input {
	flex: 1;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
}
#scb-input:focus { border-color: var(--scb-color); }

#scb-send {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var(--scb-color);
	color: #fff;
	cursor: pointer;
	font-size: 15px;
}

@media (max-width: 420px) {
	#scb-panel { width: calc(100vw - 24px); right: -8px; }
}
