/* ==========================================================================
   chat.css — чат поддержки: кнопка в плавающем доке + панель в стиле
   мессенджера (цветная шапка, тонированная лента, пузыри с хвостиками,
   pill-композер). Грузится последним, поэтому перебивает bo-system/theme/dark.
   ========================================================================== */

:root {
	--bc-w: 400px;
	--bc-h: min(640px, calc(100vh - 36px));
	--bc-radius: 20px;
	--bc-accent: #7c3aed;
	--bc-accent-deep: #5b21b6;
	--bc-head: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 46%, #5b21b6 100%);
	--bc-me: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
	--bc-log: #f4f5fa;
	--bc-bubble: #ffffff;
	--bc-ink: #14141c;
	--bc-muted: #6b6b78;
	--bc-line: rgba(20, 20, 28, 0.08);
	--bc-field: #f2f2f7;
	--bc-shadow: 0 24px 60px -12px rgba(20, 20, 28, 0.28), 0 2px 10px rgba(20, 20, 28, 0.08);
}

/* --------------------------------------------------------------------------
   1. Кнопка запуска — в доке .bo-float рядом с Telegram и VK
   -------------------------------------------------------------------------- */

.bo-float__chat {
	position: relative;
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bc-head);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 26px -8px rgba(124, 58, 237, 0.62), 0 3px 8px rgba(20, 20, 28, 0.16);
	transition: transform 0.22s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.bo-float__chat:hover {
	transform: translateY(-2px) scale(1.04);
	box-shadow: 0 16px 34px -8px rgba(124, 58, 237, 0.72), 0 4px 10px rgba(20, 20, 28, 0.18);
	filter: saturate(1.08);
}

.bo-float__chat:active {
	transform: translateY(0) scale(0.97);
}

.bo-float__chat:focus-visible {
	outline: 2px solid var(--bc-accent);
	outline-offset: 3px;
}

.bo-float__chat-ico,
.bo-float__chat-x {
	display: grid;
	place-items: center;
	grid-area: 1 / 1;
	transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.19, 1, 0.22, 1);
}

.bo-float__chat-ico svg,
.bo-float__chat-x svg {
	width: 25px;
	height: 25px;
}

.bo-float__chat-x {
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
}

.bo-float__chat-x svg {
	width: 21px;
	height: 21px;
}

body.bo-chat-open .bo-float__chat-ico {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

body.bo-chat-open .bo-float__chat-x {
	opacity: 1;
	transform: none;
}

/* пульсирующая точка «можно спросить» — до первого открытия за сессию */
.bo-float__chat-dot {
	position: absolute;
	top: -1px;
	right: -1px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
	animation: bo-float-pulse 2.4s ease-out infinite;
}

.bo-float__chat.is-seen .bo-float__chat-dot {
	display: none;
}

/* непрочитанный ответ пришёл, пока панель свёрнута */
.bo-float__chat.is-unread .bo-float__chat-dot {
	display: block;
	background: #ef4444;
	border-color: #fff;
}

@keyframes bo-float-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
	}
	70% {
		box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
	}
}

/* подсказка слева от кнопки (только на десктопе с курсором) */
.bo-float__chat-tip {
	position: absolute;
	right: calc(100% + 12px);
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	padding: 7px 12px;
	border-radius: 11px;
	background: rgba(20, 20, 28, 0.94);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.19, 1, 0.22, 1);
}

.bo-float__chat-tip::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -4px;
	width: 9px;
	height: 9px;
	margin-top: -4px;
	background: rgba(20, 20, 28, 0.94);
	transform: rotate(45deg);
	border-radius: 2px;
}

@media (hover: hover) and (pointer: fine) {
	.bo-float__chat:hover .bo-float__chat-tip,
	.bo-float__chat:focus-visible .bo-float__chat-tip {
		opacity: 1;
		transform: translateY(-50%) translateX(0);
	}
}

