.wp-chatbot {
	--wp-chatbot-bg: #f5f7fb;
	--wp-chatbot-surface: #ffffff;
	--wp-chatbot-surface-2: #f8fafc;
	--wp-chatbot-surface-3: #eef3f8;
	--wp-chatbot-border: rgba(15, 23, 42, 0.08);
	--wp-chatbot-border-soft: rgba(15, 23, 42, 0.06);
	--wp-chatbot-text: #162033;
	--wp-chatbot-text-soft: #607086;
	--wp-chatbot-text-dim: #8a97aa;
	--wp-chatbot-brand: #1f6fff;
	--wp-chatbot-brand-2: #175fe0;
	--wp-chatbot-brand-soft: #e9f1ff;
	--wp-chatbot-user: #1f6fff;
	--wp-chatbot-success-bg: #ecfdf3;
	--wp-chatbot-success-text: #16794d;
	--wp-chatbot-error-bg: #fff2f2;
	--wp-chatbot-error-text: #c53d3d;
	--wp-chatbot-offset-bottom: 20px;
	--wp-chatbot-offset-side: 20px;
	z-index: 9999;
	font-family: "Segoe UI", Arial, sans-serif;
	color: var(--wp-chatbot-text);
}

.wp-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;
}

.wp-chatbot--global {
	position: fixed;
	bottom: var(--wp-chatbot-offset-bottom);
	width: 56px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.wp-chatbot--global.is-open {
	width: min(400px, calc(100vw - 24px));
}

.wp-chatbot--shortcode {
	position: relative;
	width: min(400px, 100%);
	max-width: 100%;
}

.wp-chatbot--launcher-right {
	right: var(--wp-chatbot-offset-side);
	left: auto;
}

.wp-chatbot--launcher-left {
	left: var(--wp-chatbot-offset-side);
	right: auto;
}

.wp-chatbot__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: #1f6fff !important;
	color: #ffffff !important;
	cursor: pointer;
	width: 60px;
	height: 60px;
	padding: 0;
	box-shadow: 0 14px 28px rgba(31, 111, 255, 0.28) !important;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wp-chatbot__toggle:hover,
.wp-chatbot__toggle:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 18px 34px rgba(31, 111, 255, 0.34) !important;
	background: #175fe0 !important;
}

.wp-chatbot__toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.wp-chatbot__toggle-svg {
	display: block;
	width: 24px;
	height: 24px;
	color: #ffffff;
}

.wp-chatbot__toggle-icon::before,
.wp-chatbot__toggle-icon::after {
	content: none;
}

.wp-chatbot__toggle:focus-visible,
.wp-chatbot__input:focus,
.wp-chatbot__textarea:focus,
.wp-chatbot__send:focus-visible,
.wp-chatbot__lead-close:focus-visible,
.wp-chatbot__panel-close:focus-visible {
	outline: 2px solid #7cb7ff;
	outline-offset: 2px;
}

.wp-chatbot__panel {
	display: flex;
	flex-direction: column;
	margin-top: 14px;
	border: 1px solid var(--wp-chatbot-border);
	border-radius: 22px;
	background: var(--wp-chatbot-surface);
	box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
	overflow: hidden;
}

.wp-chatbot--global .wp-chatbot__panel {
	display: none;
}

.wp-chatbot--global.is-open .wp-chatbot__panel {
	display: flex;
}

.wp-chatbot--global.is-open .wp-chatbot__toggle {
	display: none;
}

.wp-chatbot__header {
	height: 72px !important;
	padding: 0 16px !important;
	margin: 0 !important;
	border-bottom: 1px solid #e5ebf2 !important;
	background: #ffffff !important;
	box-sizing: border-box;
}

.wp-chatbot__header-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 100%;
	min-height: 72px;
	margin: 0;
}

.wp-chatbot__header-avatar {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 50%;
	background: #edf3f8;
	overflow: hidden;
}

.wp-chatbot__header-logo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.wp-chatbot__header-copy {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	margin: 0;
}

.wp-chatbot__title,
.wp-chatbot__subtitle {
	margin: 0 !important;
	padding: 0 !important;
}

.wp-chatbot__title {
	font-size: 15px !important;
	font-weight: 700;
	line-height: 1.1 !important;
	letter-spacing: -0.01em;
	color: #162033 !important;
}

.wp-chatbot__subtitle {
	font-size: 12px !important;
	line-height: 1.2 !important;
	color: #607086 !important;
}

.wp-chatbot__panel-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 8px;
	background: #f2f5f8 !important;
	color: #5f6f82 !important;
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
	opacity: 1;
	transition: background 0.16s ease, color 0.16s ease;
}

.wp-chatbot__panel-close:hover,
.wp-chatbot__panel-close:focus-visible {
	background: #e7edf3 !important;
	color: #162033 !important;
}

.wp-chatbot__messages {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 16px 14px;
	min-height: 320px;
	max-height: min(58vh, 540px);
	overflow-y: auto;
	background: var(--wp-chatbot-bg);
}

