:root {
	--treelike-bg: rgba(15, 15, 25, 0.85);
	--treelike-border: rgba(255, 255, 255, 0.12);
	--treelike-text: #f0f0f0;
	--treelike-text-muted: rgba(255, 255, 255, 0.6);
	--treelike-user-bubble: rgba(106, 168, 255, 0.3);
	/* Orbe harmonisée palette galaxie : bleu doux + doré chaud */
	--treelike-orb-gold: #ffd8a8;
	--treelike-orb-blue: #86b5ff;
	--treelike-bot-bubble: rgba(255, 255, 255, 0.06);
	--treelike-radius: 20px;
	--treelike-margin: 24px;
	--treelike-panel-width: clamp(380px, 30vw, 520px);
}

.treelike-chatbot {
	position: fixed;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--treelike-text);
	--treelike-orb-anchor-x: calc(100% - 28px);
	--treelike-orb-anchor-y: 100%;
}

/* Taille fermée pilotée par JS (launcher en absolute) */
.treelike-chatbot:not(.is-open) {
	min-width: 56px;
	min-height: 56px;
}

.treelike-chatbot--bottom-left {
	--treelike-orb-anchor-x: 28px;
}

.treelike-chatbot--bottom-right {
	right: var(--treelike-margin);
	bottom: var(--treelike-margin);
}

.treelike-chatbot--bottom-left {
	left: var(--treelike-margin);
	bottom: var(--treelike-margin);
}

/* Rond du lanceur (56 px). La bulle d'accroche est en dehors du flux. */
.treelike-chat-launcher {
	position: absolute;
	bottom: 0;
	right: 0;
	z-index: 2;
	display: block;
	width: 56px;
	height: 56px;
	min-height: 56px;
	background: none;
	border: 0;
	box-shadow: none;
	overflow: visible;
}

.treelike-chatbot--bottom-left .treelike-chat-launcher {
	right: auto;
	left: 0;
}

.treelike-chat-hook {
	position: absolute;
	bottom: calc(100% + 16px);
	right: 0;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 4px;
	row-gap: 8px;
	width: min(300px, calc(100vw - 32px));
	box-sizing: border-box;
	padding: 12px;
	background: #fff;
	color: #1a1a1a;
	border-radius: 14px;
	/* drop-shadow (et non box-shadow) : l'ombre épouse aussi la queue de bulle. */
	filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.14));
	opacity: 0;
	transform: translateY(8px);
}

/* Queue de bulle de BD : petit triangle sous la bulle, pointe vers le centre du rond du lanceur. */
.treelike-chat-hook::after {
	content: "";
	position: absolute;
	top: calc(100% - 1px);
	right: 39px;
	width: 24px;
	height: 16px;
	background: #fff;
	clip-path: polygon(0 0, 100% 0, 100% 100%);
	pointer-events: none;
}

.treelike-chatbot--bottom-left .treelike-chat-hook {
	right: auto;
	left: 0;
}

.treelike-chatbot--bottom-left .treelike-chat-hook::after {
	right: auto;
	left: 39px;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.treelike-chat-hook.is-visible {
	animation: treelike-hook-in 200ms ease forwards;
}

.treelike-chat-hook[hidden] {
	display: none;
}

.treelike-chat-hook__text {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
	padding-right: 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: #1a1a1a;
}

.treelike-chat-hook__pills {
	grid-column: 1 / -1;
	grid-row: 2;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
}

.treelike-chat-hook__pill {
	box-sizing: border-box;
	width: 100%;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: #f4f6f8;
	color: #1a1a1a;
	border-radius: 20px;
	padding: 10px 14px;
	min-height: 40px;
	font-size: 13px;
	line-height: 1.3;
	text-align: center;
	white-space: normal;
	cursor: pointer;
}

.treelike-chat-hook__pill:hover {
	filter: brightness(0.97);
}

.treelike-chat-hook__dismiss {
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	justify-self: end;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #5c6570;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.treelike-chat-hook__dismiss:hover {
	color: #1a1a1a;
}

.treelike-chatbot.is-open .treelike-chat-hook {
	display: none;
}

@keyframes treelike-hook-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 480px) {
	.treelike-chat-hook {
		display: none !important;
	}
}

