/* ИИ-ассистент на главной странице */
.lv-assistant {
	position: absolute;
	left: 50%;
	bottom: 110px;
	transform: translateX(-50%);
	width: min(760px, calc(100% - 32px));
	z-index: 20;
	font-family: inherit;
}

.lv-assistant-log {
	max-height: 340px;
	overflow-y: auto;
	margin-bottom: 14px;
	padding: 16px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lv-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 15px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.lv-msg-user {
	align-self: flex-end;
	background: #28292c;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.lv-msg-bot {
	align-self: flex-start;
	background: #f1f1f1;
	color: #28292c;
	border-bottom-left-radius: 4px;
}

.lv-msg-typing {
	color: #888;
	font-style: italic;
}

.lv-msg-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.lv-msg-actions a {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 20px;
	background: #ffb74d;
	color: #28292c;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.lv-assistant-chips {
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
}

.lv-chip {
	flex-shrink: 0;
	padding: 8px 16px;
	border: 0;
	border-radius: 24px;
	background: #fff;
	color: #28292c;
	font-size: 14px;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transition: transform .15s ease, background .15s ease;
}

.lv-chip:hover {
	background: #ffb74d;
	transform: translateY(-1px);
}

.lv-assistant-form {
	display: flex;
	align-items: center;
	padding: 8px 8px 8px 26px;
	border-radius: 40px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.lv-assistant-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	background: transparent;
	font-size: 17px;
	color: #28292c;
	padding: 14px 0;
}

.lv-assistant-send {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: #ebebeb;
	color: #555;
	font-size: 18px;
	cursor: pointer;
	transition: background .15s ease;
}

.lv-assistant-send:hover,
.lv-assistant-send:not(:disabled):focus {
	background: #ffb74d;
	color: #28292c;
}

.lv-assistant-send:disabled {
	opacity: .5;
	cursor: default;
}

/* Узкое окно: кнопки листаются по горизонтали, а не переносятся на вторую строку */
@media (max-width: 900px) {
	.lv-assistant-chips {
		justify-content: flex-start;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}
}

/* Кнопка-иконка и шапка панели нужны только на телефоне */
.lv-assistant-toggle,
.lv-assistant-head {
	display: none;
}

/* Телефон: чат свёрнут в круглую кнопку справа внизу, по нажатию выезжает панель снизу */
@media (max-width: 768px) {
	.lv-assistant {
		left: auto;
		right: 16px;
		bottom: 18px;
		width: auto;
		transform: none;
		z-index: 30;
	}
	/* Текст слайда уезжает вверх, пока открыт чат (величину ставит assistant.js) */
	.mry-main-title-frame .container {
		transform: translateY(calc(-1 * var(--lv-lift, 0px)));
		transition: transform .3s ease;
	}
	.lv-assistant-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 58px;
		height: 58px;
		border: 0;
		border-radius: 50%;
		background: #ffb74d;
		color: #28292c;
		font-size: 24px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
		cursor: pointer;
	}
	.lv-assistant:not(.lv-open) .lv-assistant-log,
	.lv-assistant:not(.lv-open) .lv-assistant-chips,
	.lv-assistant:not(.lv-open) .lv-assistant-form {
		display: none;
	}

	.lv-assistant.lv-open {
		left: 0;
		right: 0;
		bottom: 0;
		padding: 12px 12px 16px;
		border-radius: 22px 22px 0 0;
		background: #fff;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
	}
	.lv-open .lv-assistant-toggle {
		display: none;
	}
	.lv-open .lv-assistant-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 4px 10px;
		font-size: 15px;
		font-weight: 600;
		color: #28292c;
	}
	.lv-assistant-close {
		width: 36px;
		height: 36px;
		border: 0;
		border-radius: 50%;
		background: #f1f1f1;
		color: #28292c;
		font-size: 16px;
		cursor: pointer;
	}
	.lv-open .lv-assistant-log {
		max-height: 45vh;
		padding: 4px;
		margin-bottom: 10px;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}
	.lv-assistant-chips {
		justify-content: flex-start;
		overflow-x: auto;
		margin-bottom: 10px;
		padding-bottom: 4px;
	}
	.lv-chip {
		background: #f1f1f1;
		box-shadow: none;
	}
	.lv-assistant-form {
		padding: 4px 4px 4px 18px;
		background: #f1f1f1;
		box-shadow: none;
	}
	.lv-assistant-input {
		font-size: 16px; /* меньше 16px - iPhone зумит страницу при вводе */
		padding: 10px 0;
	}
	.lv-assistant-send {
		width: 44px;
		height: 44px;
		background: #ffb74d;
		color: #28292c;
	}
}
