/* ---------------------------------------------------------------------------
   Yunfanzhi Live Chat – visitor widget
   Works standalone; colours fall back to the yunfanzhi-dtc theme variables
   when that theme is active.
   ------------------------------------------------------------------------- */

:root {
	--yfz-lc-accent: var(--yfz-color-accent, #2563eb);
	--yfz-lc-accent-hover: var(--yfz-color-accent-hover, #1d4ed8);
	--yfz-lc-primary: var(--yfz-color-primary, #111827);
	--yfz-lc-text: var(--yfz-color-text, #1f2937);
	--yfz-lc-muted: var(--yfz-color-text-muted, #6b7280);
	--yfz-lc-border: var(--yfz-color-border, #e5e7eb);
	--yfz-lc-bg: var(--yfz-color-bg, #ffffff);
	--yfz-lc-bg-alt: var(--yfz-color-bg-alt, #f9fafb);
	--yfz-lc-radius: var(--yfz-radius, 10px);
	--yfz-lc-font: var(--yfz-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

.yfz-lc *,
.yfz-lc *::before,
.yfz-lc *::after {
	box-sizing: border-box;
}

.yfz-lc {
	--yfz-lc-bottom: clamp(14px, 3vw, 24px);
	--yfz-lc-side: clamp(14px, 3vw, 24px);
	position: fixed;
	right: var(--yfz-lc-side);
	bottom: var(--yfz-lc-bottom);
	z-index: 980;
	font-family: var(--yfz-lc-font);
	line-height: 1.4;
	/* Column-reverse keeps the round launcher at the very bottom while the
	   panel opens ABOVE it. Before this the launcher ended up stacked above
	   the panel, which looked like a stray "big close button" outside the
	   chat window. */
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-end;
}

/* When the legacy theme widget stays visible, sit above it. */
.yfz-lc.yfz-lc--shift {
	bottom: calc(var(--yfz-lc-bottom) + 76px);
}

/* Mobile/tablet sticky add-to-cart bar (theme `.sticky-atc`) slides over the
   bottom edge — raise the launcher above it exactly like the theme does for
   its own chat widget. */
@supports selector(:has(*)) {
	body:has(.sticky-atc.is-visible) #yfz-lc {
		bottom: calc(var(--yfz-lc-bottom) + 76px);
	}

	@media (max-width: 767px) {
		body:has(.sticky-atc.is-visible) #yfz-lc {
			bottom: calc(var(--yfz-lc-bottom) + 92px);
		}
	}
}

/* Legacy widget hidden entirely (setting enabled). */
body.yfz-lc-hide-legacy .chat-widget {
	display: none !important;
}

/* Any element carrying the `hidden` attribute is truly hidden – several
   interactive regions (toolbar, profile form, emoji pop, hub menu…) use
   `display:flex` and would otherwise ignore the attribute. */
.yfz-lc [hidden],
.yfz-lc__panel[hidden],
.yfz-lc__badge[hidden],
.yfz-lc__notice[hidden] {
	display: none !important;
}

/* Accessible-only labels (toggle button text, "back to top" name, etc.) – WP
   ships a `.screen-reader-text` helper but we own this UI, so declare our own
   visually-hidden style. */
.screen-reader-text,
.yfz-lc .screen-reader-text {
	border: 0 !important;
	clip: rect(1px, 1px, 1px, 1px) !important;
	-webkit-clip-path: inset(50%) !important;
	clip-path: inset(50%) !important;
	height: 1px !important;
	margin: -1px !important;
	overflow: hidden !important;
	padding: 0 !important;
	position: absolute !important;
	width: 1px !important;
	white-space: nowrap !important;
	word-wrap: normal !important;
}

/* ------------------------------------------------------------------ Launcher */
.yfz-lc__launcher {
	display: flex;
	justify-content: flex-end;
}

/* When the chat panel is open we hide the launcher entirely so the only
   "close" affordance is the X button inside the panel header. */
.yfz-lc.yfz-lc--open .yfz-lc__launcher {
	display: none;
}

.yfz-lc__toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 999px;
	background: var(--yfz-lc-accent);
	color: #fff;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
	cursor: pointer;
	transition: background-color 180ms ease, transform 180ms ease;
}

.yfz-lc__toggle:hover {
	background: var(--yfz-lc-accent-hover);
	transform: translateY(-2px);
}

.yfz-lc__toggle:focus-visible {
	outline: 2px solid var(--yfz-lc-accent);
	outline-offset: 3px;
}

.yfz-lc__toggle-icon {
	display: inline-flex;
}

.yfz-lc__toggle-icon--close {
	display: none;
}

.yfz-lc__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------------- Panel */
.yfz-lc__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(92vw, 380px);
	height: min(600px, calc(100vh - 100px));
	max-height: min(600px, calc(100vh - 100px));
	margin-bottom: 12px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 18px;
	background: var(--yfz-lc-bg);
	box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
	/* `overflow: visible` keeps the emoji popover + drop overlay from being
	   clipped by the rounded panel while the inner `.yfz-lc__messages` still
	   has its own overflow:auto for chat scrolling. */
	overflow: visible;
}

.yfz-lc__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--yfz-lc-primary);
	color: #fff;
}

.yfz-lc__identity {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1 1 auto;
}

.yfz-lc__title {
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yfz-lc__state {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	opacity: 0.92;
}

.yfz-lc__dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	flex: none;
	background: #9ca3af;
}

.yfz-lc__dot--online {
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
}

.yfz-lc__close {
	position: relative;
	flex: none;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	cursor: pointer;
	transition: background-color 180ms ease, transform 200ms ease;
}

.yfz-lc__close svg {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 16px;
	height: 16px;
	stroke-width: 2.4;
	transition: transform 220ms ease;
}

.yfz-lc__close:hover {
	background: rgba(255, 255, 255, 0.26);
	transform: rotate(90deg);
}

.yfz-lc__close:active {
	transform: rotate(90deg) scale(0.94);
}

.yfz-lc__close:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.65);
	outline-offset: 2px;
}

/* -------------------------------------------------- Optional visitor profile
   Collapsed by default: a slim pill invites the visitor to identify; the
   two-field form only appears while it is being edited. */
.yfz-lc__profile {
	padding: 8px 14px 0;
}

.yfz-lc__profile-idle {
	display: flex;
}

.yfz-lc__profile-open {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	max-width: 100%;
	padding: 4px 12px 4px 10px;
	border: 0;
	border-radius: 999px;
	background: var(--yfz-lc-bg-alt);
	border: 1px dashed var(--yfz-lc-border);
	color: var(--yfz-lc-muted);
	font-family: inherit;
	font-size: 12px;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.yfz-lc__profile-open svg {
	flex: none;
	color: var(--yfz-lc-accent);
}

.yfz-lc__profile-open span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yfz-lc__profile-open:hover {
	background: rgba(37, 99, 235, 0.08);
	border-color: var(--yfz-lc-accent);
	color: var(--yfz-lc-text);
}

.yfz-lc__profile-form {
	display: flex;
	gap: 6px;
	align-items: center;
}

.yfz-lc__profile-form .yfz-lc__input {
	min-width: 0;
	min-height: 38px;
	padding: 6px 10px;
	font-size: 12.5px;
}

.yfz-lc__profile-form .yfz-lc__input--sm {
	flex: 1 1 0;
}

.yfz-lc__profile-form .yfz-lc__input:first-child {
	flex: 0 1 38%;
}

.yfz-lc__profile-save {
	flex: none;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 12px;
	background: var(--yfz-lc-accent);
	color: #fff;
	cursor: pointer;
	transition: background-color 180ms ease;
}

.yfz-lc__profile-save:hover {
	background: var(--yfz-lc-accent-hover);
}

.yfz-lc__input {
	width: 100%;
	min-height: 40px;
	padding: 8px 12px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: var(--yfz-lc-radius);
	background: var(--yfz-lc-bg);
	color: var(--yfz-lc-text);
	font-family: inherit;
	font-size: 13px;
	transition: border-color 180ms ease, box-shadow 180ms ease;
}

.yfz-lc__input:focus {
	outline: none;
	border-color: var(--yfz-lc-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ---------------------------------------------------------------- Messages */
.yfz-lc__messages {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
}

.yfz-lc__msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 92%;
	min-width: 0;
	font-size: 14px;
	line-height: 1.5;
}

.yfz-lc__msg--visitor {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.yfz-lc__msg--agent {
	align-self: flex-start;
}

.yfz-lc__bubble {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
	padding: 9px 13px;
	border-radius: 16px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.yfz-lc__msg--visitor .yfz-lc__bubble {
	background: var(--yfz-lc-accent);
	color: #fff;
	border-bottom-right-radius: 5px;
}

.yfz-lc__msg--agent .yfz-lc__bubble {
	background: var(--yfz-lc-bg-alt);
	border: 1px solid var(--yfz-lc-border);
	color: var(--yfz-lc-text);
	border-bottom-left-radius: 5px;
}

.yfz-lc__avatar {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background: var(--yfz-lc-bg-alt);
	object-fit: cover;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.yfz-lc__msg--system {
	align-self: center;
	display: block;
	background: transparent;
	box-shadow: none;
	font-size: 12px;
	color: var(--yfz-lc-muted);
	text-align: center;
	max-width: 100%;
	padding: 4px 10px;
}

.yfz-lc__msg-meta {
	display: block;
	margin-top: 3px;
	font-size: 10px;
	opacity: 0.75;
}

.yfz-lc__greeting {
	align-self: center;
	margin: 0 0 4px;
	padding: 6px 14px;
	font-size: 12.5px;
	color: var(--yfz-lc-muted);
	text-align: center;
}

/* ------------------------------------------------------------------ Notice */
.yfz-lc__notice {
	margin: 0 14px 10px;
	padding: 8px 12px;
	border: 1px dashed var(--yfz-lc-border);
	border-radius: var(--yfz-lc-radius);
	background: var(--yfz-lc-bg-alt);
	color: var(--yfz-lc-muted);
	font-size: 12.5px;
}

/* ---------------------------------------------------------------- Composer
   Column layout: optional tool strip above the text row. */
.yfz-lc__composer {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 6px 14px 10px;
	border-top: 1px solid var(--yfz-lc-border);
	background: var(--yfz-lc-bg);
}

.yfz-lc__composer-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.yfz-lc__textarea {
	flex: 1 1 auto;
	min-height: 40px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: var(--yfz-lc-radius);
	background: var(--yfz-lc-bg);
	color: var(--yfz-lc-text);
	font-family: inherit;
	font-size: 14px;
	resize: none;
	transition: border-color 180ms ease, box-shadow 180ms ease;
}

.yfz-lc__textarea:focus {
	outline: none;
	border-color: var(--yfz-lc-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.yfz-lc__send {
	position: relative;
	flex: none;
	display: inline-block;
	width: 46px;
	height: 44px;
	border: 0;
	border-radius: 12px;
	background: var(--yfz-lc-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
	transition: background-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.yfz-lc__send svg {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 20px;
	height: 20px;
}

.yfz-lc__send:hover {
	background: var(--yfz-lc-accent-hover);
	transform: translateY(-1px);
}

.yfz-lc__send:disabled {
	opacity: 0.55;
	cursor: default;
	box-shadow: none;
	transform: none;
}

/* --------------------------------------------------------------- Mobile (≤600) */
@media (max-width: 600px) {
	.yfz-lc {
		--yfz-lc-bottom: max(10px, env(safe-area-inset-bottom));
		right: 10px;
	}

	.yfz-lc.yfz-lc--shift {
		bottom: calc(var(--yfz-lc-bottom) + 68px);
	}

	.yfz-lc__panel {
		position: fixed;
		inset: 0;
		z-index: 5;
		width: 100%;
		height: 100%;
		max-height: none;
		margin: 0;
		border: 0;
		border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.yfz-lc__header {
		padding-top: max(12px, env(safe-area-inset-top));
	}

	.yfz-lc__messages {
		flex: 1 1 auto;
		min-height: 0;
		max-height: none;
	}
}

/* ------------------------------------------------------- Back-to-top button.
   Sits on the right edge, just above the launcher, and hides while the chat
   panel is open so the two never overlap. */
.yfz-lc__top {
	position: absolute;
	right: 8px;
	bottom: calc(56px + 14px);
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 999px;
	background: var(--yfz-lc-bg);
	color: var(--yfz-lc-text);
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
	cursor: pointer;
	z-index: 3;
	transition: background-color 180ms ease, transform 180ms ease;
}

.yfz-lc__top:hover {
	background: var(--yfz-lc-bg-alt);
	transform: translateY(-2px);
}

.yfz-lc__top svg {
	width: 18px;
	height: 18px;
}

body.yfz-lc-scrolled .yfz-lc__top {
	display: inline-flex;
}

.yfz-lc.yfz-lc--open .yfz-lc__top {
	display: none !important;
}

@media (max-width: 600px) {
	.yfz-lc__top {
		right: 4px;
		bottom: calc(56px + 8px);
	}
}

/* ------------------------------------------------------- Composer tool strip
   "+" in the input row expands this strip with the file + emoji actions. */
.yfz-lc__toolbar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 0 10px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--yfz-lc-border);
}

.yfz-lc__toolbar.is-collapsed {
	display: none;
}

.yfz-lc__tool {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 10px;
	background: var(--yfz-lc-bg-alt);
	color: var(--yfz-lc-text);
	cursor: pointer;
	transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.yfz-lc__tool svg {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 16px;
	height: 16px;
	stroke-width: 2;
}

.yfz-lc__tool:hover,
.yfz-lc__tool[aria-expanded='true'] {
	background: var(--yfz-lc-accent);
	border-color: var(--yfz-lc-accent);
	color: #fff;
	transform: translateY(-1px);
}

.yfz-lc__tool:disabled {
	opacity: 0.55;
	cursor: default;
	transform: none;
}

.yfz-lc__toolbar-hint {
	margin-left: auto;
	font-size: 11.5px;
	color: var(--yfz-lc-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yfz-lc__toolbar-collapse {
	position: relative;
	flex: none;
	display: inline-block;
	width: 26px;
	height: 26px;
	margin-left: 4px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--yfz-lc-muted);
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

.yfz-lc__toolbar-collapse:hover {
	background: var(--yfz-lc-bg-alt);
	color: var(--yfz-lc-text);
}

.yfz-lc__toolbar-collapse svg {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 14px;
	height: 14px;
	stroke-width: 2.4;
}

/* "+" expand button at the start of the input row (only visible when the
   toolbar above is collapsed). */
.yfz-lc__expand {
	position: relative;
	flex: none;
	display: inline-block;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 12px;
	background: var(--yfz-lc-bg-alt);
	color: var(--yfz-lc-accent);
	cursor: pointer;
	transition: background-color 180ms ease, color 180ms ease;
}

.yfz-lc__expand[hidden] {
	display: none;
}

.yfz-lc__expand:hover {
	background: var(--yfz-lc-accent);
	color: #fff;
}

.yfz-lc__expand svg {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	stroke-width: 2.2;
}

/* Upload / send progress pill shown above the composer. */
.yfz-lc__sending {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: center;
	margin: 6px 14px 0;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--yfz-lc-bg-alt);
	border: 1px solid var(--yfz-lc-border);
	color: var(--yfz-lc-muted);
	font-size: 12px;
	align-self: center;
}

.yfz-lc__sending-dots {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: var(--yfz-lc-accent);
	animation: yfz-lc-pulse 1s ease-in-out infinite;
}

@keyframes yfz-lc-pulse {
	0%, 100% {
		opacity: 0.35;
		transform: scale(0.85);
	}
	50% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes yfz-lc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Transient visitor bubble shown while files are uploading/sending.
   Replaced by the final bubble once the request returns. */
.yfz-lc__msg--uploading {
	opacity: 0.95;
}

.yfz-lc__msg--uploading .yfz-lc__bubble {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 200px;
	max-width: 280px;
	padding: 9px 12px;
	background: var(--yfz-lc-bg-alt);
	color: var(--yfz-lc-text);
	border: 1px solid var(--yfz-lc-border);
	border-radius: 14px 14px 4px 14px;
	font-size: 12.5px;
}

.yfz-lc__uploading-spinner {
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid var(--yfz-lc-border);
	border-top-color: var(--yfz-lc-accent);
	border-radius: 50%;
	animation: yfz-lc-spin 0.7s linear infinite;
}

.yfz-lc__uploading-text {
	flex: 1;
	min-width: 0;
	line-height: 1.4;
}

.yfz-lc__uploading-text small {
	display: block;
	color: var(--yfz-lc-muted);
	font-size: 11px;
	margin-top: 2px;
}

.yfz-lc__uploading-bar {
	flex: none;
	width: 70px;
	height: 4px;
	background: var(--yfz-lc-border);
	border-radius: 2px;
	overflow: hidden;
}

.yfz-lc__uploading-bar-fill {
	height: 100%;
	width: 0;
	background: var(--yfz-lc-accent);
	transition: width 220ms ease;
}

.yfz-lc__msg--uploading.is-error .yfz-lc__bubble {
	border-color: rgba(220, 38, 38, 0.4);
	background: rgba(220, 38, 38, 0.08);
	color: #b91c1c;
}

.yfz-lc__msg--uploading.is-error .yfz-lc__uploading-spinner {
	border-color: rgba(220, 38, 38, 0.3);
	border-top-color: #b91c1c;
	animation: none;
}

.yfz-lc__emoji-pop {
	position: absolute;
	right: 12px;
	bottom: calc(100% + 6px);
	z-index: 4;
	width: calc(100% - 24px);
	max-width: 320px;
	max-height: 220px;
	overflow-y: auto;
	padding: 8px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 12px;
	background: var(--yfz-lc-bg);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 2px;
}

.yfz-lc__emoji-pop[hidden] {
	display: none;
}

.yfz-lc__emoji-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 120ms ease, transform 120ms ease;
}

.yfz-lc__emoji-btn:hover {
	background: var(--yfz-lc-bg-alt);
	transform: scale(1.1);
}

/* --------------------------------------------------------------- drop overlay
   Shown only while files are being dragged over the widget. */
.yfz-lc__drop {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: none;
	align-items: center;
	justify-content: center;
	border: 2px dashed var(--yfz-lc-accent);
	border-radius: 16px;
	background: rgba(37, 99, 235, 0.12);
	color: var(--yfz-lc-accent);
	pointer-events: none;
}

.yfz-lc__drop.is-visible {
	display: flex;
}

.yfz-lc__drop-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
}

.yfz-lc__pending {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 14px 0;
}

.yfz-lc__pending[hidden] {
	display: none;
}

.yfz-lc__pending-chip {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 10px;
	background: var(--yfz-lc-bg-alt);
	font-size: 12px;
	color: var(--yfz-lc-text);
	min-width: 0;
}

.yfz-lc__pending-thumb {
	flex: none;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: var(--yfz-lc-bg);
	overflow: hidden;
}

.yfz-lc__pending-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yfz-lc__pending-thumb svg {
	width: 16px;
	height: 16px;
	color: var(--yfz-lc-muted);
}

.yfz-lc__pending-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yfz-lc__pending-size {
	flex: none;
	font-size: 11px;
	color: var(--yfz-lc-muted);
}

.yfz-lc__pending-x {
	flex: none;
	border: 0;
	background: none;
	color: var(--yfz-lc-muted);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 2px 4px;
	border-radius: 4px;
}

.yfz-lc__pending-x:hover {
	color: var(--yfz-lc-text);
	background: rgba(127, 127, 127, 0.15);
}

/* Message attachments (image previews / file chips) inside bubbles. */
.yfz-lc__msg .yfz-lc__attachments {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 4px;
	min-width: 0;
	max-width: 100%;
}

.yfz-lc__attach-image {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	max-width: 100%;
}

.yfz-lc__attach-image img {
	display: block;
	width: auto;
	max-width: min(230px, 100%);
	max-height: 220px;
	border-radius: 10px;
	cursor: zoom-in;
}

.yfz-lc__attach-file {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 240px;
	padding: 7px 10px;
	border-radius: 10px;
	background: rgba(127, 127, 127, 0.16);
	color: inherit;
	text-decoration: none;
	font-size: 12px;
}

.yfz-lc__attach-file:hover {
	background: rgba(127, 127, 127, 0.26);
}

.yfz-lc__attach-file svg {
	flex: none;
	width: 16px;
	height: 16px;
}

.yfz-lc__attach-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.yfz-lc__attach-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	word-break: keep-all;
}

.yfz-lc__attach-sub {
	font-size: 10px;
	opacity: 0.75;
}

.yfz-lc__msg .yfz-lc__msg-text + .yfz-lc__attachments,
.yfz-lc__msg .yfz-lc__attachments + .yfz-lc__msg-text {
	margin-top: 4px;
}

/* ---------------------------------------------------------------------- Hub
   Standalone "reach us" launcher with WhatsApp / Telegram / WeChat / X /
   Email shortcuts. Lives OUTSIDE the chat panel; hidden while the panel is
   open (the whole launcher row hides at that point). */
.yfz-lc__hub {
	position: relative;
	margin-right: 8px;
}

.yfz-lc__hub-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 999px;
	background: var(--yfz-lc-bg);
	color: var(--yfz-lc-accent);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
	cursor: pointer;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.yfz-lc__hub-toggle:hover,
.yfz-lc__hub-toggle[aria-expanded='true'] {
	background: var(--yfz-lc-primary);
	color: #fff;
	transform: translateY(-2px);
}

.yfz-lc__hub-toggle:focus-visible {
	outline: 2px solid var(--yfz-lc-accent);
	outline-offset: 3px;
}

.yfz-lc__hub-toggle svg {
	position: absolute;
	inset: 0;
	margin: auto;
	transition: transform 220ms ease;
}

.yfz-lc__hub-icon {
	display: inline-flex;
}

.yfz-lc__hub-icon--close {
	display: none;
}

.yfz-lc__hub-toggle[aria-expanded='true'] .yfz-lc__hub-icon--open {
	display: none;
}

.yfz-lc__hub-toggle[aria-expanded='true'] .yfz-lc__hub-icon--close {
	display: inline-flex;
}

.yfz-lc__hub-menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 10px);
	z-index: 6;
	width: min(320px, calc(100vw - 40px));
	padding: 6px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 16px;
	background: var(--yfz-lc-bg);
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.yfz-lc__hub-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 10px 8px;
	font-size: 12px;
	font-weight: 700;
	color: var(--yfz-lc-text);
}

.yfz-lc__hub-head svg {
	flex: none;
	width: 15px;
	height: 15px;
	color: var(--yfz-lc-accent);
}

.yfz-lc__hub-item + .yfz-lc__hub-item {
	border-top: 1px solid var(--yfz-lc-border);
}

.yfz-lc__hub-row {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: inherit;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color 140ms ease;
}

.yfz-lc__hub-row:hover {
	background: var(--yfz-lc-bg-alt);
}

.yfz-lc__hub-ic {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	color: #fff;
}

.yfz-lc__hub-ic svg {
	width: 21px;
	height: 21px;
}

.yfz-lc__hub-meta {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.yfz-lc__hub-name {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--yfz-lc-text);
}

.yfz-lc__hub-sub {
	font-size: 11.5px;
	color: var(--yfz-lc-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yfz-lc__hub-chev {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--yfz-lc-muted);
	transition: transform 180ms ease;
}

.yfz-lc__hub-item.is-open .yfz-lc__hub-chev {
	transform: rotate(180deg);
}

/* QR expansion inside a hub item. */
.yfz-lc__hub-qr {
	padding: 2px 12px 12px;
}

.yfz-lc__hub-qr-img {
	display: block;
	width: 168px;
	height: 168px;
	margin: 4px auto 10px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 12px;
	padding: 6px;
	background: #fff;
	object-fit: contain;
}

.yfz-lc__hub-qr-tip {
	margin: 0 0 10px;
	text-align: center;
	font-size: 12px;
	color: var(--yfz-lc-muted);
}

.yfz-lc__hub-actions {
	display: flex;
	justify-content: center;
	gap: 8px;
}

.yfz-lc__hub-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 108px;
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	border: 0;
	background: var(--yfz-lc-accent);
	color: #fff;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 180ms ease, transform 180ms ease;
}

.yfz-lc__hub-btn:hover {
	background: var(--yfz-lc-accent-hover);
	transform: translateY(-1px);
	color: #fff;
}

.yfz-lc__hub-btn--ghost {
	background: var(--yfz-lc-bg-alt);
	border: 1px solid var(--yfz-lc-border);
	color: var(--yfz-lc-text);
}

.yfz-lc__hub-btn--ghost:hover {
	background: var(--yfz-lc-border);
	color: var(--yfz-lc-text);
}

@media (max-width: 600px) {
	.yfz-lc__hub {
		margin-right: 6px;
	}

	.yfz-lc__hub-menu {
		right: -52px;
	}
}

/* ----------------------------------------------------------- emoji image style
   Rendered by assets/js/emoji-util.js. */
.yfz-lc__emoji-btn > .yfz-emoji {
	width: 24px;
	height: 24px;
}

.yfz-lc__msg-text .yfz-emoji {
	width: 1.2em;
	height: 1.2em;
	vertical-align: -0.2em;
}

/* ------------------------------------------------- Translation preference
   Visitor-side panel: outgoing messages can be translated; received
   (agent) messages always show verbatim. The choice is kept in the
   browser (localStorage) and sent with every poll. */
.yfz-lc__tr-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 2px 0;
	font-size: 11.5px;
	color: var(--yfz-lc-muted);
}

.yfz-lc__tr-bar-text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yfz-lc__tr-open {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	flex: none;
	padding: 3px 9px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 999px;
	background: transparent;
	color: var(--yfz-lc-muted);
	font-size: 11px;
	line-height: 1.7;
	cursor: pointer;
	transition: border-color 160ms ease, color 160ms ease;
}

.yfz-lc__tr-open:hover {
	border-color: var(--yfz-lc-accent);
	color: var(--yfz-lc-accent);
}

.yfz-lc__tr-state {
	font-weight: 600;
	text-transform: uppercase;
}

.yfz-lc__tr-pop {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: calc(100% + 8px);
	z-index: 6;
	max-width: 340px;
	overflow: hidden;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 14px;
	background: var(--yfz-lc-bg);
	box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.yfz-lc__tr-pop[hidden] {
	display: none !important;
}

.yfz-lc__tr-pop-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--yfz-lc-border);
}

.yfz-lc__tr-pop-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--yfz-lc-text);
}

.yfz-lc__tr-pop-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--yfz-lc-muted);
	cursor: pointer;
}

.yfz-lc__tr-pop-close:hover {
	background: var(--yfz-lc-bg-alt);
	color: var(--yfz-lc-text);
}

.yfz-lc__tr-sec {
	padding: 11px 12px;
	border-bottom: 1px solid var(--yfz-lc-border);
}

.yfz-lc__tr-sec:last-of-type {
	border-bottom: 0;
}

.yfz-lc__tr-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.yfz-lc__tr-row-label {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--yfz-lc-text);
}

.yfz-lc__tr-switch {
	position: relative;
	display: inline-block;
	flex: none;
	width: 38px;
	height: 21px;
}

.yfz-lc__tr-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.yfz-lc__tr-switch-ui {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #cbd5e1;
	transition: background 180ms ease;
}

.yfz-lc__tr-switch-ui::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
	transition: transform 180ms ease;
}