.treelike-chatbot--bottom-left .treelike-chat-launcher {
	right: auto;
	left: 0;
}

.treelike-chat-launcher:hover .treelike-chat-toggle {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.treelike-chatbot.is-open .treelike-chat-launcher {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.treelike-chat-toggle {
	position: relative;
	width: 56px;
	height: 56px;
	min-width: 56px;
	border: 0;
	border-radius: 50%;
	background: var(--accent-color);
	color: var(--launcher-icon, #ffffff);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	flex-shrink: 0;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.treelike-chat-bubble {
	display: block;
}

.treelike-chat-online {
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 2px #fff;
	pointer-events: none;
}

.treelike-chat-toggle:focus:not(:focus-visible) {
	outline: none;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.treelike-chat-toggle:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 3px;
	box-shadow: none;
}

.treelike-chat-hook__dismiss:focus:not(:focus-visible),
.treelike-chat-hook__pill:focus:not(:focus-visible),
.chat-close:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

.treelike-chat-hook__dismiss:focus-visible,
.treelike-chat-hook__pill:focus-visible,
.chat-close:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 3px;
}

.treelike-chat-hook__dismiss:focus-visible {
	border-radius: 50%;
}

.treelike-chat-hook__pill:focus-visible {
	border-radius: 20px;
}

.chat-close:focus-visible {
	border-radius: 50%;
}

.glass-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--treelike-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--treelike-border);
	overflow: hidden;
	/* The panel is never a scroll container: only the thread scrolls. */
	overflow: clip;
	opacity: 0;
	pointer-events: none;
	box-sizing: border-box;
}

.glass-panel.is-visible {
	opacity: 1;
	pointer-events: auto;
}

@media (min-width: 481px) {
	.treelike-chatbot.is-open {
		width: 56px;
		height: 56px;
		pointer-events: none;
	}

	.glass-panel {
		position: fixed;
		z-index: 99999;
		top: var(--wp-admin--admin-bar--height, 0px);
		bottom: 0;
		height: auto;
		width: var(--treelike-panel-width);
		max-width: 100vw;
		border-radius: 0;
		opacity: 1;
		transition: transform 220ms ease;
	}

	.treelike-chatbot--bottom-right .glass-panel {
		right: 0;
		left: auto;
		border-left: 1px solid rgba(255, 255, 255, 0.16);
		border-right: 0;
		box-shadow: -16px 0 40px rgba(0, 0, 0, 0.28);
		transform: translateX(100%);
	}

	.treelike-chatbot--bottom-left .glass-panel {
		left: 0;
		right: auto;
		border-right: 1px solid rgba(255, 255, 255, 0.16);
		border-left: 0;
		box-shadow: 16px 0 40px rgba(0, 0, 0, 0.28);
		transform: translateX(-100%);
	}

	.treelike-chatbot--bottom-right .glass-panel.is-visible,
	.treelike-chatbot--bottom-left .glass-panel.is-visible {
		transform: translateX(0);
	}

	.treelike-chatbot--bottom-right .glass-panel.is-visible.is-closing {
		transform: translateX(100%);
		pointer-events: none;
	}

	.treelike-chatbot--bottom-left .glass-panel.is-visible.is-closing {
		transform: translateX(-100%);
		pointer-events: none;
	}

	.glass-panel.is-instant,
	.glass-panel.is-instant.is-visible,
	.glass-panel.is-instant.is-closing {
		transition: none !important;
	}
}

@media (min-width: 481px) and (max-width: 1024px) {
	.treelike-chatbot {
		--treelike-panel-width: min(420px, 100vw);
	}
}

@media (min-width: 1025px) {
	.treelike-chatbot {
		--treelike-panel-width: min(700px, calc(100vw - 48px));
	}

	.chat-message,
	.chat-consent {
		max-width: 96%;
	}

	.chat-cta {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

#treelike-chat-window[hidden] {
	display: none !important;
}

.chat-header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--accent-color);
	color: var(--launcher-icon, #ffffff);
	transition: opacity 0.25s ease;
}