/* на мобильном панель — шторка, кнопка под ней не нужна */
@media (max-width: 719px) {
	body.bo-chat-open .bo-float__chat {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   2. Панель
   -------------------------------------------------------------------------- */

.bo-chat {
	position: static;
}

.bo-chat__panel {
	position: fixed;
	right: 88px;
	bottom: 18px;
	z-index: 280;
	display: flex;
	flex-direction: column;
	width: var(--bc-w);
	max-width: calc(100vw - 24px);
	height: var(--bc-h);
	max-height: calc(100vh - 32px);
	overflow: hidden;
	background: var(--bc-bubble);
	border: 1px solid var(--bc-line);
	border-radius: var(--bc-radius);
	box-shadow: var(--bc-shadow);
	animation: bo-panel-in 0.26s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.bo-chat__panel[hidden] {
	display: none;
}

@keyframes bo-panel-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.975);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- шапка ---------- */
.bo-chat__head {
	display: flex;
	align-items: center;
	gap: 11px;
	flex: 0 0 auto;
	padding: 13px 14px;
	background: var(--bc-head);
	color: #fff;
}

.bo-chat__ava {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
	color: #fff;
}

.bo-chat__ava svg {
	width: 21px;
	height: 21px;
}

.bo-chat__who-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.bo-chat__who-text strong {
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.bo-chat__who-text small {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.82);
}

.bo-chat__online {
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
	animation: bo-online 2.6s ease-in-out infinite;
}

@keyframes bo-online {
	0%,
	100% {
		box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
	}
	50% {
		box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.12);
	}
}

.bo-chat__close {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	margin-left: auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
}

.bo-chat__close:hover {
	background: rgba(255, 255, 255, 0.26);
}

.bo-chat__close:active {
	transform: scale(0.94);
}

.bo-chat__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---------- переключатель режимов ---------- */
.bo-chat__tabs {
	display: flex;
	gap: 4px;
	flex: 0 0 auto;
	padding: 9px 10px;
	background: var(--bc-bubble);
	border-bottom: 1px solid var(--bc-line);
}

.bo-chat__tab {
	flex: 1 1 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--bc-muted);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 650;
	letter-spacing: -0.005em;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bo-chat__tab:hover {
	color: var(--bc-ink);
	background: var(--bc-field);
}

.bo-chat__tab.is-active {
	background: var(--bc-field);
	color: var(--bc-accent-deep);
	box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.16);
}

.bo-chat__tab:focus-visible {
	outline: 2px solid var(--bc-accent);
	outline-offset: 1px;
}

/* ---------- экраны ---------- */
.bo-chat__views {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
}

.bo-chat__view {
	display: none;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	min-width: 0;
	overflow: hidden;
}

.bo-chat__view.is-active {
	display: flex;
}

/* ---------- лента ---------- */
.bo-chat__log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 14px 14px 6px;
	background-color: var(--bc-log);
	background-image: radial-gradient(circle at 1px 1px, rgba(124, 58, 237, 0.09) 1px, transparent 0);
	background-size: 18px 18px;
	scrollbar-width: thin;
	overscroll-behavior: contain;
}

.bo-chat__log::-webkit-scrollbar {
	width: 8px;
}

.bo-chat__log::-webkit-scrollbar-thumb {
	background: rgba(20, 20, 28, 0.16);
	border-radius: 8px;
	border: 2px solid transparent;
	background-clip: content-box;
}

.bo-chat__day {
	display: block;
	margin: 0 auto 12px;
	width: max-content;
	padding: 4px 11px;
	border-radius: 999px;
	background: rgba(20, 20, 28, 0.07);
	color: var(--bc-muted);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.01em;
}

.bo-chat__msg {
	display: flex;
	min-width: 0;
	margin-bottom: 10px;
	animation: bo-msg-in 0.24s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.bo-chat__msg--me {
	justify-content: flex-end;
}

@keyframes bo-msg-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.bo-chat__bubble {
	position: relative;
	max-width: 80%;
	padding: 9px 12px 19px;
	border-radius: 16px 16px 16px 6px;
	background: var(--bc-bubble);
	color: var(--bc-ink);
	font-size: 13.5px;
	line-height: 1.52;
	white-space: pre-line;
	overflow-wrap: anywhere;
	box-shadow: 0 1px 2px rgba(20, 20, 28, 0.09), 0 6px 16px -12px rgba(20, 20, 28, 0.3);
}

.bo-chat__msg--me .bo-chat__bubble {
	border-radius: 16px 16px 6px 16px;
	background: var(--bc-me);
	color: #fff;
	box-shadow: 0 6px 18px -10px rgba(124, 58, 237, 0.7);
}

.bo-chat__bubble a {
	color: var(--bc-accent-deep);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bo-chat__msg--me .bo-chat__bubble a {
	color: #fff;
}

.bo-chat__bubble strong {
	font-weight: 700;
}

.bo-chat__time {
	position: absolute;
	right: 11px;
	bottom: 6px;
	font-size: 10.5px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: rgba(20, 20, 28, 0.42);
}

.bo-chat__msg--me .bo-chat__time {
	color: rgba(255, 255, 255, 0.72);
}

/* «печатает…» */
.bo-chat__typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 13px 14px;
	border-radius: 16px 16px 16px 6px;
	background: var(--bc-bubble);
	box-shadow: 0 1px 2px rgba(20, 20, 28, 0.09);
}

.bo-chat__typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #a3a3b4;
	animation: bo-dot 1.15s ease-in-out infinite;
}

