.atb-mini-chat {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9999;
	font-family: inherit;
}

.atb-mini-chat,
.atb-mini-chat * {
	box-sizing: border-box;
}

.atb-mini-chat__button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 14px 18px;
	border: 0;
	border-radius: 4px;
	background: #2f6df6;
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.atb-mini-chat__button:hover,
.atb-mini-chat__button:focus {
	background: #2458d6;
	color: #fff;
	outline: none;
}

.atb-mini-chat__button:focus-visible {
	box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.28), 0 14px 36px rgba(0, 0, 0, 0.22);
}

.atb-mini-chat__button-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	font-weight: 800;
}

.atb-mini-chat__panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	width: min(390px, calc(100vw - 32px));
	max-height: calc(100vh - 120px);
	overflow: auto;
	padding: 18px;
	border: 1px solid rgba(17, 24, 39, 0.1);
	border-radius: 4px;
	background: #fff;
	color: #111827;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.atb-mini-chat.is-open .atb-mini-chat__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.atb-mini-chat__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 6px;
}

.atb-mini-chat__eyebrow {
	margin: 0 0 4px;
	color: #2f6df6;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
}

.atb-mini-chat__title {
	margin: 0;
	color: #111827;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.2;
}

.atb-mini-chat__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: #f3f4f6;
	color: #111827;
	font: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.atb-mini-chat__close:hover,
.atb-mini-chat__close:focus {
	background: #e5e7eb;
	color: #111827;
	outline: none;
}

.atb-mini-chat__text {
	margin: 0 0 10px;
	color: #4b5563;
	font-size: 15px;
	line-height: 1.42;
}

.atb-mini-chat__notice {
	margin: 0 0 14px;
	padding: 8px 10px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.45;
}

.atb-mini-chat__notice--success {
	background: #ecfdf3;
	color: #166534;
}

.atb-mini-chat__notice--error {
	background: #fef2f2;
	color: #991b1b;
}

.atb-mini-chat__form {
	display: grid;
	gap: 8px;
	margin: 0;
}

.atb-mini-chat__field {
	display: grid;
	gap: 4px;
	margin: 0;
}

.atb-mini-chat__field label {
	color: #111827;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
}

.atb-mini-chat__field label span {
	color: #6b7280;
	font-weight: 500;
}

.atb-mini-chat__field input,
.atb-mini-chat__field textarea {
	width: 100%;
	min-height: 38px;
	padding: 11px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
	color: #111827;
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
}

.atb-mini-chat__field textarea {
	min-height: 132px;
	resize: vertical;
}

.atb-mini-chat__field input:focus,
.atb-mini-chat__field textarea:focus {
	border-color: #2f6df6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.14);
}

.atb-mini-chat__field--trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.atb-mini-chat__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	margin-top: 2px;
	padding: 13px 18px;
	border: 0;
	border-radius: 4px;
	background: #111827;
	color: #fff;
	font: inherit;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}

.atb-mini-chat__submit:hover,
.atb-mini-chat__submit:focus {
	background: #2f6df6;
	color: #fff;
	outline: none;
}

@media (max-width: 640px) {
	.atb-mini-chat {
		right: 14px;
		bottom: calc(14px + env(safe-area-inset-bottom));
		left: auto;
	}

	.atb-mini-chat__button {
		width: auto;
		max-width: calc(100vw - 28px);
		justify-content: center;
		padding: 12px 16px;
		border-radius: 4px;
	}

	.atb-mini-chat__panel {
		right: 0;
		left: auto;
		bottom: calc(62px + env(safe-area-inset-bottom));
		width: min(360px, calc(100vw - 28px));
		max-height: calc(100vh - 100px);
		padding: 18px;
		border-radius: 4px;
	}
}

/* Hide mini-chat on mobile while typing in external forms */
@media (max-width: 640px) {
	body:has(input:focus) .atb-mini-chat:not(:has(:focus)),
	body:has(textarea:focus) .atb-mini-chat:not(:has(:focus)),
	body:has(select:focus) .atb-mini-chat:not(:has(:focus)) {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}
}