.yfz-lc__tr-switch input:checked + .yfz-lc__tr-switch-ui {
	background: var(--yfz-lc-accent);
}

.yfz-lc__tr-switch input:checked + .yfz-lc__tr-switch-ui::after {
	transform: translateX(17px);
}

.yfz-lc__tr-switch input:focus-visible + .yfz-lc__tr-switch-ui {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.yfz-lc__tr-desc {
	margin: 7px 0 0;
	font-size: 11.5px;
	line-height: 1.55;
	color: var(--yfz-lc-muted);
}

.yfz-lc__tr-field {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
}

.yfz-lc__tr-field-label {
	flex: none;
	font-size: 11.5px;
	color: var(--yfz-lc-muted);
}

.yfz-lc__tr-select {
	flex: 1 1 auto;
	min-width: 0;
	padding: 6px 8px;
	border: 1px solid var(--yfz-lc-border);
	border-radius: 8px;
	background: var(--yfz-lc-bg);
	color: var(--yfz-lc-text);
	font-size: 12px;
	font-family: inherit;
}

.yfz-lc__tr-select:focus {
	outline: none;
	border-color: var(--yfz-lc-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.yfz-lc__tr-save {
	display: block;
	width: calc(100% - 24px);
	margin: 0 12px 12px;
	padding: 9px 12px;
	border: 0;
	border-radius: 9px;
	background: var(--yfz-lc-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 160ms ease;
}

.yfz-lc__tr-save:hover {
	background: var(--yfz-lc-accent-hover);
}

/* -----------------------------------------------------------------------
 * Visitor translation preference is temporarily not exposed on the
 * front-end – hide the entire preference chrome (status bar, language
 * badge, settings trigger, popover). Delete this block to re-open it.
 * --------------------------------------------------------------------- */
.yfz-lc [class^="yfz-lc__tr-"],
.yfz-lc [class*=" yfz-lc__tr-"] {
	display: none !important;
}

/* -----------------------------------------------------------------------
 * Voice-message recording
 * --------------------------------------------------------------------- */
.yfz-lc__tool--voice.is-recording {
	color: #e11d48;
}

.yfz-lc__tool.is-recording svg {
	animation: yfz-lc-rec-pulse 1s ease-in-out infinite;
}

@keyframes yfz-lc-rec-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}

.yfz-lc__record {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 4px 4px;
	margin-bottom: 4px;
	color: var(--yfz-lc-text);
}

.yfz-lc__record-dot {
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #ef4444;
	animation: yfz-lc-rec-dot 1.1s ease-in-out infinite;
}

@keyframes yfz-lc-rec-dot {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(0.72); opacity: 0.55; }
}

.yfz-lc__record-text {
	flex: 1 1 auto;
	font-size: 12.5px;
	font-weight: 600;
	color: #dc2626;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yfz-lc__record-time {
	flex: none;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--yfz-lc-muted);
}

.yfz-lc__record-send,
.yfz-lc__record-cancel {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: #fff;
	transition: background 140ms ease, transform 80ms ease;
}

.yfz-lc__record-send {
	background: var(--yfz-lc-accent);
}

.yfz-lc__record-send:hover {
	background: var(--yfz-lc-accent-hover);
}

.yfz-lc__record-send:active,
.yfz-lc__record-cancel:active {
	transform: scale(0.92);
}

.yfz-lc__record-cancel {
	background: #64748b;
}

.yfz-lc__record-cancel:hover {
	background: #475569;
}

/* -----------------------------------------------------------------------
 * Voice-message bubbles
 * --------------------------------------------------------------------- */
.yfz-lc__attach-audio {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: 230px;
	padding: 7px 12px 7px 7px;
	border-radius: 12px;
	background: rgba(127, 127, 127, 0.18);
}

.yfz-lc__audio-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--yfz-lc-accent);
	color: #fff;
	cursor: pointer;
	transition: background 140ms ease;
}

