:root {
	--slcp-primary: #165dff;
	--slcp-secondary: #08b981;
	--slcp-surface: rgba(255, 255, 255, .82);
	--slcp-text: #111827;
	--slcp-muted: #667085;
	--slcp-line: rgba(17, 24, 39, .12);
	--slcp-shadow: 0 24px 80px rgba(15, 23, 42, .24);
	--slcp-radius: 24px;
	--slcp-vw: 100vw;
	--slcp-vh: 100vh;
	--slcp-edge: clamp(8px, 2.2vw, 22px);
}

.slcp-widget {
	position: fixed;
	right: max(var(--slcp-edge), env(safe-area-inset-right));
	bottom: max(var(--slcp-edge), env(safe-area-inset-bottom));
	z-index: 999999;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--slcp-text);
}

.slcp-widget[data-position="left"] {
	right: auto;
	left: max(var(--slcp-edge), env(safe-area-inset-left));
}

.slcp-launcher,
.slcp-primary,
.slcp-open-button {
	border: 0;
	cursor: pointer;
	background: linear-gradient(135deg, var(--slcp-primary), var(--slcp-secondary));
	color: #fff;
	box-shadow: var(--slcp-shadow);
}

.slcp-launcher {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 24px;
	display: grid;
	place-items: center;
	overflow: visible;
	isolation: isolate;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.slcp-launcher:hover,
.slcp-launcher:focus-visible {
	transform: translateY(-2px);
}

.slcp-widget.is-open .slcp-launcher {
	display: none;
}

.slcp-launcher::before {
	content: "";
	position: absolute;
	inset: -7px;
	z-index: -1;
	border: 2px solid rgba(8, 185, 129, .32);
	border-radius: 30px;
	opacity: .95;
	animation: slcp-live-ring 2.2s ease-out infinite;
}

.slcp-launcher[aria-expanded="true"]::before,
.slcp-launcher[aria-expanded="true"] .slcp-live-badge {
	display: none;
}

.slcp-launcher svg {
	width: 32px;
	height: 32px;
	fill: currentColor;
}

.slcp-live-badge {
	position: absolute;
	top: -14px;
	left: 50%;
	z-index: 2;
	padding: 4px 9px;
	border: 2px solid rgba(255, 255, 255, .94);
	border-radius: 999px;
	background: #08b981;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	transform: translateX(-50%);
	box-shadow: 0 10px 22px rgba(8, 185, 129, .32);
}

.slcp-status-dot {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 10px;
	height: 10px;
	border: 2px solid rgba(255, 255, 255, .95);
	border-radius: 50%;
	background: #08b981;
	box-shadow: 0 0 0 4px rgba(8, 185, 129, .18);
}

.slcp-widget[data-status="offline"] .slcp-live-badge {
	background: #64748b;
	box-shadow: 0 10px 22px rgba(100, 116, 139, .28);
}

.slcp-widget[data-status="offline"] .slcp-live-badge::before {
	content: "Offline";
}

.slcp-widget[data-status="offline"] .slcp-live-badge {
	font-size: 0;
}

.slcp-widget[data-status="offline"] .slcp-live-badge::before {
	font-size: 11px;
}

.slcp-widget[data-status="offline"] .slcp-status-dot {
	background: #94a3b8;
	box-shadow: 0 0 0 4px rgba(148, 163, 184, .18);
}

.slcp-widget[data-status="offline"] .slcp-launcher::before {
	border-color: rgba(148, 163, 184, .28);
	animation: none;
}

@keyframes slcp-live-ring {
	0% { opacity: .9; transform: scale(.92); }
	70% { opacity: 0; transform: scale(1.16); }
	100% { opacity: 0; transform: scale(1.16); }
}

.slcp-unread {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 12px;
	line-height: 22px;
}

.slcp-panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	width: min(390px, calc(var(--slcp-vw) - (var(--slcp-edge) * 2)));
	height: min(720px, calc(var(--slcp-vh) - 112px));
	max-width: calc(var(--slcp-vw) - (var(--slcp-edge) * 2));
	max-height: calc(var(--slcp-vh) - 112px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--slcp-line);
	border-radius: var(--slcp-radius);
	background: var(--slcp-surface);
	backdrop-filter: blur(22px) saturate(1.25);
	box-shadow: var(--slcp-shadow);
	transform-origin: bottom right;
	animation: slcp-pop .18s ease-out;
}

.slcp-panel[hidden],
.slcp-intake[hidden],
.slcp-chat[hidden],
.slcp-composer[hidden],
[data-slcp-file][hidden] {
	display: none !important;
}

.slcp-widget[data-position="left"] .slcp-panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

