/* Lenis / smooth scroll: корневой атрибут задаётся из JS (data-lenis-prevent) */
.sitecbot-root {
	--sitecbot-accent: #2563eb;
	--sitecbot-surface: #ffffff;
	--sitecbot-text: #111827;
	/* Текст/иконки на акцентном фоне (шапка, FAB, «Отправить»); JS выставляет по яркости акцента */
	--sitecbot-on-accent: #ffffff;
	--sitecbot-top: 0px;
	--sitecbot-right: 24px;
	--sitecbot-bottom: 24px;
	--sitecbot-left: 0px;
	--sitecbot-font-size: 15px;
	--sitecbot-line-height: 1.45;
	--sitecbot-radius-lg: 16px;
	--sitecbot-radius-md: 10px;
	--sitecbot-shadow-panel: 0 20px 50px rgba(15, 23, 42, 0.2);
	--sitecbot-shadow-fab: 0 10px 25px rgba(15, 23, 42, 0.22);
	--sitecbot-fab-size: 56px;
	--sitecbot-panel-max-width: 380px;
	--sitecbot-panel-max-height: 560px;
	--sitecbot-panel-border-width: 0px;
	--sitecbot-user-bubble-mix: 18%;
	position: fixed;
	z-index: 999999;
	font-family: var(--sitecbot-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
	font-size: var(--sitecbot-font-size);
	line-height: var(--sitecbot-line-height);
	color: var(--sitecbot-text);
	box-sizing: border-box;
	/* Корень виджета: без рамки/обводки/тени от темы (контент — у вложенных блоков). */
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent;
}

.sitecbot-root:focus,
.sitecbot-root:focus-visible,
.sitecbot-root:focus-within {
	outline: none !important;
	box-shadow: none !important;
}

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

.sitecbot-corner-bottom-right {
	right: var(--sitecbot-right);
	bottom: var(--sitecbot-bottom);
	left: auto;
	top: auto;
}

.sitecbot-corner-bottom-left {
	left: var(--sitecbot-left);
	bottom: var(--sitecbot-bottom);
	right: auto;
	top: auto;
}

.sitecbot-corner-top-right {
	right: var(--sitecbot-right);
	top: var(--sitecbot-top);
	bottom: auto;
	left: auto;
}

.sitecbot-corner-top-left {
	left: var(--sitecbot-left);
	top: var(--sitecbot-top);
	bottom: auto;
	right: auto;
}

.sitecbot-toggle {
	position: relative;
	z-index: 3;
	width: var(--sitecbot-fab-size);
	height: var(--sitecbot-fab-size);
	border-radius: 50%;
	border: none !important;
	/* Темы часто задают button:focus { outline }; без сброса — квадратная обводка вокруг круга. */
	outline: none !important;
	background: var(--sitecbot-fab-bg, var(--sitecbot-accent));
	color: var(--sitecbot-on-fab, var(--sitecbot-on-accent));
	box-shadow: var(--sitecbot-shadow-fab);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	-webkit-appearance: none;
	appearance: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sitecbot-toggle:hover {
	transform: translateY(-1px);
	filter: brightness(1.03);
}

.sitecbot-toggle:focus-visible {
	outline: 2px solid var(--sitecbot-on-fab, var(--sitecbot-on-accent)) !important;
	outline-offset: 3px;
}

.sitecbot-toggle img {
	border-radius: 50%;
	object-fit: cover;
	width: 28px;
	height: 28px;
}

.sitecbot-panel {
	position: absolute;
	width: min(var(--sitecbot-panel-max-width), calc(100vw - 32px));
	max-height: min(var(--sitecbot-panel-max-height), calc(100vh - 100px));
	background: var(--sitecbot-surface);
	color: var(--sitecbot-text);
	border-radius: var(--sitecbot-radius-lg);
	border: var(--sitecbot-panel-border-width) solid var(--sitecbot-panel-border-color, color-mix(in srgb, var(--sitecbot-text) 14%, var(--sitecbot-surface)));
	box-shadow: var(--sitecbot-shadow-panel);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	/* Не отдавать цепочку скролла родительской странице */
	overscroll-behavior: contain;
}

/* display:flex выше перебивает UA-стиль [hidden] { display:none } — без этого панель всегда видна */
.sitecbot-panel[hidden],
.sitecbot-root[hidden] {
	display: none !important;
}


/* С диалогом панель должна занимать заданную высоту — иначе у .sitecbot-messages часто нет «лишнего» scrollHeight и колесо уходит на страницу */
.sitecbot-panel.sitecbot-panel--has-chat {
	height: min(var(--sitecbot-panel-max-height), calc(100vh - 100px));
}

.sitecbot-corner-bottom-right .sitecbot-panel,
.sitecbot-corner-top-right .sitecbot-panel {
	right: 0px;
}

.sitecbot-corner-bottom-left .sitecbot-panel,
.sitecbot-corner-top-left .sitecbot-panel {
	left: 16px;
}

.sitecbot-corner-bottom-right .sitecbot-panel,
.sitecbot-corner-bottom-left .sitecbot-panel {
	bottom: calc(var(--sitecbot-fab-size) + 16px);
}

.sitecbot-corner-top-right .sitecbot-panel,
.sitecbot-corner-top-left .sitecbot-panel {
	top: calc(var(--sitecbot-fab-size) + 16px);
}

/* Шапка и блок консультанта не сжимаются — иначе съедается место у поля ввода */
.sitecbot-hero,
.sitecbot-intro {
	flex-shrink: 0;
}

/* Шапка приветствия: акцент из настроек + лёгкий паттерн */
.sitecbot-hero {
	position: relative;
	background: var(--sitecbot-accent);
	color: var(--sitecbot-on-accent);
	border-radius: var(--sitecbot-radius-lg) var(--sitecbot-radius-lg) 0 0;
}

.sitecbot-hero-pattern {
	position: absolute;
	inset: 0;
	opacity: 0.14;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.7' opacity='0.9'%3E%3Ccircle cx='28' cy='32' r='9'/%3E%3Cpath d='M52 18l6 16h-12z'/%3E%3Ccircle cx='118' cy='44' r='7'/%3E%3Cpath d='M88 78l14-8v16z'/%3E%3Crect x='18' y='92' width='18' height='18' rx='3'/%3E%3Cpath d='M120 100h16M128 92v16'/%3E%3Ccircle cx='58' cy='128' r='11'/%3E%3Cpath d='M100 130c8-6 18-6 24 2'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 200px 200px;
}

/* На светлом акценте паттерн из тёмных линий, иначе белые штрихи не видны */
.sitecbot-root[data-sitecbot-accent-light="1"] .sitecbot-hero-pattern {
	opacity: 0.12;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23000000' stroke-width='0.7' opacity='0.85'%3E%3Ccircle cx='28' cy='32' r='9'/%3E%3Cpath d='M52 18l6 16h-12z'/%3E%3Ccircle cx='118' cy='44' r='7'/%3E%3Cpath d='M88 78l14-8v16z'/%3E%3Crect x='18' y='92' width='18' height='18' rx='3'/%3E%3Cpath d='M120 100h16M128 92v16'/%3E%3Ccircle cx='58' cy='128' r='11'/%3E%3Cpath d='M100 130c8-6 18-6 24 2'/%3E%3C/g%3E%3C/svg%3E");
}

.sitecbot-root[data-sitecbot-hero-pattern="0"] .sitecbot-hero-pattern {
	display: none;
}

.sitecbot-hero-top {
	position: absolute;
	right: 0;
	top: 0;
	z-index: 2;
	display: flex;
	justify-content: flex-end;
	padding: 8px 8px 0;
}

.sitecbot-hero-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.sitecbot-clear-history {
	background: color-mix(in srgb, var(--sitecbot-on-accent) 16%, transparent);
	border: 1px solid color-mix(in srgb, var(--sitecbot-on-accent) 38%, transparent);
	color: var(--sitecbot-on-accent);
	font-size: 11px;
	padding: 5px 9px;
	border-radius: calc(var(--sitecbot-radius-md) * 0.65);
	cursor: pointer;
	line-height: 1.2;
	font-family: inherit;
}

.sitecbot-clear-history:hover {
	background: color-mix(in srgb, var(--sitecbot-on-accent) 26%, transparent);
}

.sitecbot-clear-history:focus-visible {
	outline: 2px solid var(--sitecbot-on-accent);
	outline-offset: 2px;
}

.sitecbot-close {
	background: transparent;
	border: none;
	color: var(--sitecbot-on-accent);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	opacity: 0.92;
	font-family: inherit;
	border-radius: calc(var(--sitecbot-radius-md) * 0.65);
}

.sitecbot-close:hover {
	opacity: 1;
	background: color-mix(in srgb, var(--sitecbot-on-accent) 14%, transparent);
}

.sitecbot-close:focus-visible {
	outline: 2px solid var(--sitecbot-on-accent);
	outline-offset: 2px;
	opacity: 1;
}

.sitecbot-hero-inner {
	position: relative;
	z-index: 1;
	padding: 40px 20px 22px;
	text-align: center;
}

.sitecbot-hero-avatar {
	width: 72px;
	height: 72px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	color: var(--sitecbot-accent);
}

/* На светлом акценте «акцентный» цвет внутри белого круга может быть слишком бледным */
.sitecbot-root[data-sitecbot-accent-light="1"] .sitecbot-hero-avatar {
	color: #0f172a;
}

.sitecbot-hero-avatar img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
}

.sitecbot-hero-title {
	margin: 0 0 10px;
	font-size: calc(var(--sitecbot-font-size) * 1.15);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--sitecbot-on-accent);
}

