.efc-concierge,
.efc-concierge * {
	box-sizing: border-box;
}

.efc-concierge {
	--efc-primary: #3b8afb;
	--efc-dark: #353742;
	--efc-light: #f5f7fb;
	--efc-muted: #8a8c93;
	position: fixed;
	right: 24px;
	bottom: 92px;
	z-index: 99990;
	font-family: Inter, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--efc-dark);
}

.efc-concierge button,
.efc-concierge input,
.efc-concierge textarea {
	font: inherit;
	letter-spacing: 0;
}

.efc-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 60px;
	max-width: min(330px, calc(100vw - 32px));
	padding: 4px 4px 4px 16px;
	border: 1px solid #dfe4ec;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(31, 36, 48, 0.17);
	color: var(--efc-dark);
	cursor: pointer;
	text-align: left;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.efc-launcher:hover {
	border-color: var(--efc-primary);
	box-shadow: 0 12px 34px rgba(31, 36, 48, 0.22);
	transform: translateY(-1px);
}

.efc-concierge[data-state="open"] .efc-launcher,
.efc-concierge[data-state="open"] .efc-preview-badge {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

.efc-launcher:focus-visible,
.efc-icon-button:focus-visible,
.efc-nav-button:focus-visible,
.efc-send:focus-visible,
.efc-option:focus-visible,
.efc-action:focus-visible,
.efc-source:focus-visible {
	outline: 3px solid rgba(59, 138, 251, 0.35);
	outline-offset: 2px;
}

.efc-launcher__portrait,
.efc-avatar {
	display: block;
	flex: 0 0 auto;
	overflow: hidden;
	border-radius: 6px;
	background: var(--efc-light);
}

.efc-launcher__portrait {
	width: 52px;
	height: 52px;
}

.efc-launcher__portrait img,
.efc-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 22%;
}

.efc-launcher > span:not(.efc-launcher__portrait) {
	min-width: 0;
	font-weight: 650;
	white-space: nowrap;
}

.efc-preview-badge {
	position: absolute;
	right: 0;
	bottom: calc(100% + 8px);
	padding: 4px 8px;
	border-radius: 4px;
	background: var(--efc-dark);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.efc-dialog {
	position: absolute;
	right: 0;
	bottom: 74px;
	display: flex;
	width: 390px;
	max-width: calc(100vw - 32px);
	height: min(620px, calc(100dvh - 190px));
	min-height: 430px;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #dfe4ec;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 18px 50px rgba(31, 36, 48, 0.24);
}

.efc-dialog[hidden] {
	display: none;
}

.efc-dialog__header {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) 36px;
	align-items: center;
	gap: 12px;
	min-height: 76px;
	padding: 12px 14px;
	background: var(--efc-primary);
	color: #fff;
}

.efc-avatar {
	width: 48px;
	height: 48px;
	border: 2px solid rgba(255, 255, 255, 0.9);
}

.efc-dialog__header h2,
.efc-dialog__header p {
	margin: 0;
	color: inherit;
	overflow-wrap: anywhere;
}

.efc-dialog__header h2 {
	font-size: 16px;
	font-weight: 750;
	line-height: 1.25;
}

.efc-dialog__header p {
	margin-top: 2px;
	font-size: 12px;
	opacity: 0.9;
}

