/* ---------- Floating Chat Widget ---------- */
#sac-chat-widget {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#sac-chat-widget button#sac-chat-toggle {
	all: unset;
	box-sizing: border-box !important;
	width: 60px !important;
	height: 60px !important;
	border-radius: 50% !important;
	background: #2563eb !important;
	color: #fff !important;
	cursor: pointer !important;
	box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: transform 0.15s ease;
}
#sac-chat-toggle:hover {
	transform: scale(1.06);
}
#sac-chat-toggle .sac-icon-chat,
#sac-chat-toggle .sac-icon-close {
	display: flex;
	align-items: center;
	justify-content: center;
}
#sac-chat-toggle .sac-icon-chat svg,
#sac-chat-toggle .sac-icon-close svg {
	fill: #fff !important;
}
#sac-chat-toggle .sac-icon-close { display: none; }
#sac-chat-toggle.sac-open .sac-icon-chat { display: none; }
#sac-chat-toggle.sac-open .sac-icon-close { display: flex; }

#sac-chat-box {
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 340px;
	max-width: calc(100vw - 32px);
	height: 460px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0,0,0,0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
#sac-chat-box.sac-hidden { display: none; }

.sac-chat-header {
	background: #2563eb;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 600;
	font-size: 15px;
}
.sac-header-actions { display: flex; gap: 6px; }
.sac-chat-header .sac-icon-btn {
	text-decoration: none !important;
	background: rgba(255,255,255,0.18) !important;
	border-radius: 50% !important;
	width: 30px !important;
	height: 30px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #fff !important;
	transition: background 0.15s ease;
	box-sizing: border-box;
}
.sac-chat-header .sac-icon-btn:hover { background: rgba(255,255,255,0.32) !important; }
.sac-chat-header .sac-icon-btn svg {
	fill: #fff !important;
	display: block !important;
	width: 15px !important;
	height: 15px !important;
}

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

.sac-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 13.5px;
	line-height: 1.45;
	word-wrap: break-word;
}
.sac-msg-bot {
	background: #fff;
	border: 1px solid #e5e7eb;
	align-self: flex-start;
	border-bottom-left-radius: 2px;
}
.sac-msg-user {
	background: #2563eb;
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 2px;
}
.sac-msg a { color: inherit; text-decoration: underline; }
.sac-msg-source-link {
	display: inline-block;
	margin-top: 6px;
	font-size: 12.5px;
	font-weight: 600;
}
.sac-typing {
	font-style: italic;
	color: #888;
	font-size: 12.5px;
}

.sac-quick-questions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-self: flex-start;
	max-width: 100%;
}
.sac-quick-btn {
	background: #fff !important;
	border: 1px solid #2563eb !important;
	color: #2563eb !important;
	border-radius: 16px !important;
	padding: 6px 12px !important;
	font-size: 12.5px !important;
	cursor: pointer !important;
	line-height: 1.3 !important;
}
.sac-quick-btn:hover { background: #eff4ff !important; }

.sac-chat-input-row {
	display: flex;
	align-items: center;
	border-top: 1px solid #e5e7eb;
	padding: 10px;
	gap: 8px;
	background: #fff;
}
#sac-chat-input {
	flex: 1;
	border: 1px solid #d1d5db !important;
	border-radius: 20px !important;
	padding: 9px 14px !important;
	font-size: 13.5px !important;
	outline: none !important;
	box-shadow: none !important;
	background: #fff !important;
	color: #111 !important;
	height: auto !important;
	margin: 0 !important;
}
#sac-chat-input:focus { border-color: #2563eb !important; }

#sac-chat-widget button#sac-chat-send {
	all: unset;
	box-sizing: border-box !important;
	background: #2563eb !important;
	color: #fff !important;
	border: none !important;
	border-radius: 50% !important;
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	padding: 0 !important;
	margin: 0 !important;
	flex-shrink: 0 !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	box-shadow: none !important;
	text-transform: none !important;
}
#sac-chat-widget button#sac-chat-send:hover { background: #1d4ed8 !important; }
#sac-chat-widget button#sac-chat-send svg {
	width: 16px !important;
	height: 16px !important;
	fill: #fff !important;
	margin-left: 2px !important;
	display: block !important;
}

.sac-chat-footer {
	display: flex;
	justify-content: center;
	gap: 16px;
	padding: 10px 8px;
	font-size: 12px;
	background: #f5f7fb;
	border-top: 1px solid #e5e7eb;
}
.sac-chat-footer .sac-footer-link {
	color: #2563eb !important;
	text-decoration: none !important;
	font-weight: 600 !important;
	display: flex !important;
	align-items: center !important;
	gap: 5px !important;
}
.sac-chat-footer .sac-footer-link svg {
	fill: #2563eb !important;
	display: block !important;
	width: 14px !important;
	height: 14px !important;
}
.sac-chat-footer .sac-footer-link:hover { text-decoration: underline !important; }

/* ---------- Admin Settings Page ---------- */
.sac-admin-wrap .sac-qa-table { margin-top: 10px; }
.sac-admin-wrap .sac-qa-table th,
.sac-admin-wrap .sac-qa-table td {
	padding: 10px;
	vertical-align: top;
}