.sitecbot-hero-desc {
	margin: 0 auto;
	max-width: 32em;
	font-size: calc(var(--sitecbot-font-size) * 0.87);
	line-height: 1.55;
	color: var(--sitecbot-on-accent);
	opacity: 0.9;
	font-weight: 400;
}

.sitecbot-hero-compact-brand {
	display: none;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1;
}

.sitecbot-hero-compact-avatar {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--sitecbot-on-accent) 18%, transparent);
	overflow: hidden;
	color: var(--sitecbot-on-accent);
}

.sitecbot-hero-compact-avatar--photo {
	background: var(--sitecbot-surface);
	padding: 0;
}

.sitecbot-hero-compact-avatar--photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sitecbot-hero-compact-title {
	flex: 1;
	min-width: 0;
	font-size: var(--sitecbot-font-size);
	font-weight: 600;
	line-height: 1.3;
	color: var(--sitecbot-on-accent);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Компактная шапка после начала диалога */
.sitecbot-panel--has-chat .sitecbot-hero {
	border-radius: 0;
}

.sitecbot-panel--has-chat .sitecbot-hero-pattern {
	opacity: 0.09;
}

.sitecbot-root[data-sitecbot-accent-light="1"] .sitecbot-panel--has-chat .sitecbot-hero-pattern {
	opacity: 0.08;
}

.sitecbot-panel--has-chat .sitecbot-hero-inner {
	display: flex;
	align-items: center;
	padding: 10px 12px 10px 14px;
	text-align: left;
	gap: 0;
	min-height: 0;
}

.sitecbot-panel--has-chat .sitecbot-hero-avatar,
.sitecbot-panel--has-chat .sitecbot-hero-title,
.sitecbot-panel--has-chat .sitecbot-hero-desc {
	display: none !important;
}

.sitecbot-panel--has-chat .sitecbot-hero-compact-brand {
	display: flex;
}

.sitecbot-panel--has-chat .sitecbot-hero-top {
	padding: 6px 8px;
}

.sitecbot-panel--has-chat .sitecbot-hero-inner {
	padding: 10px 120px 10px 14px;
}

/* Блок консультанта под шапкой */
.sitecbot-intro {
	background: var(--sitecbot-surface);
	padding: 14px 16px 16px;
	border-bottom: 1px solid #e8edf2;
	border-bottom: 1px solid color-mix(in srgb, var(--sitecbot-text) 12%, var(--sitecbot-surface));
	flex-shrink: 0;
}

.sitecbot-intro[hidden] {
	display: none !important;
}

.sitecbot-consultant {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.sitecbot-consultant-avatar {
	position: relative;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--sitecbot-accent) 38%, #1e3a5f);
	color: #fff;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.sitecbot-consultant-avatar--photo {
	background: var(--sitecbot-surface);
	/* Не используем overflow:hidden — иначе обрезается индикатор «в сети»; круг задаёт img */
	overflow: visible;
	padding: 0;
}

.sitecbot-consultant-avatar--photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.sitecbot-consultant-online {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
	transform: translate(15%, -15%);
}

.sitecbot-consultant-text {
	min-width: 0;
	padding-top: 2px;
}

.sitecbot-consultant-name {
	font-size: var(--sitecbot-font-size);
	font-weight: 700;
	color: var(--sitecbot-text);
	line-height: 1.25;
}

.sitecbot-consultant-tagline {
	margin-top: 4px;
	font-size: calc(var(--sitecbot-font-size) * 0.87);
	line-height: 1.45;
	color: var(--sitecbot-text);
	opacity: 0.72;
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.sitecbot-consultant-avatar:not(.sitecbot-consultant-avatar--photo) {
		background: #2563eb;
	}
}

/* min-height: 0 — иначе flex-элемент не сжимается и нижняя форма уезжает под overflow панели */
.sitecbot-messages {
	flex: 1 1 0%;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	/* Вертикальный скролл только внутри ленты; без цепочки к body */
	touch-action: pan-y;
	overscroll-behavior: contain;
	overscroll-behavior-y: contain;
	position: relative;
	padding: 12px 14px;
	background: var(--sitecbot-messages-bg, color-mix(in srgb, var(--sitecbot-text) 4%, var(--sitecbot-surface)));
}

.sitecbot-msg {
	margin-bottom: 10px;
	padding: 10px 12px;
	border-radius: var(--sitecbot-radius-md);
	max-width: 100%;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Строка: аватар бота + пузырь */
.sitecbot-msg-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 10px;
	max-width: 100%;
}

.sitecbot-msg-row--bot .sitecbot-msg {
	flex: 1 1 0%;
	min-width: 0;
	margin-bottom: 0;
}

.sitecbot-msg-row__avatar {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--sitecbot-accent) 24%, var(--sitecbot-surface));
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.sitecbot-msg-row__avatar--photo {
	background: var(--sitecbot-surface);
	padding: 0;
}

