/* Next Level Bot — public launcher and panel.
   Never targets #header-outer or any header element. */

.nlbot {
	--nlbot-bg: #1c1c1c;
	--nlbot-bg-elevated: #262626;
	--nlbot-bg-input: #121212;
	--nlbot-fg: #ffffff;
	--nlbot-muted: #b9b9b9;
	--nlbot-line: rgba(255, 255, 255, 0.1);
	--nlbot-accent: #6dcef2;
	--nlbot-accent-2: #0f8fff;
	--nlbot-accent-3: #0de2b8;
	--nlbot-gradient: linear-gradient(135deg, #0f8fff 0%, #6dcef2 55%, #0de2b8 100%);
	--nlbot-radius: 18px;
	--nlbot-radius-sm: 12px;
	--nlbot-z: 9980;
	--nlbot-side: 20px;
	--nlbot-bottom: 16px;
	--nlbot-lift: 0px;
	--nlbot-launcher: 64px;
	--nlbot-font: inherit;

	position: fixed;
	z-index: var(--nlbot-z);
	bottom: calc(var(--nlbot-bottom) + var(--nlbot-lift));
	left: var(--nlbot-side);
	right: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	font-family: var(--nlbot-font);
	pointer-events: none;
	transition: bottom 0.25s ease;
}

.nlbot.nlbot-pos-right {
	left: auto;
	right: var(--nlbot-side);
	align-items: flex-end;
}

.nlbot-launcher,
.nlbot-panel {
	pointer-events: auto;
}

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

.nlbot-launcher {
	position: relative;
	width: var(--nlbot-launcher);
	height: var(--nlbot-launcher);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nlbot-gradient);
	box-shadow:
		0 8px 24px rgba(15, 143, 255, 0.35),
		0 2px 8px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	overflow: hidden;
	flex-shrink: 0;
	appearance: none;
	-webkit-appearance: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nlbot-launcher:hover,
.nlbot-launcher:focus-visible {
	transform: translateY(-2px) scale(1.04);
	box-shadow:
		0 12px 28px rgba(15, 143, 255, 0.45),
		0 2px 8px rgba(0, 0, 0, 0.3);
}

.nlbot-launcher:focus {
	outline: none;
}

.nlbot-launcher:focus-visible {
	box-shadow:
		0 0 0 3px #1c1c1c,
		0 0 0 6px #6dcef2,
		0 12px 28px rgba(15, 143, 255, 0.45);
}

.nlbot-launcher-icon {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 6px;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.nlbot-launcher-close {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #0b1a24;
	opacity: 0;
	transform: scale(0.6) rotate(-40deg);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.nlbot.is-open .nlbot-launcher-icon {
	opacity: 0;
	transform: scale(0.6) rotate(40deg);
}

.nlbot.is-open .nlbot-launcher-close {
	opacity: 1;
	transform: scale(1) rotate(0);
}

/* Hidden until JS reveals the launcher (delay, or immediately with a fade). */
.nlbot:not(.nlbot-is-visible) .nlbot-launcher {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(14px);
}
.nlbot.nlbot-is-visible .nlbot-launcher {
	transition:
		opacity 0.4s ease,
		transform 0.4s cubic-bezier(0.22, 0.8, 0.25, 1),
		visibility 0.4s,
		box-shadow 0.2s ease;
}

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

.nlbot-panel {
	position: absolute;
	left: 0;
	bottom: calc(var(--nlbot-launcher) + 12px);
	width: min(392px, calc(100vw - 24px));
	max-height: min(640px, calc(100vh - 120px - var(--nlbot-lift)));
	display: flex;
	flex-direction: column;
	background: var(--nlbot-bg);
	color: var(--nlbot-fg);
	border-radius: var(--nlbot-radius);
	box-shadow:
		0 18px 50px rgba(0, 0, 0, 0.4),
		0 0 0 1px var(--nlbot-line);
	overflow: hidden;
	transform-origin: bottom left;
	opacity: 0;
	transform: translateY(12px) scale(0.96);
	pointer-events: none;
	visibility: hidden;
	transition:
		opacity 0.22s ease,
		transform 0.22s cubic-bezier(0.22, 0.8, 0.25, 1),
		visibility 0.22s;
}

.nlbot-panel[hidden] {
	display: none !important;
}

.nlbot.nlbot-pos-right .nlbot-panel {
	left: auto;
	right: 0;
	transform-origin: bottom right;
}

.nlbot.is-open .nlbot-panel:not([hidden]) {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	visibility: visible;
}

.nlbot-panel-chrome {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 14px 12px 16px;
	background: linear-gradient(180deg, #242424 0%, var(--nlbot-bg) 100%);
	border-bottom: 1px solid var(--nlbot-line);
	flex-shrink: 0;
}

.nlbot-panel-ident {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.nlbot-panel-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: contain;
	background: var(--nlbot-gradient);
	padding: 3px;
	flex-shrink: 0;
}

.nlbot-panel-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--nlbot-fg);
}

.nlbot-panel-sub {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--nlbot-muted);
	line-height: 1.2;
}

.nlbot-panel-x {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nlbot-fg);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	appearance: none;
	-webkit-appearance: none;
}

