.rekhi-live-chat {
	--rekhi-chat-green: #22c55e;
	--rekhi-chat-orange: var(--primary-color, #ff6b00);
	--rekhi-chat-surface: var(--bg-dark-surface, #0b0b0b);
	--rekhi-chat-text: var(--text-light-main, #fff);
	--rekhi-chat-muted: rgba(255, 255, 255, 0.62);
	--rekhi-chat-border: rgba(255, 255, 255, 0.14);
	position: fixed;
	right: 22px;
	bottom: 96px;
	z-index: 9998;
	font-family: inherit;
}

.rekhi-live-chat--inline {
	position: relative;
	right: auto;
	bottom: auto;
	z-index: 1;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
}

.rekhi-live-chat__avatar,
.rekhi-live-chat__toggle-face {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(255, 107, 0, 0.28);
	flex: 0 0 auto;
}

.rekhi-live-chat__avatar--sm {
	width: 36px;
	height: 36px;
}

.rekhi-live-chat__avatar img,
.rekhi-live-chat__toggle-face img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.rekhi-live-chat__avatar-fallback {
	font-weight: 800;
	font-size: 0.95rem;
	color: #fff;
}

.rekhi-live-chat__toggle {
	position: relative;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background: transparent;
	box-shadow: 0 0 0 3px #fff, 0 10px 28px rgba(255, 107, 0, 0.45);
	overflow: visible;
}

.rekhi-live-chat__toggle-face {
	width: 64px;
	height: 64px;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.rekhi-live-chat__live-badge {
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: var(--rekhi-chat-green);
	border: 2.5px solid #fff;
	animation: rekhi-chat-ring 2s ease-out infinite;
	z-index: 2;
}

@keyframes rekhi-chat-ring {
	0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
	70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.rekhi-live-chat__toggle-label:empty {
	display: none;
}

.rekhi-live-chat--inline .rekhi-live-chat__toggle {
	width: 100%;
	height: auto;
	min-height: 52px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 14px;
	background: var(--rekhi-chat-orange);
	color: #fff;
	box-shadow: none;
	font-weight: 800;
}

.rekhi-live-chat--inline .rekhi-live-chat__toggle-face {
	width: 40px;
	height: 40px;
}

.rekhi-live-chat--inline .rekhi-live-chat__toggle-label {
	display: inline;
	color: #fff;
}

.rekhi-live-chat__pill {
	position: fixed;
	right: 98px;
	bottom: 114px;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	background: #fff;
	color: #0f172a;
	font: 600 13px/1 inherit;
	box-shadow: 0 4px 16px rgba(16, 24, 40, 0.18);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.rekhi-live-chat__pill[hidden],
.rekhi-live-chat.is-open .rekhi-live-chat__pill {
	opacity: 0;
	pointer-events: none;
	transform: translateY(6px);
}

.rekhi-live-chat--inline .rekhi-live-chat__pill {
	display: none;
}

.rekhi-live-chat__pill-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rekhi-chat-green);
	animation: rekhi-chat-dot 1.6s ease-in-out infinite;
}

@keyframes rekhi-chat-dot {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(0.7); opacity: 0.55; }
}

.rekhi-live-chat__greet {
	position: fixed;
	right: 22px;
	bottom: 176px;
	z-index: 9999;
	width: 268px;
	max-width: calc(100vw - 48px);
	padding: 14px 16px;
	border-radius: 16px;
	background: #fff;
	color: #15171c;
	box-shadow: 0 10px 40px rgba(16, 24, 40, 0.2);
	cursor: pointer;
	font-size: 13.5px;
	line-height: 1.45;
}

.rekhi-live-chat__greet[hidden] {
	display: none !important;
}

.rekhi-live-chat--inline .rekhi-live-chat__greet {
	display: none !important;
}

.rekhi-live-chat__greet-x {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: transparent;
	color: #9aa1ad;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
}

.rekhi-live-chat__greet-head {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 8px;
	padding-right: 18px;
}

.rekhi-live-chat__greet-head strong {
	display: block;
	font-size: 13px;
	color: #15171c;
}

.rekhi-live-chat__greet-head small {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	color: #6b7280;
}

.rekhi-live-chat__online-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--rekhi-chat-green);
	display: inline-block;
}

.rekhi-live-chat__greet p {
	margin: 0;
	color: #15171c;
}

.rekhi-live-chat__panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	display: grid;
	width: min(400px, calc(100vw - 32px));
	max-height: min(620px, calc(100vh - 120px));
	overflow: hidden;
	border: 1px solid var(--rekhi-chat-border);
	border-radius: 16px;
	color: var(--rekhi-chat-text);
	background:
		linear-gradient(135deg, rgba(255, 107, 0, 0.14), transparent 55%),
		rgba(11, 11, 11, 0.96);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
}

.rekhi-live-chat__panel[hidden] {
	display: none !important;
}

.rekhi-live-chat--inline .rekhi-live-chat__panel {
	position: relative;
	right: auto;
	bottom: auto;
	width: 100%;
	margin-top: 12px;
	max-height: none;
}

.rekhi-live-chat__panel header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--rekhi-chat-border);
}

.rekhi-live-chat__header-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.rekhi-live-chat__header-meta strong {
	display: block;
	font-size: 0.92rem;
	line-height: 1.2;
}

.rekhi-live-chat__header-meta small {
	display: block;
	font-size: 0.72rem;
	color: var(--rekhi-chat-muted);
	line-height: 1.3;
}