.chat-header-icon .treelike-chat-bubble {
	width: 18px;
	height: 18px;
}

.chat-header-icon.is-thinking {
	animation: treelike-header-pulse 0.75s ease-in-out infinite;
	will-change: opacity, transform;
}

.chat-header-icon.is-responding {
	opacity: 0.85;
}

@keyframes treelike-header-pulse {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.35;
		transform: scale(0.9);
	}
}

.chat-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--treelike-border);
	flex-shrink: 0;
}

.chat-header-text {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.chat-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.chat-subtitle {
	font-size: 12px;
	color: var(--treelike-text-muted);
}

.chat-test-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-top: 4px;
}

.chat-test-badge {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 999px;
	background: #b45309;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.4;
	width: fit-content;
}

.chat-test-reset {
	border: 0;
	background: transparent;
	color: var(--treelike-text-muted);
	font-size: 10px;
	line-height: 1.4;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}

.chat-test-reset:hover,
.chat-test-reset:focus-visible {
	color: var(--treelike-text);
}

.chat-test-reset:disabled {
	opacity: 0.55;
	cursor: wait;
}

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

.chat-erase {
	align-self: flex-start;
	margin: 4px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #f0f0f0;
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	text-align: left;
	text-decoration: underline;
	cursor: pointer;
}

.chat-erase:hover,
.chat-erase:focus-visible {
	color: var(--treelike-text);
}

.chat-erase:disabled {
	opacity: 0.55;
	cursor: wait;
}

.chat-close {
	width: 32px;
	height: 32px;
	min-width: 32px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: var(--treelike-text);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	position: relative;
	z-index: 2;
}

.chat-close:hover {
	background: rgba(255, 255, 255, 0.14);
}

.chat-messages {
	flex: 1;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.chat-messages > * {
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.chat-message {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.6;
	word-break: break-word;
	white-space: pre-wrap;
}

.chat-message--bot {
	align-self: flex-start;
	background: var(--treelike-bot-bubble);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-sources {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--treelike-text-muted);
	white-space: normal;
}

.chat-sources a {
	color: inherit;
}

/* Typing indicator: bot bubble with three dots in the accent color. */
.chat-typing {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	white-space: normal;
}

.chat-typing-dots {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 22px;
}

.chat-typing-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent-color);
	opacity: 0.35;
	animation: treelike-typing-dot 1.2s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

.chat-typing-note {
	font-size: 12px;
	line-height: 1.4;
	opacity: 0.7;
	transition: opacity 160ms ease;
}

.chat-typing-note.is-fading {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.chat-typing-note {
		transition: none;
	}
}

/* Read by screen readers only. */
.chat-typing-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@keyframes treelike-typing-dot {
	0%,
	60%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	30% {
		opacity: 1;
		transform: translateY(-4px);
	}
}

.chat-suggested {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 4px;
}

.chat-suggested__question {
	font: inherit;
	font-size: 13px;
	line-height: 1.3;
	color: var(--accent-color, #6aa8ff);
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 6px 12px;
	cursor: pointer;
	text-align: left;
	max-width: 100%;
}

.chat-suggested__question:focus-visible {
	outline: 2px solid var(--accent-color, #6aa8ff);
	outline-offset: 2px;
}

.chat-message--user {
	align-self: flex-end;
	background: color-mix(in srgb, var(--accent-color) 30%, transparent);
	border: 1px solid color-mix(in srgb, var(--accent-color) 35%, transparent);
}

.chat-message a {
	color: var(--accent-color);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.chat-message a:hover,
.chat-message a:focus-visible {
	opacity: 0.85;
}

.chat-message--user a {
	color: inherit;
	font-weight: 600;
}

.chat-input-area {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	flex-shrink: 0;
	padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--treelike-border);
}

#treelike-input {
	box-sizing: border-box;
	flex: 1;
	min-width: 0;
	resize: none;
	overflow-y: hidden;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--treelike-text);
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	min-height: calc(1.5em + 22px);
	max-height: calc(1.5em * 4 + 22px);
}

#treelike-input.is-scrollable {
	overflow-y: auto;
}

