.bhl-forum-chat,
.bhl-forum-chat * {
	box-sizing: border-box;
}

.bhl-forum-chat {
	--bhl-chat-green: #008069;
	--bhl-chat-accent: #25d366;
	--bhl-chat-bg: #efeae2;
	--bhl-chat-text: #111b21;
	--bhl-chat-muted: #667781;
	--bhl-chat-question: #fff;
	--bhl-chat-answer: #d9fdd3;
	--bhl-chat-ticks: #53bdeb;

	position: fixed;
	left: 22px;
	bottom: 22px;
	z-index: 99998;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--bhl-chat-text);
	opacity: 0;
	pointer-events: none;
	transform: translateY(14px);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.bhl-forum-chat.is-visible,
.bhl-forum-chat.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.bhl-forum-chat__bubble {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 62px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bhl-chat-accent);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bhl-forum-chat__bubble:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.bhl-forum-chat__bubble svg {
	position: absolute;
	inset: 0;
	margin: auto;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.bhl-forum-chat__bubble-close {
	opacity: 0;
	transform: rotate(45deg) scale(0.4);
}

.bhl-forum-chat.is-open .bhl-forum-chat__bubble-icon {
	opacity: 0;
	transform: rotate(-45deg) scale(0.4);
}

.bhl-forum-chat.is-open .bhl-forum-chat__bubble-close {
	opacity: 1;
	transform: none;
}

.bhl-forum-chat__teaser {
	position: absolute;
	left: 76px;
	bottom: 12px;
}

.bhl-forum-chat__teaser[hidden] {
	display: none;
}

.bhl-forum-chat__teaser-open {
	max-width: calc(100vw - 130px);
	padding: 11px 16px;
	border: 0;
	border-radius: 16px 16px 16px 4px;
	background: #fff;
	color: var(--bhl-chat-text);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	animation: bhl-chat-teaser-in 0.3s ease-out;
}

.bhl-forum-chat__teaser-close {
	position: absolute;
	top: -8px;
	left: -8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #54656f;
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.bhl-forum-chat__teaser:hover .bhl-forum-chat__teaser-close,
.bhl-forum-chat__teaser-close:focus-visible {
	opacity: 1;
}

@keyframes bhl-chat-teaser-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.bhl-forum-chat__panel {
	position: absolute;
	left: 0;
	bottom: 76px;
	display: grid;
	grid-template-rows: auto 1fr auto;
	width: min(390px, calc(100vw - 28px));
	height: min(620px, calc(100vh - 112px));
	height: min(620px, calc(100dvh - 112px));
	overflow: hidden;
	border-radius: 14px;
	background-color: var(--bhl-chat-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cg fill='none' stroke='%23dcd0bf' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='26' cy='28' r='7'/%3E%3Cpath d='M84,14c5-7,14-6,16,1'/%3E%3Cpath d='M138,54l2.6,5.2 5.8,.9-4.2,4.1 1,5.8-5.2-2.8-5.2,2.8 1-5.8-4.2-4.1 5.8-.9z'/%3E%3Cpath d='M36,86c0-7,11-7,11,0c0,5-5.5,5-5.5,9m0,5v.5'/%3E%3Cpath d='M108,112h14m-7-7v14'/%3E%3Cpath d='M18,136c6-5,13,5,19,0'/%3E%3Ccircle cx='78' cy='62' r='2.5'/%3E%3Cpath d='M148,132a6,6 0 1 1-8-5'/%3E%3Ccircle cx='62' cy='150' r='6'/%3E%3Cpath d='M120,26l3,3m0-3l-3,3'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 170px auto;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
	transform-origin: 30px calc(100% - 8px);
}

.bhl-forum-chat.is-open .bhl-forum-chat__panel {
	animation: bhl-chat-pop 0.24s cubic-bezier(0.18, 0.89, 0.32, 1.15);
}

@keyframes bhl-chat-pop {
	from {
		opacity: 0;
		transform: scale(0.82) translateY(16px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

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

.bhl-forum-chat__header {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 60px;
	padding: 9px 12px;
	background: var(--bhl-chat-green);
	color: #fff;
}

.bhl-forum-chat__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bhl-forum-chat__close:hover {
	background: rgba(255, 255, 255, 0.14);
}

.bhl-forum-chat__avatar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	color: var(--bhl-chat-green);
	flex: 0 0 auto;
}

.bhl-forum-chat__avatar::after {
	content: "";
	position: absolute;
	bottom: -1px;
	inset-inline-end: -1px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--bhl-chat-accent);
	border: 2px solid var(--bhl-chat-green);
}

.bhl-forum-chat__heading {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.bhl-forum-chat__heading strong {
	font-size: 16px;
	font-weight: 700;
}

.bhl-forum-chat__heading span {
	color: rgba(255, 255, 255, 0.82);
	font-size: 12px;
}

.bhl-forum-chat__messages {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-height: 0;
	padding: 14px 16px;
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Children must keep their natural height; the column scrolls instead of squeezing them. */
.bhl-forum-chat__messages > * {
	flex: 0 0 auto;
}

.bhl-forum-chat__divider {
	align-self: center;
	max-width: 88%;
	margin: 10px 0 2px;
	padding: 5px 12px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.92);
	color: #54656f;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.bhl-forum-chat__divider:first-child {
	margin-top: 0;
}

.bhl-forum-chat__msg {
	position: relative;
	width: fit-content;
	min-width: 118px;
	max-width: 84%;
	padding: 7px 9px 6px;
	box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.22);
}

.bhl-forum-chat__msg.is-pending {
	opacity: 0.85;
}

.bhl-forum-chat__msg::before {
	content: "";
	position: absolute;
	top: 0;
	width: 12px;
	height: 18px;
	background: inherit;
}

.bhl-forum-chat__msg--question {
	align-self: flex-start;
	background: var(--bhl-chat-question);
	border-radius: 0 12px 12px 12px;
}

.bhl-forum-chat__msg--question::before {
	left: -8px;
	border-top-left-radius: 10px;
	clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.bhl-forum-chat__msg--answer {
	align-self: flex-end;
	background: var(--bhl-chat-answer);
	border-radius: 12px 0 12px 12px;
}

.bhl-forum-chat__msg--answer::before {
	right: -8px;
	border-top-right-radius: 10px;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bhl-forum-chat__meta {
	margin: 0 0 3px;
	color: var(--bhl-chat-green);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

.bhl-forum-chat__text {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bhl-chat-text);
	font: inherit;
	font-size: 14.5px;
	line-height: 1.42;
	text-align: right;
	white-space: normal;
	overflow-wrap: anywhere;
	cursor: pointer;
}

/* Keep the theme's global button:hover (red) from leaking into the widget. */
.bhl-forum-chat .bhl-forum-chat__text:hover,
.bhl-forum-chat .bhl-forum-chat__text:focus,
.bhl-forum-chat .bhl-forum-chat__text:active {
	border: 0;
	background: transparent;
	color: var(--bhl-chat-text);
	text-decoration: none;
	box-shadow: none;
}

.bhl-forum-chat__msg::after {
	content: "מעבר לפורום ↗";
	position: absolute;
	top: -10px;
	inset-inline-end: 10px;
	z-index: 1;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--bhl-chat-green);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	line-height: 1.6;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(3px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.bhl-forum-chat__msg:has(> .bhl-forum-chat__text:hover)::after,
.bhl-forum-chat__msg:has(> .bhl-forum-chat__text:focus-visible)::after {
	opacity: 1;
	transform: none;
}

.bhl-forum-chat__msg:has(> .bhl-forum-chat__text:hover) {
	box-shadow: 0 2px 8px rgba(11, 20, 26, 0.26);
}

.bhl-forum-chat__msg-footer {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	color: var(--bhl-chat-muted);
	font-size: 11px;
	line-height: 1.3;
}

.bhl-forum-chat__time {
	flex: 0 0 auto;
	white-space: nowrap;
	overflow: visible;
}

.bhl-forum-chat__msg-status {
	display: inline-flex;
	align-items: center;
}

.bhl-forum-chat__msg-status.is-pending {
	color: var(--bhl-chat-muted);
}

.bhl-forum-chat__msg-status.is-sent {
	color: var(--bhl-chat-ticks);
}

.bhl-forum-chat__reply {
	margin: 0;
	margin-inline-end: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bhl-chat-green);
	font-size: 11px;
	cursor: pointer;
}

.bhl-forum-chat__reply:hover {
	text-decoration: underline;
}

.bhl-forum-chat__status {
	align-self: center;
	max-width: 82%;
	margin-top: 12px;
	padding: 7px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.76);
	color: var(--bhl-chat-muted);
	font-size: 12.5px;
	text-align: center;
}

.bhl-forum-chat__status.is-error,
.bhl-forum-chat__error {
	color: #8a1f11;
	background: #fde8e4;
}

.bhl-forum-chat__form {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 10px 10px;
	background: #f0f2f5;
}

.bhl-forum-chat__guest {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px;
}

.bhl-forum-chat__guest[hidden],
.bhl-forum-chat__replying[hidden] {
	display: none;
}

.bhl-forum-chat__guest input,
.bhl-forum-chat__compose textarea {
	width: 100%;
	border: 0;
	outline: 0;
	background: #fff;
	color: var(--bhl-chat-text);
	font-family: inherit;
}

.bhl-forum-chat__guest input {
	height: 34px;
	padding: 0 12px;
	border-radius: 8px;
	font-size: 13px;
}

.bhl-forum-chat__guest a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0 10px;
	border-radius: 8px;
	background: #fff;
	color: var(--bhl-chat-green);
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.bhl-forum-chat__replying {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 10px;
	border-right: 3px solid var(--bhl-chat-accent);
	border-radius: 8px;
	background: #fff;
	color: var(--bhl-chat-muted);
	font-size: 12px;
}

.bhl-forum-chat__replying span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bhl-forum-chat__replying button {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bhl-chat-muted);
	font-size: 18px;
	cursor: pointer;
}

.bhl-forum-chat__compose {
	display: flex;
	align-items: flex-end;
	gap: 7px;
}

.bhl-forum-chat__compose textarea {
	min-height: 42px;
	max-height: 96px;
	padding: 11px 14px;
	border-radius: 21px;
	resize: none;
	font-size: 14px;
	line-height: 1.35;
}

.bhl-forum-chat__compose button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--bhl-chat-accent);
	color: #fff;
	cursor: pointer;
	transform: scaleX(-1);
	transition: background 0.15s ease;
}

.bhl-forum-chat__compose button:hover {
	background: #1fbe5b;
}

.bhl-forum-chat__compose button svg {
	display: block;
}

.bhl-forum-chat__compose button:disabled {
	opacity: 0.62;
	cursor: wait;
}

.bhl-forum-chat__error {
	padding: 7px 10px;
	border-radius: 8px;
	font-size: 12px;
}

@media (max-width: 560px) {
	.bhl-forum-chat {
		left: 14px;
		bottom: 14px;
	}

	.bhl-forum-chat__bubble {
		width: 56px;
		height: 56px;
	}

	.bhl-forum-chat__teaser {
		left: 66px;
		bottom: 10px;
	}

	.bhl-forum-chat__teaser-open {
		max-width: calc(100vw - 110px);
		font-size: 12.5px;
	}

	.bhl-forum-chat__panel {
		left: 0;
		bottom: 68px;
		width: calc(100vw - 28px);
		height: min(570px, calc(100vh - 92px));
		height: min(570px, calc(100dvh - 92px));
	}

	.bhl-forum-chat__messages {
		padding-inline: 12px;
	}

	.bhl-forum-chat__msg {
		max-width: 88%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bhl-forum-chat,
	.bhl-forum-chat__bubble,
	.bhl-forum-chat__bubble svg {
		transition: none;
	}

	.bhl-forum-chat.is-open .bhl-forum-chat__panel,
	.bhl-forum-chat__teaser-open {
		animation: none;
	}
}

/* Theme hover-style guards for the remaining widget buttons. */
.bhl-forum-chat .bhl-forum-chat__reply:hover,
.bhl-forum-chat .bhl-forum-chat__reply:focus {
	border: 0;
	background: transparent;
	color: var(--bhl-chat-green);
	text-decoration: underline;
	box-shadow: none;
}

.bhl-forum-chat .bhl-forum-chat__bubble:hover,
.bhl-forum-chat .bhl-forum-chat__bubble:focus {
	background: var(--bhl-chat-accent);
	color: #fff;
}

.bhl-forum-chat .bhl-forum-chat__compose button:hover,
.bhl-forum-chat .bhl-forum-chat__compose button:focus {
	background: #1fbe5b;
	color: #fff;
}

.bhl-forum-chat .bhl-forum-chat__close:hover,
.bhl-forum-chat .bhl-forum-chat__close:focus {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.bhl-forum-chat .bhl-forum-chat__teaser-open:hover,
.bhl-forum-chat .bhl-forum-chat__teaser-open:focus {
	background: #fff;
	color: var(--bhl-chat-text);
}

.bhl-forum-chat .bhl-forum-chat__teaser-close:hover,
.bhl-forum-chat .bhl-forum-chat__teaser-close:focus {
	background: #54656f;
	color: #fff;
}

.bhl-forum-chat .bhl-forum-chat__replying button:hover,
.bhl-forum-chat .bhl-forum-chat__replying button:focus {
	border: 0;
	background: transparent;
	color: var(--bhl-chat-text);
}
