.bambu-chat-fab {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 10120;
}

.bambu-chat-fab [data-bambu-chat-fab] {
	position: relative;
}

.bambu-chat-fab__badge {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 8px 16px rgba(239, 68, 68, .35);
	opacity: 0;
	transform: scale(.7);
	transition: opacity .22s ease, transform .22s ease;
	pointer-events: none;
}

.bambu-chat-fab__badge.is-visible {
	opacity: 1;
	transform: scale(1);
}

.bambu-chat-toast {
	position: fixed;
	right: 18px;
	bottom: 84px;
	z-index: 10110;
	max-width: min(86vw, 320px);
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid #ddd6fe;
	background: #ffffff;
	color: #312e81;
	font: 600 13px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	box-shadow: 0 14px 30px rgba(17, 24, 39, .18);
	opacity: 0;
	transform: translateY(8px) scale(.97);
	pointer-events: none;
	transition: opacity .24s ease, transform .28s cubic-bezier(.16, 1, .3, 1);
	text-align: left;
	cursor: pointer;
}

.bambu-chat-toast.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.bambu-chat-fab__btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #7c3aed, #4f46e5);
	color: #fff;
	font: 700 16px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	cursor: pointer;
	box-shadow: 0 14px 34px rgba(79, 70, 229, .35);
	transition: transform .32s cubic-bezier(.16, 1, .3, 1), box-shadow .32s cubic-bezier(.16, 1, .3, 1), filter .28s ease;
}

.bambu-chat-fab__btn:hover {
	transform: translateY(-1px) scale(1.008);
	box-shadow: 0 18px 38px rgba(79, 70, 229, .42);
	filter: saturate(1.04);
}

.bambu-chat-fab__icon {
	display: inline-flex;
}

.bambu-chat-fab__icon svg {
	fill: currentColor;
}

.bambu-chat-panel {
	position: fixed;
	right: 18px;
	bottom: 84px;
	z-index: 10130;
	width: min(92vw, 400px);
	height: clamp(620px, 74vh, 700px);
	max-height: calc(100vh - 92px);
	border: 1px solid #ece7ff;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 54px rgba(17, 24, 39, .18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(.98);
	pointer-events: none;
	transition: opacity .28s ease, transform .34s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .34s;
	display: flex;
	flex-direction: column;
}

.bambu-chat-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition: opacity .28s ease, transform .34s cubic-bezier(.16, 1, .3, 1), visibility 0s linear 0s;
}

.bambu-chat-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid #f0ebff;
}

.bambu-chat-panel__brand {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-width: 0;
	flex: 1 1 auto;
}

.bambu-chat-panel__brand-icon {
	width: 34px;
	height: 34px;
	border-radius: 11px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #7c3aed, #4f46e5);
	color: #fff;
	box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
	flex: none;
}

.bambu-chat-panel__brand-icon svg {
	fill: currentColor;
}

.bambu-chat-panel__title {
	margin: 0;
	color: #111827;
	font-size: 21px;
	font-weight: 800;
	line-height: 1.2;
	white-space: normal !important;
	word-break: break-word;
	max-width: 100%;
}

.bambu-chat-panel__meta {
	margin: 3px 0 0;
	color: #6b7280;
	font-size: 12px;
}

.bambu-chat-panel__dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #22c55e;
}

.bambu-chat-panel__close {
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 0 4px;
	flex: none;
	transition: color .24s ease, transform .24s ease;
}

.bambu-chat-panel__close:hover {
	color: #4b5563;
	transform: rotate(90deg);
}

.bambu-chat-panel__intro {
	margin: 10px 16px 12px;
	padding: 14px 16px;
	border: 1px solid #ebe9f8;
	border-radius: 12px;
	background: #f7f7fc;
}

.bambu-chat-panel__intro h4 {
	margin: 0 0 7px;
	font-size: 24px;
	font-weight: 800;
	color: #111827;
}

.bambu-chat-panel__intro p {
	margin: 0;
	font-size: 16px;
	line-height: 1.45;
	color: #374151;
}

.bambu-chat-panel__topics {
	padding: 0 16px 12px;
}

.bambu-chat-panel__topics h5 {
	margin: 0 0 10px;
	font-size: 18px;
	font-weight: 800;
	color: #111827;
}

.bambu-chat-panel__topics-list {
	display: grid;
	gap: 8px;
}

.bambu-chat-panel__history {
	display: none;
	flex-direction: column;
	gap: 10px;
	margin: 10px 16px 10px;
	padding: 8px 4px 2px;
	overflow-y: auto;
	max-height: 290px;
}

.bambu-chat-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.bambu-chat-msg.is-user {
	justify-content: flex-end;
}

.bambu-chat-msg.is-manager {
	justify-content: flex-start;
}