.yfz-lc__audio-play:hover {
	background: var(--yfz-lc-accent-hover);
}

.yfz-lc__audio-ic {
	width: 15px;
	height: 15px;
}

.yfz-lc__audio-ic--pause {
	display: none;
}

.yfz-lc__attach-audio.is-playing .yfz-lc__audio-ic--play {
	display: none;
}

.yfz-lc__attach-audio.is-playing .yfz-lc__audio-ic--pause {
	display: block;
}

.yfz-lc__audio-meta {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.yfz-lc__audio-name {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yfz-lc__audio-dur {
	font-size: 10.5px;
	font-variant-numeric: tabular-nums;
	opacity: 0.72;
}

/* -----------------------------------------------------------------------
 * Call controls in the panel header
 * --------------------------------------------------------------------- */
.yfz-lc__call-btns {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

/* The call affordances should always be reachable from the header; the
   JS layer only toggles the `disabled` state, not visibility, so a stale
   or short-circuited JS bundle can never hide the buttons from the
   visitor. */
.yfz-lc__call-btns[hidden] {
	display: flex !important;
}

.yfz-lc__call-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(127, 127, 127, 0.14);
	color: inherit;
	cursor: pointer;
	transition: background 140ms ease, color 140ms ease;
}

.yfz-lc__call-btn:hover {
	background: var(--yfz-lc-accent);
	color: #fff;
}

.yfz-lc__call-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.yfz-lc__call-btn:disabled:hover {
	background: rgba(127, 127, 127, 0.14);
	color: inherit;
}

/* -----------------------------------------------------------------------
 * Call screen (incoming / outgoing / active)
 * --------------------------------------------------------------------- */
.yfz-lc__call-stage {
	position: absolute;
	inset: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	border-radius: inherit;
	overflow: hidden;
	background: var(--yfz-lc-bg);
}

.yfz-lc__call-note {
	max-width: 240px;
	padding: 10px 14px;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.18);
	font-size: 13px;
	text-align: center;
	color: var(--yfz-lc-text);
}

/* Voice-call playback element: kept out of the flow and invisible so the
   call card stays clean while the remote audio still reaches the user. */
.yfz-lc__call-audio,
.yfz-lc-a__call-audio {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
}

.yfz-lc__call-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	width: 260px;
	text-align: center;
}