.wp-chatbot__message {
	max-width: 84%;
	padding: 11px 13px;
	border-radius: 18px;
	line-height: 1.5;
	font-size: 14px;
	white-space: pre-line;
	word-break: break-word;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.wp-chatbot__message--bot {
	align-self: flex-start;
	border-top-left-radius: 8px;
	background: var(--wp-chatbot-surface);
	color: var(--wp-chatbot-text);
	border: 1px solid var(--wp-chatbot-border);
}

.wp-chatbot__message--user {
	align-self: flex-end;
	border-top-right-radius: 8px;
	background: var(--wp-chatbot-user);
	color: #fff;
}

.wp-chatbot__lead {
	position: relative;
	margin: 0 14px 14px;
	padding: 14px;
	border: 1px solid #d9e6ff;
	border-radius: 16px;
	background: #f7fbff;
	box-shadow: 0 8px 22px rgba(31, 111, 255, 0.08);
}

.wp-chatbot__lead-close {
	position: absolute;
	top: 10px;
	right: 10px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 4px 8px;
	background: transparent;
	color: var(--wp-chatbot-text-soft);
	transition: color 0.18s ease, opacity 0.18s ease;
	opacity: 0.75;
}

.wp-chatbot__lead-close:hover,
.wp-chatbot__lead-close:focus-visible {
	background: transparent;
	color: var(--wp-chatbot-text);
	opacity: 1;
}

.wp-chatbot__lead-title,
.wp-chatbot__lead-text {
	margin: 0;
}

.wp-chatbot__lead-title {
	padding-right: 34px;
	font-size: 15px;
	font-weight: 700;
	color: var(--wp-chatbot-text);
}

.wp-chatbot__lead-text {
	margin-top: 6px;
	color: var(--wp-chatbot-text-soft);
	font-size: 13px;
	line-height: 1.5;
}

.wp-chatbot__lead-form {
	display: grid;
	gap: 10px;
	margin-top: 14px;
}

.wp-chatbot__form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--wp-chatbot-border-soft);
	background: var(--wp-chatbot-surface);
}

.wp-chatbot__input,
.wp-chatbot__textarea {
	width: 100%;
	min-width: 0;
	padding: 11px 13px;
	border: 1px solid #d7e0ea;
	border-radius: 15px;
	background: #fff;
	color: var(--wp-chatbot-text);
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wp-chatbot__input::placeholder,
.wp-chatbot__textarea::placeholder {
	color: var(--wp-chatbot-text-dim);
}

.wp-chatbot__input:focus,
.wp-chatbot__textarea:focus {
	border-color: rgba(31, 111, 255, 0.42);
	box-shadow: 0 0 0 4px rgba(31, 111, 255, 0.12);
	background: #fff;
}

.wp-chatbot__textarea {
	min-height: 108px;
	resize: vertical;
}

.wp-chatbot__lead-feedback {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.45;
}

.wp-chatbot__lead-feedback--success {
	background: var(--wp-chatbot-success-bg);
	color: var(--wp-chatbot-success-text);
}

.wp-chatbot__lead-feedback--error {
	background: var(--wp-chatbot-error-bg);
	color: var(--wp-chatbot-error-text);
}

.wp-chatbot__send {
	border: 0;
	border-radius: 12px;
	background: #eff4fb;
	color: #31506f;
	cursor: pointer;
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: none;
	transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.wp-chatbot__send:hover,
.wp-chatbot__send:focus-visible {
	transform: none;
	background: #e6eef8;
	color: #17324d;
}

.wp-chatbot__send:disabled {
	opacity: 0.65;
	cursor: wait;
	transform: none;
	box-shadow: none;
}

.wp-chatbot__send--lead {
	justify-self: start;
}

@media (max-width: 767px) {
	.wp-chatbot--global {
		right: 10px;
		left: 10px;
		bottom: max(10px, min(var(--wp-chatbot-offset-bottom), 32px));
		width: 56px;
		align-items: flex-end;
	}

	.wp-chatbot--global.is-open {
		width: auto;
	}

	.wp-chatbot--global .wp-chatbot__toggle {
		width: 60px;
		height: 60px;
		margin-left: auto;
	}

	.wp-chatbot--global .wp-chatbot__panel {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		margin-top: 12px;
		border-right: 0;
		border-bottom: 0;
		border-left: 0;
		border-radius: 26px 26px 0 0;
		min-height: 74vh;
		max-height: 92vh;
		height: 92vh;
	}

	.wp-chatbot--shortcode .wp-chatbot__panel {
		position: relative;
		right: auto;
		bottom: auto;
		left: auto;
		min-height: 0;
		max-height: none;
	}

	.wp-chatbot__header {
		height: 72px !important;
		padding: 0 14px !important;
	}

	.wp-chatbot__header-inner {
		gap: 10px;
		min-height: 72px;
	}

	.wp-chatbot__header-avatar {
		width: 40px;
		height: 40px;
		flex-basis: 40px;
	}

	.wp-chatbot__messages {
		flex: 1 1 auto;
		min-height: 40vh;
		max-height: none;
		padding: 14px;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.wp-chatbot__lead {
		margin: 0 16px 14px;
		padding: 14px;
	}

	.wp-chatbot__form {
		flex-direction: column;
		align-items: stretch;
		padding: 12px 14px 14px;
		flex: 0 0 auto;
	}

	.wp-chatbot__message {
		max-width: 92%;
	}

	.wp-chatbot__send,
	.wp-chatbot__send--lead {
		width: 100%;
		justify-self: stretch;
	}
}

@media (max-width: 420px) {
	.wp-chatbot--global {
		right: 8px;
		left: 8px;
		bottom: 8px;
	}

	.wp-chatbot--global .wp-chatbot__panel {
		border-radius: 22px 22px 0 0;
		min-height: 78vh;
	}

	.wp-chatbot__title {
		font-size: 17px;
	}
}
