.ch-assistente {
	position: fixed;
	right: max(20px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 90;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	width: min(400px, calc(100% - 32px));
	pointer-events: none;
}

.ch-assistente__abrir,
.ch-assistente__painel {
	pointer-events: auto;
}

.ch-assistente__abrir {
	width: 56px;
	height: 56px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #d81117;
	color: #fff;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ch-assistente__abrir:focus-visible,
.ch-assistente__fechar:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

.ch-assistente__painel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	overscroll-behavior: none;
	min-height: 0;
	width: 100%;
	height: min(768px, calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
	background: #d81117;
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ch-assistente__painel[hidden] {
	display: none;
}

.ch-assistente__barra {
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 0 4px 0 16px;
	background: #d81117;
	color: #fff;
}

.ch-assistente__barra p {
	margin: 0;
	font-family: "DM Sans", sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}

.ch-assistente__fechar {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.ch-assistente__frame {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	border: 0;
	display: block;
	background: #fff;
	overflow: hidden;
}

.ch-footer {
	padding-bottom: calc(56px + max(20px, env(safe-area-inset-bottom)) + 12px) !important;
}

body:has(.menu-hide.open) .ch-assistente {
	visibility: hidden;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.ch-assistente,
	.ch-assistente__painel,
	.ch-assistente__abrir {
		transition: none;
	}
}

@media print {
	.ch-assistente {
		display: none !important;
	}
}