.sitecbot-msg-row__avatar--photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sitecbot-msg-row__avatar-fallback {
	font-size: calc(var(--sitecbot-font-size) * 0.85);
	font-weight: 700;
	line-height: 1;
	color: var(--sitecbot-accent);
}

.sitecbot-msg-row--bot+.sitecbot-sources {
	margin-left: 40px;
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.sitecbot-msg-row__avatar:not(.sitecbot-msg-row__avatar--photo) {
		background: #e0e7ff;
	}
}

.sitecbot-msg-user {
	background: color-mix(in srgb, var(--sitecbot-accent) var(--sitecbot-user-bubble-mix), var(--sitecbot-surface));
	margin-left: 24px;
	color: var(--sitecbot-text);
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.sitecbot-messages {
		background: #f8fafc;
	}

	.sitecbot-msg-user {
		background: #e0e7ff;
	}
}

.sitecbot-msg-bot {
	background: var(--sitecbot-surface);
	border: 1px solid #e2e8f0;
	border: 1px solid color-mix(in srgb, var(--sitecbot-text) 14%, var(--sitecbot-surface));
	margin-right: 0;
	color: var(--sitecbot-text);
}

.sitecbot-msg-html {
	font-size: calc(var(--sitecbot-font-size) * 0.93);
	line-height: 1.55;
	color: inherit;
}

