.yet-support {
	--yet-bg: #ffffff;
	--yet-text: #111827;
	--yet-muted: #6b7280;
	--yet-border: rgba(17, 24, 39, 0.12);
	--yet-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
	--yet-accent: #2563eb;
	position: fixed;
	inset-block-end: max(16px, calc(env(safe-area-inset-bottom) + 12px));
	z-index: 99980;
	font-family: inherit;
	direction: rtl;
	color: var(--yet-text);
}

.yet-support--left {
	inset-inline-start: max(16px, env(safe-area-inset-left));
}

.yet-support--right {
	inset-inline-end: max(16px, env(safe-area-inset-right));
}

.yet-support *,
.yet-support *::before,
.yet-support *::after {
	box-sizing: border-box;
}

.yet-support__launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 52px;
	min-height: 52px;
	padding: 9px 14px;
	border: 0;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	box-shadow: 0 12px 30px rgba(17, 24, 39, 0.24);
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
	will-change: transform;
}

.yet-support__launcher:hover,
.yet-support__launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 16px 36px rgba(17, 24, 39, 0.3);
	outline: none;
}

.yet-support__launcher-icon {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
}

.yet-support__launcher-text {
	display: inline-block;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}

.yet-support__launcher svg,
.yet-support__minimize svg,
.yet-support__channel svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.yet-support__panel {
	position: absolute;
	inset-block-end: 64px;
	inline-size: min(360px, calc(100vw - 32px));
	max-block-size: min(620px, calc(100vh - 110px));
	overflow: auto;
	border: 1px solid var(--yet-border);
	border-radius: 22px;
	background: var(--yet-bg);
	box-shadow: var(--yet-shadow);
	transform-origin: bottom left;
	animation: yet-panel-in 180ms ease both;
}

.yet-support__offline {
	margin: 12px 12px 0;
	padding: 14px;
	border: 1px solid rgba(239, 68, 68, 0.22);
	border-radius: 16px;
	background: rgba(239, 68, 68, 0.07);
}

.yet-support__offline strong {
	display: block;
	font-size: 14px;
	line-height: 1.6;
}

.yet-support__offline span {
	display: block;
	margin-top: 4px;
	color: var(--yet-muted);
	font-size: 12px;
	line-height: 1.7;
}

.yet-support--left .yet-support__panel {
	inset-inline-start: 0;
}

.yet-support--right .yet-support__panel {
	inset-inline-end: 0;
}

.yet-support__header {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px;
	background: color-mix(in srgb, var(--yet-bg) 88%, transparent);
	backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--yet-border);
}

.yet-support__header strong,
.yet-support__widget h3,
.yet-support__channel strong {
	display: block;
	margin: 0;
	line-height: 1.4;
}

.yet-support__header span,
.yet-support__widget p,
.yet-support__channel small {
	display: block;
	color: var(--yet-muted);
	font-size: 12px;
	line-height: 1.7;
}

.yet-support__minimize {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--yet-border);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.yet-support__widgets {
	display: grid;
	gap: 12px;
	padding: 12px;
}

.yet-support__widget {
	padding: 14px;
	border: 1px solid var(--yet-border);
	border-radius: 16px;
	background: color-mix(in srgb, var(--yet-bg) 96%, #2563eb 4%);
}

.yet-support__widget-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.yet-support__widget h3 {
	font-size: 15px;
	font-weight: 800;
}

.yet-support__status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	color: var(--yet-muted);
	font-size: 11px;
	white-space: nowrap;
}

.yet-support__status span {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #ef4444;
}

.yet-support__widget.is-online .yet-support__status span {
	background: #22c55e;
}

.yet-support__operators {
	display: flex;
	align-items: center;
	margin-block: 12px 4px;
	min-height: 44px;
}

.yet-support__avatar {
	position: relative;
	display: block;
	width: 42px;
	height: 42px;
	border: 3px solid var(--yet-bg);
	border-radius: 999px;
	margin-inline-start: -10px;
	background: #f3f4f6;
	overflow: hidden;
}

.yet-support__avatar i {
	position: absolute;
	right: 0;
	bottom: 1px;
	width: 11px;
	height: 11px;
	border: 2px solid var(--yet-bg);
	border-radius: 999px;
	background: #22c55e;
}

.yet-support__avatar:first-child {
	margin-inline-start: 0;
}

.yet-support__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yet-support__operators em {
	margin-inline-start: 8px;
	color: var(--yet-muted);
	font-size: 12px;
	font-style: normal;
}

.yet-support__channels {
	display: grid;
	gap: 10px;
	margin-block-start: 12px;
}

.yet-support__channel {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 10px;
	min-height: 58px;
	width: 100%;
	padding: 10px;
	border: 1px solid color-mix(in srgb, var(--yet-channel-color, var(--yet-accent)) 26%, transparent);
	border-radius: 14px;
	background: color-mix(in srgb, var(--yet-channel-color, var(--yet-accent)) 9%, var(--yet-bg));
	color: var(--yet-text);
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.yet-support__channel:hover,
.yet-support__channel:focus-visible {
	transform: translateY(-1px);
	border-color: var(--yet-channel-color, var(--yet-accent));
	outline: none;
}

.yet-support__channel:disabled {
	cursor: not-allowed;
	opacity: 0.58;
	filter: grayscale(0.3);
}

.yet-support__channel > span {
	grid-row: 1 / 3;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--yet-channel-color, var(--yet-accent));
	color: #fff;
}

.yet-support__channel strong,
.yet-support__channel small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@keyframes yet-panel-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (prefers-color-scheme: dark) {
	.yet-support {
		--yet-bg: #111827;
		--yet-text: #f9fafb;
		--yet-muted: #cbd5e1;
		--yet-border: rgba(255, 255, 255, 0.12);
		--yet-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
	}

	.yet-support__launcher {
		background: #f9fafb;
		color: #111827;
	}
}

@media (max-width: 520px) {
	.yet-support {
		inset-inline: auto;
		inset-block-end: max(14px, calc(env(safe-area-inset-bottom) + 10px));
	}

	.yet-support__launcher {
		width: 48px;
		height: 48px;
		min-width: 48px;
		min-height: 48px;
		padding: 0;
		border-radius: 999px;
	}

	.yet-support__launcher-icon {
		width: 30px;
		height: 30px;
		flex-basis: 30px;
		background: transparent;
	}

	.yet-support__launcher-text {
		display: none;
	}

	.yet-support__panel {
		inset-inline: 0;
		inline-size: min(360px, calc(100vw - 24px));
		inset-block-end: 58px;
		max-block-size: min(76vh, 620px);
		border-radius: 20px;
	}

	.yet-support--left {
		inset-inline-start: max(12px, env(safe-area-inset-left));
	}

	.yet-support--right {
		inset-inline-end: max(12px, env(safe-area-inset-right));
	}

	.yet-support__widget-head {
		display: grid;
	}
}
