/* ANI Networking chat widget */

.ani-chat {
	--ani-accent: #0b6fb4;
	--ani-accent-dark: #095a92;
	--ani-surface: #ffffff;
	--ani-text: #1c2530;
	--ani-muted: #667585;
	--ani-line: #e3e8ee;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--ani-text);
}

/* Launcher ------------------------------------------------------------ */

.ani-chat__launch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--ani-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(11, 111, 180, 0.32);
	transition: background 0.15s ease, transform 0.15s ease;
}

.ani-chat__launch:hover {
	background: var(--ani-accent-dark);
	transform: translateY(-1px);
}

.ani-chat__launch:focus-visible {
	outline: 3px solid #ffb020;
	outline-offset: 2px;
}

.ani-chat__launch-icon {
	font-size: 18px;
}

.ani-chat.is-open .ani-chat__launch {
	display: none;
}

/* Panel --------------------------------------------------------------- */

.ani-chat__panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: var(--ani-surface);
	border: 1px solid var(--ani-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 18px 48px rgba(16, 33, 51, 0.22);
}

.ani-chat__panel[hidden] {
	display: none;
}

.ani-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--ani-accent);
	color: #fff;
}

.ani-chat__header strong {
	display: block;
	font-size: 15px;
}

.ani-chat__header span {
	display: block;
	font-size: 12px;
	opacity: 0.85;
}

.ani-chat__close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	padding: 0 4px;
	cursor: pointer;
	border-radius: 6px;
}

.ani-chat__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Log ----------------------------------------------------------------- */

.ani-chat__log {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f9fb;
}

.ani-msg {
	display: flex;
}

.ani-msg--user {
	justify-content: flex-end;
}

.ani-msg__body {
	max-width: 84%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.ani-msg--bot .ani-msg__body {
	background: #fff;
	border: 1px solid var(--ani-line);
	border-bottom-left-radius: 4px;
}

.ani-msg--user .ani-msg__body {
	background: var(--ani-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

/* Typing indicator ---------------------------------------------------- */

.ani-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px;
	border-radius: 50%;
	background: var(--ani-muted);
	animation: ani-bounce 1.2s infinite ease-in-out;
}

.ani-dot:nth-child(2) { animation-delay: 0.15s; }
.ani-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes ani-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
	30%           { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ani-dot { animation: none; }
	.ani-chat__launch { transition: none; }
}

/* Quick replies ------------------------------------------------------- */

.ani-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 2px 0 2px;
}

.ani-chip {
	display: inline-block;
	padding: 7px 12px;
	border: 1px solid var(--ani-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--ani-accent);
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.ani-chip:hover {
	background: var(--ani-accent);
	color: #fff;
}

.ani-chip:focus-visible {
	outline: 2px solid var(--ani-accent);
	outline-offset: 2px;
}

.ani-chip--call {
	border-color: #1c7c3c;
	color: #1c7c3c;
	font-weight: 600;
}

.ani-chip--call:hover {
	background: #1c7c3c;
	color: #fff;
}

/* Honeypot — hidden from people, present for form-fillers -------------- */

.ani-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ani-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Turnstile (only rendered if keys are configured) --------------------- */

.ani-chat__turnstile:not(:empty) {
	padding: 8px 16px 0;
	background: var(--ani-surface);
}

/* Form ---------------------------------------------------------------- */

.ani-chat__form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid var(--ani-line);
	position: relative;
	background: var(--ani-surface);
}

.ani-chat__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--ani-line);
	border-radius: 8px;
	font: inherit;
	color: var(--ani-text);
	background: #fff;
}

.ani-chat__input:focus {
	outline: 2px solid var(--ani-accent);
	outline-offset: -1px;
	border-color: var(--ani-accent);
}

.ani-chat__input:disabled {
	background: #f2f4f7;
}

.ani-chat__send {
	flex: 0 0 auto;
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--ani-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ani-chat__send:hover:not(:disabled) {
	background: var(--ani-accent-dark);
}

.ani-chat__send:disabled {
	opacity: 0.55;
	cursor: default;
}

/* Small screens ------------------------------------------------------- */

@media (max-width: 480px) {
	.ani-chat {
		right: 12px;
		bottom: 12px;
		left: 12px;
	}

	.ani-chat__panel {
		width: 100%;
		height: min(78vh, 560px);
	}
}