.sitecbot-msg-html p {
	margin: 0 0 0.65em;
}

.sitecbot-msg-html p:last-child {
	margin-bottom: 0;
}

.sitecbot-msg-html a {
	color: var(--sitecbot-text);
	text-decoration: underline;
	font-weight: 500;
}

.sitecbot-msg-html a:focus-visible,
.sitecbot-sources a:focus-visible {
	outline: 2px solid var(--sitecbot-accent);
	outline-offset: 2px;
}

.sitecbot-msg-html .sitecbot-llm-text {
	margin-bottom: 0.75em;
}

.sitecbot-msg-html .sitecbot-llm-text ul {
	margin: 0.35em 0 0.65em;
	padding-left: 1.25em;
	list-style: disc;
}

.sitecbot-msg-html .sitecbot-llm-text li {
	margin: 0.35em 0;
}

.sitecbot-msg-html .sitecbot-llm-text strong {
	font-weight: 600;
}

.sitecbot-loading {
	opacity: 0.75;
	font-style: italic;
}

.sitecbot-thinking {
	display: inline;
}

.sitecbot-thinking__text {
	font-style: italic;
}

.sitecbot-thinking__dots {
	display: inline;
	white-space: nowrap;
}

.sitecbot-thinking__dot {
	display: inline-block;
	animation: sitecbot-thinking-wave 1.35s ease-in-out infinite;
}

