/* LRM Lead Chat. Brand colors come from settings as CSS variables on .lrmlc-root. */

.lrmlc-root {
	--lrmlc-primary: #174c80;
	--lrmlc-on-primary: #ffffff;
	--lrmlc-accent: #f9c900;
	--lrmlc-on-accent: #14171c;
	--lrmlc-offset: 24px;
	--lrmlc-side: 20px;
	--lrmlc-bg: #ffffff;
	--lrmlc-text: #1d2127;
	--lrmlc-muted: #5f6873;
	--lrmlc-bot-bubble: #f1f3f6;
	--lrmlc-border: #dfe3e8;
	--lrmlc-shadow: 0 12px 40px rgba(16, 24, 40, 0.18), 0 2px 8px rgba(16, 24, 40, 0.08);
	position: fixed;
	bottom: var(--lrmlc-offset);
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--lrmlc-text);
	transition: bottom 0.2s ease;
}

.lrmlc-root.lrmlc-right { right: var(--lrmlc-side); }
.lrmlc-root.lrmlc-left { left: var(--lrmlc-side); }

/* Sit above a reCAPTCHA badge in the same corner. */
.lrmlc-root.lrmlc-lifted { bottom: calc(var(--lrmlc-offset) + 70px); }

.lrmlc-root *,
.lrmlc-root *::before,
.lrmlc-root *::after { box-sizing: border-box; }

.lrmlc-root button {
	font: inherit;
	cursor: pointer;
	margin: 0;
}

/* Launcher */
.lrmlc-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lrmlc-primary);
	color: var(--lrmlc-on-primary);
	box-shadow: var(--lrmlc-shadow);
	transition: transform 0.15s ease;
}
.lrmlc-launcher:hover { transform: scale(1.05); }
.lrmlc-launcher:focus-visible { outline: 3px solid var(--lrmlc-accent); outline-offset: 3px; }
.lrmlc-left .lrmlc-launcher { margin-right: auto; }
.lrmlc-right .lrmlc-launcher { margin-left: auto; }

/* Teaser */
.lrmlc-teaser {
	position: absolute;
	bottom: 70px;
	display: none;
	align-items: flex-start;
	gap: 6px;
	width: max-content;
	max-width: 260px;
	padding: 10px 8px 10px 14px;
	background: var(--lrmlc-bg);
	border: 1px solid var(--lrmlc-border);
	border-radius: 14px;
	box-shadow: var(--lrmlc-shadow);
}
.lrmlc-right .lrmlc-teaser { right: 0; }
.lrmlc-left .lrmlc-teaser { left: 0; }
.lrmlc-teaser.lrmlc-show { display: flex; animation: lrmlc-rise 0.25s ease; }
.lrmlc-teaser-text {
	padding: 0;
	border: 0;
	background: none;
	color: var(--lrmlc-text);
	text-align: left;
	font-size: 14px;
}
.lrmlc-teaser-close {
	flex: none;
	display: flex;
	padding: 2px;
	border: 0;
	background: none;
	color: var(--lrmlc-muted);
}

/* Panel */
.lrmlc-panel {
	position: absolute;
	bottom: 72px;
	display: flex;
	flex-direction: column;
	width: 370px;
	height: min(580px, calc(100vh - 120px));
	background: var(--lrmlc-bg);
	border-radius: 16px;
	box-shadow: var(--lrmlc-shadow);
	overflow: hidden;
	animation: lrmlc-rise 0.2s ease;
}
.lrmlc-panel[hidden] { display: none; }
.lrmlc-right .lrmlc-panel { right: 0; }
.lrmlc-left .lrmlc-panel { left: 0; }

.lrmlc-header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 10px 14px 16px;
	background: var(--lrmlc-primary);
	color: var(--lrmlc-on-primary);
	border-bottom: 3px solid var(--lrmlc-accent);
}
.lrmlc-titles { flex: 1; min-width: 0; }
.lrmlc-title {
	font-weight: 700;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.lrmlc-sub { font-size: 12px; opacity: 0.85; }

.lrmlc-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	text-decoration: none;
}
.lrmlc-icon-btn:hover,
.lrmlc-icon-btn:focus-visible { background: rgba(255, 255, 255, 0.16); color: inherit; }

/* Messages */
.lrmlc-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overscroll-behavior: contain;
}
.lrmlc-msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 16px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.lrmlc-bot {
	align-self: flex-start;
	background: var(--lrmlc-bot-bubble);
	border-bottom-left-radius: 4px;
}
.lrmlc-user {
	align-self: flex-end;
	background: var(--lrmlc-primary);
	color: var(--lrmlc-on-primary);
	border-bottom-right-radius: 4px;
}
.lrmlc-msg a { color: inherit; text-decoration: underline; font-weight: 600; }
.lrmlc-thumb { display: block; max-width: 180px; max-height: 180px; border-radius: 10px; }
.lrmlc-user:has(.lrmlc-thumb) { padding: 4px; }

.lrmlc-typing { display: flex; gap: 4px; padding: 13px 14px; }
.lrmlc-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--lrmlc-muted);
	animation: lrmlc-dot 1.2s infinite ease-in-out;
}
.lrmlc-typing span:nth-child(2) { animation-delay: 0.15s; }
.lrmlc-typing span:nth-child(3) { animation-delay: 0.3s; }

/* Composer */
.lrmlc-composer {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	margin: 0;
	padding: 10px;
	border-top: 1px solid var(--lrmlc-border);
}
.lrmlc-input {
	flex: 1;
	min-height: 40px;
	max-height: 120px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid var(--lrmlc-border);
	border-radius: 20px;
	background: #fff;
	color: var(--lrmlc-text);
	font: inherit;
	font-size: 16px; /* stops iOS zooming in */
	line-height: 1.35;
	resize: none;
}
.lrmlc-input:focus { outline: 2px solid var(--lrmlc-primary); outline-offset: 0; border-color: transparent; }
.lrmlc-send,
.lrmlc-attach {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
}
.lrmlc-send { background: var(--lrmlc-accent); color: var(--lrmlc-on-accent); }
.lrmlc-send:disabled { opacity: 0.5; cursor: default; }
.lrmlc-attach { background: transparent; color: var(--lrmlc-primary); }
.lrmlc-attach:hover { background: var(--lrmlc-bot-bubble); }

.lrmlc-hp,
.lrmlc-file {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.lrmlc-foot {
	padding: 0 12px 10px;
	font-size: 11px;
	color: var(--lrmlc-muted);
	text-align: center;
}

@keyframes lrmlc-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}
@keyframes lrmlc-dot {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

/* Phones: the chat takes the full screen when open. */
@media (max-width: 600px) {
	.lrmlc-root { --lrmlc-side: 14px; }
	.lrmlc-launcher { width: 54px; height: 54px; }
	.lrmlc-root.lrmlc-open {
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
	}
	.lrmlc-root.lrmlc-open .lrmlc-launcher { display: none; }
	.lrmlc-root.lrmlc-open .lrmlc-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		height: 100dvh;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lrmlc-panel,
	.lrmlc-teaser.lrmlc-show,
	.lrmlc-typing span { animation: none; }
}