@keyframes slcp-pop {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.slcp-panel__header {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	padding: 18px;
	background: rgba(255, 255, 255, .35);
	border-bottom: 1px solid var(--slcp-line);
}

.slcp-panel__header strong,
.slcp-panel__header span {
	display: block;
}

.slcp-panel__header span {
	color: var(--slcp-muted);
	font-size: 13px;
}

.slcp-panel__header em {
	font-style: normal;
}

.slcp-panel__header i {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 7px;
	border-radius: 50%;
	background: var(--slcp-secondary);
	box-shadow: 0 0 0 4px rgba(8, 185, 129, .15);
}

.slcp-widget[data-status="offline"] .slcp-panel__header i {
	background: #94a3b8;
	box-shadow: 0 0 0 4px rgba(148, 163, 184, .18);
}

.slcp-panel__header button,
.slcp-tools button,
.slcp-composer button {
	border: 0;
	border-radius: 12px;
	background: rgba(17, 24, 39, .08);
	color: inherit;
	cursor: pointer;
}

.slcp-panel__header button {
	width: 34px;
	height: 34px;
	font-size: 22px;
	line-height: 1;
}

.slcp-panel__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 18px;
}

.slcp-fieldset {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.slcp-intake input,
.slcp-intake textarea,
.slcp-composer input {
	width: 100%;
	border: 1px solid var(--slcp-line);
	border-radius: 14px;
	background: rgba(255, 255, 255, .72);
	color: var(--slcp-text);
	font: inherit;
	padding: 12px 13px;
	box-sizing: border-box;
}

.slcp-intake textarea {
	margin-top: 10px;
	resize: vertical;
}

.slcp-consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 12px 0;
	color: var(--slcp-muted);
	font-size: 13px;
	line-height: 1.4;
}

.slcp-primary,
.slcp-open-button {
	min-height: 44px;
	border-radius: 14px;
	padding: 0 18px;
	font-weight: 700;
}

.slcp-primary {
	width: 100%;
}

.slcp-messages {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.slcp-call-host {
	display: grid;
	gap: 10px;
	margin-bottom: 10px;
}

.slcp-call-host:empty {
	display: none;
}

.slcp-message {
	max-width: 82%;
	padding: 11px 13px;
	border-radius: 16px;
	background: #fff;
	color: #111827;
	box-shadow: 0 6px 20px rgba(15, 23, 42, .08);
	line-height: 1.38;
	overflow-wrap: anywhere;
	-webkit-text-fill-color: currentColor;
}

.slcp-widget .slcp-message:not(.is-own),
.slcp-widget .slcp-message:not(.is-own) * {
	color: #111827 !important;
	-webkit-text-fill-color: #111827;
}

.slcp-message.is-own {
	align-self: flex-end;
	background: var(--slcp-primary);
	color: #fff;
	-webkit-text-fill-color: #fff;
}

.slcp-widget .slcp-message.is-own,
.slcp-widget .slcp-message.is-own * {
	color: #fff !important;
	-webkit-text-fill-color: #fff;
}

.slcp-media-preview {
	display: grid;
	gap: 10px;
	align-self: stretch;
	padding: 12px;
	border: 1px solid var(--slcp-line);
	border-radius: 16px;
	background: rgba(255, 255, 255, .72);
}

.slcp-media-preview span {
	color: var(--slcp-muted);
	font-size: 13px;
	font-weight: 700;
}

.slcp-media-preview video {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	background: #020617;
	object-fit: cover;
}

.slcp-media-preview button {
	justify-self: start;
	border: 0;
	border-radius: 10px;
	background: rgba(17, 24, 39, .1);
	color: inherit;
	cursor: pointer;
	padding: 8px 12px;
}

.slcp-call-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.slcp-media-preview .slcp-call-controls button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	min-height: 42px;
	font-weight: 700;
}

.slcp-media-preview .slcp-speaker-button {
	border: 1px solid var(--slcp-primary);
	background: transparent;
	color: var(--slcp-primary);
}

.slcp-media-preview .slcp-speaker-button.is-active {
	background: var(--slcp-primary);
	color: #fff;
}

.slcp-speaker-button svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.slcp-media-preview .slcp-end-call-button {
	background: #dc2626;
	color: #fff;
}

.slcp-typing {
	color: var(--slcp-muted);
	font-size: 13px;
	margin-top: 10px;
}

.slcp-composer {
	position: relative;
	flex: 0 0 auto;
	padding: 12px;
	border-top: 1px solid var(--slcp-line);
	background: rgba(255, 255, 255, .45);
}

.slcp-emoji-picker {
	position: absolute;
	right: 12px;
	bottom: calc(100% - 4px);
	left: 12px;
	z-index: 5;
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	padding: 9px;
	border: 1px solid var(--slcp-line);
	border-radius: 8px;
	background: var(--slcp-surface);
	box-shadow: 0 14px 34px rgba(15, 23, 42, .2);
}