.yfz-lc__call-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 86px;
	height: 86px;
	margin-bottom: 10px;
	border-radius: 50%;
	background: var(--yfz-lc-accent);
	color: #fff;
}

.yfz-lc__call-avatar .yfz-lc__call-avatar-ic svg {
	width: 38px;
	height: 38px;
}

.yfz-lc__call-avatar--active {
	background: #10b981;
}

.yfz-lc__call-name {
	font-size: 17px;
	font-weight: 700;
	color: var(--yfz-lc-text);
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.yfz-lc__call-sub {
	font-size: 13px;
	color: var(--yfz-lc-muted);
}

.yfz-lc__call-sub--pulse {
	animation: yfz-lc-call-blip 1.4s ease-in-out infinite;
}

@keyframes yfz-lc-call-blip {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.yfz-lc__call-card--ring .yfz-lc__call-avatar {
	box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
	animation: yfz-lc-call-ring 1.6s ease-out infinite;
}

@keyframes yfz-lc-call-ring {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
	}
	70% {
		box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
	}
}

.yfz-lc__call-timer {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: var(--yfz-lc-text);
}

.yfz-lc__call-timer--standalone {
	margin: 6px 0 2px;
	font-size: 15px;
	font-weight: 600;
}

.yfz-lc__call-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 22px;
}

