:root {
	--efc-primary: #103B66;
	--efc-secondary: #E9EEF5;
	--efc-button: #0F7A66;
	--efc-text: #102030;
	--efc-header: #0A2740;
	--efc-font: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

.efc-widget {
	position: fixed;
	z-index: 99999;
	right: 24px;
	bottom: 24px;
	box-sizing: border-box;
	font-family: var(--efc-font);
	color: var(--efc-text);
}

.efc-widget.efc-widget-bottom-left {
	left: 24px;
	right: auto;
}

.efc-widget.efc-widget-top-right {
	top: 24px;
	bottom: auto;
}

.efc-widget.efc-widget-top-left {
	top: 24px;
	left: 24px;
	right: auto;
	bottom: auto;
}

.efc-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 18px;
	border-radius: 999px;
	border: 0;
	background: linear-gradient(135deg, var(--efc-button), var(--efc-primary));
	color: #fff;
	font-weight: 700;
	box-shadow: 0 16px 36px rgba(16, 59, 102, 0.28);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.efc-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 18px 42px rgba(16, 59, 102, 0.34);
}

.efc-shell {
	width: min(420px, calc(100vw - 32px));
	height: min(760px, calc(100vh - 48px));
	max-width: calc(100vw - 32px);
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(20px);
	border: 1px solid rgba(16, 48, 78, 0.12);
	border-radius: 24px;
	box-shadow: 0 30px 80px rgba(10, 39, 64, 0.24);
	overflow: hidden;
	display: none;
	flex-direction: column;
	margin-bottom: 16px;
}

.efc-shell.is-open {
	display: flex;
	animation: efcPop 0.22s ease-out;
}

@keyframes efcPop {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.efc-header {
	background: linear-gradient(160deg, var(--efc-header), var(--efc-primary));
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.efc-header-copy {
	display: grid;
	gap: 4px;
}

.efc-title {
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.01em;
}

.efc-subtitle {
	font-size: 12px;
	line-height: 1.4;
	opacity: 0.9;
}

.efc-controls {
	display: flex;
	gap: 8px;
}

.efc-icon-button {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
}

.efc-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	background: linear-gradient(180deg, #fff, #fbfcfe);
}

.efc-transcript {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: pan-y;
	padding: 18px;
	display: grid;
	gap: 12px;
	background:
		radial-gradient(circle at top right, rgba(16, 59, 102, 0.04), transparent 28%),
		radial-gradient(circle at bottom left, rgba(15, 122, 102, 0.05), transparent 24%);
}

.efc-bubble {
	max-width: 88%;
	padding: 12px 14px;
	border-radius: 18px;
	box-shadow: 0 8px 24px rgba(16, 32, 48, 0.05);
	line-height: 1.5;
	font-size: 14px;
}

.efc-bubble-body {
	white-space: pre-wrap;
}

.efc-bubble-meta {
	margin-top: 4px;
	font-size: 11px;
	opacity: 0.72;
}

.efc-bot {
	background: #fff;
	border: 1px solid rgba(16, 48, 78, 0.08);
	color: var(--efc-text);
}

.efc-user {
	background: linear-gradient(135deg, rgba(16, 59, 102, 0.98), rgba(15, 122, 102, 0.92));
	color: #fff;
	margin-left: auto;
}

.efc-composer {
	padding: 16px 18px 18px;
	border-top: 1px solid rgba(16, 48, 78, 0.08);
	background: rgba(255, 255, 255, 0.96);
	display: grid;
	gap: 12px;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.efc-step-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(16, 32, 48, 0.54);
}

.efc-question {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
}

.efc-help {
	font-size: 13px;
	color: rgba(16, 32, 48, 0.68);
	line-height: 1.5;
}

.efc-choice-grid,
.efc-checkbox-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.efc-choice,
.efc-primary-button,
.efc-secondary-button {
	border: 0;
	border-radius: 14px;
	padding: 12px 14px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.efc-choice {
	background: #fff;
	border: 1px solid rgba(16, 48, 78, 0.12);
	color: var(--efc-text);
	text-align: left;
	min-height: 52px;
	box-shadow: 0 6px 16px rgba(16, 32, 48, 0.04);
}

.efc-choice:hover,
.efc-primary-button:hover,
.efc-secondary-button:hover {
	transform: translateY(-1px);
}

.efc-primary-button {
	background: linear-gradient(135deg, var(--efc-button), var(--efc-primary));
	color: #fff;
	box-shadow: 0 12px 28px rgba(16, 59, 102, 0.22);
}

.efc-secondary-button {
	background: #edf3f8;
	color: var(--efc-text);
}

.efc-group-form {
	display: grid;
	gap: 12px;
}

.efc-field {
	display: grid;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: rgba(16, 32, 48, 0.82);
}

.efc-field-label {
	font-size: 13px;
	font-weight: 600;
}

.efc-input,
.efc-group-form textarea,
.efc-group-form input {
	width: 100%;
	border: 1px solid rgba(16, 48, 78, 0.14);
	border-radius: 12px;
	background: #fff;
	padding: 12px 13px;
	font: inherit;
	color: var(--efc-text);
}

.efc-upload-box {
	display: grid;
	gap: 12px;
}

.efc-progress {
	height: 10px;
	border-radius: 999px;
	background: #e8edf2;
	overflow: hidden;
}

.efc-progress-bar {
	display: block;
	height: 100%;
	width: 0%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--efc-button), var(--efc-primary));
	transition: width 0.2s ease;
}

.efc-upload-status {
	font-size: 13px;
	color: rgba(16, 32, 48, 0.72);
	line-height: 1.4;
}

.efc-loading {
	padding: 20px 0;
	color: rgba(16, 32, 48, 0.7);
}

.efc-ready .efc-launcher {
	display: inline-flex;
}

@media (max-width: 640px) {
	.efc-widget {
		right: max(12px, env(safe-area-inset-right));
		left: max(12px, env(safe-area-inset-left));
		bottom: max(12px, env(safe-area-inset-bottom));
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		gap: 12px;
	}

	.efc-widget.efc-widget-bottom-left,
	.efc-widget.efc-widget-top-left {
		left: 12px;
		right: 12px;
	}

	.efc-shell {
		width: 100%;
		max-width: 100%;
		height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
		height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
		max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
		max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
		border-radius: 22px;
		margin-bottom: 0;
	}

	.efc-panel {
		min-height: 0;
	}

	.efc-header,
	.efc-transcript,
	.efc-composer {
		box-sizing: border-box;
	}

	.efc-transcript {
		padding: 14px;
	}

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

	.efc-choice-grid,
	.efc-checkbox-grid {
		grid-template-columns: 1fr;
	}
}
