.lfgcb, .lfgcb * { box-sizing: border-box; }

.lfgcb {
	--lfgcb-color: #111;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}
.lfgcb-right { right: 20px; }
.lfgcb-left { left: 20px; }

.lfgcb-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lfgcb-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
	transition: transform .18s ease, box-shadow .18s ease;
}
.lfgcb-right .lfgcb-toggle { margin-left: auto; }
.lfgcb-toggle:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 28px rgba(0, 0, 0, .32); }
.lfgcb-toggle:focus-visible, .lfgcb-close:focus-visible, .lfgcb-send:focus-visible, .lfgcb-chip:focus-visible, .lfgcb-input:focus-visible {
	outline: 2px solid var(--lfgcb-color);
	outline-offset: 2px;
}

.lfgcb-panel {
	position: absolute;
	bottom: 72px;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #1c1c1c;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
	animation: lfgcb-in .2s ease;
}
.lfgcb-panel[hidden] { display: none; }
.lfgcb-right .lfgcb-panel { right: 0; }
.lfgcb-left .lfgcb-panel { left: 0; }

@keyframes lfgcb-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lfgcb-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	background: var(--lfgcb-color);
	color: #fff;
}
.lfgcb-titles { display: flex; flex-direction: column; min-width: 0; }
.lfgcb-title { font-size: 16px; font-weight: 700; line-height: 1.25; }
.lfgcb-subtitle { font-size: 12.5px; opacity: .8; }
.lfgcb-close {
	flex: none;
	display: flex;
	padding: 6px;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: 8px;
	opacity: .85;
}
.lfgcb-close:hover { opacity: 1; background: rgba(255, 255, 255, .14); }

.lfgcb-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f6f6f6;
	scroll-behavior: smooth;
}

.lfgcb-msg {
	max-width: 86%;
	padding: 10px 14px;
	border-radius: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.lfgcb-msg p { margin: 0 0 6px; }
.lfgcb-msg p:last-child { margin-bottom: 0; }
.lfgcb-msg ul { margin: 4px 0 6px 18px; padding: 0; }
.lfgcb-msg li { margin: 2px 0; }
.lfgcb-msg a { color: inherit; text-decoration: underline; font-weight: 600; }

.lfgcb-bot { align-self: flex-start; background: #fff; border: 1px solid #e6e6e6; border-bottom-left-radius: 4px; }
.lfgcb-user { align-self: flex-end; background: var(--lfgcb-color); color: #fff; border-bottom-right-radius: 4px; }
.lfgcb-error { border-color: #e0b4b4; background: #fff6f6; }

.lfgcb-typing { display: flex; gap: 5px; padding: 14px 16px; }
.lfgcb-typing span {
	width: 7px; height: 7px; border-radius: 50%; background: #9a9a9a;
	animation: lfgcb-dot 1.1s infinite ease-in-out;
}
.lfgcb-typing span:nth-child(2) { animation-delay: .15s; }
.lfgcb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes lfgcb-dot { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.lfgcb-suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 2px; }
.lfgcb-chip {
	max-width: 100%;
	padding: 8px 14px;
	border: 1px solid var(--lfgcb-color);
	border-radius: 999px;
	background: #fff;
	color: var(--lfgcb-color);
	font: inherit;
	font-size: 13.5px;
	text-align: left;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.lfgcb-chip:hover { background: var(--lfgcb-color); color: #fff; }

.lfgcb-form { display: flex; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid #ececec; }
.lfgcb-input {
	flex: 1;
	min-width: 0;
	padding: 11px 14px;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	font: inherit;
	font-size: 15px;
	background: #fff;
	color: #1c1c1c;
}
.lfgcb-send {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lfgcb-color);
	color: #fff;
	cursor: pointer;
}
.lfgcb-send:disabled { opacity: .45; cursor: default; }

.lfgcb-foot { padding: 0 14px 10px; background: #fff; color: #7a7a7a; font-size: 11.5px; text-align: center; }
.lfgcb-foot a { color: inherit; text-decoration: underline; }

.lfgcb-note {
	align-self: center;
	padding: 4px 12px;
	border-radius: 999px;
	background: #e9f4ec;
	color: #25613a;
	font-size: 12.5px;
	font-weight: 600;
}

.lfgcb-nudge {
	position: absolute;
	bottom: 72px;
	display: flex;
	align-items: flex-start;
	gap: 2px;
	width: 260px;
	max-width: calc(100vw - 40px);
	background: #fff;
	color: #1c1c1c;
	border-radius: 14px;
	box-shadow: 0 10px 34px rgba(0, 0, 0, .24);
	animation: lfgcb-in .25s ease;
}
.lfgcb-right .lfgcb-nudge { right: 0; border-bottom-right-radius: 4px; }
.lfgcb-left .lfgcb-nudge { left: 0; border-bottom-left-radius: 4px; }
.lfgcb-nudge-text {
	flex: 1;
	padding: 13px 4px 13px 15px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.lfgcb-nudge-x {
	flex: none;
	display: flex;
	padding: 8px;
	border: 0;
	background: transparent;
	color: #8a8a8a;
	cursor: pointer;
}
.lfgcb-nudge-x:hover { color: #1c1c1c; }
.lfgcb-nudge-text:focus-visible, .lfgcb-nudge-x:focus-visible { outline: 2px solid var(--lfgcb-color); outline-offset: 2px; border-radius: 10px; }

@media (max-width: 520px) {
	.lfgcb { bottom: 14px; }
	.lfgcb-right { right: 14px; }
	.lfgcb-left { left: 14px; }
	.lfgcb-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	.lfgcb-input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.lfgcb-panel, .lfgcb-toggle, .lfgcb-typing span { animation: none; transition: none; }
	.lfgcb-log { scroll-behavior: auto; }
}
