.bf-chat,
.bf-chat * {
	box-sizing: border-box;
}

.bf-chat {
	--bf-chat-ink: #08090b;
	--bf-chat-panel: #111217;
	--bf-chat-line: rgba(255, 255, 255, 0.16);
	--bf-chat-text: #f7f1e8;
	--bf-chat-muted: rgba(247, 241, 232, 0.68);
	--bf-chat-orange: #ff5a1f;
	--bf-chat-pink: #ff3f7d;
	bottom: 42px;
	color: var(--bf-chat-text);
	font-family: Inter, Arial, sans-serif;
	position: fixed;
	right: 22px;
	z-index: 9999;
}

.bf-cookie-consent {
	align-items: center;
	background: #111217;
	border: 1px solid rgba(255, 90, 31, 0.52);
	border-top: 3px solid var(--bf-chat-orange);
	bottom: 32px;
	box-shadow: 0 20px 56px rgba(0, 0, 0, 0.48);
	display: grid;
	gap: 12px 24px;
	grid-template-columns: minmax(0, 1fr) auto;
	left: 50%;
	max-width: none;
	padding: 16px 18px;
	position: fixed;
	right: auto;
	transform: translateX(-50%);
	width: min(1240px, calc(100vw - 48px));
	z-index: 1;
}

.bf-cookie-consent[hidden] {
	display: none;
}

.bf-cookie-consent h2 {
	color: var(--bf-chat-text);
	font-size: 1rem;
	margin: 0;
}

.bf-cookie-consent p {
	color: var(--bf-chat-muted);
	font-size: 0.82rem;
	line-height: 1.45;
	margin: 5px 0 0;
}

.bf-cookie-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.bf-cookie-consent button {
	border: 1px solid var(--bf-chat-line);
	border-radius: 5px;
	cursor: pointer;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 800;
	min-height: 40px;
	padding: 9px 12px;
}

.bf-cookie-consent__necessary {
	background: transparent;
	color: var(--bf-chat-text);
}

.bf-cookie-consent__accept {
	background: var(--bf-chat-orange);
	border-color: var(--bf-chat-orange) !important;
	color: #fff;
}

.bf-cookie-consent p a {
	color: var(--bf-chat-text);
	font-size: 0.75rem;
	font-weight: 700;
}

.bf-chat__toggle,
.bf-chat__minimize,
.bf-chat__avatar-toggle,
.bf-chat__close,
.bf-chat__form button {
	border: 0;
	cursor: pointer;
	font: inherit;
}

.bf-chat__toggle {
	align-items: center;
	background: linear-gradient(100deg, var(--bf-chat-orange) 0%, var(--bf-chat-orange) 66%, var(--bf-chat-pink) 100%);
	border-radius: 999px;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
	color: #fff;
	display: inline-flex;
	font-size: 0.88rem;
	font-weight: 900;
	letter-spacing: 0;
	min-height: 62px;
	padding: 8px 22px 8px 72px;
	position: relative;
	text-transform: uppercase;
	transform-origin: right center;
	transition: min-height 220ms ease, padding 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.bf-chat.is-open .bf-chat__toggle {
	min-height: 42px;
	padding: 8px 16px;
	transform: translateY(0) scale(1);
}

.bf-chat--consent-visible {
	bottom: 162px;
}

.bf-chat__toggle-avatar {
	align-items: center;
	background: var(--bf-chat-orange);
	border: 3px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(255, 63, 125, 0.78), 0 16px 36px rgba(0, 0, 0, 0.46);
	display: inline-flex;
	height: 96px;
	justify-content: center;
	left: -38px;
	overflow: hidden;
	position: absolute;
	top: 50%;
	transform: translateY(-50%) scale(1);
	transform-origin: center;
	transition: opacity 160ms ease, transform 220ms ease;
	width: 96px;
}

.bf-chat.is-open .bf-chat__toggle-avatar {
	opacity: 0;
	pointer-events: none;
	transform: translateY(-50%) scale(0.58);
}

.bf-chat__toggle-avatar img {
	display: block;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transform: scale(1.38);
	transform-origin: 50% 34%;
	width: 100%;
}

.bf-chat__panel {
	background:
		linear-gradient(180deg, rgba(255, 90, 31, 0.11), rgba(255, 63, 125, 0.07)),
		var(--bf-chat-panel);
	border: 1px solid rgba(255, 90, 31, 0.38);
	border-radius: 8px;
	bottom: 64px;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.54);
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	height: min(620px, calc(100dvh - 110px));
	min-height: 440px;
	overflow: hidden;
	position: absolute;
	right: 0;
	width: min(380px, calc(100vw - 28px));
}