.nlbot-panel-x:hover,
.nlbot-panel-x:focus-visible {
	background: var(--nlbot-bg-elevated);
}

.nlbot-panel-x:focus {
	outline: none;
}

.nlbot-panel-x:focus-visible {
	box-shadow: 0 0 0 2px #6dcef2;
}

.nlbot-panel-body {
	padding: 16px 16px 18px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1 1 auto;
}

/* ---- Chat views ---- */

.nlbot-view[hidden] {
	display: none !important;
}

.nlbot-bubble-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin-bottom: 14px;
}

.nlbot-bubble-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: contain;
	background: var(--nlbot-gradient);
	padding: 2px;
	flex-shrink: 0;
}

.nlbot-bubble {
	margin: 0;
	max-width: 85%;
	padding: 10px 14px;
	background: var(--nlbot-bg-elevated);
	border-radius: 16px 16px 16px 4px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--nlbot-fg);
}

.nlbot-bubble-success {
	background: linear-gradient(135deg, rgba(15, 143, 255, 0.25), rgba(13, 226, 184, 0.18));
	border: 1px solid rgba(109, 206, 242, 0.35);
}

.nlbot-replies {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
}

.nlbot-reply {
	display: block;
	width: 100%;
	text-align: left;
	padding: 11px 14px;
	border: 1px solid var(--nlbot-line);
	border-radius: 999px;
	background: transparent;
	color: var(--nlbot-fg);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nlbot-reply:hover,
.nlbot-reply:focus-visible {
	background: var(--nlbot-gradient);
	border-color: transparent;
	color: #0b1a24;
	transform: translateY(-1px);
}

.nlbot-reply:focus {
	outline: none;
}

.nlbot-reply:focus-visible {
	box-shadow: 0 0 0 2px #1c1c1c, 0 0 0 4px #6dcef2;
}

.nlbot-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0 0 8px;
	padding: 4px 0;
	border: 0;
	background: transparent;
	color: var(--nlbot-accent);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.nlbot-back:hover,
.nlbot-back:focus-visible {
	color: var(--nlbot-accent-3);
	text-decoration: underline;
}

.nlbot-back:focus {
	outline: none;
}

.nlbot-view-title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
}

.nlbot-view-lead {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--nlbot-muted);
}

/* ---- Offices ---- */

.nlbot-offices {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nlbot-office {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"name num"
		"note num";
	gap: 2px 12px;
	align-items: center;
	padding: 12px 14px;
	border-radius: var(--nlbot-radius-sm);
	background: var(--nlbot-bg-elevated);
	color: var(--nlbot-fg);
	text-decoration: none;
	border: 1px solid var(--nlbot-line);
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.nlbot-office:hover,
.nlbot-office:focus-visible {
	border-color: var(--nlbot-accent);
	transform: translateY(-1px);
}

.nlbot-office:focus {
	outline: none;
}

.nlbot-office-name {
	grid-area: name;
	font-weight: 700;
	font-size: 14px;
}

.nlbot-office-num {
	grid-area: num;
	font-weight: 700;
	font-size: 14px;
	color: var(--nlbot-accent);
	white-space: nowrap;
}

.nlbot-office-note {
	grid-area: note;
	font-size: 12px;
	color: var(--nlbot-muted);
}

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

.nlbot-form {
	margin: 0;
}

.nlbot-field {
	margin: 0 0 10px;
}

.nlbot-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--nlbot-muted);
}