.bo-chat__typing i:nth-child(2) {
	animation-delay: 0.16s;
}

.bo-chat__typing i:nth-child(3) {
	animation-delay: 0.32s;
}

@keyframes bo-dot {
	0%,
	60%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	30% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* ---------- быстрые вопросы ---------- */
.bo-chat__chips {
	display: flex;
	gap: 7px;
	flex: 0 0 auto;
	min-width: 0;
	padding: 10px 14px 2px;
	overflow-x: auto;
	background: var(--bc-log);
	scrollbar-width: none;
}

.bo-chat__chips::-webkit-scrollbar {
	display: none;
}

.bo-chat__chips[hidden] {
	display: none;
}

.bo-chat__chip {
	flex: 0 0 auto;
	padding: 7px 12px;
	border: 1px solid rgba(124, 58, 237, 0.22);
	border-radius: 999px;
	background: var(--bc-bubble);
	color: var(--bc-accent-deep);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.bo-chat__chip:hover {
	background: rgba(124, 58, 237, 0.09);
	border-color: rgba(124, 58, 237, 0.4);
}

.bo-chat__chip:active {
	transform: scale(0.97);
}

.bo-chat__chip:focus-visible {
	outline: 2px solid var(--bc-accent);
	outline-offset: 2px;
}

/* ---------- поле ввода ---------- */
.bo-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	flex: 0 0 auto;
	padding: 10px 12px 6px;
	background: var(--bc-log);
}

.bo-chat__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 42px;
	max-height: 108px;
	padding: 11px 14px;
	border: 1px solid transparent;
	border-radius: 21px;
	background: var(--bc-bubble);
	color: var(--bc-ink);
	font-family: inherit;
	font-size: 13.5px;
	line-height: 1.45;
	resize: none;
	box-shadow: 0 1px 2px rgba(20, 20, 28, 0.08);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bo-chat__input::placeholder {
	color: rgba(20, 20, 28, 0.38);
}

.bo-chat__input:focus {
	outline: none;
	border-color: rgba(124, 58, 237, 0.55);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.13);
}

.bo-chat__send {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bc-me);
	color: #fff;
	cursor: pointer;
	opacity: 0.55;
	transform: scale(0.94);
	box-shadow: 0 8px 18px -10px rgba(124, 58, 237, 0.85);
	transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.2s ease;
}

.bo-chat__composer.is-filled .bo-chat__send {
	opacity: 1;
	transform: none;
}

.bo-chat__send svg {
	width: 19px;
	height: 19px;
	margin-left: 2px;
}

.bo-chat__send:hover:not(:disabled) {
	box-shadow: 0 12px 24px -10px rgba(124, 58, 237, 0.95);
}

.bo-chat__send:active:not(:disabled) {
	transform: scale(0.92);
}

.bo-chat__send:disabled {
	cursor: progress;
	opacity: 0.45;
}

.bo-chat__send:focus-visible {
	outline: 2px solid var(--bc-accent);
	outline-offset: 3px;
}

.bo-chat__note {
	flex: 0 0 auto;
	margin: 0;
	padding: 0 16px 11px;
	background: var(--bc-log);
	color: var(--bc-muted);
	font-size: 11px;
	line-height: 1.4;
	text-align: center;
}