.bf-chat.is-open .bf-chat__panel {
	bottom: 54px;
}

.bf-chat__panel[hidden] {
	display: none;
}

.bf-chat.is-open .bf-chat__panel {
	animation: bf-chat-panel-in 220ms ease-out both;
}

@keyframes bf-chat-panel-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.bf-chat__header {
	align-items: center;
	background: rgba(0, 0, 0, 0.3);
	border-bottom: 1px solid var(--bf-chat-line);
	display: flex;
	gap: 20px;
	justify-content: space-between;
	padding: 16px 20px;
}

.bf-chat__identity {
	align-items: center;
	display: flex;
	gap: 13px;
	min-width: 0;
}

.bf-chat__avatar {
	background: var(--bf-chat-orange);
	border: 2px solid rgba(255, 255, 255, 0.76);
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(255, 63, 125, 0.7);
	display: block;
	height: 58px;
	overflow: hidden;
	position: relative;
	width: 58px;
}

.bf-chat__avatar img {
	display: block;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transform: scale(1.38);
	transform-origin: 50% 34%;
	width: 100%;
}

.bf-chat__header strong {
	display: block;
	font-size: 0.98rem;
	font-weight: 900;
	line-height: 1.1;
	text-transform: uppercase;
}

.bf-chat__header .bf-chat__identity span {
	color: var(--bf-chat-muted);
	display: block;
	font-size: 0.78rem;
	margin-top: 3px;
}

.bf-chat__header-actions {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
	margin-right: 2px;
}

.bf-chat__minimize,
.bf-chat__close {
	background: rgba(255, 255, 255, 0.045);
	border: 1px solid rgba(247, 241, 232, 0.22);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	line-height: 1;
	padding: 0;
	position: relative;
	transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
	width: 36px;
}

.bf-chat__minimize {
	color: var(--bf-chat-orange);
	font-size: 0;
}

.bf-chat__close {
	color: var(--bf-chat-pink);
	font-size: 0;
}

.bf-chat__minimize::before {
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	content: '';
	height: 9px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -64%) rotate(45deg);
	width: 9px;
}

.bf-chat__close::before,
.bf-chat__close::after {
	background: currentColor;
	border-radius: 999px;
	content: '';
	height: 2px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform-origin: center;
	width: 13px;
}

.bf-chat__close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.bf-chat__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.bf-chat__minimize:hover,
.bf-chat__minimize:focus-visible,
.bf-chat__close:hover,
.bf-chat__close:focus-visible {
	background: rgba(255, 255, 255, 0.12);
	border-color: currentColor;
	outline: 0;
	transform: translateY(-1px);
}

.bf-chat__messages {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px;
	scrollbar-gutter: stable;
}

.bf-chat__support {
	background: rgba(0, 0, 0, 0.18);
	border-top: 1px solid var(--bf-chat-line);
	padding: 13px 16px 15px;
}

.bf-chat__support[hidden] {
	display: none;
}

.bf-chat__support h2 {
	font-size: 0.88rem;
	margin: 0 0 10px;
}

.bf-chat__support-form {
	display: grid;
	gap: 8px;
	grid-template-columns: 1fr 1fr;
}

.bf-chat__support-form label {
	color: var(--bf-chat-muted);
	font-size: 0.72rem;
	font-weight: 800;
}

.bf-chat__support-form input {
	appearance: none;
	background: var(--bf-chat-ink) !important;
	border: 1px solid var(--bf-chat-line);
	border-radius: 5px;
	box-shadow: inset 0 0 0 999px var(--bf-chat-ink);
	color: var(--bf-chat-text) !important;
	font: inherit;
	margin-top: 5px;
	min-height: 38px;
	padding: 8px 9px;
	-webkit-text-fill-color: var(--bf-chat-text);
	width: 100%;
}

.bf-chat__support-form button,
.bf-chat__support-actions button {
	background: var(--bf-chat-orange);
	border: 0;
	border-radius: 5px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 0.76rem;
	font-weight: 900;
	min-height: 38px;
	padding: 8px 10px;
}

.bf-chat__support-form button {
	grid-column: 1 / -1;
}

.bf-chat__support-preview {
	margin-top: 10px;
}

