#cf-widget-wrap {
	position: fixed;
	z-index: 99999;
	font-family: var(--cf-w-font, inherit);
}

#cf-widget-wrap.pos-bottom-left {
	bottom: 24px;
	left: 24px;
}

#cf-widget-wrap *, #cf-widget-wrap *::before, #cf-widget-wrap *::after {
	box-sizing: border-box;
}

#cf-widget-wrap {
	--cf-w-accent: var(--cf-accent-color, #6366f1);
	--cf-w-bg: var(--cf-bg-color, #fff);
	--cf-w-text: var(--cf-text-color, #1a1a2e);
	--cf-w-btn: var(--cf-btn-color, #6366f1);
	--cf-w-btn-text: var(--cf-btn-text-color, #fff);
	--cf-w-surface: #f8f9fc;
	--cf-w-border: #e2e6f0;
	--cf-w-muted: #9ca3af;
	--cf-w-user-bg: #f0f0ff;
	--cf-w-user-text: #1a1a2e;
	--cf-w-radius: var(--cf-border-radius-val, 12px);
	--cf-w-shadow: 0 20px 60px rgba(0, 0, 0, .15), 0 4px 16px rgba(0, 0, 0, .08);
}

#cf-trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--cf-w-btn);
	color: var(--cf-w-btn-text);
	border: none;
	padding: 12px 20px 12px 14px;
	border-radius: 50px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
	transition: all .25s ease;
	font-family: inherit;
}

#cf-trigger:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
}

.cf-trigger-icon {
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, .2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#cf-panel {
	position: fixed;
	width: 390px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 110px);
	background: var(--cf-w-bg);
	border: 1px solid var(--cf-w-border);
	border-radius: var(--cf-w-radius);
	box-shadow: var(--cf-w-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: cfSlideIn .3s cubic-bezier(.34, 1.56, .64, 1);
}

#cf-panel[hidden] {
	display: none;
}

.pos-bottom-left  #cf-panel {
	bottom: 90px;
	left: 24px;
}

@keyframes cfSlideIn {
	from {
		opacity: 0;
		transform: translateY(20px) scale(.95);
	}
	
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.radius-rounded   #cf-panel {
	border-radius: 16px;
}

.cf-w-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--cf-w-accent);
	flex-shrink: 0;
}

.cf-w-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cf-w-avatar {
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, .2);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 18px;
	overflow: hidden;
}

.cf-w-name {
	font-size: 14px;
	font-weight: 700;
	color: white;
	letter-spacing: .02em;
}

.cf-w-status {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 2px;
}

.cf-w-dot {
	width: 7px;
	height: 7px;
	background: #4ade80;
	border-radius: 50%;
	animation: cfPulse 2s ease infinite;
}

@keyframes cfPulse {
	0%, 100% {
		opacity: 1;
	}
	
	50% {
		opacity: .5;
	}
}

.cf-w-status-text {
	font-size: 11px;
	color: rgba(255, 255, 255, .8);
}

.cf-w-header-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cf-w-close {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	opacity: .7;
	transition: opacity .2s;
}

.cf-w-close:hover {
	opacity: 1;
}

.cf-w-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.cf-w-msgs::-webkit-scrollbar {
	width: 4px;
}

.cf-w-msgs::-webkit-scrollbar-thumb {
	background: var(--cf-w-border);
	border-radius: 4px;
}

@keyframes cfMsgIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cfDot {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: .4;
	}
	
	30% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

.cf-w-input-area {
	padding: 10px 14px;
	border-top: 1px solid var(--cf-w-border);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cf-w-opts {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.cf-w-free-row {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.cf-w-free-input {
	flex: 1;
	background: var(--cf-w-surface);
	border: 1.5px solid var(--cf-w-border);
	color: var(--cf-w-text);
	padding: 9px 13px;
	border-radius: 12px;
	font-size: 13px;
	font-family: inherit;
	outline: none;
	resize: none;
	min-height: 38px;
	max-height: 90px;
	line-height: 1.4;
	transition: border-color .2s;
}

.cf-w-free-input::placeholder {
	color: var(--cf-w-muted);
}

.cf-w-free-input:focus {
	border-color: var(--cf-w-accent);
}

.cf-w-send-btn {
	background: var(--cf-w-btn);
	border: none;
	color: var(--cf-w-btn-text);
	width: 38px;
	height: 38px;
	border-radius: 10px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all .2s;
}

.cf-w-send-btn:hover {
	filter: brightness(1.1);
}

.cf-w-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	border-top: 1px solid var(--cf-w-border);
	flex-shrink: 0;
}

.cf-w-powered {
	font-size: 10px;
	color: var(--cf-w-muted);
}

.cf-w-powered a {
	color: var(--cf-w-accent);
	text-decoration: none;
	font-weight: 600;
}

.cf-w-powered a:hover {
	text-decoration: underline;
}

@media (max-width:480px) {
	#cf-panel {
		right: 8px !important;
		left: 8px !important;
		bottom: 80px !important;
		width: calc(100vw - 16px) !important;
		height: calc(100vh - 96px) !important;
		max-height: none !important;
	}
}