.bashcran-site-chat-root {
	--bc-sc-color: #e31e24;
	--bc-sc-color-dark: #c4191f;
	--bc-sc-tg-blue: #3390ec;
	--bc-sc-tg-green: #c8ddc4;
	--bc-sc-bottom: 24px;
	--bc-sc-side: 16px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	z-index: 99990;
	position: fixed;
	right: 0;
	bottom: 0;
	left: auto;
	pointer-events: none;
}

.bashcran-site-chat-root--left {
	right: auto;
	left: 0;
}

.bashcran-site-chat-root * {
	box-sizing: border-box;
}

.bashcran-site-chat-root.is-open {
	pointer-events: auto;
}

.bashcran-site-chat-launcher {
	pointer-events: auto;
	position: fixed;
	right: var(--bc-sc-side);
	bottom: var(--bc-sc-bottom);
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px 14px 18px;
	background: linear-gradient(145deg, var(--bc-sc-color) 0%, var(--bc-sc-color-dark) 100%);
	color: #fff;
	border: none;
	border-radius: 28px 0 0 28px;
	box-shadow:
		0 4px 24px rgba(0, 0, 0, 0.18),
		0 0 0 1px rgba(255, 255, 255, 0.12) inset;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	max-width: min(360px, calc(100vw - 16px));
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.bashcran-site-chat-root--left .bashcran-site-chat-launcher {
	right: auto;
	left: var(--bc-sc-side);
	border-radius: 0 28px 28px 0;
	padding: 14px 18px 14px 20px;
}

.bashcran-site-chat-root--round .bashcran-site-chat-launcher {
	right: var(--bc-sc-side);
	left: auto;
	width: 56px;
	height: 56px;
	padding: 0;
	border-radius: 50%;
	justify-content: center;
	max-width: none;
}

.bashcran-site-chat-root--left.bashcran-site-chat-root--round .bashcran-site-chat-launcher {
	left: var(--bc-sc-side);
	right: auto;
}

.bashcran-site-chat-launcher:hover {
	transform: translateY(-2px);
	box-shadow:
		0 8px 28px rgba(0, 0, 0, 0.22),
		0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.bashcran-site-chat-launcher__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: #fff;
	color: var(--bc-sc-color);
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bashcran-site-chat-root--left .bashcran-site-chat-launcher__badge {
	right: auto;
	left: -4px;
}

.bashcran-site-chat-root--round .bashcran-site-chat-launcher {
	position: fixed;
}

.bashcran-site-chat-root--round .bashcran-site-chat-launcher__badge {
	top: -2px;
	right: -2px;
}

.bashcran-site-chat-launcher__icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	display: inline-flex;
}

.bashcran-site-chat-launcher__icon svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
}

.bashcran-site-chat-panel {
	pointer-events: auto;
	position: fixed;
	right: var(--bc-sc-side);
	bottom: var(--bc-sc-bottom);
	width: min(400px, calc(100vw - 24px));
	height: min(520px, calc(100vh - 32px));
	min-height: 360px;
	max-height: calc(100vh - 16px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.06),
		0 16px 56px rgba(15, 23, 42, 0.22);
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.96);
	visibility: hidden;
	transition:
		opacity 0.22s ease,
		transform 0.22s ease,
		visibility 0.22s;
}

.bashcran-site-chat-root--left .bashcran-site-chat-panel {
	right: auto;
	left: var(--bc-sc-side);
}

.bashcran-site-chat-root.is-open .bashcran-site-chat-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	visibility: visible;
}

.bashcran-site-chat-root.is-open .bashcran-site-chat-launcher {
	display: none;
}

.bashcran-site-chat-header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: linear-gradient(145deg, var(--bc-sc-color) 0%, var(--bc-sc-color-dark) 100%);
	color: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
	cursor: move;
	user-select: none;
	touch-action: none;
}

.bashcran-site-chat-panel--custom-pos {
	right: auto;
	bottom: auto;
}

.bashcran-site-chat-panel--resizing {
	transition: none;
}

.bashcran-site-chat-resize {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 16px;
	cursor: ns-resize;
	touch-action: none;
	user-select: none;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.02));
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.bashcran-site-chat-body {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bashcran-site-chat-resize::before {
	content: '';
	display: block;
	width: 40px;
	height: 4px;
	border-radius: 999px;
	background: rgba(100, 116, 139, 0.35);
	box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2);
	transition:
		width 0.15s ease,
		background 0.15s ease;
}

.bashcran-site-chat-resize:hover::before,
.bashcran-site-chat-resize:focus-visible::before,
.bashcran-site-chat-panel--resizing .bashcran-site-chat-resize::before {
	width: 52px;
	background: color-mix(in srgb, var(--bc-sc-tg-blue) 55%, #94a3b8);
}

.bashcran-site-chat-resize:focus-visible {
	outline: none;
}

body.bashcran-site-chat-dragging,
body.bashcran-site-chat-resizing {
	user-select: none;
}

body.bashcran-site-chat-dragging {
	cursor: move;
}

body.bashcran-site-chat-resizing {
	cursor: ns-resize;
}

.bashcran-site-chat-header__title {
	font-size: 15px;
	font-weight: 600;
	margin: 0;
	padding-right: 8px;
	line-height: 1.35;
}

.bashcran-site-chat-close {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.bashcran-site-chat-close:hover {
	background: rgba(255, 255, 255, 0.32);
}

.bashcran-site-chat-offline {
	flex-shrink: 0;
	padding: 10px 14px;
	background: #fff8e6;
	color: #8a6d00;
	font-size: 13px;
	line-height: 1.4;
	border-bottom: 1px solid #f0e6c8;
}

.bashcran-site-chat-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 14px 12px 10px;
	background-color: var(--bc-sc-tg-green);
	background-image:
		radial-gradient(ellipse 120% 70% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
		radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.2) 0 1px, transparent 1.2px),
		radial-gradient(circle at 68% 48%, rgba(255, 255, 255, 0.14) 0 1px, transparent 1.2px);
	background-size:
		100% 100%,
		48px 48px,
		56px 56px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	scroll-behavior: smooth;
}

