#hinvi-chat {
	--hc-color: #0f4c81;
	--hc-bg: #ffffff;
	--hc-text: #1f2a33;
	--hc-muted: #6b7680;
	--hc-bot: #f1f4f8;
	--hc-border: #e3e8ee;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--hc-text);
}
@media (prefers-color-scheme: dark) {
	#hinvi-chat {
		--hc-bg: #1b2127;
		--hc-text: #e8edf2;
		--hc-muted: #9aa6b2;
		--hc-bot: #262e36;
		--hc-border: #323b44;
	}
}
#hinvi-chat * { box-sizing: border-box; }

#hinvi-chat .hc-launcher {
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--hc-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: transform .15s ease;
}
#hinvi-chat .hc-launcher:hover { transform: scale(1.06); }
#hinvi-chat .hc-launcher svg { width: 28px; height: 28px; }
#hinvi-chat .hc-ico-close,
#hinvi-chat.hc-is-open .hc-ico-chat { display: none; }
#hinvi-chat.hc-is-open .hc-ico-close { display: block; }

#hinvi-chat .hc-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 370px;
	height: min(560px, calc(100vh - 120px));
	background: var(--hc-bg);
	border: 1px solid var(--hc-border);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
#hinvi-chat .hc-panel[hidden] { display: none; }

#hinvi-chat .hc-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 12px 14px 16px;
	background: var(--hc-color);
	color: #fff;
}
#hinvi-chat .hc-head strong { flex: 1; font-size: 15px; color: #fff; }
#hinvi-chat .hc-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; }
#hinvi-chat .hc-head button {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	opacity: .85;
}
#hinvi-chat .hc-head button:hover { opacity: 1; }
#hinvi-chat .hc-head .hc-reset { font-size: 18px; }

#hinvi-chat .hc-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
#hinvi-chat .hc-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
#hinvi-chat .hc-assistant { align-self: flex-start; background: var(--hc-bot); border-bottom-left-radius: 4px; }
#hinvi-chat .hc-user { align-self: flex-end; background: var(--hc-color); color: #fff; border-bottom-right-radius: 4px; }
#hinvi-chat .hc-msg a { color: inherit; text-decoration: underline; }

#hinvi-chat .hc-typing { display: flex; gap: 4px; padding: 14px; }
#hinvi-chat .hc-typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--hc-muted);
	animation: hc-blink 1.2s infinite ease-in-out;
}
#hinvi-chat .hc-typing span:nth-child(2) { animation-delay: .2s; }
#hinvi-chat .hc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes hc-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

#hinvi-chat .hc-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--hc-border);
	margin: 0;
}
#hinvi-chat .hc-form textarea {
	flex: 1;
	resize: none;
	border: 1px solid var(--hc-border);
	border-radius: 10px;
	padding: 9px 11px;
	font: inherit;
	color: var(--hc-text);
	background: var(--hc-bg);
	min-height: 40px;
	max-height: 120px;
	margin: 0;
}
#hinvi-chat .hc-form textarea:focus { outline: 2px solid var(--hc-color); outline-offset: -1px; }
#hinvi-chat .hc-form button {
	width: 40px; height: 40px;
	flex: none;
	border: 0;
	border-radius: 10px;
	background: var(--hc-color);
	color: #fff;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	padding: 0;
}
#hinvi-chat .hc-form button:disabled { opacity: .5; cursor: wait; }
#hinvi-chat .hc-form button svg { width: 20px; height: 20px; }

#hinvi-chat .hc-legal {
	margin: 0;
	padding: 0 14px 10px;
	font-size: 11px;
	color: var(--hc-muted);
	line-height: 1.35;
}
#hinvi-chat .hc-legal a { color: var(--hc-muted); }

@media (max-width: 480px) {
	#hinvi-chat { right: 16px; bottom: 16px; }
	#hinvi-chat .hc-panel {
		position: fixed;
		inset: 0;
		width: auto;
		height: auto;
		border-radius: 0;
		border: 0;
	}
	#hinvi-chat.hc-is-open .hc-launcher { display: none; }
}