.efc-icon-button,
.efc-send {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.efc-icon-button {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.efc-icon-button:hover {
	background: rgba(255, 255, 255, 0.24);
}

.efc-dialog__nav {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 6px 12px;
	border-bottom: 1px solid #e2e6ed;
	background: #fff;
}

.efc-nav-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 82px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid #d4d9e2;
	border-radius: 6px;
	background: #fff;
	color: var(--efc-dark);
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
}

.efc-nav-button:hover:not(:disabled) {
	border-color: var(--efc-primary);
	color: var(--efc-primary);
}

.efc-nav-button:disabled {
	cursor: default;
	opacity: 0.42;
}

.efc-dialog__body {
	flex: 1 1 auto;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 18px 14px;
	background: var(--efc-light);
	overscroll-behavior: contain;
}

.efc-message {
	display: flex;
	margin: 0 0 12px;
}

.efc-message--visitor {
	justify-content: flex-end;
}

.efc-message__content {
	width: fit-content;
	max-width: 88%;
	padding: 10px 12px;
	border: 1px solid #e0e5ed;
	border-radius: 7px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(31, 36, 48, 0.05);
	overflow-wrap: anywhere;
}

.efc-message--visitor .efc-message__content {
	border-color: var(--efc-primary);
	background: var(--efc-primary);
	color: #fff;
}

.efc-message__content p {
	margin: 0;
	color: inherit;
	font-size: 14px;
	line-height: 1.55;
	white-space: pre-line;
}

.efc-message__content p + p {
	margin-top: 8px;
}

.efc-options,
.efc-actions,
.efc-sources {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 10px;
}

.efc-options {
	flex-direction: column;
	align-items: stretch;
}

.efc-option,
.efc-action,
.efc-source {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 7px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.efc-option {
	width: 100%;
	justify-content: flex-start;
	border: 1px solid var(--efc-primary);
	background: #fff;
	color: var(--efc-primary);
	cursor: pointer;
	text-align: left;
}

.efc-option:hover {
	background: #eef5ff;
}

.efc-option--contact,
.efc-option--contact:hover {
	background: var(--efc-primary);
	color: #fff;
	font-weight: 700;
}

.efc-option--contact:hover {
	background: #2d75dd;
}

.efc-action {
	border: 1px solid var(--efc-primary);
	background: var(--efc-primary);
	color: #fff;
}

.efc-action:hover {
	border-color: var(--efc-dark);
	background: var(--efc-dark);
	color: #fff;
}

.efc-source {
	min-height: 30px;
	padding: 4px 0;
	border-radius: 0;
	color: var(--efc-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.efc-typing {
	align-items: center;
	gap: 4px;
	min-height: 32px;
	padding: 6px 18px;
	background: var(--efc-light);
}

.efc-typing:not([hidden]) {
	display: flex;
}

.efc-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--efc-muted);
	animation: efc-pulse 1s ease-in-out infinite;
}

.efc-typing span:nth-child(2) {
	animation-delay: 120ms;
}

.efc-typing span:nth-child(3) {
	animation-delay: 240ms;
}

.efc-dialog__footer {
	flex: 0 0 auto;
	padding: 10px 12px 12px;
	border-top: 1px solid #e2e6ed;
	background: #fff;
}

.efc-privacy {
	margin: 0 2px 8px;
	color: #5c616b;
	font-size: 12px;
	line-height: 1.4;
}

.efc-dialog__footer form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 40px;
	align-items: end;
	gap: 8px;
}

.efc-dialog textarea {
	display: block;
	width: 100%;
	min-height: 42px;
	max-height: 96px;
	resize: none;
	padding: 10px 12px;
	border: 1px solid #cfd5df;
	border-radius: 6px;
	background: #fff;
	color: var(--efc-dark);
	font-size: 13px;
	line-height: 1.45;
	overflow-y: auto;
}

.efc-dialog textarea:focus {
	border-color: var(--efc-primary);
	box-shadow: 0 0 0 3px rgba(59, 138, 251, 0.14);
	outline: 0;
}

.efc-send {
	width: 40px;
	height: 42px;
	background: var(--efc-primary);
	color: #fff;
}

.efc-send:hover {
	background: var(--efc-dark);
}

.efc-send:disabled {
	cursor: wait;
	opacity: 0.55;
}

.efc-concierge .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@keyframes efc-pulse {
	0%, 100% { opacity: 0.35; transform: translateY(0); }
	50% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 640px) {
	html.efc-concierge-open,
	body.efc-concierge-open {
		overflow: hidden !important;
		overscroll-behavior: none;
	}

	.efc-concierge {
		right: 12px;
		bottom: calc(20px + env(safe-area-inset-bottom));
	}

	.efc-launcher {
		max-width: calc(100vw - 24px);
	}

	.efc-launcher__portrait {
		width: 48px;
		height: 48px;
	}

	.efc-dialog {
		position: fixed;
		inset: 0;
		width: 100vw;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		min-height: 100vh;
		min-height: 100dvh;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.efc-dialog__header {
		min-height: calc(76px + env(safe-area-inset-top));
		padding-top: calc(12px + env(safe-area-inset-top));
	}

	.efc-dialog__nav {
		padding-right: 14px;
		padding-left: 14px;
	}

	.efc-dialog__body {
		min-height: 0;
		padding: 16px 14px;
	}

	.efc-dialog__footer {
		padding-bottom: calc(12px + env(safe-area-inset-bottom));
	}
}

@media (max-width: 390px) {
	.efc-launcher > span:not(.efc-launcher__portrait) {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.efc-launcher,
	.efc-typing span {
		animation: none;
		transition: none;
	}
}