.yfz-lc__call-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
	transition: transform 100ms ease, filter 140ms ease;
}

.yfz-lc__call-action:hover {
	filter: brightness(1.08);
}

.yfz-lc__call-action:active {
	transform: scale(0.94);
}

.yfz-lc__call-action--accept {
	background: #22c55e;
}

.yfz-lc__call-action--decline {
	background: #ef4444;
}

.yfz-lc__call-action--hangup {
	background: #ef4444;
}

.yfz-lc__call-action--mic {
	background: #334155;
	color: #fff;
}

.yfz-lc__call-action--mic.is-muted {
	background: #ef4444;
}

.yfz-lc__call-mic-off {
	display: none;
}

.yfz-lc__call-action--mic.is-muted .yfz-lc__call-mic-on {
	display: none;
}

.yfz-lc__call-action--mic.is-muted .yfz-lc__call-mic-off {
	display: block;
}

/* Active video layout fills the whole stage. */
.yfz-lc__call-video {
	position: absolute;
	inset: 0;
	background: #0f172a;
	overflow: hidden;
}

.yfz-lc__call-remote {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yfz-lc__call-local {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	width: 108px;
	aspect-ratio: 3 / 4;
	border-radius: 10px;
	border: 2px solid rgba(255, 255, 255, 0.9);
	object-fit: cover;
	background: #1e293b;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.yfz-lc__call-video .yfz-lc__call-timer {
	position: absolute;
	top: 12px;
	left: 50%;
	z-index: 3;
	transform: translateX(-50%);
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 12.5px;
}

.yfz-lc__call-actions--overlay {
	position: absolute;
	bottom: 14px;
	left: 50%;
	z-index: 3;
	transform: translateX(-50%);
	margin: 0;
}

@media (max-width: 480px) {
	.yfz-lc__call-local {
		width: 84px;
	}
}

/* -----------------------------------------------------------------------
 * Message recall + voice-to-text (visitor)
 * --------------------------------------------------------------------- */

/* Recalled bubbles collapse in place to a muted placeholder. */
.yfz-lc__msg--recalled .yfz-lc__bubble {
	background: var(--yfz-lc-bg-alt) !important;
	border: 1px dashed var(--yfz-lc-border) !important;
	color: var(--yfz-lc-muted) !important;
	box-shadow: none;
	font-size: 12.5px;
}

.yfz-lc__msg--recalled .yfz-lc__avatar {
	opacity: 0.5;
	filter: grayscale(1);
}

.yfz-lc__recalled {
	font-style: normal;
}

/* Dots menu on the visitor's own fresh bubbles (hover to reveal, always
   visible on touch screens). */
.yfz-lc__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0 0 0 6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	opacity: 0;
	cursor: pointer;
	transition: background 140ms ease, opacity 140ms ease;
	vertical-align: middle;
}

