.mw-ai-chatbot {
	--mw-ai-bg: rgba(14, 15, 18, 0.86);
	--mw-ai-bg-solid: #111216;
	--mw-ai-panel: rgba(24, 25, 30, 0.82);
	--mw-ai-panel-strong: rgba(31, 32, 38, 0.94);
	--mw-ai-border: rgba(255, 255, 255, 0.12);
	--mw-ai-border-strong: rgba(232, 92, 50, 0.42);
	--mw-ai-text: #f7f3ef;
	--mw-ai-muted: rgba(247, 243, 239, 0.68);
	--mw-ai-soft: rgba(255, 255, 255, 0.08);
	--mw-ai-accent: #e85c32;
	--mw-ai-accent-dark: #bc3f1f;
	--mw-ai-radius: 18px;
	--mw-ai-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
	color: var(--mw-ai-text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
}

.mw-ai-chatbot *,
.mw-ai-chatbot *::before,
.mw-ai-chatbot *::after {
	box-sizing: border-box;
}

.mw-ai-chatbot--floating {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99999;
}

.mw-ai-chatbot--embedded {
	width: 100%;
	max-width: 760px;
	margin: 24px auto;
}

.mw-ai-chatbot__launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 156px;
	max-width: min( calc(100vw - 32px), 230px );
	height: 58px;
	padding: 0 18px;
	border: 1px solid var(--mw-ai-border-strong);
	border-radius: var(--mw-ai-radius);
	background: linear-gradient(135deg, rgba(232, 92, 50, 0.98), rgba(188, 63, 31, 0.96));
	box-shadow: 0 18px 42px rgba(232, 92, 50, 0.24), 0 12px 30px rgba(0, 0, 0, 0.28);
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0;
	transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.mw-ai-chatbot__launcher:hover,
.mw-ai-chatbot__launcher:focus-visible {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.34);
	box-shadow: 0 24px 54px rgba(232, 92, 50, 0.3), 0 14px 36px rgba(0, 0, 0, 0.3);
	outline: none;
}

.mw-ai-chatbot__launcher-icon {
	position: relative;
	width: 22px;
	height: 18px;
	border: 2px solid currentColor;
	border-radius: 8px;
	flex: 0 0 auto;
}

.mw-ai-chatbot__launcher-icon::after {
	content: "";
	position: absolute;
	left: 5px;
	bottom: -7px;
	width: 8px;
	height: 8px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	border-bottom-left-radius: 3px;
	transform: skewY(-22deg);
	background: transparent;
}

.mw-ai-chatbot__launcher-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mw-ai-chatbot__panel {
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 104px));
	min-height: 440px;
	border: 1px solid var(--mw-ai-border);
	border-radius: var(--mw-ai-radius);
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
		var(--mw-ai-panel);
	box-shadow: var(--mw-ai-shadow);
	backdrop-filter: blur(22px) saturate(130%);
	-webkit-backdrop-filter: blur(22px) saturate(130%);
	overflow: hidden;
}

.mw-ai-chatbot--floating .mw-ai-chatbot__panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px) scale(0.98);
	transform-origin: right bottom;
	transition: opacity 180ms ease, transform 180ms ease;
}

.mw-ai-chatbot--floating.is-open .mw-ai-chatbot__panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.mw-ai-chatbot--embedded .mw-ai-chatbot__panel {
	position: relative;
	width: 100%;
	height: clamp(520px, 72vh, 720px);
	min-height: 520px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
		var(--mw-ai-bg-solid);
}

.mw-ai-chatbot__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	border-bottom: 1px solid var(--mw-ai-border);
	background: rgba(11, 12, 15, 0.46);
}

.mw-ai-chatbot__identity {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.mw-ai-chatbot__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 14px;
	background: linear-gradient(135deg, var(--mw-ai-accent), #2e2f36);
	color: #fff;
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0;
}

.mw-ai-chatbot__title-wrap {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mw-ai-chatbot__title {
	display: block;
	overflow: hidden;
	color: var(--mw-ai-text);
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mw-ai-chatbot__status {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--mw-ai-muted);
	font-size: 12px;
}

.mw-ai-chatbot__status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 999px;
	background: #43d17a;
	box-shadow: 0 0 0 4px rgba(67, 209, 122, 0.12);
}

.mw-ai-chatbot__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--mw-ai-border);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--mw-ai-text);
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.mw-ai-chatbot__close:hover,
.mw-ai-chatbot__close:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.22);
	outline: none;
	transform: translateY(-1px);
}

.mw-ai-chatbot__close span {
	position: relative;
	width: 16px;
	height: 16px;
}

.mw-ai-chatbot__close span::before,
.mw-ai-chatbot__close span::after {
	content: "";
	position: absolute;
	top: 7px;
	left: 1px;
	width: 14px;
	height: 2px;
	border-radius: 99px;
	background: currentColor;
}

.mw-ai-chatbot__close span::before {
	transform: rotate(45deg);
}

.mw-ai-chatbot__close span::after {
	transform: rotate(-45deg);
}

.mw-ai-chatbot__messages {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	padding: 16px;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-color: rgba(232, 92, 50, 0.7) rgba(255, 255, 255, 0.08);
	scrollbar-width: thin;
}

.mw-ai-chatbot__messages::-webkit-scrollbar {
	width: 8px;
}

.mw-ai-chatbot__messages::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}

.mw-ai-chatbot__messages::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background: rgba(232, 92, 50, 0.72);
}

.mw-ai-chatbot__message {
	display: flex;
	width: 100%;
}

.mw-ai-chatbot__message--assistant {
	justify-content: flex-start;
}