#treelike-input:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 2px;
}

#treelike-input::placeholder {
	color: var(--treelike-text-muted);
}

#treelike-send {
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--accent-color);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

#treelike-send:hover,
#treelike-send:focus-visible {
	filter: brightness(1.08);
	outline: 2px solid #fff;
	outline-offset: 2px;
}

#treelike-send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	/* Racine : launcher reste en bas à droite */
	.treelike-chatbot--bottom-right {
		right: var(--treelike-margin);
		bottom: var(--treelike-margin);
		left: auto;
	}

	.treelike-chatbot--bottom-left {
		left: var(--treelike-margin);
		bottom: var(--treelike-margin);
		right: auto;
	}

	.treelike-chatbot.is-open {
		width: auto;
		height: auto;
	}

	/* Panneau : feuille pleine largeur ancrée en bas */
	.glass-panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		width: 100%;
		/* Hauteur = viewport visible (JS), collée au clavier. */
		height: var(--tl-panel-h, 100dvh);
		max-height: none;
		border-radius: 0;
		box-shadow: none;
	}

	.chat-header {
		padding-top: calc(16px + env(safe-area-inset-top, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.chat-header-icon.is-thinking {
		animation: none !important;
	}

	/* Fixed dots, no animation. */
	.chat-typing-dot {
		animation: none !important;
		opacity: 0.7;
	}

	.glass-panel,
	.glass-panel.is-visible,
	.glass-panel.is-visible.is-closing {
		animation: none !important;
		transition: none !important;
		filter: none !important;
	}

	.treelike-chatbot.is-open .treelike-chat-launcher {
		transition: none !important;
	}

	.treelike-chat-hook,
	.treelike-chat-hook.is-visible {
		animation: none !important;
		opacity: 1;
		transform: none;
	}
}

.chat-cta {
	display: block;
	width: calc(100% - 32px);
	margin: 0 16px 8px;
	padding: 10px 12px;
	border: 0;
	border-radius: 12px;
	background: var(--accent-color, #6aa8ff);
	color: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
}

.chat-cta[hidden] {
	display: none;
}

.chat-lead-status {
	width: calc(100% - 32px);
	margin: 0 16px 8px;
	padding: 8px 12px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--treelike-text-muted);
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
}

.chat-contact-card {
	align-self: stretch;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: 14px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	flex-direction: column;
	gap: 12px;
	box-sizing: border-box;
}

.chat-consent {
	align-self: flex-start;
	max-width: 92%;
	padding: 12px 14px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-consent-prompt,
.chat-consent-saved {
	margin: 0 0 10px;
	font-size: 13px;
	line-height: 1.5;
}

.chat-consent-saved {
	margin: 0;
	color: var(--treelike-text-muted);
}

.chat-consent-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.chat-consent-privacy {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.4;
}

.chat-consent-privacy a,
.chat-contact-consent-text a {
	color: inherit;
	text-decoration: underline;
}

.chat-consent-privacy a {
	color: var(--treelike-text-muted);
}

.chat-consent-actions[hidden],
.chat-contact-form[hidden] {
	display: none;
}

.chat-consent-yes,
.chat-consent-no,
.chat-contact-toggle,
.chat-contact-submit {
	border: 0;
	border-radius: 12px;
	background: var(--accent-color);
	color: #fff;
	padding: 10px 14px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
}

.chat-consent-no {
	background: transparent;
	color: var(--treelike-text);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-consent-yes:hover,
.chat-consent-yes:focus-visible,
.chat-consent-no:hover,
.chat-consent-no:focus-visible,
.chat-contact-toggle:hover,
.chat-contact-toggle:focus-visible,
.chat-contact-submit:hover,
.chat-contact-submit:focus-visible {
	filter: brightness(1.08);
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.chat-contact-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/*
 * Anti-robot field. It sits inside the form (position: relative), clipped to one pixel: unlike a box
 * pushed 10000 px to the left of the fixed panel, it can neither be scrolled to nor scroll an ancestor.
 */
.chat-contact-trap {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	pointer-events: none;
}

.chat-contact-form {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.chat-contact-close {
	align-self: flex-end;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: transparent;
	color: var(--treelike-text);
	padding: 4px 12px;
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
}

.chat-contact-close:hover,
.chat-contact-close:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	outline: 2px solid var(--accent-color);
	outline-offset: 2px;
}

.chat-contact-form input:not([type="checkbox"]),
.chat-contact-form textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--treelike-text);
	padding: 8px 10px;
	font: inherit;
	font-size: 13px;
}

.chat-contact-form input:focus-visible,
.chat-contact-form textarea:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 2px;
}

.chat-contact-form textarea {
	resize: vertical;
	min-height: 72px;
}

.chat-appointment-slots {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 12px;
}

.chat-appointment-slots-title {
	margin: 0;
	font-weight: 600;
	color: var(--treelike-text);
}

.chat-appointment-note {
	margin: 0;
	color: var(--treelike-text-muted);
	line-height: 1.45;
}

.chat-appointment-day {
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	overflow: hidden;
}

.chat-appointment-day-summary {
	padding: 8px 10px;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	color: var(--treelike-text);
}

.chat-appointment-day-summary::-webkit-details-marker {
	display: none;
}

.chat-appointment-day-summary::after {
	content: '+';
	float: right;
	font-weight: 400;
	color: var(--treelike-text-muted);
}

.chat-appointment-day[open] .chat-appointment-day-summary::after {
	content: '−';
}

.chat-appointment-day-slots {
	padding: 0 10px 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-appointment-slot {
	display: block;
	margin-top: 6px;
	cursor: pointer;
}

.chat-contact-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	font-size: 12px;
	line-height: 1.5;
	color: var(--treelike-text-muted);
	cursor: pointer;
}

.chat-contact-consent input[type="checkbox"] {
	width: 16px;
	height: 16px;
	min-width: 16px;
	margin: 2px 0 0;
	padding: 0;
	flex-shrink: 0;
	accent-color: var(--accent-color);
}

.chat-contact-consent-text {
	flex: 1;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: break-word;
}

.chat-contact-fallback {
	margin: 0;
	font-size: 12px;
	line-height: 1.6;
	color: var(--treelike-text-muted);
}

.chat-contact-fallback--solo {
	align-self: stretch;
	padding: 10px 12px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-contact-fallback a {
	color: var(--treelike-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.chat-contact-fallback a:hover,
.chat-contact-fallback a:focus-visible {
	color: var(--accent-color);
}

.chat-contact-feedback {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
}

.chat-contact-feedback.is-success {
	color: #86efac;
}

.chat-contact-feedback.is-error {
	color: #fca5a5;
}

/* Guided navigation (2.6.2). These rules do nothing while --treelike-nav-panel-width is unset:
   the fallback is the width the panel already uses. The variable is set from JS only when the
   feature is on and the window is at least navigationMinWidth. */
@media (min-width: 481px) {
	#treelike-chat-window.glass-panel {
		width: var(--treelike-nav-panel-width, var(--treelike-panel-width));
	}
}

@media (max-width: 480px) {
	#treelike-chat-window.glass-panel {
		width: var(--treelike-nav-panel-width, 100%);
	}
}

.glass-panel.is-nav-dock {
	position: fixed;
	top: var(--treelike-nav-admin-offset, var(--wp-admin--admin-bar--height, 0px));
	bottom: 0;
	height: auto;
	margin: 0;
}

.treelike-chatbot--bottom-right .glass-panel.is-nav-dock {
	right: 0;
	left: auto;
}

.treelike-chatbot--bottom-left .glass-panel.is-nav-dock {
	left: 0;
	right: auto;
}

.chat-nav-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 1;
	min-width: 0;
	max-width: 46%;
}

.chat-nav-toggle[hidden] {
	display: none !important;
}

.chat-nav-switch {
	flex: 0 0 auto;
	width: 36px;
	height: 20px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
}

.chat-nav-switch__track {
	display: block;
	position: relative;
	width: 36px;
	height: 20px;
	border-radius: 999px;
	background: #8d939c;
}

.chat-nav-switch__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	transform: translateX(0);
	transition: transform 150ms ease;
}

.chat-nav-switch[aria-checked="true"] .chat-nav-switch__track {
	background: #1f7a3a;
}

.chat-nav-switch[aria-checked="true"] .chat-nav-switch__thumb {
	transform: translateX(16px);
}

.chat-nav-switch:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 3px;
}