.sitecbot-thinking__dot:nth-child(1) {
	animation-delay: 0ms;
}

.sitecbot-thinking__dot:nth-child(2) {
	animation-delay: 180ms;
}

.sitecbot-thinking__dot:nth-child(3) {
	animation-delay: 360ms;
}

@keyframes sitecbot-thinking-wave {

	0%,
	100% {
		opacity: 0.2;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-2px);
	}

	70% {
		opacity: 0.45;
		transform: translateY(0);
	}
}

@keyframes sitecbot-thinking-fade {

	0%,
	100% {
		opacity: 0.25;
	}

	50% {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sitecbot-thinking__dot {
		animation: sitecbot-thinking-fade 1.2s ease-in-out infinite;
		transform: none !important;
	}

	.sitecbot-thinking__dot:nth-child(1) {
		animation-delay: 0ms;
	}

	.sitecbot-thinking__dot:nth-child(2) {
		animation-delay: 180ms;
	}

	.sitecbot-thinking__dot:nth-child(3) {
		animation-delay: 360ms;
	}
}

.sitecbot-sources {
	padding: 0 14px 10px;
	font-size: calc(var(--sitecbot-font-size) * 0.87);
	background: var(--sitecbot-messages-bg, color-mix(in srgb, var(--sitecbot-text) 4%, var(--sitecbot-surface)));
	color: var(--sitecbot-text);
}

.sitecbot-sources a {
	color: var(--sitecbot-text);
	text-decoration: underline;
	display: inline-block;
	margin-right: 6px;
	margin-bottom: 4px;
	font-weight: 500;
}

.sitecbot-form {
	display: flex;
	flex-direction: column;
	gap: 0;
	flex-shrink: 0;
	padding: 10px 12px 12px;
	border-top: 1px solid #e2e8f0;
	border-top: 1px solid color-mix(in srgb, var(--sitecbot-text) 14%, var(--sitecbot-surface));
	background: var(--sitecbot-surface);
}

/* Grid + align-items: end — кнопка по нижнему краю textarea (flex-end в ряду иногда визуально «центрирует» из-за baseline/inline-flex) */
.sitecbot-form__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
}

.sitecbot-form__input-wrap {
	min-width: 0;
}

.sitecbot-input {
	width: 100%;
	resize: vertical;
	min-height: 44px;
	border: 1px solid #cbd5e1;
	border: 1px solid color-mix(in srgb, var(--sitecbot-text) 22%, var(--sitecbot-surface));
	border-radius: var(--sitecbot-radius-md);
	padding: 8px 10px;
	font: inherit;
	font-size: 16px;
	color: var(--sitecbot-text);
	background: var(--sitecbot-surface);
}

.sitecbot-input:focus,
.sitecbot-input:focus-visible {
	outline: none !important;
	border-color: var(--sitecbot-accent);
	box-shadow: none;
}