.bf-chat__support-summary {
	background: rgba(255, 255, 255, 0.07);
	border-radius: 5px;
	color: var(--bf-chat-text);
	font-size: 0.78rem;
	line-height: 1.45;
	margin: 0 0 10px;
	padding: 9px 10px;
	white-space: pre-wrap;
}

.bf-chat__support-consent {
	align-items: flex-start;
	color: var(--bf-chat-muted);
	display: flex;
	font-size: 0.72rem;
	gap: 7px;
	line-height: 1.35;
}

.bf-chat__support-consent input {
	accent-color: var(--bf-chat-pink);
	margin: 2px 0 0;
}

.bf-chat__support-actions {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

.bf-chat__support-actions button:first-child {
	background: transparent;
	border: 1px solid var(--bf-chat-line);
	color: var(--bf-chat-text);
}

.bf-chat__support-actions button:last-child {
	background: var(--bf-chat-pink);
}

.bf-chat__support button:disabled {
	opacity: 0.55;
	pointer-events: none;
}

.bf-chat__message {
	border-radius: 8px;
	font-size: 0.92rem;
	line-height: 1.5;
	max-width: 92%;
	padding: 11px 12px;
	white-space: pre-wrap;
}

.bf-chat__message--assistant {
	align-self: flex-start;
	background: rgba(255, 255, 255, 0.08);
	color: var(--bf-chat-text);
}

.bf-chat__message--user {
	align-self: flex-end;
	background: var(--bf-chat-orange);
	color: #fff;
}

.bf-chat__message--staff {
	align-self: flex-start;
	background: linear-gradient(135deg, rgba(255, 90, 31, 0.16), rgba(255, 63, 125, 0.12));
	border: 1px solid rgba(255, 90, 31, 0.38);
	color: var(--bf-chat-text);
	display: grid;
	gap: 8px;
}

.bf-chat__staff-identity {
	align-items: center;
	color: var(--bf-chat-orange);
	display: flex;
	font-size: 0.72rem;
	font-weight: 900;
	gap: 8px;
	letter-spacing: 0.025em;
	text-transform: uppercase;
}

.bf-chat__staff-identity img {
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 50%;
	height: 28px;
	object-fit: cover;
	width: 28px;
}

.bf-chat__staff-message {
	display: block;
	white-space: pre-wrap;
}

.bf-chat--handoff .bf-chat__header {
	background: linear-gradient(100deg, rgba(255, 90, 31, 0.18), rgba(255, 63, 125, 0.08));
}

.bf-chat__action {
	align-self: flex-start;
	background: var(--bf-chat-orange);
	border-radius: 6px;
	color: #fff;
	font-size: 0.8rem;
	font-weight: 800;
	line-height: 1.2;
	max-width: 92%;
	padding: 10px 12px;
	text-decoration: none;
}

.bf-chat__action:hover,
.bf-chat__action:focus-visible {
	background: var(--bf-chat-pink);
	color: #fff;
}

.bf-chat__form {
	align-items: stretch;
	border-top: 1px solid var(--bf-chat-line);
	display: grid;
	gap: 10px;
	grid-template-columns: minmax(0, 1fr) 82px;
	padding: 14px;
}

.bf-chat__review-consent {
	align-items: flex-start;
	color: var(--bf-chat-muted);
	display: flex;
	font-size: 0.72rem;
	grid-column: 1 / -1;
	line-height: 1.35;
	gap: 8px;
}

.bf-chat__review-consent input {
	accent-color: var(--bf-chat-pink);
	flex: 0 0 auto;
	margin: 2px 0 0;
}

.bf-chat__review-consent a {
	color: var(--bf-chat-text);
	font-weight: 700;
}

.bf-chat__form textarea {
	appearance: none;
	-webkit-appearance: none;
	background: var(--bf-chat-ink) !important;
	border: 1px solid var(--bf-chat-line);
	border-radius: 6px;
	box-shadow: inset 0 0 0 999px var(--bf-chat-ink);
	caret-color: var(--bf-chat-orange);
	color: var(--bf-chat-text) !important;
	font: inherit;
	height: 72px;
	min-height: 72px;
	max-height: 72px;
	padding: 11px 12px;
	resize: none;
	-webkit-text-fill-color: var(--bf-chat-text);
	width: 100%;
}

.bf-chat__form textarea:hover,
.bf-chat__form textarea:active,
.bf-chat__form textarea:focus,
.bf-chat__form textarea:valid,
.bf-chat__form textarea:invalid {
	background: var(--bf-chat-ink) !important;
	box-shadow: inset 0 0 0 999px var(--bf-chat-ink);
	color: var(--bf-chat-text) !important;
	-webkit-text-fill-color: var(--bf-chat-text);
}

.bf-chat__form textarea:focus {
	border-color: var(--bf-chat-orange);
	outline: 0;
}

.bf-chat__form textarea::placeholder {
	color: var(--bf-chat-muted);
	opacity: 1;
	-webkit-text-fill-color: var(--bf-chat-muted);
}

.bf-chat__form textarea:-webkit-autofill,
.bf-chat__form textarea:-webkit-autofill:hover,
.bf-chat__form textarea:-webkit-autofill:focus,
.bf-chat__form textarea:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 999px var(--bf-chat-ink) inset !important;
	-webkit-text-fill-color: var(--bf-chat-text) !important;
	border-color: var(--bf-chat-line);
	caret-color: var(--bf-chat-orange);
	transition: background-color 9999s ease-out;
}

