/* HotLead AI public widget (Phase 1). Themed via the --hl-primary custom
   property set from server config. Kept minimal and render-block-free. */
.hl-widget {
	--hl-primary: #2b3660;
	--hl-accent: #2b3660;
	--hl-launcher: #2b3660;
	position: fixed;
	z-index: 2147483000;
	bottom: 24px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.hl-pos-bottom-right { right: 24px; }
.hl-pos-bottom-left { left: 24px; }

/* Reset: neutralise the host theme's control chrome so its button/input styles
   (borders, fills, uppercase, shadows) can never bleed into the widget. The
   component rules below then supply the widget's own look. */
.hl-widget button,
.hl-widget input,
.hl-widget textarea,
.hl-widget select {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	outline: none !important;
	font-family: inherit !important;
	line-height: normal !important;
}
.hl-widget button {
	font-weight: 400;
	cursor: pointer;
}

.hl-launcher {
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--hl-launcher);
	box-shadow: 0 10px 28px -6px rgba(20, 24, 40, 0.45);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.hl-launcher:focus-visible { outline: 3px solid rgba(43, 54, 96, 0.4); outline-offset: 2px; }

/* launcher + optional label chip sit side by side */
.hl-launcher-wrap { display: flex; align-items: center; gap: 12px; }
.hl-pos-bottom-left .hl-launcher-wrap { flex-direction: row-reverse; }
.hl-launcher-label {
	background: #fff;
	border: 1px solid #e6e7eb;
	border-radius: 22px;
	padding: 10px 16px;
	font-size: 13.5px;
	font-weight: 500;
	color: #16181d;
	box-shadow: 0 6px 20px -6px rgba(20, 24, 40, 0.2);
	cursor: pointer;
	white-space: nowrap;
}
/* the label is desktop-only chrome */
@media (max-width: 640px) { .hl-launcher-label { display: none; } }

.hl-panel {
	position: absolute;
	bottom: 74px;
	right: 0;
	width: 384px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border: 1px solid #e6e7eb;
	border-radius: 20px;
	box-shadow: 0 30px 70px -18px rgba(20, 24, 40, 0.4);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.hl-pos-bottom-left .hl-panel { right: auto; left: 0; }
/* The hidden attribute must win over the display:flex above (author rules beat
   the UA [hidden] rule), or the panel never closes. */
.hl-panel[hidden] { display: none; }

.hl-header {
	background: var(--hl-primary);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
}
.hl-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hl-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	color: var(--hl-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	flex: 0 0 auto;
}
.hl-head-main { min-width: 0; }
.hl-title { font-weight: 600; font-size: 15px; line-height: 1.2; }
.hl-status {
	font-size: 11.5px;
	color: #aeb7d4;
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 1px;
}
.hl-status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #57c98a;
	display: inline-block;
	flex: 0 0 auto;
}
.hl-head-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	position: relative;
}
.hl-menu-btn {
	background: transparent;
	border: 0;
	color: #aeb7d4;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.hl-menu-btn:hover { color: #fff; }
.hl-close {
	background: transparent;
	border: 0;
	color: #aeb7d4;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
	padding: 0;
}
.hl-close:hover { color: #fff; }

/* overflow menu (Privacy / Download transcript / Restart) */
.hl-menu {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 8px;
	background: #fff;
	border: 1px solid #e6e7eb;
	border-radius: 10px;
	box-shadow: 0 12px 32px -8px rgba(20, 24, 40, 0.28);
	padding: 5px;
	min-width: 184px;
	z-index: 5;
}
.hl-menu-item {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: left;
	background: transparent;
	border: 0;
	padding: 9px 12px;
	font-size: 13px;
	color: #16181d;
	border-radius: 7px;
	cursor: pointer;
	text-decoration: none;
}
.hl-menu-item:hover { background: #f4f5f7; }

.hl-stream {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fbfbfc;
}
.hl-msg {
	max-width: 86%;
	padding: 10px 12px;
	font-size: 13.5px;
	line-height: 1.5;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.hl-bot {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #eceef1;
	border-bottom-left-radius: 4px;
}
.hl-user {
	align-self: flex-end;
	background: var(--hl-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.hl-typing::after {
	content: "…";
	animation: hl-blink 1.2s infinite;
}
@keyframes hl-blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.hl-composer {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 12px;
	border-top: 1px solid #eceef1;
	background: #fff;
}
.hl-input {
	flex: 1;
	border: 1px solid #e6e7eb;
	background: #f4f5f7;
	border-radius: 22px;
	padding: 10px 14px;
	font-size: 13.5px;
	outline: none;
}
.hl-input:focus { border-color: var(--hl-primary); }
.hl-send {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--hl-accent);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.hl-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 12px;
	background: #fff;
	border-top: 1px solid #f2f3f5;
}
.hl-human {
	background: none;
	border: 0;
	padding: 0;
	font-size: 11.5px;
	color: #8a9099;
	text-decoration: none;
	cursor: pointer;
}
.hl-human:hover {
	color: var(--hl-primary);
	text-decoration: underline;
}
.hl-badge {
	font-size: 10.5px;
	color: #b3b7be;
}

/* qualifier / suggested chips */
.hl-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	align-self: flex-start;
	max-width: 92%;
}
.hl-chip {
	background: #fff;
	border: 1px solid #d9dde3;
	color: var(--hl-accent);
	font-size: 12.5px;
	font-weight: 500;
	padding: 8px 13px;
	border-radius: 16px;
	cursor: pointer;
}
.hl-chip:hover { background: #f4f5f7; }

/* inline capture card */
.hl-capture {
	align-self: stretch;
	background: #fff;
	border: 1px solid #e6e7eb;
	border-radius: 16px;
	padding: 14px;
	box-shadow: 0 2px 8px -2px rgba(20, 24, 40, 0.08);
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.hl-cap-label {
	font-size: 12px;
	color: #8a9099;
	font-weight: 500;
}
.hl-cap-input {
	border: 1px solid #d6d9df;
	border-radius: 9px;
	padding: 10px 12px;
	font-size: 13.5px;
	color: #16181d;
	width: 100%;
}
.hl-cap-input:focus { outline: none; border-color: var(--hl-primary); }
.hl-cap-toggle { display: flex; gap: 8px; }
.hl-cap-opt {
	flex: 1;
	border: 1px solid #d6d9df;
	background: #fff;
	border-radius: 9px;
	padding: 9px;
	font-size: 13px;
	color: #5a616b;
	cursor: pointer;
}
.hl-cap-opt.hl-active {
	border-color: #25543a;
	background: #eaf3ee;
	color: #25543a;
	font-weight: 500;
}
.hl-cap-submit {
	background: var(--hl-accent);
	color: #fff;
	border: 0;
	border-radius: 9px;
	padding: 11px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}
.hl-cap-submit:disabled { opacity: 0.7; cursor: default; }
.hl-wa-now {
	display: block;
	text-align: center;
	background: #25543a;
	color: #fff;
	border-radius: 11px;
	padding: 11px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	margin-top: 2px;
}
.hl-note { align-self: stretch; }

/* WooCommerce product cards */
.hl-cards {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.hl-card {
	display: flex;
	gap: 10px;
	background: #fff;
	border: 1px solid #e6e7eb;
	border-radius: 12px;
	padding: 10px;
	align-items: center;
}
.hl-card-img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	flex: 0 0 auto;
	background: #f4f5f7;
}
.hl-card-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	flex: 1;
}
.hl-card-title {
	font-size: 13px;
	font-weight: 600;
	color: #16181d;
	text-decoration: none;
	line-height: 1.3;
}
.hl-card-title:hover { text-decoration: underline; }
.hl-card-meta { display: flex; align-items: baseline; gap: 6px; }
.hl-card-price { font-size: 13.5px; font-weight: 600; color: var(--hl-primary); }
.hl-card-was { font-size: 11.5px; color: #9aa0a8; text-decoration: line-through; }
.hl-card-avail { font-size: 11.5px; font-weight: 500; }
.hl-card-avail.hl-in { color: #1a7f37; }
.hl-card-avail.hl-out { color: #b3261e; }
.hl-card-btn {
	align-self: flex-start;
	margin-top: 4px;
	background: var(--hl-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 8px;
}

/* order-status cards */
.hl-order { align-items: stretch; }
.hl-order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hl-order-status {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	background: #eef0f6;
	color: #4a5163;
	white-space: nowrap;
}
.hl-status-processing { background: #fff3d6; color: #8a6100; }
.hl-status-completed { background: #e6f4ea; color: #1a7f37; }
.hl-status-cancelled,
.hl-status-failed { background: #fce8e6; color: #b3261e; }
.hl-status-on-hold { background: #eae6fb; color: #5b3fbf; }

/* conversational form step */
.hl-form-step {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.hl-form-step textarea.hl-cap-input { min-height: 72px; resize: vertical; }

/* consent notice */
.hl-consent {
	align-self: stretch;
	font-size: 11.5px;
	color: #8a9099;
	line-height: 1.5;
	background: #f6f7f9;
	border: 1px solid #eceef1;
	border-radius: 10px;
	padding: 9px 11px;
}
.hl-consent-start {
	display: inline-block;
	margin-top: 8px;
	background: var(--hl-accent);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
}
.hl-composer.hl-disabled { opacity: 0.6; }

/* source chips under a grounded answer */
.hl-source-chips {
	align-self: flex-start;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	max-width: 92%;
	margin-top: -4px;
}
.hl-source-label { font-size: 11px; color: #9aa0a8; }
.hl-source-chip {
	font-size: 11px;
	color: var(--hl-accent);
	background: #f0f2f6;
	border-radius: 10px;
	padding: 3px 9px;
	text-decoration: none;
}
.hl-source-chip:hover { text-decoration: underline; }

/* proactive teaser bubble above the launcher */
.hl-teaser {
	position: absolute;
	bottom: 74px;
	right: 0;
	width: 260px;
	max-width: calc(100vw - 48px);
	background: #fff;
	border: 1px solid #e6e7eb;
	border-radius: 14px;
	box-shadow: 0 16px 40px -12px rgba(20, 24, 40, 0.35);
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.45;
	color: #16181d;
	cursor: pointer;
}
.hl-pos-bottom-left .hl-teaser { right: auto; left: 0; }
.hl-teaser-close {
	position: absolute;
	top: 4px;
	right: 8px;
	background: transparent;
	border: 0;
	font-size: 16px;
	line-height: 1;
	color: #b3b7be;
	cursor: pointer;
}
.hl-teaser-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hl-teaser-chip {
	background: #f4f5f7;
	border: 1px solid #d9dde3;
	color: var(--hl-accent);
	font-size: 12px;
	font-weight: 500;
	padding: 5px 10px;
	border-radius: 12px;
	cursor: pointer;
}

/* voice & image composer controls */
.hl-icon-btn {
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: #f0f2f6;
	color: var(--hl-accent);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	padding: 0;
}
.hl-icon-btn:hover { background: #e6e9f0; }
.hl-recording { background: #fce8e6; color: #b3261e; }
.hl-attach-thumb {
	max-width: 120px;
	max-height: 120px;
	border-radius: 10px;
	align-self: flex-end;
	border: 1px solid #e6e7eb;
}

/* Mobile: the panel becomes a full-height bottom sheet (Part D §3). */
@media (max-width: 640px) {
	.hl-panel {
		position: fixed;
		right: 0;
		left: 0;
		bottom: 0;
		top: 0;
		width: 100%;
		max-width: 100%;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
	}
	.hl-pos-bottom-left .hl-panel { left: 0; right: 0; }
	.hl-teaser {
		right: 12px;
		left: 12px;
		width: auto;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hl-typing::after { animation: none; }
	.hl-teaser { transition: none; }
}

/* Theme-proof the interactive elements: force the widget's own look so a host
   theme's button/link rules (even !important ones) can't override colours,
   borders or radii. Scoped + !important to win the cascade on any theme. */
.hl-widget .hl-launcher { background: var(--hl-launcher) !important; border: 0 !important; border-radius: 50% !important; width: 60px !important; height: 60px !important; padding: 0 !important; }
.hl-widget .hl-send { background: var(--hl-accent) !important; border: 0 !important; border-radius: 50% !important; width: 40px !important; height: 40px !important; padding: 0 !important; }
.hl-widget .hl-icon-btn { width: 34px !important; height: 34px !important; padding: 0 !important; }
.hl-widget .hl-menu-btn,
.hl-widget .hl-close { background: transparent !important; border: 0 !important; }
.hl-widget .hl-menu { background: #fff !important; border: 1px solid #e6e7eb !important; }
.hl-widget .hl-menu-item { background: transparent !important; border: 0 !important; border-radius: 7px !important; color: #16181d !important; }
.hl-widget .hl-menu-item:hover { background: #f4f5f7 !important; }
.hl-widget .hl-human { background: none !important; border: 0 !important; padding: 0 !important; color: #8a9099 !important; }
.hl-widget .hl-human:hover { color: var(--hl-primary) !important; }
.hl-widget .hl-chip,
.hl-widget .hl-teaser-chip { background: #fff !important; border: 1px solid #d9dde3 !important; border-radius: 16px !important; color: var(--hl-accent) !important; }
.hl-widget .hl-icon-btn { background: #f0f2f6 !important; border: 0 !important; border-radius: 50% !important; color: var(--hl-accent) !important; }
.hl-widget .hl-cap-submit,
.hl-widget .hl-consent-start,
.hl-widget .hl-wa-now,
.hl-widget .hl-card-btn { background: var(--hl-accent) !important; border: 0 !important; color: #fff !important; }
.hl-widget .hl-wa-now { background: #25543a !important; }
.hl-widget .hl-cap-opt { background: #fff !important; color: #5a616b !important; }
.hl-widget .hl-cap-opt.hl-active { background: #eaf3ee !important; border-color: #25543a !important; color: #25543a !important; }
.hl-widget .hl-source-chip { color: var(--hl-accent) !important; }
.hl-widget .hl-launcher-label { color: #16181d !important; background: #fff !important; }
.hl-widget .hl-input,
.hl-widget .hl-cap-input { background: #f4f5f7 !important; border: 1px solid #e6e7eb !important; }
.hl-widget .hl-cap-input { background: #fff !important; }

/* Live chat: header status when a human agent is online. */
.hl-widget .hl-status.hl-status-live .hl-status-dot { background: #22c55e !important; }