.yfz-lc__more svg {
	width: 15px;
	height: 15px;
}

.yfz-lc__msg--visitor:hover .yfz-lc__more,
.yfz-lc__more:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.yfz-lc__more {
		opacity: 1;
	}
}

/* Floating message-action menu (recall). */
.yfz-lc__msg-menu {
	position: fixed;
	z-index: 99999;
	min-width: 128px;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--yfz-lc-border, #e2e8f0);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.yfz-lc__msg-menu[hidden] {
	display: none;
}

.yfz-lc__msg-menu-item {
	display: block;
	width: 100%;
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #1e293b;
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.yfz-lc__msg-menu-item:hover {
	background: #f1f5f9;
}

/* Voice card supports a transcript row / transcript request button. */
.yfz-lc__attach-audio {
	flex-wrap: wrap;
}

.yfz-lc__audio-tr {
	width: 100%;
	margin: 4px 0 0;
	padding: 2px 8px;
	border: 1px solid rgba(127, 127, 127, 0.35);
	border-radius: 10px;
	background: rgba(127, 127, 127, 0.1);
	color: inherit;
	font-size: 11px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 140ms ease;
}

.yfz-lc__audio-tr:hover {
	background: rgba(127, 127, 127, 0.22);
}

.yfz-lc__audio-tr[hidden] {
	display: none;
}

.yfz-lc__transcript {
	display: block;
	width: 100%;
	margin: 4px 0 0;
	font-size: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	opacity: 0.92;
}
