.rush-chat {
	--rush-chat-color: #111;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
}

.rush-chat__toggle {
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: var(--rush-chat-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
}

.rush-chat__panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 110px);
	background: #fff;
	color: #222;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.rush-chat__panel[hidden] {
	display: none;
}

.rush-chat__header {
	background: var(--rush-chat-color);
	color: #fff;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 600;
}

.rush-chat__close {
	background: none;
	border: 0;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.rush-chat__log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f6f6f6;
}

.rush-chat__msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 12px;
	word-wrap: break-word;
}

.rush-chat__msg--bot {
	background: #fff;
	align-self: flex-start;
	border: 1px solid #e4e4e4;
}

.rush-chat__msg--user {
	background: var(--rush-chat-color);
	color: #fff;
	align-self: flex-end;
}

.rush-chat__msg a {
	color: inherit;
	text-decoration: underline;
}

.rush-chat__typing span {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px;
	border-radius: 50%;
	background: #999;
	animation: rush-chat-blink 1.2s infinite both;
}

.rush-chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.rush-chat__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes rush-chat-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

.rush-chat__form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e4e4e4;
	margin: 0;
}

.rush-chat__input {
	flex: 1;
	resize: none;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
	min-height: 40px;
	max-height: 120px;
}

.rush-chat__send {
	border: 0;
	border-radius: 8px;
	background: var(--rush-chat-color);
	color: #fff;
	padding: 0 14px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.rush-chat__send:disabled {
	opacity: 0.5;
	cursor: default;
}

.rush-chat__note {
	font-size: 11px;
	color: #777;
	padding: 0 12px 10px;
}

.rush-chat__note a {
	color: inherit;
}

/* Bottom-left placement, so the button doesn't sit on top of other corner widgets. */
.rush-chat--left {
	right: auto;
	left: 20px;
}

.rush-chat--left .rush-chat__toggle {
	margin-left: 0;
}

.rush-chat--left .rush-chat__panel {
	right: auto;
	left: 0;
}

@media (max-width: 480px) {
	.rush-chat {
		right: 12px;
		bottom: 12px;
	}
	.rush-chat--left {
		right: auto;
		left: 12px;
	}
	.rush-chat__panel {
		position: fixed;
		inset: 12px 12px 82px 12px;
		width: auto;
		height: auto;
		max-height: none;
		max-width: none;
	}
}