.bambu-chat-msg__avatar {
	width: 28px;
	height: 28px;
	border-radius: 999px;
	overflow: hidden;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bambu-chat-msg__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bambu-chat-msg.is-user .bambu-chat-msg__avatar {
	order: 2;
	background: linear-gradient(135deg, #8b5cf6, #6d28d9);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.bambu-chat-msg.is-manager .bambu-chat-msg__avatar {
	background: #f5f3ff;
	border: 1px solid #ddd6fe;
}

.bambu-chat-msg__bubble {
	max-width: 80%;
	padding: 10px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
}

.bambu-chat-msg.is-user .bambu-chat-msg__bubble {
	background: linear-gradient(135deg, #7c3aed, #4f46e5);
	color: #fff;
	border-bottom-right-radius: 6px;
}

.bambu-chat-msg.is-manager .bambu-chat-msg__bubble {
	background: #f3f4f6;
	color: #111827;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 6px;
}

.bambu-chat-topic {
	text-align: left;
	border: 1px solid #c8b8ff;
	background: #fff;
	color: #5b21b6;
	border-radius: 12px;
	padding: 11px 12px;
	font: 700 16px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	cursor: pointer;
	transition: border-color .28s ease, background-color .28s ease, color .28s ease, transform .28s cubic-bezier(.16, 1, .3, 1), box-shadow .28s ease;
}

.bambu-chat-topic:hover {
	border-color: #a78bfa;
	background: #f8f5ff;
	color: #4c1d95;
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(124, 58, 237, .12);
}

.bambu-chat-panel__form {
	padding: 0 16px 14px;
	margin-top: auto;
	background: #fff;
	position: sticky;
	bottom: 0;
	z-index: 3;
	border-top: 1px solid #f0ebff;
}

.bambu-chat-panel__label {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	color: #111827;
}

.bambu-chat-panel__textarea-wrap {
	position: relative;
}

.bambu-chat-panel__textarea-wrap textarea {
	width: 100%;
	min-height: 102px;
	resize: vertical;
	border: 1px solid #ddd6fe;
	border-radius: 12px;
	background: #fff;
	color: #111827;
	padding: 12px 14px;
	font: 400 15px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.bambu-chat-panel__textarea-wrap textarea:focus {
	outline: none;
	border-color: #8b5cf6;
	box-shadow: 0 0 0 4px rgba(139, 92, 246, .14);
}

.bambu-chat-panel__send {
	width: 100%;
	margin-top: 10px;
	border: 0;
	border-radius: 12px;
	padding: 12px 14px;
	background: linear-gradient(135deg, #7c3aed, #4f46e5);
	color: #fff;
	font: 600 16px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	letter-spacing: .2px;
	cursor: pointer;
	box-shadow: 0 12px 24px rgba(79, 70, 229, .28);
	transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s cubic-bezier(.16, 1, .3, 1), filter .24s ease;
}

.bambu-chat-panel__send:hover {
	transform: translateY(-1px) scale(1.006);
	box-shadow: 0 16px 30px rgba(79, 70, 229, .34);
	filter: saturate(1.03);
}

.bambu-chat-panel__status {
	min-height: 18px;
	margin: 8px 0 0;
	font-size: 12px;
	color: #6b7280;
	order: 4;
}

.bambu-chat-panel__status.is-ok {
	color: #166534;
}

.bambu-chat-panel__status.is-error {
	color: #b91c1c;
}

.bambu-chat-panel__telegram {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px 14px;
	border-top: 1px solid #f0ebff;
	background: #fcfbff;
	border-radius: 0 0 18px 18px;
	margin-top: auto;
}

.bambu-chat-panel__tg-icon {
	font-size: 20px;
	color: #4f46e5;
}

.bambu-chat-panel__telegram strong {
	display: block;
	font-size: 16px;
	color: #4f46e5;
}

.bambu-chat-panel__telegram p {
	margin: 2px 0 0;
	font-size: 14px;
	color: #6b7280;
}

.bambu-chat-panel__telegram a {
	margin-left: auto;
	color: #6d28d9;
	text-decoration: none;
	font-size: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: #f3ecff;
	border: 1px solid #ddd6fe;
	transition: transform .24s ease, color .24s ease;
}

.bambu-chat-panel__telegram a:hover {
	transform: translateY(-1px);
	color: #5b21b6;
}

@media (max-width: 991px) {
	.bambu-chat-panel {
		width: min(95vw, 390px);
		height: min(78vh, 680px);
		max-height: calc(100vh - 86px);
	}
}

@media (max-width: 767px) {
	html.bambu-chat-open,
	body.bambu-chat-open {
		overflow: hidden !important;
		touch-action: none;
	}

	.bambu-chat-fab {
		right: 12px;
		bottom: 12px;
	}

	.bambu-chat-toast {
		right: 12px;
		bottom: 74px;
		max-width: calc(100vw - 24px);
	}

	.bambu-chat-panel {
		right: 10px;
		bottom: 70px;
		width: calc(100vw - 20px);
		max-width: 360px;
		height: min(78vh, 560px);
		max-height: min(78vh, 560px);
		overflow: hidden;
	}

	.bambu-chat-panel__history {
		max-height: 190px;
	}

	.bambu-chat-panel__telegram {
		display: none;
	}

	.bambu-chat-panel__intro p {
		font-size: 15px;
	}

	.bambu-chat-panel__title {
		font-size: 20px;
		white-space: normal !important;
	}

	.bambu-chat-panel__topics h5 {
		font-size: 20px;
	}

	.bambu-chat-panel__history {
		max-height: 250px;
	}
}

