#sdad-chatbot-root {
	position: fixed;
	bottom: 24px;
	z-index: 999999;
	font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	--sdad-primary: #0b6ef3;
}

/* Reset — many themes apply global styles to buttons/links/svg that would
   otherwise leak into the widget and break its look. :where() keeps this
   reset's specificity at zero so it never fights with the specific rules below. */
:where(#sdad-chatbot-root) button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
}

:where(#sdad-chatbot-root) a {
	text-decoration: none;
}

#sdad-chatbot-root svg {
	display: block;
}

#sdad-chatbot-root * {
	box-sizing: border-box;
}

#sdad-chatbot-root.sdad-pos-right { right: 24px; }
#sdad-chatbot-root.sdad-pos-left { left: 24px; }

#sdad-chatbot-toggle {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: var(--sdad-primary) !important;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(0,0,0,0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#sdad-chatbot-toggle:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

#sdad-chatbot-toggle svg {
	width: 34px;
	height: 34px;
}

#sdad-chatbot-window {
	position: absolute;
	bottom: 74px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: 72vh;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.18), 0 4px 14px rgba(0,0,0,0.08);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 1;
	transform: translateY(0) scale(1);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

#sdad-chatbot-root.sdad-pos-right #sdad-chatbot-window { right: 0; }
#sdad-chatbot-root.sdad-pos-left #sdad-chatbot-window { left: 0; }

#sdad-chatbot-window.sdad-hidden {
	opacity: 0;
	transform: translateY(12px) scale(0.97);
	pointer-events: none;
	position: absolute;
}

.sdad-chatbot-header {
	background: var(--sdad-primary);
	background: linear-gradient(135deg, var(--sdad-primary), color-mix(in srgb, var(--sdad-primary) 70%, #001c47));
	color: #fff;
	padding: 14px 16px;
	font-size: 15.5px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.sdad-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sdad-agent-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sdad-agent-avatar svg {
	width: 20px;
	height: 20px;
}

.sdad-chatbot-header button {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 4px !important;
	margin: 0 !important;
	color: #fff !important;
	line-height: 1;
	opacity: 0.9;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}
.sdad-chatbot-header button:hover { opacity: 1; background: rgba(255,255,255,0.15) !important; }

.sdad-header-right {
	display: flex;
	align-items: center;
	gap: 2px;
}

#sdad-chatbot-reset {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
}

#sdad-chatbot-reset svg {
	width: 17px;
	height: 17px;
}

#sdad-chatbot-close {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
}

#sdad-chatbot-close svg {
	width: 20px;
	height: 20px;
}

#sdad-chatbot-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f7f8fa;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sdad-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.sdad-row-bot {
	justify-content: flex-start;
}

.sdad-row-user {
	justify-content: flex-end;
}

.sdad-msg-col {
	display: flex;
	flex-direction: column;
	max-width: 78%;
}

.sdad-row-user .sdad-msg-col {
	align-items: flex-end;
}

.sdad-msg-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--sdad-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sdad-msg-avatar svg {
	width: 15px;
	height: 15px;
}

.sdad-msg {
	padding: 11px 14px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.55;
	word-wrap: break-word;
}

.sdad-msg-time {
	font-size: 10.5px;
	color: #9aa0a6;
	margin-top: 3px;
	padding: 0 3px;
}

.sdad-msg-bot {
	background: #fff;
	color: #262a2e;
	align-self: flex-start;
	border: 1px solid #eceef1;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.sdad-msg-user {
	background: var(--sdad-primary);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
	box-shadow: 0 2px 6px rgba(11,110,243,0.25);
}

.sdad-result-card {
	background: #fff;
	border: 1px solid #e7e9ec;
	border-radius: 10px;
	padding: 10px 12px;
	margin-top: 8px;
}

.sdad-answer-text {
	font-size: 13.5px;
	line-height: 1.6;
	color: #222;
	margin-bottom: 10px;
}

.sdad-answer-source {
	font-size: 12px;
	margin-bottom: 10px;
}

.sdad-links-heading {
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #8a8f98;
	margin: 10px 0 6px;
	padding-top: 8px;
	border-top: 1px solid #eee;
}

.sdad-links-list {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.sdad-link-item {
	font-size: 11.5px;
	line-height: 1.45;
}

.sdad-link-item a {
	color: var(--sdad-primary) !important;
	text-decoration: none !important;
	font-weight: 600 !important;
	font-size: inherit !important;
}
.sdad-link-item a:hover { text-decoration: underline !important; }

.sdad-result-card .sdad-result-title {
	font-weight: 600;
	font-size: 13.5px;
	color: #1a1a1a;
	margin-bottom: 4px;
	display: block;
}

.sdad-result-card .sdad-result-excerpt {
	font-size: 12.8px;
	color: #555;
	margin-bottom: 6px;
}

.sdad-result-card a.sdad-result-link {
	font-size: 12.5px !important;
	color: var(--sdad-primary) !important;
	text-decoration: none !important;
	font-weight: 600 !important;
}
.sdad-result-card a.sdad-result-link:hover { text-decoration: underline !important; }

.sdad-typing {
	align-self: flex-start;
	font-size: 12.5px;
	color: #888;
	font-style: italic;
}

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

#sdad-chatbot-input {
	flex: 1;
	border: 1px solid #dfe2e6;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 13.5px;
	outline: none;
}
#sdad-chatbot-input:focus { border-color: var(--sdad-primary); }

#sdad-chatbot-form button[type="submit"] {
	background: var(--sdad-primary) !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sdad-send-icon {
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 12px solid #ffffff;
	margin-left: 4px;
}

.sdad-handoff-prompt {
	font-size: 13px;
}

.sdad-handoff-text {
	margin-bottom: 10px;
	line-height: 1.5;
}

.sdad-handoff-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sdad-handoff-btn {
	border: 1px solid var(--sdad-primary) !important;
	background: #fff !important;
	color: var(--sdad-primary) !important;
	border-radius: 20px;
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.sdad-handoff-btn:hover {
	background: var(--sdad-primary) !important;
	color: #fff !important;
}

.sdad-handoff-btn.sdad-handoff-human {
	background: var(--sdad-primary) !important;
	color: #fff !important;
}

.sdad-handoff-picked {
	font-size: 12.5px;
	color: #8a8f98;
	font-style: italic;
}

.sdad-powered-by {
	text-align: center;
	font-size: 10.5px !important;
	line-height: 1.4;
	color: #9aa0a6 !important;
	padding: 6px 0 9px;
	background: #fff;
}

.sdad-powered-by a {
	color: #9aa0a6 !important;
	text-decoration: none !important;
	font-weight: 600 !important;
	font-size: inherit !important;
}

.sdad-powered-by a:hover {
	color: var(--sdad-primary) !important;
}

@media (max-width: 480px) {
	#sdad-chatbot-window {
		width: calc(100vw - 24px);
		height: 65vh;
	}
}