.chat-nav-switch__label {
	min-width: 0;
	color: var(--treelike-text);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chat-nav-invite {
	align-self: stretch;
	max-width: 100%;
	padding: 12px 14px;
	border-radius: 16px;
	border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
	border-left: 4px solid var(--accent-color);
	background: rgba(37, 99, 235, 0.08);
	background: color-mix(in srgb, var(--accent-color) 12%, transparent);
	display: flex;
	flex-direction: column;
	gap: 10px;
	animation: treelike-nav-invite-in 250ms ease;
}

.chat-nav-invite__head {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.chat-nav-invite__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--accent-color);
}

.chat-nav-invite__title {
	margin: 0;
	min-width: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.chat-nav-invite__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
}

.chat-nav-invite__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
}

.chat-nav-invite__accept,
.chat-nav-invite__decline {
	border: 0;
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
}

.chat-nav-invite__accept {
	border-radius: 12px;
	background: var(--accent-color);
	color: #fff;
	font-weight: 700;
	padding: 8px 14px;
}

.chat-nav-invite__decline {
	padding: 4px 0;
	background: transparent;
	color: var(--treelike-text-muted, var(--treelike-text));
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.chat-nav-invite__accept:focus-visible,
.chat-nav-invite__decline:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 3px;
}

@keyframes treelike-nav-invite-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.chat-nav-switch__thumb {
		transition: none;
	}

	.chat-nav-invite {
		animation: none;
	}
}

