/* LSI Scales AI Chatbot — widget styles */
:root {
	--lsi-accent: #FE5815;        /* brand orange */
	--lsi-accent-dark: #003E3E;   /* brand teal */
	--lsi-bg: #ffffff;
	--lsi-user-bubble: #FE5815;   /* user bubbles in brand orange */
	--lsi-bot-bubble: #f1f5f9;
	--lsi-text: #1f2933;
	--lsi-muted: #6b7280;
	--lsi-shadow: 0 12px 38px rgba(0, 62, 62, 0.28);
}

#lsi-bot-root, #lsi-bot-root * {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Launcher button */
#lsi-bot-launcher {
	position: fixed;
	bottom: 22px;
	right: 22px;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--lsi-accent);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: var(--lsi-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999998;
	overflow: visible;
	transition: transform .18s ease, background .18s ease;
}
#lsi-bot-launcher:hover { transform: scale(1.06); background: var(--lsi-accent-dark); }
#lsi-bot-launcher svg {
	width: 32px !important; height: 32px !important; position: relative; z-index: 2;
	display: block !important; color: #fff; stroke: #fff; overflow: visible;
}
#lsi-bot-launcher .lsi-pulse {
	position: absolute; inset: 0; border-radius: 50%; z-index: 1; pointer-events: none;
	box-shadow: 0 0 0 0 rgba(254,88,21,.55);
	animation: lsi-pulse 2.2s infinite;
}
@keyframes lsi-pulse {
	0% { box-shadow: 0 0 0 0 rgba(254,88,21,.5); }
	70% { box-shadow: 0 0 0 16px rgba(254,88,21,0); }
	100% { box-shadow: 0 0 0 0 rgba(254,88,21,0); }
}

/* Panel */
#lsi-bot-panel {
	position: fixed;
	bottom: 96px;
	right: 22px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 130px);
	background: var(--lsi-bg);
	border-radius: 16px;
	box-shadow: var(--lsi-shadow);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .2s ease, transform .2s ease;
}
#lsi-bot-panel.lsi-open { display: flex; opacity: 1; transform: translateY(0); }

/* Header */
#lsi-bot-header {
	background: linear-gradient(135deg, var(--lsi-accent) 0%, #d8470d 55%, var(--lsi-accent-dark) 100%);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}
#lsi-bot-header .lsi-avatar {
	width: 40px; height: 40px; border-radius: 50%;
	background: rgba(255,255,255,.18);
	display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
#lsi-bot-header .lsi-avatar svg { width: 22px; height: 22px; }
#lsi-bot-header .lsi-titles { line-height: 1.25; flex: 1; min-width: 0; }
#lsi-bot-header .lsi-title { font-weight: 700; font-size: 15px; }
#lsi-bot-header .lsi-subtitle { font-size: 12px; opacity: .85; }
#lsi-bot-header .lsi-status { font-size: 11px; opacity: .9; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
#lsi-bot-header .lsi-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
#lsi-bot-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 22px; line-height: 1; opacity: .85; padding: 4px; }
#lsi-bot-close:hover { opacity: 1; }

/* Messages */
#lsi-bot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #fafbfc;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.lsi-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.lsi-msg.bot { align-self: flex-start; background: var(--lsi-bot-bubble); color: var(--lsi-text); border-bottom-left-radius: 4px; }
.lsi-msg.user { align-self: flex-end; background: var(--lsi-user-bubble); color: #fff; border-bottom-right-radius: 4px; }
.lsi-msg a { color: inherit; text-decoration: underline; }
.lsi-msg.user a { color: #fff; }

/* Quick replies */
#lsi-bot-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 6px; background: #fafbfc; }
.lsi-quick-btn {
	background: #fff; border: 1px solid #d4dde6; color: var(--lsi-accent);
	border-radius: 18px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; transition: all .15s ease;
}
.lsi-quick-btn:hover { background: var(--lsi-accent); color: #fff; border-color: var(--lsi-accent); }

/* Typing indicator */
.lsi-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.lsi-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa6b2; animation: lsi-bounce 1.3s infinite; }
.lsi-typing span:nth-child(2) { animation-delay: .2s; }
.lsi-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes lsi-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Input */
#lsi-bot-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e6ebf0; background: #fff; }
#lsi-bot-input {
	flex: 1; resize: none; border: 1px solid #d4dde6; border-radius: 10px;
	padding: 10px 12px; font-size: 14px; max-height: 90px; line-height: 1.4; outline: none; color: var(--lsi-text);
}
#lsi-bot-input:focus { border-color: var(--lsi-accent); }
#lsi-bot-send {
	background: var(--lsi-accent); border: none; color: #fff; border-radius: 10px;
	width: 44px; flex: 0 0 auto; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease;
}
#lsi-bot-send:hover { background: var(--lsi-accent-dark); }
#lsi-bot-send:disabled { opacity: .5; cursor: default; }
#lsi-bot-send svg { width: 20px !important; height: 20px !important; display: block !important; stroke: #fff; }
#lsi-bot-send svg path { stroke: #fff; }

#lsi-bot-footer { text-align: center; font-size: 10.5px; color: var(--lsi-muted); padding: 0 0 8px; background: #fff; }

/* ---- Mobile: full-screen sheet ---------------------------------------- */
@media (max-width: 600px) {
	#lsi-bot-launcher {
		bottom: 16px; right: 16px;
		width: 56px; height: 56px;
		/* respect iPhone home-bar / notch safe areas */
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		right: calc(16px + env(safe-area-inset-right, 0px));
	}
	#lsi-bot-launcher svg { width: 28px !important; height: 28px !important; }

	#lsi-bot-panel {
		top: 0; left: 0; right: 0; bottom: 0;
		width: 100%;
		/* use dynamic viewport height so the mobile address bar / keyboard
		   doesn't cut off the input row (falls back to vh/100% on old browsers) */
		height: 100%;
		height: 100vh;
		height: 100dvh;
		max-width: 100%;
		max-height: none;
		border-radius: 0;
		transform: translateY(100%);
	}
	#lsi-bot-panel.lsi-open { transform: translateY(0); }

	#lsi-bot-header {
		padding: 14px 16px;
		padding-top: calc(14px + env(safe-area-inset-top, 0px));
	}
	#lsi-bot-close { font-size: 28px; padding: 8px; }

	#lsi-bot-messages { padding: 14px; }
	.lsi-msg { max-width: 88%; font-size: 15px; }

	#lsi-bot-input-row {
		padding: 10px 12px;
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	}
	#lsi-bot-input { font-size: 16px; } /* 16px stops iOS Safari auto-zoom on focus */
	#lsi-bot-send { width: 48px; }

	#lsi-bot-quick { padding: 0 14px 8px; }
	.lsi-quick-btn { font-size: 13px; padding: 8px 13px; }
}

/* Small phones: tighten launcher a touch */
@media (max-width: 360px) {
	#lsi-bot-launcher { width: 52px; height: 52px; }
}