.mw-ai-chatbot__message--user {
	justify-content: flex-end;
}

.mw-ai-chatbot__bubble {
	width: fit-content;
	max-width: 86%;
	padding: 11px 13px;
	border: 1px solid var(--mw-ai-border);
	border-radius: 16px;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.mw-ai-chatbot__message--assistant .mw-ai-chatbot__bubble {
	border-top-left-radius: 7px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--mw-ai-text);
}

.mw-ai-chatbot__message--user .mw-ai-chatbot__bubble {
	border-color: rgba(232, 92, 50, 0.58);
	border-top-right-radius: 7px;
	background: linear-gradient(135deg, var(--mw-ai-accent), var(--mw-ai-accent-dark));
	color: #fff;
}

.mw-ai-chatbot__bubble a {
	color: #ffb29b;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.mw-ai-chatbot__message--user .mw-ai-chatbot__bubble a {
	color: #fff;
}

.mw-ai-chatbot__typing {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-width: 52px;
	height: 21px;
}

.mw-ai-chatbot__typing span {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: rgba(247, 243, 239, 0.78);
	animation: mw-ai-typing 900ms ease-in-out infinite;
}

.mw-ai-chatbot__typing span:nth-child(2) {
	animation-delay: 120ms;
}

.mw-ai-chatbot__typing span:nth-child(3) {
	animation-delay: 240ms;
}

@keyframes mw-ai-typing {
	0%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}

	50% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

.mw-ai-chatbot__privacy {
	margin: 0 16px 12px;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.055);
	color: var(--mw-ai-muted);
	font-size: 12px;
	line-height: 1.4;
}

.mw-ai-chatbot__form {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	padding: 14px 16px 12px;
	border-top: 1px solid var(--mw-ai-border);
	background: rgba(11, 12, 15, 0.54);
}

.mw-ai-chatbot__input {
	display: block;
	width: 100%;
	max-height: 112px;
	min-height: 46px;
	padding: 12px 13px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 15px;
	background: rgba(255, 255, 255, 0.07);
	color: #fff;
	caret-color: #fff;
	font: inherit;
	line-height: 1.4;
	resize: none;
	scrollbar-width: thin;
	transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
	-webkit-text-fill-color: #fff;
}

.mw-ai-chatbot__input::placeholder {
	color: rgba(247, 243, 239, 0.46);
}

.mw-ai-chatbot__input:focus {
	border-color: var(--mw-ai-border-strong);
	background: rgba(255, 255, 255, 0.09);
	box-shadow: 0 0 0 4px rgba(232, 92, 50, 0.13);
	color: #fff;
	caret-color: #fff;
	outline: none;
	-webkit-text-fill-color: #fff;
}

.mw-ai-chatbot__input:focus-visible,
.mw-ai-chatbot__input:active,
.mw-ai-chatbot__input:not(:placeholder-shown),
.mw-ai-chatbot__input:-webkit-autofill {
	color: #fff;
	caret-color: #fff;
	-webkit-text-fill-color: #fff;
}

.mw-ai-chatbot__send {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 1px solid rgba(232, 92, 50, 0.44);
	border-radius: 15px;
	background: var(--mw-ai-accent);
	color: #fff;
	cursor: pointer;
	flex: 0 0 auto;
	transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.mw-ai-chatbot__send:hover,
.mw-ai-chatbot__send:focus-visible {
	background: #f16d46;
	outline: none;
	transform: translateY(-1px);
}

.mw-ai-chatbot__send:disabled {
	cursor: not-allowed;
	opacity: 0.56;
	transform: none;
}

.mw-ai-chatbot__send span[aria-hidden="true"] {
	position: relative;
	width: 16px;
	height: 16px;
}

.mw-ai-chatbot__send span[aria-hidden="true"]::before {
	content: none;
}

.mw-ai-chatbot__send span[aria-hidden="true"]::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 2px;
	width: 10px;
	height: 10px;
	border-top: 2.5px solid currentColor;
	border-right: 2.5px solid currentColor;
	border-radius: 1px;
	transform: rotate(45deg);
}

.mw-ai-chatbot__contact-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	padding: 0 16px 14px;
	background: rgba(11, 12, 15, 0.54);
}

.mw-ai-chatbot__contact-links a {
	color: var(--mw-ai-muted);
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	transition: color 160ms ease;
}

.mw-ai-chatbot__contact-links a:hover,
.mw-ai-chatbot__contact-links a:focus-visible {
	color: #ffb29b;
	outline: none;
}

.mw-ai-chatbot .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 520px) {
	.mw-ai-chatbot--floating {
		right: 12px;
		bottom: 12px;
		left: 12px;
	}

	.mw-ai-chatbot__launcher {
		justify-content: center;
		width: 100%;
		max-width: none;
	}

	.mw-ai-chatbot--floating .mw-ai-chatbot__panel {
		right: 0;
		bottom: 70px;
		width: 100%;
		height: min(680px, calc(100vh - 92px));
		min-height: 420px;
	}

	.mw-ai-chatbot__bubble {
		max-width: 92%;
	}

	.mw-ai-chatbot__header,
	.mw-ai-chatbot__messages,
	.mw-ai-chatbot__form,
	.mw-ai-chatbot__contact-links {
		padding-right: 14px;
		padding-left: 14px;
	}

	.mw-ai-chatbot__privacy {
		margin-right: 14px;
		margin-left: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mw-ai-chatbot__launcher,
	.mw-ai-chatbot__panel,
	.mw-ai-chatbot__close,
	.mw-ai-chatbot__send,
	.mw-ai-chatbot__typing span {
		animation: none;
		transition: none;
	}
}