.bo-chat__note.is-error {
	color: var(--ff-danger);
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   3. Форма заявки внутри чата
   -------------------------------------------------------------------------- */

.bo-chat__lead {
	display: block;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 14px;
	background: var(--bc-log);
}

.bo-chat__lead[hidden] {
	display: none;
}

.bo-chat__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.bo-chat__field {
	display: block;
	margin-bottom: 10px;
}

.bo-chat__field > span {
	display: block;
	margin-bottom: 5px;
	font-size: 11.5px;
	font-weight: 650;
	color: var(--bc-muted);
}

.bo-chat__field em {
	font-style: normal;
	font-weight: 500;
	opacity: 0.75;
}

.bo-chat__field input,
.bo-chat__field textarea {
	display: block;
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--bc-line);
	border-radius: 13px;
	background: var(--bc-bubble);
	color: var(--bc-ink);
	font-family: inherit;
	font-size: 13.5px;
	line-height: 1.45;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bo-chat__field textarea {
	resize: vertical;
	min-height: 74px;
}

.bo-chat__field input:focus,
.bo-chat__field textarea:focus {
	outline: none;
	border-color: rgba(124, 58, 237, 0.55);
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.13);
}

.bo-chat__field.is-error input,
.bo-chat__field.is-error textarea,
.bo-chat__agree.is-error input {
	border-color: var(--ff-danger);
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.11);
}

.bo-chat__agree {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 2px 0 12px;
	font-size: 11.5px;
	line-height: 1.45;
	color: var(--bc-muted);
}

.bo-chat__agree input {
	flex: 0 0 auto;
	margin: 1px 0 0;
	width: 15px;
	height: 15px;
	accent-color: var(--bc-accent);
}

.bo-chat__agree a {
	color: var(--bc-accent-deep);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bo-chat__submit {
	display: block;
	width: 100%;
	padding: 12px 16px;
	border: 0;
	border-radius: 13px;
	background: var(--bc-me);
	color: #fff;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 24px -12px rgba(124, 58, 237, 0.9);
	transition: filter 0.18s ease, transform 0.18s ease;
}

.bo-chat__submit:hover:not(:disabled) {
	filter: brightness(1.07);
}

.bo-chat__submit:active:not(:disabled) {
	transform: scale(0.99);
}

.bo-chat__submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.bo-chat__status {
	margin: 9px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: var(--bc-muted);
	text-align: center;
}

.bo-chat__status.is-error {
	color: var(--ff-danger);
}

.bo-chat__done {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 26px 22px;
	background: var(--bc-log);
	text-align: center;
}

.bo-chat__done[hidden] {
	display: none;
}

.bo-chat__done-ico {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	margin-bottom: 3px;
	border-radius: 50%;
	background: rgba(34, 197, 94, 0.14);
	color: var(--ff-success);
}

.bo-chat__done-ico svg {
	width: 23px;
	height: 23px;
}

.bo-chat__done strong {
	font-size: 15.5px;
	font-weight: 750;
	color: var(--bc-ink);
}

.bo-chat__done p {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--bc-muted);
	max-width: 30ch;
}

.bo-chat__again {
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--bc-accent-deep);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.bo-chat__again:hover {
	opacity: 0.8;
}

/* --------------------------------------------------------------------------
   4. Контакты в подвале панели
   -------------------------------------------------------------------------- */

.bo-chat__contacts {
	flex: 0 0 auto;
	padding: 10px 14px 12px;
	background: var(--bc-bubble);
	border-top: 1px solid var(--bc-line);
}

.bo-chat__contacts-label {
	display: block;
	margin-bottom: 7px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: rgba(20, 20, 28, 0.42);
}

.bo-chat__contacts-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
}

.bo-chat__contacts-row a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--bc-ink);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.18s ease;
}

.bo-chat__contacts-row a svg {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	color: var(--bc-accent);
}

.bo-chat__contacts-row a:hover {
	color: var(--bc-accent-deep);
}

