/* Lynbro Contact Buttons & Chat — GPL-2.0-or-later. */
.lfb {
	/* The site's colours (theme.json presets), with fallbacks (CLAUDE.md §9). */
	--lfb-panel: var(--wp--preset--color--surface, var(--wp--preset--color--base, #fff));
	--lfb-text: var(--wp--preset--color--contrast, #1d2327);
	--lfb-muted: #50575e;
	--lfb-line: #dcdcde;
	--lfb-hover: #f0f0f1;
	--lfb-bubble: var(--lfb-hover);
	--lfb-focus: var(--wp--custom--color--focus, var(--wp--preset--color--accent, #2271b1));
	position: fixed;
	/* Suite z-index bands (suite-overlap-matrix C.8): banners 99 000–99 989, consent 99 989 above us. */
	z-index: 99000;
	bottom: calc(var(--lfb-y, 20px) + var(--lfb-lift, 0px) + env(safe-area-inset-bottom, 0px));
	right: var(--lfb-x, 20px);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	/* The site's font (CLAUDE.md §9); size and line height fixed for the panel. */
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--lfb-text);
	text-align: left;
	transition: bottom .2s ease;
	-webkit-text-size-adjust: 100%;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
	.lfb {
		/* The suite theme token contract names muted text and lines; mixed only without it. */
		--lfb-muted: var(--wp--preset--color--muted, color-mix(in srgb, var(--lfb-text) 72%, var(--lfb-panel)));
		--lfb-line: var(--wp--preset--color--border, color-mix(in srgb, var(--lfb-text) 16%, var(--lfb-panel)));
		--lfb-hover: color-mix(in srgb, var(--lfb-text) 7%, var(--lfb-panel));
	}
}
.lfb--left { right: auto; left: var(--lfb-x, 20px); align-items: flex-start; }
.lfb[hidden], .lfb [hidden] { display: none !important; }
/* A Lynbro modal is open (booking, popup): get out of the way. */
html.lynbro-modal-open .lfb { display: none !important; }
/* Dark panel only when the owner chose "follow the visitor's dark mode". */
@media (prefers-color-scheme: dark) {
	.lfb.lfb--auto-dark {
		--lfb-panel: #1e1e1e;
		--lfb-text: #f0f0f1;
		--lfb-muted: #c3c4c7;
		--lfb-line: #3c434a;
		--lfb-hover: #2c3338;
		--lfb-bubble: #2c3338;
		--lfb-focus: #72aee6;
	}
}
.lfb *, .lfb *::before, .lfb *::after { box-sizing: border-box; }
.lfb button, .lfb a, .lfb textarea {
	margin: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
}
.lfb svg { display: block; flex: none; }
.lfb-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.lfb :focus-visible { outline: 3px solid var(--lfb-focus); outline-offset: 2px; }

/* Launcher */
.lfb-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: var(--lfb-size, 56px);
	height: var(--lfb-size, 56px);
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--lfb-bg, #1a7f37);
	color: var(--lfb-fg, #fff);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .2);
	cursor: pointer;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease;
}
/* Classic themes style button:hover/:focus (Storefront greys them): keep ours. */
.lfb-launcher:hover, .lfb-launcher:focus, .lfb-launcher:active { background: var(--lfb-bg, #1a7f37); color: var(--lfb-fg, #fff); }
.lfb-launcher:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.lfb-launcher:focus-visible { outline-color: var(--lfb-bg); box-shadow: 0 0 0 3px #fff, 0 4px 14px rgba(0, 0, 0, .22); }
.lfb--labelled .lfb-launcher { width: auto; padding: 0 20px 0 14px; }
.lfb-launcher-text { font-weight: 600; white-space: nowrap; }
.lfb-launcher-x { display: none; }
.lfb--open .lfb-launcher-x { display: block; }
.lfb--open .lfb-launcher-ic { display: none; }

/* Panel */
.lfb-panel {
	display: flex;
	flex-direction: column;
	width: min(360px, calc(100vw - 32px));
	max-height: calc(100vh - var(--lfb-y, 20px) - var(--lfb-size, 56px) - var(--lfb-lift, 0px) - 40px);
	max-height: calc(100dvh - var(--lfb-y, 20px) - var(--lfb-size, 56px) - var(--lfb-lift, 0px) - 40px);
	overflow: hidden;
	border: 1px solid var(--lfb-line);
	border-radius: 16px;
	background: var(--lfb-panel);
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
	animation: lfb-in .18s ease-out;
}
@keyframes lfb-in { from { opacity: 0; transform: translateY(8px); } }
.lfb-head {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 10px 12px 16px;
	border-bottom: 1px solid var(--lfb-line);
}
.lfb .lfb-title {
	flex: 1;
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--lfb-text);
}
.lfb--view .lfb-head { padding-left: 6px; }
.lfb-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--lfb-text);
	cursor: pointer;
}
.lfb-icon-btn:hover, .lfb-icon-btn:focus { background: var(--lfb-hover); color: var(--lfb-text); }
.lfb-note { margin: 0; padding: 8px 16px; font-size: 14px; color: var(--lfb-muted); }

.lfb .lfb-list { margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.lfb .lfb-list li { margin: 0; padding: 0; list-style: none; }
.lfb .lfb-list li::before { content: none; }
.lfb-ch {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 8px 10px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--lfb-text);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.lfb-ch:hover, .lfb-ch:focus { background: var(--lfb-hover); color: var(--lfb-text); text-decoration: none; }
.lfb-ic {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: none;
	border-radius: 12px;
}
.lfb-txt { display: flex; flex-direction: column; min-width: 0; }
.lfb-lb { font-weight: 600; overflow-wrap: anywhere; }
.lfb-sub { font-size: 13px; color: var(--lfb-muted); overflow-wrap: anywhere; }

/* Chat / form views */
.lfb-view { display: flex; flex-direction: column; min-height: 0; padding: 12px 16px 16px; overflow-y: auto; }
.lfb-view--tall { flex: 0 1 auto; height: 560px; min-height: 0; padding: 0; }
.lfb-view--tall .lfb-gate, .lfb-view--tall .lfb-status:not(:empty) { margin: 12px 16px 0; }
.lfb-gate { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.lfb-notice { margin: 0; font-size: 14px; color: var(--lfb-muted); }
.lfb-notice a, .lfb-msg a { color: inherit; text-decoration: underline; }
.lfb-status { font-size: 14px; color: var(--lfb-muted); }
.lfb-status:empty { display: none; }
.lfb-mount { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lfb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 10px;
	background: var(--lfb-bg, #1a7f37);
	color: var(--lfb-fg, #fff);
	font-weight: 600;
	cursor: pointer;
}
.lfb-btn:hover, .lfb-btn:focus, .lfb-btn:active { background: var(--lfb-bg, #1a7f37); color: var(--lfb-fg, #fff); }
.lfb-btn:hover { filter: brightness(1.08); }
.lfb-btn:disabled { opacity: .6; cursor: default; }

/* n8n chat */
.lfb-log { flex: 1; min-height: 0; padding: 12px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.lfb-msg {
	max-width: 85%;
	padding: 8px 12px;
	border-radius: 14px;
	background: var(--lfb-bubble);
	overflow-wrap: anywhere;
	white-space: normal;
}
.lfb-msg--user { align-self: flex-end; background: var(--lfb-bg, #1a7f37); color: var(--lfb-fg, #fff); }
.lfb-msg--wait { color: var(--lfb-muted); font-style: italic; }
.lfb-msg--err { border: 1px solid #d63638; background: transparent; }
.lfb-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--lfb-line); }
.lfb-form textarea {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid var(--lfb-line);
	border-radius: 10px;
	background: var(--lfb-panel);
	color: var(--lfb-text);
	resize: none;
}

@media (max-width: 480px) {
	.lfb-panel { width: calc(100vw - var(--lfb-x, 20px) - 12px); }
}
@media (prefers-reduced-motion: reduce) {
	.lfb, .lfb-launcher, .lfb-panel { transition: none; animation: none; }
	.lfb-launcher:hover { transform: none; }
}
@media print { .lfb { display: none !important; } }
