/**
 * Виджет чата на лендинге /pro-dementsiya/.
 * Вне .pro-demencia-landing: overflow-x:hidden на узких экранах иначе клипует position:fixed.
 */
.pro-dementsiya-chat {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
}

.pro-dementsiya-chat__frame {
	display: block;
	width: 380px;
	height: 600px;
	border: none;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 8px 32px rgba(39, 49, 74, 0.18);
}

.pro-dementsiya-chat__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #27314a;
	box-shadow: 0 2px 10px rgba(39, 49, 74, 0.18);
	cursor: pointer;
}

.pro-dementsiya-chat__close:hover,
.pro-dementsiya-chat__close:focus-visible {
	color: #d1416b;
}

.pro-dementsiya-chat__close:focus-visible {
	outline: 2px solid #d1416b;
	outline-offset: 2px;
}

.pro-dementsiya-chat__open {
	display: none;
	align-items: center;
	gap: 0.4rem;
	min-height: 48px;
	padding: 0.65rem 1rem 0.65rem 0.85rem;
	border: none;
	border-radius: 2rem;
	background: #d1416b;
	color: #fff;
	font-family: Onest, Montserrat, system-ui, sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 8px 24px rgba(209, 65, 107, 0.28);
	cursor: pointer;
}

.pro-dementsiya-chat__open:hover,
.pro-dementsiya-chat__open:focus-visible {
	background: #b4232a;
}

.pro-dementsiya-chat__open:focus-visible {
	outline: 2px solid #e7c9c1;
	outline-offset: 2px;
}

.pro-dementsiya-chat--closed .pro-dementsiya-chat__frame,
.pro-dementsiya-chat--closed .pro-dementsiya-chat__close {
	display: none;
}

.pro-dementsiya-chat--closed .pro-dementsiya-chat__open {
	display: inline-flex;
}

.pro-dementsiya-chat__open[hidden] {
	display: none !important;
}

@media (max-width: 81.25em) {
	.pro-dementsiya-chat {
		right: 12px;
		bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
	}

	.pro-dementsiya-chat__frame {
		width: min(380px, calc(100vw - 24px));
		height: min(600px, calc(100vh - 8rem - env(safe-area-inset-bottom, 0px)));
	}
}