.bo-chat__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. Тёмная тема
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .bo-chat__panel {
	background: #14141d;
	border-color: rgba(255, 255, 255, 0.09);
	box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.66), 0 2px 10px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .bo-chat__tabs {
	background: #14141d;
	border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .bo-chat__tab {
	color: #9a9aac;
}

html[data-theme="dark"] .bo-chat__tab:hover {
	color: #f2f2f7;
	background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .bo-chat__tab.is-active {
	background: rgba(139, 92, 246, 0.16);
	color: #c4b5fd;
	box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

html[data-theme="dark"] .bo-chat__log,
html[data-theme="dark"] .bo-chat__chips,
html[data-theme="dark"] .bo-chat__composer,
html[data-theme="dark"] .bo-chat__note,
html[data-theme="dark"] .bo-chat__lead,
html[data-theme="dark"] .bo-chat__done {
	background-color: #0f0f17;
	background-image: radial-gradient(circle at 1px 1px, rgba(139, 92, 246, 0.13) 1px, transparent 0);
}

html[data-theme="dark"] .bo-chat__chips,
html[data-theme="dark"] .bo-chat__composer,
html[data-theme="dark"] .bo-chat__note {
	background-image: none;
}

html[data-theme="dark"] .bo-chat__day {
	background: rgba(255, 255, 255, 0.09);
	color: #9a9aac;
}

html[data-theme="dark"] .bo-chat__bubble,
html[data-theme="dark"] .bo-chat__typing {
	background: #1d1d29;
	color: #ececf3;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .bo-chat__bubble a {
	color: #c4b5fd;
}

html[data-theme="dark"] .bo-chat__msg--me .bo-chat__bubble a {
	color: #fff;
}

html[data-theme="dark"] .bo-chat__time {
	color: rgba(236, 236, 243, 0.45);
}

html[data-theme="dark"] .bo-chat__msg--me .bo-chat__time {
	color: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .bo-chat__input {
	background: #1d1d29;
	color: #ececf3;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .bo-chat__input::placeholder {
	color: rgba(236, 236, 243, 0.4);
}

html[data-theme="dark"] .bo-chat__chip {
	background: #1d1d29;
	border-color: rgba(139, 92, 246, 0.34);
	color: #c4b5fd;
}

html[data-theme="dark"] .bo-chat__chip:hover {
	background: rgba(139, 92, 246, 0.16);
}

html[data-theme="dark"] .bo-chat__note {
	color: #8f8fa2;
}

html[data-theme="dark"] .bo-chat__field input,
html[data-theme="dark"] .bo-chat__field textarea {
	background: #1d1d29;
	border-color: rgba(255, 255, 255, 0.1);
	color: #ececf3;
}

html[data-theme="dark"] .bo-chat__field > span,
html[data-theme="dark"] .bo-chat__agree,
html[data-theme="dark"] .bo-chat__status,
html[data-theme="dark"] .bo-chat__done p {
	color: #93939f;
}

html[data-theme="dark"] .bo-chat__done strong {
	color: #f2f2f7;
}

html[data-theme="dark"] .bo-chat__again,
html[data-theme="dark"] .bo-chat__agree a {
	color: #c4b5fd;
}

html[data-theme="dark"] .bo-chat__contacts {
	background: #14141d;
	border-top-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .bo-chat__contacts-label {
	color: rgba(236, 236, 243, 0.4);
}

html[data-theme="dark"] .bo-chat__contacts-row a {
	color: #ececf3;
}

html[data-theme="dark"] .bo-float__chat-dot,
html[data-theme="dark"] .bo-float__chat.is-unread .bo-float__chat-dot {
	border-color: #14141d;
}

/* --------------------------------------------------------------------------
   6. Адаптив
   -------------------------------------------------------------------------- */

@media (max-width: 719px) {
	.bo-chat__panel {
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-width: none;
		/* Лист не должен залезать под шапку сайта — иначе «ручка» прячется за ней. */
		height: min(calc(100dvh - var(--ff-header) - 6px), 760px);
		max-height: none;
		border: 0;
		border-radius: 22px 22px 0 0;
		padding-bottom: env(safe-area-inset-bottom);
		animation-name: bo-sheet-in;
	}

	@supports (height: 100dvh) {
		.bo-chat__panel {
			height: min(calc(100dvh - var(--ff-header) - 6px), 760px);
		}
	}

	.bo-chat__bubble {
		max-width: 86%;
	}

	.bo-chat__head {
		padding: 12px 14px 13px;
	}

	/* «ручка» шторки */
	.bo-chat__head::before {
		content: "";
		position: absolute;
		top: 6px;
		left: 50%;
		width: 38px;
		height: 4px;
		margin-left: -19px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.4);
	}

	.bo-chat__contacts-row {
		gap: 6px 12px;
	}

	.bo-chat__contacts-row a {
		font-size: 11.5px;
	}
}

@keyframes bo-sheet-in {
	from {
		opacity: 0;
		transform: translateY(26px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 379px) {
	.bo-chat__who-text small {
		display: none;
	}

	.bo-chat__bubble {
		font-size: 13px;
	}

	.bo-chat__chip {
		font-size: 11.5px;
		padding: 6px 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bo-chat__panel,
	.bo-chat__msg,
	.bo-float__chat,
	.bo-float__chat-dot,
	.bo-chat__online,
	.bo-chat__typing i {
		animation: none !important;
		transition: none !important;
	}
}
