:root {
	--scb-accent: #2563eb;
}

#scb-root,
#scb-root * {
	box-sizing: border-box;
}

#scb-toggle {
	position: fixed;
	right: 22px;
	bottom: 22px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--scb-accent);
	color: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

#scb-root[data-pos="left"] #scb-toggle {
	right: auto;
	left: 22px;
}

#scb-toggle:hover {
	transform: scale(1.06);
}

#scb-toggle svg {
	width: 28px;
	height: 28px;
	fill: #fff;
}

#scb-panel {
	position: fixed;
	right: 22px;
	bottom: 94px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 130px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
	z-index: 999999;
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#scb-root[data-pos="left"] #scb-panel {
	right: auto;
	left: 22px;
}

#scb-panel.scb-open {
	display: flex;
}

#scb-header {
	background: var(--scb-accent);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
}

#scb-header h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	line-height: 1.3;
}

#scb-actions {
	display: flex;
	align-items: center;
	gap: 2px;
}

#scb-clear,
#scb-close {
	background: transparent;
	border: none;
	color: #fff;
	line-height: 1;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	opacity: 0.85;
	transition: opacity 0.15s ease, background 0.15s ease;
}

#scb-clear:hover,
#scb-close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.18);
}

#scb-close {
	font-size: 22px;
}

#scb-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: #f7f8fa;
}

.scb-msg {
	margin: 0 0 12px;
	display: flex;
}

.scb-msg.scb-user {
	justify-content: flex-end;
}

.scb-bubble {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.scb-bot .scb-bubble {
	background: #fff;
	color: #1f2430;
	border: 1px solid #e6e8ec;
	border-bottom-left-radius: 4px;
}

.scb-user .scb-bubble {
	background: var(--scb-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.scb-sources {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.scb-sources li {
	margin: 4px 0 0;
}

.scb-sources a {
	font-size: 12.5px;
	color: var(--scb-accent);
	text-decoration: none;
}

.scb-sources a:hover {
	text-decoration: underline;
}

.scb-source-snippet {
	display: block;
	font-size: 12px;
	color: #6b7280;
	line-height: 1.4;
	margin: 2px 0 0;
}

#scb-starters {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 12px 12px;
	background: #f7f8fa;
}

.scb-chip {
	border: 1px solid var(--scb-accent);
	background: #fff;
	color: var(--scb-accent);
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 12.5px;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	font-family: inherit;
}

.scb-chip:hover {
	background: var(--scb-accent);
	color: #fff;
}

.scb-typing span {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 1px;
	background: #b3b8c2;
	border-radius: 50%;
	animation: scb-blink 1.2s infinite both;
}

.scb-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.scb-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes scb-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

#scb-form {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e6e8ec;
	background: #fff;
}

#scb-input {
	flex: 1 1 auto;
	border: 1px solid #d4d7dd;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	resize: none;
	outline: none;
	font-family: inherit;
}

#scb-input:focus {
	border-color: var(--scb-accent);
}

#scb-send {
	border: none;
	background: var(--scb-accent);
	color: #fff;
	border-radius: 10px;
	padding: 0 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

#scb-send:disabled {
	opacity: 0.6;
	cursor: default;
}