.rekhi-live-chat__panel header button {
	border: 0;
	color: var(--rekhi-chat-text);
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

.rekhi-live-chat__log {
	display: grid;
	gap: 10px;
	max-height: 240px;
	padding: 14px;
	overflow: auto;
}

.rekhi-live-chat__log p {
	margin: 0;
}

.rekhi-live-chat__log span {
	display: inline-block;
	padding: 10px 12px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.08);
	line-height: 1.45;
	font-size: 0.9rem;
	white-space: pre-wrap;
	max-width: 100%;
}

.rekhi-live-chat__log p.is-user {
	text-align: right;
}

.rekhi-live-chat__log p.is-user span {
	background: rgba(255, 107, 0, 0.28);
}

.rekhi-live-chat__log p.is-typing span {
	color: var(--rekhi-chat-muted);
	font-style: italic;
}

.rekhi-live-chat__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.rekhi-live-chat__actions button,
.rekhi-live-chat__actions a {
	border: 1px solid var(--rekhi-chat-border);
	border-radius: 999px;
	padding: 7px 11px;
	font-size: 0.75rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.rekhi-live-chat__actions .is-primary {
	border: 0;
	background: var(--rekhi-chat-orange);
	color: #fff;
}

.rekhi-live-chat__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 12px 10px;
}

.rekhi-live-chat__chip {
	border: 1px solid var(--rekhi-chat-border);
	border-radius: 999px;
	padding: 7px 11px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--rekhi-chat-text);
	font-size: 0.75rem;
	font-weight: 650;
	cursor: pointer;
	text-align: left;
}

.rekhi-live-chat__chip:hover {
	border-color: rgba(255, 107, 0, 0.55);
	background: rgba(255, 107, 0, 0.14);
}

.rekhi-live-chat__lead {
	padding: 0 12px 10px;
	border-top: 1px solid var(--rekhi-chat-border);
	padding-top: 10px;
}

.rekhi-live-chat__lead-hint {
	margin: 0 0 8px;
	font-size: 0.72rem;
	color: var(--rekhi-chat-muted);
	line-height: 1.35;
}

.rekhi-live-chat__lead-fields {
	display: grid;
	gap: 6px;
}

.rekhi-live-chat__lead-fields input,
.rekhi-live-chat input[name="question"] {
	min-width: 0;
	width: 100%;
	border: 1px solid var(--rekhi-chat-border);
	border-radius: 999px;
	padding: 10px 12px;
	color: var(--rekhi-chat-text);
	background: rgba(255, 255, 255, 0.08);
	box-sizing: border-box;
}

.rekhi-live-chat form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	padding: 0 12px 12px;
}

.rekhi-live-chat form button {
	border: 0;
	border-radius: 999px;
	padding: 0 16px;
	color: #fff;
	background: var(--rekhi-chat-orange);
	font-weight: 800;
	cursor: pointer;
}

.rekhi-live-chat__handoff {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 8px;
	padding: 0 12px 12px;
}

.rekhi-live-chat__handoff a {
	padding: 10px;
	border: 1px solid var(--rekhi-chat-border);
	border-radius: 12px;
	color: #fff;
	text-align: center;
	text-decoration: none;
	font-weight: 800;
	font-size: 0.78rem;
	background: rgba(255, 255, 255, 0.05);
}

.rekhi-live-chat__cta-primary {
	border: 0 !important;
	background: var(--rekhi-chat-orange) !important;
	color: #fff !important;
}

.rekhi-live-chat__nudge {
	position: fixed;
	right: 22px;
	bottom: 176px;
	z-index: 9999;
	max-width: 260px;
	padding: 12px 14px;
	border-radius: 14px;
	background: #fff;
	color: #0f172a;
	font-size: 0.82rem;
	font-weight: 650;
	line-height: 1.4;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
	cursor: pointer;
}

.rekhi-live-chat__nudge[hidden] {
	display: none !important;
}

@media (max-width: 520px) {
	/* Stack above WhatsApp / phone FABs; keep CTAs readable */
	.rekhi-live-chat {
		right: 14px;
		bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	}

	.rekhi-live-chat__toggle {
		width: 54px;
		height: 54px;
	}

	.rekhi-live-chat__toggle-face {
		width: 54px;
		height: 54px;
	}

	/* Online pill crowds the hero on narrow phones — hide it */
	.rekhi-live-chat__pill {
		display: none !important;
	}

	.rekhi-live-chat__greet,
	.rekhi-live-chat__nudge {
		right: 14px;
		bottom: calc(156px + env(safe-area-inset-bottom, 0px));
		max-width: min(280px, calc(100vw - 28px));
	}

	/* True full-screen chat shell */
	.rekhi-live-chat.is-open {
		right: 0;
		bottom: 0;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 10080;
	}

	.rekhi-live-chat.is-open .rekhi-live-chat__toggle {
		display: none;
	}

	.rekhi-live-chat.is-open .rekhi-live-chat__panel {
		position: fixed;
		inset: 0;
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0;
		display: flex !important;
		flex-direction: column;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		z-index: 10081;
	}

	.rekhi-live-chat.is-open .rekhi-live-chat__log {
		flex: 1 1 auto;
		max-height: none;
		min-height: 0;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	.rekhi-live-chat.is-open .rekhi-live-chat__chips,
	.rekhi-live-chat.is-open .rekhi-live-chat__lead,
	.rekhi-live-chat.is-open form,
	.rekhi-live-chat.is-open .rekhi-live-chat__handoff {
		flex: 0 0 auto;
	}

	.rekhi-live-chat.is-open .rekhi-live-chat__handoff {
		grid-template-columns: 1fr;
	}

	/* Hide chat while mobile mega drawer is open */
	html.rekhi-rmm-scroll-lock .rekhi-live-chat:not(.is-open) {
		opacity: 0;
		pointer-events: none;
	}
}