.chat-message--system {
	align-self: center;
	max-width: 100%;
	padding: 2px 8px;
	background: transparent;
	color: var(--treelike-text-muted);
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

.treelike-nav-site {
	position: fixed;
	z-index: 99998;
	overflow: hidden;
	box-sizing: border-box;
}

.treelike-nav-site iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.treelike-nav-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 2;
	pointer-events: none;
	background: var(--accent-color, #6aa8ff);
}

.treelike-lang {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 32px;
	padding: 0 8px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: inherit;
	font: inherit;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
}

.treelike-lang:hover {
	background: rgba(255, 255, 255, 0.14);
}

.treelike-lang:focus-visible,
.treelike-lang-menu__option:focus-visible,
.treelike-lang-suggest__yes:focus-visible,
.treelike-lang-suggest__no:focus-visible {
	outline: 2px solid var(--accent-color, #6aa8ff);
	outline-offset: 2px;
}

.treelike-lang-menu {
	position: absolute;
	z-index: 6;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--treelike-bg, #fff);
	color: var(--treelike-text, inherit);
	border: 1px solid var(--treelike-border, #ddd);
	border-radius: 10px;
	min-width: 168px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.treelike-lang-menu[hidden] {
	display: none;
}

.treelike-lang-menu.is-sheet {
	right: 0;
	left: 0;
	bottom: 0;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	overflow: auto;
}

.treelike-lang-menu__option {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.treelike-lang-menu__option[aria-selected="true"] {
	font-weight: 600;
}

.treelike-lang-menu__option:hover {
	background: rgba(0, 0, 0, 0.05);
}

.treelike-lang-suggest {
	margin: 8px 0 0;
	color: var(--treelike-text-muted);
	font-size: 12px;
	line-height: 1.4;
}

.treelike-lang-suggest__yes,
.treelike-lang-suggest__no {
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
	padding: 0 4px;
	text-decoration: underline;
}