.nlbot-req,
.nlbot-opt {
	font-weight: 500;
	text-transform: lowercase;
}

.nlbot-req {
	color: var(--nlbot-accent);
}

.nlbot-opt {
	color: #8a8a8a;
}

.nlbot-field input,
.nlbot-field select,
.nlbot-field textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid var(--nlbot-line);
	border-radius: 10px;
	background: var(--nlbot-bg-input);
	color: var(--nlbot-fg);
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
}

.nlbot-field select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236dcef2' d='M1 1l5 5 5-5'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

.nlbot-field textarea {
	resize: vertical;
	min-height: 96px;
}

.nlbot-field input:focus,
.nlbot-field select:focus,
.nlbot-field textarea:focus {
	outline: none;
	border-color: var(--nlbot-accent);
	box-shadow: 0 0 0 2px rgba(109, 206, 242, 0.25);
}

.nlbot-field.is-invalid input,
.nlbot-field.is-invalid select,
.nlbot-field.is-invalid textarea {
	border-color: #f87171;
}

.nlbot-submit-wrap {
	margin: 14px 0 0;
}

.nlbot-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--nlbot-gradient);
	color: #0b1a24;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.nlbot-submit:hover,
.nlbot-submit:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.05);
}

.nlbot-submit:focus {
	outline: none;
}

.nlbot-submit:focus-visible {
	box-shadow: 0 0 0 3px #1c1c1c, 0 0 0 5px #6dcef2;
}

.nlbot-submit:disabled {
	opacity: 0.65;
	cursor: wait;
	transform: none;
}

.nlbot-form-error {
	margin: 0 0 8px;
	padding: 8px 10px;
	border-radius: 8px;
	background: rgba(248, 113, 113, 0.15);
	color: #fecaca;
	font-size: 13px;
}

.nlbot-form-error[hidden],
.nlbot-success[hidden] {
	display: none !important;
}

/* Honeypot: visually hidden, not display:none (bots often skip those). */
.nlbot-hp {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Mobile sheet ---- */

@media (max-width: 600px) {
	.nlbot {
		left: 0;
		right: 0;
		bottom: 0;
		padding: 0;
		align-items: stretch;
		gap: 0;
		transition: bottom 0.25s ease;
	}

	.nlbot.nlbot-pos-right {
		left: 0;
		right: 0;
		align-items: stretch;
	}

	.nlbot-launcher {
		position: absolute;
		left: var(--nlbot-side);
		bottom: calc(var(--nlbot-bottom) + var(--nlbot-lift));
		transition: bottom 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
	}

	.nlbot.nlbot-pos-right .nlbot-launcher {
		left: auto;
		right: var(--nlbot-side);
	}

	.nlbot.is-open .nlbot-launcher {
		/* Hide the bubble while the full-width sheet is open;
		   close is available in the panel chrome. */
		opacity: 0;
		pointer-events: none;
		transform: scale(0.6);
	}

	.nlbot-panel {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-height: min(92vh, calc(100vh - 8px));
		border-radius: 20px 20px 0 0;
		transform-origin: bottom center;
		transform: translateY(24px);
	}

	.nlbot.is-open .nlbot-panel:not([hidden]) {
		transform: translateY(0);
	}

	.nlbot.is-open {
		/* Lift the sheet itself above the banner bar. */
		bottom: var(--nlbot-lift);
	}
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
	.nlbot,
	.nlbot-launcher,
	.nlbot-launcher-icon,
	.nlbot-launcher-close,
	.nlbot-panel,
	.nlbot-reply,
	.nlbot-office,
	.nlbot-submit {
		transition: none !important;
		animation: none !important;
	}

	.nlbot-launcher:hover,
	.nlbot-launcher:focus-visible,
	.nlbot-reply:hover,
	.nlbot-reply:focus-visible,
	.nlbot-office:hover,
	.nlbot-submit:hover {
		transform: none;
	}

	.nlbot-panel {
		transform: none;
	}

	.nlbot:not(.nlbot-is-visible) .nlbot-launcher,
	.nlbot.nlbot-is-visible .nlbot-launcher {
		transition: none !important;
		transform: none !important;
	}
}
