.sitesage-root {
	--ss-accent: #4f46e5;
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.sitesage-right { right: 20px; }
.sitesage-left { left: 20px; }

/* Launcher */
.sitesage-launcher {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--ss-accent); color: #fff; border: 0;
	padding: 12px 18px; border-radius: 999px; cursor: pointer;
	font-size: 15px; font-weight: 600; line-height: 1;
	box-shadow: 0 8px 24px rgba(0,0,0,.22);
	transition: transform .15s ease, box-shadow .15s ease;
}
.sitesage-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.sitesage-launcher svg { display: block; }
.sitesage-open .sitesage-launcher { transform: scale(.9); opacity: 0; pointer-events: none; }

/* Panel */
.sitesage-panel {
	position: absolute; bottom: 0; width: 380px; max-width: calc(100vw - 32px);
	height: 560px; max-height: calc(100vh - 40px);
	background: #fff; border-radius: 18px; overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 18px 60px rgba(0,0,0,.28);
	opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.sitesage-right .sitesage-panel { right: 0; }
.sitesage-left .sitesage-panel { left: 0; }
.sitesage-open .sitesage-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.sitesage-header {
	background: var(--ss-accent); color: #fff;
	padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.sitesage-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.sitesage-dot { width: 9px; height: 9px; background: #4ade80; border-radius: 50%; box-shadow: 0 0 0 3px rgba(74,222,128,.3); }
.sitesage-close { background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; opacity: .85; }
.sitesage-close:hover { opacity: 1; }

/* Tabs */
.sitesage-tabs { display: flex; background: #fff; border-bottom: 1px solid #eceef2; }
.sitesage-tab { flex: 1; border: 0; background: transparent; padding: 11px 8px; font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; }
.sitesage-tab:hover { color: #111827; }
.sitesage-tab-active { color: var(--ss-accent); border-bottom-color: var(--ss-accent); }

.sitesage-tabpanel { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* WhatsApp panel */
.sitesage-wa { align-items: center; justify-content: center; text-align: center; padding: 26px 22px; gap: 6px; }
.sitesage-wa-icon { margin-bottom: 6px; }
.sitesage-wa-text { color: #4b5563; font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.sitesage-wa-btn { display: inline-flex; align-items: center; gap: 8px; background: #25D366; color: #fff; text-decoration: none; padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.sitesage-wa-btn:hover { filter: brightness(1.05); }

.sitesage-lead-ok { text-align: center; font-size: 12px; color: #059669; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 6px 10px; margin: 4px 0; }

.sitesage-log { flex: 1; overflow-y: auto; padding: 16px; background: #f7f8fb; }

.sitesage-msg { margin-bottom: 12px; display: flex; flex-direction: column; }
.sitesage-msg-user { align-items: flex-end; }
.sitesage-msg-bot { align-items: flex-start; }
.sitesage-bubble {
	max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5;
	word-wrap: break-word; white-space: normal;
}
.sitesage-msg-bot .sitesage-bubble { background: #fff; color: #1f2430; border: 1px solid #eceef2; border-bottom-left-radius: 4px; }
.sitesage-msg-user .sitesage-bubble { background: var(--ss-accent); color: #fff; border-bottom-right-radius: 4px; }
.sitesage-bubble a { color: inherit; text-decoration: underline; }
.sitesage-msg-bot .sitesage-bubble a { color: var(--ss-accent); }

.sitesage-sources { margin-top: 6px; max-width: 84%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sitesage-sources-label { font-size: 11px; color: #8a8f9a; }
.sitesage-source {
	font-size: 11px; background: #eef2ff; color: #4338ca; padding: 3px 9px;
	border-radius: 999px; text-decoration: none; max-width: 160px; overflow: hidden;
	text-overflow: ellipsis; white-space: nowrap;
}
.sitesage-source:hover { background: #e0e7ff; }

/* Typing indicator */
.sitesage-typing .sitesage-bubble { display: inline-flex; gap: 4px; }
.sitesage-typing span { width: 7px; height: 7px; background: #c3c7d0; border-radius: 50%; animation: ss-bounce 1.2s infinite; }
.sitesage-typing span:nth-child(2) { animation-delay: .18s; }
.sitesage-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ss-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Input */
.sitesage-input { display: flex; padding: 10px; gap: 8px; border-top: 1px solid #eceef2; background: #fff; }
.sitesage-input input { flex: 1; border: 1px solid #dcdfe6; border-radius: 999px; padding: 10px 14px; font-size: 14px; outline: none; }
.sitesage-input input:focus { border-color: var(--ss-accent); }
.sitesage-send { background: var(--ss-accent); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sitesage-send:hover { filter: brightness(1.08); }

.sitesage-brand { text-align: center; font-size: 10px; color: #aab; padding: 6px 0 8px; background: #fff; letter-spacing: .03em; }
.sitesage-brand a { color: #99a; text-decoration: none; }
.sitesage-brand a:hover { color: var(--ss-accent); text-decoration: underline; }

@media (max-width: 480px) {
	.sitesage-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
}