.bashcran-site-chat-msg {
	display: flex;
	gap: 8px;
	max-width: 88%;
	animation: bashcran-sc-msg-in 0.22s ease;
}

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

.bashcran-site-chat-msg--bot,
.bashcran-site-chat-msg--operator {
	align-self: flex-start;
}

.bashcran-site-chat-msg--visitor {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.bashcran-site-chat-msg__avatar {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.bashcran-site-chat-msg__bubble {
	padding: 9px 12px 8px;
	border-radius: 14px;
	background: #fff;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.9) inset,
		0 1px 2px rgba(15, 23, 42, 0.06);
	font-size: 14px;
	line-height: 1.45;
	color: #111827;
	word-break: break-word;
}

.bashcran-site-chat-msg__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	opacity: 0.65;
	margin-bottom: 4px;
}

.bashcran-site-chat-msg--visitor .bashcran-site-chat-msg__bubble {
	background: linear-gradient(180deg, #62b0f0 0%, var(--bc-sc-tg-blue) 55%, #2b7cd3 100%);
	color: #fff;
	border-bottom-right-radius: 4px;
	box-shadow: 0 2px 10px rgba(43, 124, 211, 0.28);
}

.bashcran-site-chat-msg--visitor .bashcran-site-chat-msg__label {
	opacity: 0.88;
	color: rgba(255, 255, 255, 0.92);
}

.bashcran-site-chat-msg--bot .bashcran-site-chat-msg__bubble,
.bashcran-site-chat-msg--operator .bashcran-site-chat-msg__bubble {
	border-bottom-left-radius: 4px;
}

.bashcran-site-chat-msg__time {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	opacity: 0.55;
	text-align: right;
}

.bashcran-site-chat-msg--visitor .bashcran-site-chat-msg__time {
	opacity: 0.82;
	color: rgba(255, 255, 255, 0.9);
}

.bashcran-site-chat-contact {
	flex-shrink: 0;
	padding: 10px 14px;
	background: #fff;
	border-top: 1px solid #e8e8e8;
}

.bashcran-site-chat-contact summary {
	cursor: pointer;
	font-size: 13px;
	color: #666;
	user-select: none;
}

.bashcran-site-chat-contact__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 10px;
}

.bashcran-site-chat-contact__fields input[type='email'] {
	grid-column: 1 / -1;
}

.bashcran-site-chat-contact__fields input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 13px;
}

.bashcran-site-chat-contact__save {
	margin-top: 8px;
	padding: 6px 12px;
	border: none;
	border-radius: 8px;
	background: #eee;
	font-size: 13px;
	cursor: pointer;
}

.bashcran-site-chat-contact__status {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: #2e7d32;
}

.bashcran-site-chat-compose {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 10px 10px;
	background: #fff;
	border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.bashcran-site-chat-attach {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #94a3b8;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0.45;
	pointer-events: none;
}

.bashcran-site-chat-attach svg {
	width: 22px;
	height: 22px;
}

.bashcran-site-chat-compose textarea {
	flex: 1;
	height: 42px;
	min-height: 42px;
	max-height: 42px;
	padding: 10px 14px;
	border: 1px solid rgba(148, 163, 184, 0.45);
	border-radius: 22px;
	resize: none;
	overflow-y: hidden;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.35;
	background: #f8fafc;
	transition:
		border-color 0.15s ease,
		background 0.15s ease,
		box-shadow 0.15s ease;
}

.bashcran-site-chat-compose textarea:disabled {
	background: #f5f5f5;
	opacity: 0.7;
}

.bashcran-site-chat-compose textarea:focus {
	outline: none;
	border-color: color-mix(in srgb, var(--bc-sc-tg-blue) 65%, #94a3b8);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.14);
}

.bashcran-site-chat-send {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: linear-gradient(180deg, #62b0f0 0%, var(--bc-sc-tg-blue) 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(51, 144, 236, 0.35);
	transition:
		transform 0.12s ease,
		box-shadow 0.15s ease;
}

.bashcran-site-chat-send:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(51, 144, 236, 0.42);
}

.bashcran-site-chat-send:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.bashcran-site-chat-send svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

@media (max-width: 480px) {
	.bashcran-site-chat-panel {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100vw;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
	}

	.bashcran-site-chat-root--left .bashcran-site-chat-panel {
		left: 0;
	}

	.bashcran-site-chat-launcher {
		bottom: 16px;
		font-size: 14px;
		padding: 12px 16px 12px 14px;
	}

	.bashcran-site-chat-root--round .bashcran-site-chat-launcher {
		bottom: var(--bc-sc-bottom);
	}
}