.sitecbot-send {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background-color: var(--sitecbot-accent, #2563eb) !important;
	color: var(--sitecbot-on-accent) !important;
	border: none !important;
	border-radius: var(--sitecbot-radius-md);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.sitecbot-send svg {
	display: block;
	width: 20px;
	height: 20px;
}

.sitecbot-send:hover {
	filter: brightness(1.06);
	color: var(--sitecbot-on-accent) !important;
}

.sitecbot-send:focus,
.sitecbot-send:focus-visible {
	outline: none !important;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

/* Локальный ответ без LLM: выдержки из индекса перед карточками */
.sitecbot-local-digest {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: var(--sitecbot-radius-md);
	background: color-mix(in srgb, var(--sitecbot-text) 6%, var(--sitecbot-surface));
	border: 1px solid color-mix(in srgb, var(--sitecbot-text) 12%, var(--sitecbot-surface));
	font-size: calc(var(--sitecbot-font-size) * 0.93);
	line-height: 1.55;
	color: var(--sitecbot-text);
}

.sitecbot-local-digest p {
	margin: 0;
	white-space: normal;
}

.sitecbot-local-digest__list {
	margin: 0;
	padding: 0 0 0 1.15em;
	list-style: disc;
}

.sitecbot-local-digest__list li {
	margin: 0 0 0.55em;
}

.sitecbot-local-digest__list li:last-child {
	margin-bottom: 0;
}

.sitecbot-local-digest__lead {
	font-weight: 600;
	margin: 0 0 8px !important;
}

.sitecbot-local-digest--acf-contacts {
	border-left: 3px solid var(--sitecbot-accent);
}

.sitecbot-local-digest--acf-contacts p + p {
	margin-top: 8px !important;
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.sitecbot-local-digest {
		background: #f1f5f9;
		border: 1px solid #e2e8f0;
	}
}

.sitecbot-hit-list-intro {
	margin: 0.65em 0 0.2em;
	font-size: calc(var(--sitecbot-font-size) * 0.95);
	font-weight: 600;
	line-height: 1.4;
	color: var(--sitecbot-text);
}

.sitecbot-hit-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0.35em 0 0;
}

.sitecbot-hit-plain {
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border: 1px solid color-mix(in srgb, var(--sitecbot-text) 14%, var(--sitecbot-surface));
	border-radius: var(--sitecbot-radius-md);
	background: var(--sitecbot-surface);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	font-size: calc(var(--sitecbot-font-size) * 0.93);
	line-height: 1.45;
	color: var(--sitecbot-text);
}

.sitecbot-hit-plain__title {
	display: block;
	font-weight: 600;
}

.sitecbot-hit-plain__body {
	display: block;
	margin-top: 6px;
	font-weight: 400;
	opacity: 0.92;
	white-space: normal;
}

.sitecbot-hit-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border: 1px solid color-mix(in srgb, var(--sitecbot-text) 14%, var(--sitecbot-surface));
	border-radius: var(--sitecbot-radius-md);
	background: var(--sitecbot-surface);
	text-decoration: none;
	color: var(--sitecbot-text);
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sitecbot-hit-card:hover {
	border-color: var(--sitecbot-accent);
	background: color-mix(in srgb, var(--sitecbot-text) 4%, var(--sitecbot-surface));
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.sitecbot-hit-card:focus,
.sitecbot-hit-card:focus-visible {
	outline: 2px solid var(--sitecbot-accent);
	outline-offset: 1px;
	border-color: var(--sitecbot-accent);
}

.sitecbot-hit-card__thumb {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	border-radius: calc(var(--sitecbot-radius-md) * 0.85);
	overflow: hidden;
	background: color-mix(in srgb, var(--sitecbot-text) 8%, var(--sitecbot-surface));
}

.sitecbot-hit-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sitecbot-hit-card__text {
	font-weight: 600;
	font-size: calc(var(--sitecbot-font-size) * 0.93);
	line-height: 1.35;
	flex: 1;
	min-width: 0;
}

/* Плотность интерфейса */
.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-messages {
	padding: 8px 10px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-msg-row__avatar {
	width: 28px;
	height: 28px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-msg-row--bot+.sitecbot-sources {
	margin-left: 36px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-sources {
	padding: 0 10px 8px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-form {
	padding: 8px 10px 10px;
	gap: 6px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-intro {
	padding: 10px 12px 12px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-hero-inner {
	padding: 28px 16px 16px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-panel--has-chat .sitecbot-hero-inner {
	padding: 8px 100px 8px 12px;
}

.sitecbot-root[data-sitecbot-density="compact"] .sitecbot-msg {
	padding: 8px 10px;
	margin-bottom: 8px;
}

/* Всплывающее приветствие: обводка и хвост — цвет фона панели из настроек (--sitecbot-surface) */
.sitecbot-teaser {
	--sitecbot-teaser-stroke: color-mix(in srgb, var(--sitecbot-surface) 88%, var(--sitecbot-text) 12%);
	position: absolute;
	z-index: 2;
	max-width: min(250px, calc(100vw - 24px));
	padding: 14px 40px 14px 14px;
	border-radius: 22px;
	background: var(--sitecbot-surface);
	border: 2px solid var(--sitecbot-teaser-stroke);
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.1);
	font-size: calc(var(--sitecbot-font-size) * 0.92);
	line-height: 1.38;
	color: var(--sitecbot-text);
	overflow: visible;
}

@supports not (color: color-mix(in srgb, white, black)) {
	.sitecbot-teaser {
		--sitecbot-teaser-stroke: var(--sitecbot-surface);
		border-color: var(--sitecbot-surface);
	}
}

.sitecbot-teaser__inner {
	display: flex;
	align-items: center;
	gap: 14px;
}

.sitecbot-teaser__copy {
	flex: 1;
	min-width: 0;
}

.sitecbot-teaser__avatar-wrap {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
	border-radius: 50%;
	background: var(--sitecbot-surface);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--sitecbot-surface) 78%, var(--sitecbot-text) 22%);
}

@supports not (color: color-mix(in srgb, white, black)) {
	.sitecbot-teaser__avatar-wrap {
		box-shadow: 0 0 0 2px rgba(100, 105, 115, 0.28);
	}
}

.sitecbot-teaser__avatar {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.sitecbot-teaser__title {
	font-weight: 700;
	margin-bottom: 2px;
}

.sitecbot-teaser__lead {
	font-weight: 400;
	margin-bottom: 2px;
}

.sitecbot-teaser__text {
	opacity: 0.92;
	font-size: 0.95em;
}

.sitecbot-teaser__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--sitecbot-text);
	opacity: 0.5;
}

.sitecbot-teaser__close:hover {
	opacity: 0.88;
}

.sitecbot-teaser__close-ring {
	position: absolute;
	inset: 0;
	border: 1px solid currentColor;
	border-radius: 50%;
	pointer-events: none;
	opacity: 0.85;
}

.sitecbot-teaser__close-x {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.sitecbot-teaser__close-x svg {
	display: block;
	flex-shrink: 0;
}

/* Десктоп: хвост справа/слева; ::after — обводка, ::before — заливка как у фона (общая «рамка») */
.sitecbot-corner-bottom-right .sitecbot-teaser::after,
.sitecbot-corner-top-right .sitecbot-teaser::after {
	content: "";
	position: absolute;
	right: -11px;
	top: 50%;
	margin-top: -9px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 9px 0 9px 11px;
	border-color: transparent transparent transparent var(--sitecbot-teaser-stroke);
	z-index: 1;
}

.sitecbot-corner-bottom-right .sitecbot-teaser::before,
.sitecbot-corner-top-right .sitecbot-teaser::before {
	content: "";
	position: absolute;
	right: -9px;
	top: 50%;
	margin-top: -7px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 7px 0 7px 9px;
	border-color: transparent transparent transparent var(--sitecbot-surface);
	z-index: 2;
}

.sitecbot-corner-bottom-left .sitecbot-teaser::after,
.sitecbot-corner-top-left .sitecbot-teaser::after {
	content: "";
	position: absolute;
	left: -11px;
	top: 50%;
	margin-top: -9px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 9px 11px 9px 0;
	border-color: transparent var(--sitecbot-teaser-stroke) transparent transparent;
	z-index: 1;
}

.sitecbot-corner-bottom-left .sitecbot-teaser::before,
.sitecbot-corner-top-left .sitecbot-teaser::before {
	content: "";
	position: absolute;
	left: -9px;
	top: 50%;
	margin-top: -7px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 7px 9px 7px 0;
	border-color: transparent var(--sitecbot-surface) transparent transparent;
	z-index: 2;
}

.sitecbot-corner-bottom-right .sitecbot-teaser {
	right: calc(var(--sitecbot-fab-size) + 16px);
	bottom: 0;
}

.sitecbot-corner-bottom-left .sitecbot-teaser {
	left: calc(var(--sitecbot-fab-size) + 16px);
	bottom: 0;
}

.sitecbot-corner-top-right .sitecbot-teaser {
	right: calc(var(--sitecbot-fab-size) + 16px);
	top: 0;
}

.sitecbot-corner-top-left .sitecbot-teaser {
	left: calc(var(--sitecbot-fab-size) + 16px);
	top: 0;
}

/* Иначе у position:absolute + width:auto срабатывает shrink-to-fit → узкая колонка и перенос по одному слову */
@media screen and (min-width: 641px) {
	.sitecbot-teaser {
		width: min(350px, calc(100vw - 96px));
		max-width: min(350px, calc(100vw - 96px));
		box-sizing: border-box;
		padding: 16px 44px 16px 16px;
		border-radius: 26px;
	}
}

/* Мобильные: max-width 250px, контент по центру; хвост снизу/сверху к FAB; двойной слой как на десктопе */
@media screen and (max-width: 640px) {
	.sitecbot-teaser {
		max-width: min(250px, calc(100vw - 24px));
		width: min(250px, calc(100vw - 24px));
		padding: 14px 36px 18px;
	}

	.sitecbot-teaser__inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.sitecbot-teaser__copy {
		text-align: center;
		width: 100%;
	}

	.sitecbot-corner-bottom-right .sitecbot-teaser,
	.sitecbot-corner-bottom-left .sitecbot-teaser {
		left: auto;
		right: 0;
		bottom: calc(var(--sitecbot-fab-size) + 14px);
		width: min(250px, calc(100vw - 24px));
		max-width: min(250px, calc(100vw - 24px));
	}

	.sitecbot-corner-bottom-left .sitecbot-teaser {
		left: 0;
		right: auto;
	}

	.sitecbot-corner-bottom-right .sitecbot-teaser::after {
		top: auto;
		bottom: -11px;
		left: calc(100% - var(--sitecbot-fab-size) / 2 - 9px);
		right: auto;
		margin-top: 0;
		margin-left: 0;
		border-width: 11px 9px 0 9px;
		border-color: var(--sitecbot-teaser-stroke) transparent transparent transparent;
		z-index: 1;
	}

	.sitecbot-corner-bottom-right .sitecbot-teaser::before {
		content: "";
		position: absolute;
		top: auto;
		right: auto;
		bottom: -9px;
		left: calc(100% - var(--sitecbot-fab-size) / 2 - 7px);
		margin-top: 0;
		margin-left: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 9px 7px 0 7px;
		border-color: var(--sitecbot-surface) transparent transparent transparent;
		z-index: 2;
	}

	.sitecbot-corner-bottom-left .sitecbot-teaser::after {
		top: auto;
		bottom: -11px;
		left: calc(var(--sitecbot-fab-size) / 2 - 9px);
		right: auto;
		margin-top: 0;
		margin-left: 0;
		border-width: 11px 9px 0 9px;
		border-color: var(--sitecbot-teaser-stroke) transparent transparent transparent;
		z-index: 1;
	}

	.sitecbot-corner-bottom-left .sitecbot-teaser::before {
		content: "";
		position: absolute;
		top: auto;
		right: auto;
		bottom: -9px;
		left: calc(var(--sitecbot-fab-size) / 2 - 7px);
		margin-top: 0;
		margin-left: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 9px 7px 0 7px;
		border-color: var(--sitecbot-surface) transparent transparent transparent;
		z-index: 2;
	}

	.sitecbot-corner-top-right .sitecbot-teaser,
	.sitecbot-corner-top-left .sitecbot-teaser {
		top: calc(var(--sitecbot-fab-size) + 14px);
		width: min(250px, calc(100vw - 24px));
		max-width: min(250px, calc(100vw - 24px));
	}

	.sitecbot-corner-top-right .sitecbot-teaser {
		right: 0;
		left: auto;
	}

	.sitecbot-corner-top-left .sitecbot-teaser {
		left: 0;
		right: auto;
	}

	.sitecbot-corner-top-right .sitecbot-teaser::after {
		top: -11px;
		bottom: auto;
		left: calc(100% - var(--sitecbot-fab-size) / 2 - 9px);
		right: auto;
		margin-left: 0;
		border-width: 0 9px 11px 9px;
		border-color: transparent transparent var(--sitecbot-teaser-stroke) transparent;
		z-index: 1;
	}

	.sitecbot-corner-top-right .sitecbot-teaser::before {
		content: "";
		position: absolute;
		top: -9px;
		right: auto;
		bottom: auto;
		left: calc(100% - var(--sitecbot-fab-size) / 2 - 7px);
		margin-top: 0;
		margin-left: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 0 7px 9px 7px;
		border-color: transparent transparent var(--sitecbot-surface) transparent;
		z-index: 2;
	}

	.sitecbot-corner-top-left .sitecbot-teaser::after {
		top: -11px;
		bottom: auto;
		left: calc(var(--sitecbot-fab-size) / 2 - 9px);
		right: auto;
		margin-left: 0;
		border-width: 0 9px 11px 9px;
		border-color: transparent transparent var(--sitecbot-teaser-stroke) transparent;
		z-index: 1;
	}

	.sitecbot-corner-top-left .sitecbot-teaser::before {
		content: "";
		position: absolute;
		top: -9px;
		right: auto;
		bottom: auto;
		left: calc(var(--sitecbot-fab-size) / 2 - 7px);
		margin-top: 0;
		margin-left: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 0 7px 9px 7px;
		border-color: transparent transparent var(--sitecbot-surface) transparent;
		z-index: 2;
	}
}