.obrat-widget-root {
	position: fixed;
	z-index: 999990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	line-height: 1.45;
	color: #1e293b;
	box-sizing: border-box;
}

.obrat-widget-root *,
.obrat-widget-root *::before,
.obrat-widget-root *::after {
	box-sizing: border-box;
}

#obrat-chat-widget-root button.obrat-launcher {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 10px;
	border: none !important;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	line-height: 1 !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	text-transform: none !important;
	letter-spacing: normal !important;
	-webkit-appearance: none;
	appearance: none;
	flex-shrink: 0;
	aspect-ratio: 1 / 1;
	overflow: visible;
}

#obrat-chat-widget-root button.obrat-launcher.obrat-launcher--has-image {
	overflow: visible;
}

.obrat-launcher-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	display: block;
}

.obrat-launcher--has-label .obrat-launcher-img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	flex-shrink: 0;
}

@keyframes obratPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.55), 0 10px 28px rgba(15, 23, 42, 0.22);
	}
	70% {
		box-shadow: 0 0 0 14px rgba(79, 70, 229, 0), 0 10px 28px rgba(15, 23, 42, 0.22);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(79, 70, 229, 0), 0 10px 28px rgba(15, 23, 42, 0.22);
	}
}

#obrat-chat-widget-root button.obrat-launcher.obrat-launcher--pulse {
	animation: obratPulse 1.6s infinite;
}

#obrat-chat-widget-root button.obrat-launcher:hover {
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
}

#obrat-chat-widget-root button.obrat-launcher.obrat-launcher--has-label {
	padding: 0 20px !important;
	width: auto !important;
	aspect-ratio: auto;
}

#obrat-chat-widget-root button.obrat-launcher svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
	flex-shrink: 0;
	display: block;
}

.obrat-launcher-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ef4444;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.obrat-chat-window {
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 500px;
	max-height: calc(100vh - 100px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
	border: 1px solid rgba(15, 23, 42, 0.08);
	margin-bottom: 14px;
	animation: obratSlideUp 0.2s ease-out;
}

@keyframes obratSlideUp {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.obrat-chat-header {
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
}

.obrat-chat-header-left {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	flex: 1;
}

.obrat-header-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	border: 2px solid rgba(255, 255, 255, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
	font-size: 15px;
	font-weight: 700;
}

.obrat-header-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.obrat-chat-header-info {
	min-width: 0;
}

.obrat-chat-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 2px 0;
}

.obrat-chat-subtitle {
	font-size: 12px;
	opacity: 0.9;
	display: flex;
	align-items: center;
	gap: 6px;
}

.obrat-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	display: inline-block;
	flex-shrink: 0;
}

.obrat-status-dot--offline {
	background: #f59e0b;
}

#obrat-chat-widget-root button.obrat-chat-close {
	background: rgba(255, 255, 255, 0.18) !important;
	border: none !important;
	color: inherit !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 18px !important;
	line-height: 1 !important;
	flex-shrink: 0 !important;
	aspect-ratio: 1 / 1;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

#obrat-chat-widget-root button.obrat-chat-close:hover {
	background: rgba(255, 255, 255, 0.3) !important;
}

.obrat-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f8fafc;
}

.obrat-msg {
	max-width: 84%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	word-wrap: break-word;
	white-space: pre-wrap;
	position: relative;
}

.obrat-msg--visitor {
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.obrat-msg--operator,
.obrat-msg--welcome {
	align-self: flex-start;
	background: #ffffff;
	color: #1e293b;
	border: 1px solid #e2e8f0;
	border-bottom-left-radius: 4px;
}

.obrat-msg-meta {
	font-size: 10px;
	opacity: 0.7;
	margin-top: 4px;
	display: block;
	text-align: right;
}

.obrat-msg-sender {
	font-size: 11px;
	font-weight: 600;
	margin-bottom: 3px;
	opacity: 0.8;
}

.obrat-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 88%;
	align-self: flex-start;
}

.obrat-msg-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #334155;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	overflow: hidden;
	flex-shrink: 0;
}

.obrat-msg-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.obrat-msg-row .obrat-msg {
	max-width: 100%;
}

.obrat-visitor-toast {
	width: 290px;
	max-width: calc(100vw - 28px);
	background: #ffffff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 11px 13px;
	margin-bottom: 12px;
	box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
	cursor: pointer;
	text-align: left;
	animation: obratSlideUp 0.2s ease-out;
}

.obrat-visitor-toast-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.obrat-visitor-toast-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #4f46e5;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	overflow: hidden;
	flex-shrink: 0;
}

.obrat-visitor-toast-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.obrat-visitor-toast-name {
	font-size: 12px;
	font-weight: 700;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#obrat-chat-widget-root button.obrat-visitor-toast-close {
	background: transparent !important;
	border: none !important;
	color: #94a3b8 !important;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: 20px !important;
	height: 20px !important;
	font-size: 16px !important;
	line-height: 1 !important;
	cursor: pointer;
	flex-shrink: 0;
}

.obrat-visitor-toast-body {
	font-size: 13px;
	color: #334155;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.obrat-chat-notice {
	font-size: 12px;
	color: #b45309;
	background: #fef3c7;
	border: 1px solid #fde68a;
	border-radius: 10px;
	padding: 8px 10px;
}

.obrat-chat-error {
	font-size: 12px;
	color: #b91c1c;
	background: #fee2e2;
	padding: 6px 12px;
	text-align: center;
}

.obrat-chat-footer {
	padding: 10px 12px;
	border-top: 1px solid #e2e8f0;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	flex-shrink: 0;
}

.obrat-chat-input {
	flex: 1;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	padding: 9px 12px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	min-height: 40px;
	max-height: 110px;
	outline: none;
	background: #ffffff;
	color: #1e293b;
}

.obrat-chat-input:focus {
	border-color: #4f46e5;
}

#obrat-chat-widget-root button.obrat-chat-send {
	width: 40px !important;
	height: 40px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	border: none !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	aspect-ratio: 1 / 1;
	line-height: 1 !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity 0.15s ease;
}

#obrat-chat-widget-root button.obrat-chat-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#obrat-chat-widget-root button.obrat-chat-send svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	display: block;
}

.obrat-chat-powered {
	text-align: center;
	font-size: 10px;
	color: #94a3b8;
	padding: 4px 8px 6px;
	background: #ffffff;
}

@media (max-width: 480px) {
	.obrat-chat-window {
		width: calc(100vw - 20px);
		height: calc(100vh - 96px);
	}
}