.slcp-emoji-picker[hidden] {
	display: none;
}

.slcp-emoji-picker button {
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 1;
	min-height: 34px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font-size: 20px;
	line-height: 1;
}

.slcp-emoji-picker button:hover,
.slcp-emoji-picker button:focus-visible {
	background: rgba(37, 99, 235, .1);
	outline: 2px solid var(--slcp-primary);
}

.slcp-tools {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 6px;
	margin-bottom: 10px;
}

.slcp-tools button.is-locked {
	opacity: .42;
	filter: grayscale(1);
}

.slcp-tools button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	height: 54px;
	min-width: 0;
	border: 1px solid var(--slcp-line);
	border-radius: 10px;
	background: rgba(255, 255, 255, .62);
	color: var(--slcp-text);
	transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.slcp-tools button:hover,
.slcp-tools button:focus-visible {
	border-color: var(--slcp-primary);
	background: rgba(37, 99, 235, .08);
	color: var(--slcp-primary);
	outline: none;
}

.slcp-tools button:active {
	transform: translateY(1px);
}

.slcp-tools button svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: 0 0 auto;
}

.slcp-tools button span {
	display: block;
	max-width: 100%;
	overflow: hidden;
	color: inherit;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.slcp-composer form {
	display: grid;
	grid-template-columns: 1fr 42px;
	gap: 8px;
}

.slcp-composer button[type="submit"] {
	background: var(--slcp-primary);
	color: #fff;
	font-size: 20px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--slcp-surface: rgba(17, 24, 39, .84);
		--slcp-text: #f9fafb;
		--slcp-muted: #a7b0c0;
		--slcp-line: rgba(255, 255, 255, .14);
	}
	.slcp-intake input,
	.slcp-intake textarea,
	.slcp-composer input {
		background: rgba(31, 41, 55, .78);
	}
	.slcp-tools button {
		background: rgba(31, 41, 55, .72);
	}
	.slcp-widget .slcp-message:not(.is-own) {
		background: #fff;
		color: #111827 !important;
	}
}

@media (max-width: 520px) {
	.slcp-widget {
		right: max(10px, env(safe-area-inset-right));
		bottom: max(10px, env(safe-area-inset-bottom));
	}
	.slcp-widget[data-position="left"] {
		left: max(10px, env(safe-area-inset-left));
	}
	.slcp-launcher {
		width: clamp(54px, 15vw, 66px);
		height: clamp(54px, 15vw, 66px);
		border-radius: 20px;
	}
	.slcp-panel,
	.slcp-widget[data-position="left"] .slcp-panel {
		position: fixed;
		top: max(8px, env(safe-area-inset-top));
		right: max(8px, env(safe-area-inset-right));
		bottom: max(8px, env(safe-area-inset-bottom));
		left: max(8px, env(safe-area-inset-left));
		width: auto;
		height: auto;
		max-width: none;
		max-height: none;
		border-radius: clamp(14px, 4vw, 22px);
	}
	.slcp-fieldset {
		grid-template-columns: 1fr;
	}
	.slcp-panel__header {
		padding: 14px;
	}
	.slcp-panel__body {
		padding: 14px;
	}
	.slcp-tools {
		gap: 4px;
	}
	.slcp-tools button {
		height: 48px;
		padding: 0 2px;
	}
	.slcp-tools button svg {
		width: 17px;
		height: 17px;
	}
	.slcp-tools button span {
		font-size: 8.5px;
	}
}

@media (max-height: 700px) and (min-width: 521px) {
	.slcp-panel {
		bottom: 70px;
		height: calc(var(--slcp-vh) - 86px);
		max-height: calc(var(--slcp-vh) - 86px);
	}
	.slcp-panel__header,
	.slcp-panel__body {
		padding: 12px;
	}
	.slcp-composer {
		padding: 9px;
	}
	.slcp-tools {
		margin-bottom: 7px;
	}
	.slcp-tools button {
		height: 44px;
	}
}

@media (max-height: 520px) {
	.slcp-panel,
	.slcp-widget[data-position="left"] .slcp-panel {
		position: fixed;
		top: max(6px, env(safe-area-inset-top));
		right: max(6px, env(safe-area-inset-right));
		bottom: max(6px, env(safe-area-inset-bottom));
		left: max(6px, env(safe-area-inset-left));
		width: auto;
		height: auto;
		max-width: none;
		max-height: none;
	}
	.slcp-panel__header {
		padding: 9px 12px;
	}
	.slcp-panel__body {
		padding: 9px 12px;
	}
	.slcp-composer {
		padding: 7px 9px;
	}
	.slcp-tools button {
		height: 40px;
	}
	.slcp-tools button span {
		display: none;
	}
	.slcp-tools button svg {
		width: 18px;
		height: 18px;
	}
}
