:root {
	--saac-primary: #2563eb;
	--saac-radius: 16px;
}

#saac-chat-root, .saac-inline-embed {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
#saac-chat-root *, .saac-inline-embed * { box-sizing: border-box; }

.saac-launcher {
	position: fixed;
	bottom: 24px;
	z-index: 999998;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--saac-primary);
	box-shadow: 0 8px 24px rgba(0,0,0,.2);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	transition: transform .2s ease;
}
.saac-launcher:hover { transform: scale(1.06); }
.saac-launcher.saac-right { right: 24px; }
.saac-launcher.saac-left { left: 24px; }
.saac-launcher svg { width: 28px; height: 28px; fill: #fff; }
.saac-launcher .saac-badge {
	position: absolute; top: -4px; right: -4px;
	background: #ef4444; color: #fff; font-size: 11px;
	border-radius: 999px; padding: 2px 6px; font-weight: 600;
}

.saac-window {
	position: fixed;
	bottom: 96px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: var(--saac-radius);
	box-shadow: 0 20px 60px rgba(0,0,0,.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	opacity: 0;
	transform: translateY(20px) scale(.98);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.saac-window.saac-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.saac-window.saac-right { right: 24px; }
.saac-window.saac-left { left: 24px; }

.saac-window.saac-dark { background: #1f2430; color: #eef0f5; }

.saac-header {
	background: var(--saac-primary);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.saac-header-title { font-weight: 600; font-size: 15px; }
.saac-header-status { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.saac-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.saac-status-dot.saac-offline { background: #9ca3af; }
.saac-close-btn { background: transparent; border: none; color: #fff; cursor: pointer; font-size: 18px; line-height: 1; opacity: .9; }
.saac-close-btn:hover { opacity: 1; }

.saac-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fa;
}
.saac-window.saac-dark .saac-messages { background: #161a22; }

.saac-msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.saac-msg.saac-visitor { align-self: flex-end; background: var(--saac-primary); color: #fff; border-bottom-right-radius: 4px; }
.saac-msg.saac-assistant { align-self: flex-start; background: #fff; color: #1f2430; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.saac-window.saac-dark .saac-msg.saac-assistant { background: #2a2f3a; color: #eef0f5; }

.saac-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 14px; }
.saac-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; animation: saac-bounce 1.2s infinite ease-in-out; }
.saac-typing span:nth-child(2) { animation-delay: .15s; }
.saac-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes saac-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

.saac-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.saac-quick-reply { border: 1px solid var(--saac-primary); color: var(--saac-primary); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.saac-quick-reply:hover { background: var(--saac-primary); color: #fff; }

.saac-input-bar { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid #e5e7eb; background: #fff; }
.saac-window.saac-dark .saac-input-bar { background: #1f2430; border-color: #333a47; }
.saac-input { flex: 1; border: 1px solid #d1d5db; border-radius: 999px; padding: 10px 14px; font-size: 14px; outline: none; resize: none; max-height: 80px; }
.saac-window.saac-dark .saac-input { background: #2a2f3a; border-color: #3a4150; color: #eef0f5; }
.saac-send-btn { background: var(--saac-primary); border: none; color: #fff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.saac-send-btn svg { width: 18px; height: 18px; fill: #fff; }
.saac-send-btn:disabled { opacity: .5; cursor: not-allowed; }

.saac-lead-form { padding: 14px 16px; background: #fff; border-top: 1px solid #e5e7eb; display: flex; flex-direction: column; gap: 8px; }
.saac-lead-form input { border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 12px; font-size: 13.5px; }
.saac-lead-form button { background: var(--saac-primary); color: #fff; border: none; padding: 10px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13.5px; }

.saac-booking-frame { width: 100%; height: 100%; border: none; }

.saac-footer-note { font-size: 11px; text-align: center; color: #9ca3af; padding: 4px 0 10px; }

@media (max-width: 480px) {
	.saac-window { width: calc(100vw - 16px); height: calc(100vh - 110px); right: 8px !important; left: 8px !important; bottom: 86px; }
}