/* The chat field must remain dark even when global form or autofill styles load later. */
html body .bf-chat .bf-chat__form {
	color-scheme: dark;
}

html body .bf-chat .bf-chat__form textarea,
html body .bf-chat .bf-chat__form textarea:hover,
html body .bf-chat .bf-chat__form textarea:active,
html body .bf-chat .bf-chat__form textarea:focus,
html body .bf-chat .bf-chat__form textarea:valid,
html body .bf-chat .bf-chat__form textarea:invalid,
html body .bf-chat .bf-chat__form textarea:-webkit-autofill,
html body .bf-chat .bf-chat__form textarea:-webkit-autofill:hover,
html body .bf-chat .bf-chat__form textarea:-webkit-autofill:focus,
html body .bf-chat .bf-chat__form textarea:-webkit-autofill:active {
	background-color: #08090b !important;
	background-image: none !important;
	box-shadow: inset 0 0 0 999px #08090b !important;
	color: #f7f1e8 !important;
	-webkit-text-fill-color: #f7f1e8 !important;
}

.bf-chat__form button {
	background: var(--bf-chat-pink);
	border-radius: 6px;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 900;
	min-height: 72px;
	padding: 0 15px;
	text-transform: uppercase;
}

.bf-chat__form.is-busy button {
	opacity: 0.7;
	pointer-events: none;
}

@media (max-width: 620px) {
	.bf-chat {
		bottom: 30px;
		right: 14px;
	}

	.bf-chat--consent-visible {
		bottom: 238px;
	}

	.bf-cookie-consent {
		align-items: stretch;
		bottom: 12px;
		gap: 10px;
		grid-template-columns: 1fr;
		left: 50%;
		max-width: none;
		padding: 14px;
		width: calc(100vw - 24px);
	}

	.bf-cookie-consent__actions {
		justify-content: stretch;
	}

	.bf-cookie-consent button {
		flex: 1 1 144px;
	}

	.bf-chat__toggle {
		min-height: 58px;
		padding: 8px 16px 8px 56px;
	}

	.bf-chat__toggle-avatar {
		height: 76px;
		left: -28px;
		width: 76px;
	}

	.bf-chat__panel {
		bottom: 58px;
		height: min(620px, calc(100dvh - 88px));
		min-height: 420px;
	}

	.bf-chat__avatar {
		height: 50px;
		width: 50px;
	}

	.bf-chat__support-form {
		grid-template-columns: 1fr;
	}

	.bf-chat__support-form button {
		grid-column: auto;
	}
}

@media (max-height: 620px) {
	.bf-chat__panel,
	.bf-chat.is-open .bf-chat__panel {
		bottom: 50px;
		height: calc(100dvh - 72px);
		min-height: 0;
	}

	.bf-chat__header {
		padding: 10px 12px;
	}

	.bf-chat__avatar {
		height: 42px;
		width: 42px;
	}

	.bf-chat__messages {
		padding: 10px 12px;
	}

	.bf-chat__form {
		gap: 8px;
		padding: 10px;
	}

	.bf-chat__form textarea {
		height: 52px;
		max-height: 52px;
		min-height: 52px;
	}

	.bf-chat__form button {
		min-height: 52px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bf-chat__toggle,
	.bf-chat.is-open .bf-chat__panel {
		animation: none;
		transition: none;
	}
}
