.sjm-chatbot {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	font-family: inherit;
}

/* ---------- Launcher button ---------- */

.sjm-chatbot__toggle {
	position: relative;
	width: 62px;
	height: 62px;
	border-radius: 50%!important;
	border: none;
	background: linear-gradient(145deg, #a2603f, #8c4e38);
	color: #fff!important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sjm-chatbot__toggle:hover {
	transform: translateY(-2px) scale(1.04);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.sjm-chatbot__toggle:active {
	transform: scale(0.96);
}

.sjm-chatbot__toggle svg {
	width: 27px;
	height: 27px;
	position: relative;
	z-index: 1;
}

.sjm-chatbot__toggle-ping {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #a8784f;
	opacity: 0.5;
	animation: sjm-chatbot-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes sjm-chatbot-ping {
	0% { transform: scale(1); opacity: 0.5; }
	75%, 100% { transform: scale(1.7); opacity: 0; }
}

.sjm-chatbot.is-open .sjm-chatbot__toggle-ping {
	display: none;
}

.sjm-chatbot__icon-close {
	display: none;
}

.sjm-chatbot.is-open .sjm-chatbot__icon-chat {
	display: none;
}

.sjm-chatbot.is-open .sjm-chatbot__icon-close {
	display: block;
}

/* ---------- Panel ---------- */

.sjm-chatbot__panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 480px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(16px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.sjm-chatbot__panel.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.sjm-chatbot__header {
	background: linear-gradient(135deg, #a2603f, #8c4e38);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sjm-chatbot__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sjm-chatbot__avatar svg {
	width: 20px;
	height: 20px;
}

.sjm-chatbot__heading {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.sjm-chatbot__title {
	font-weight: 600;
	font-size: 15px;
}

.sjm-chatbot__status {
	font-size: 12px;
	opacity: 0.85;
	display: flex;
	align-items: center;
	gap: 5px;
}

.sjm-chatbot__status i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #6fdc7f;
	display: inline-block;
	box-shadow: 0 0 0 2px rgba(111, 220, 127, 0.3);
}

button.sjm-chatbot__close {
	background: none;
	border: none;
	color: #fff!important;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	opacity: 0.9;
}

button.sjm-chatbot__close:hover {
	opacity: 1;    background: none;
}

/* ---------- Messages ---------- */

.sjm-chatbot__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f9f5f2;
}

.sjm-chatbot__msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 15px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	animation: sjm-chatbot-msg-in 0.25s ease both;
}

@keyframes sjm-chatbot-msg-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.sjm-chatbot__msg.bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e9ded5;
	color: #292929;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sjm-chatbot__msg.user {
	align-self: flex-end;
	background: linear-gradient(135deg, #a2603f, #8c4e38);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.sjm-chatbot__msg a {
	color: #8c4e38;
	font-weight: 600;
}

.sjm-chatbot__msg.user a {
	color: #fff;
	text-decoration: underline;
}

/* ---------- Suggestion chips ---------- */

.sjm-chatbot__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-self: flex-start;
	max-width: 100%;
	animation: sjm-chatbot-msg-in 0.25s ease both;
}

button.sjm-chatbot__chip {
	border: 1px solid #e5d9d0;
	background: #fff;
	color: #8c4e38;
	border-radius: 999px;
	padding: 5px 13px;
	font-size: 12px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

button.sjm-chatbot__chip:hover {
	background: #8c4e38;
	color: #fff;
	transform: translateY(-1px);
}

/* ---------- Typing indicator ---------- */

.sjm-chatbot__typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #e9ded5;
	border-radius: 15px;
	border-bottom-left-radius: 4px;
}

.sjm-chatbot__typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #a8784f;
	animation: sjm-chatbot-bounce 1.2s infinite;
}

.sjm-chatbot__typing span:nth-child(2) { animation-delay: 0.15s; }
.sjm-chatbot__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sjm-chatbot-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Input form ---------- */

.sjm-chatbot__form {
	display: flex;
	border-top: 1px solid #e9ded5;
	padding: 10px;
	gap: 8px;
	background: #fff;
}

form.sjm-chatbot__form .sjm-chatbot__input {
	flex: 1;
	border: 1px solid #dcdcde;
	border-radius: 20px;
	padding: 10px 15px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

form.sjm-chatbot__form .sjm-chatbot__input:focus {
	border-color: #8c4e38;
	box-shadow: 0 0 0 3px rgba(168, 120, 79, 0.25);
}

button.sjm-chatbot__send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, #a2603f, #8c4e38);
	color: #fff!important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: transform 0.12s ease;
}

button.sjm-chatbot__send:hover {
	transform: scale(1.06);
}

.sjm-chatbot__send:active {
	transform: scale(0.94);
}

.sjm-chatbot__send svg {
	width: 18px;
	height: 18px;
}

@media (max-width: 480px) {
	.sjm-chatbot__panel {
		width: calc(100vw - 24px);
		right: -8px;
	}
}
