.efe-app {
	--efe-bg: #f4f6f8;
	--efe-surface: #ffffff;
	--efe-border: #d7dde5;
	--efe-text: #15202b;
	--efe-muted: #54606c;
	--efe-accent: #0a7d67;
	--efe-accent-soft: #d9f4ee;
	--efe-warn: #b55d00;
	--efe-danger: #b42318;
	--efe-shadow: 0 24px 60px rgba(21, 32, 43, 0.08);
	color: var(--efe-text);
	font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
	container-type: inline-size;
	container-name: efe;
	position: relative !important;
	width: 94vw !important;
	max-width: 1400px !important;
	left: auto !important;
	margin-left: calc(50% - 47vw) !important;
	margin-right: calc(50% - 47vw) !important;
	transform: none !important;
	margin-top: 32px;
	margin-bottom: 32px;
}

.efe-app * {
	box-sizing: border-box;
}

.efe-shell {
	display: grid;
	grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
	gap: 24px;
	padding: 24px;
	background: linear-gradient(180deg, #f7fafb 0%, #eef3f6 100%);
	border: 1px solid var(--efe-border);
	border-radius: 24px;
	box-shadow: var(--efe-shadow);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.efe-sidebar,
.efe-workspace {
	min-width: 0;
}

.efe-title {
	margin: 0 0 6px;
	font-size: 2rem;
	line-height: 1.1;
}

.efe-kicker {
	display: inline-flex;
	padding: 6px 10px;
	border-radius: 999px;
	background: #e7eef6;
	color: #30485e;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.efe-description {
	margin: 0 0 20px;
	color: var(--efe-muted);
}

.efe-progress-card,
.efe-panel,
.efe-formula-bar,
.efe-grid-wrap,
.efe-solution {
	background: var(--efe-surface);
	border: 1px solid var(--efe-border);
	border-radius: 18px;
}

.efe-progress-card,
.efe-panel,
.efe-solution {
	padding: 16px 18px;
	margin-bottom: 16px;
}

.efe-progress-meta,
.efe-status-row,
.efe-panel-heading,
.efe-controls,
.efe-hint-feedback,
.efe-task-meta,
.efe-stat-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
}

.efe-progress-track {
	height: 10px;
	margin-top: 12px;
	background: #e5ebf1;
	border-radius: 999px;
	overflow: hidden;
}

.efe-progress-fill {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, #0a7d67 0%, #2ab086 100%);
	width: 8%;
	transition: width 180ms ease;
}

.efe-stat-strip,
.efe-task-meta {
	margin-top: 12px;
	color: var(--efe-muted);
	font-size: 0.95rem;
}

.efe-workspace {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.efe-status-row {
	padding: 4px 2px;
}

.efe-target-summary {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
}

.efe-feedback {
	min-height: 24px;
	font-weight: 600;
}

.efe-formula-bar {
	position: relative;
	padding: 14px 16px;
}

.efe-formula-bar label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
}

.efe-formula-bar input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #b9c7d6;
	border-radius: 12px;
	font: inherit;
}

.efe-formula-bar input:focus,
.efe-grid-button:focus,
.efe-controls .button:focus {
	outline: 3px solid rgba(10, 125, 103, 0.28);
	outline-offset: 2px;
}

.efe-grid-wrap {
	padding: 16px;
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
}

.efe-grid {
	width: 100%;
	border-collapse: collapse;
	min-width: 520px;
}

.efe-grid th,
.efe-grid td {
	border: 1px solid #dbe2ea;
	text-align: left;
}

.efe-grid th {
	padding: 10px;
	background: #f6f9fc;
	font-size: 0.85rem;
}

.efe-grid-button {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	min-height: 72px;
	padding: 10px;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.efe-grid-wrap.is-point-mode .efe-grid-button {
	cursor: crosshair;
}

.efe-grid-wrap.is-point-mode table {
    user-select: none;
    -webkit-user-select: none;
}

.efe-grid-ref {
	font-size: 0.74rem;
	color: var(--efe-muted);
}

.efe-grid-value {
	font-weight: 600;
}

.efe-grid-cell.is-editable .efe-grid-button {
	background: #fbfcfe;
}

.efe-grid-cell.is-target .efe-grid-button {
	background: #edf9f6;
}

.efe-grid-cell.is-selected .efe-grid-button {
	background: #d7f0ea;
}

.efe-controls {
	justify-content: flex-start;
}

.efe-controls .button {
	min-width: 120px;
}

.efe-mobile-note,
.efe-engine-error {
	padding: 12px 14px;
	border-radius: 14px;
}

.efe-mobile-note {
	background: #fff8e5;
	color: var(--efe-warn);
}

.efe-engine-error {
	background: #fdeceb;
	color: var(--efe-danger);
}

.efe-hint-copy,
.efe-solution {
	color: var(--efe-text);
}

.efe-ai-placeholder {
	margin: 12px 0 0;
	color: var(--efe-muted);
	font-size: 0.9rem;
}

.efe-leaderboard {
	margin: 0;
	padding-left: 20px;
}

.efe-leaderboard li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.efe-download {
	margin-top: 8px;
}

.efe-autocomplete-dropdown {
	position: absolute;
	top: calc(100% - 10px);
	left: 16px;
	right: 16px;
	max-height: 200px;
	background: var(--efe-surface);
	border: 1px solid var(--efe-border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(21, 32, 43, 0.12);
	overflow-y: auto;
	z-index: 100;
	list-style: none;
	margin: 0;
	padding: 4px 0;
}

.efe-autocomplete-dropdown:empty {
	display: none;
}

.efe-autocomplete-item {
	padding: 8px 14px;
	cursor: pointer;
	font-family: monospace;
	font-weight: 600;
	font-size: 0.95rem;
}

.efe-autocomplete-item:hover,
.efe-autocomplete-item.is-active {
	background: var(--efe-accent-soft);
	color: var(--efe-accent);
}

@container efe (max-width: 550px) {
	.efe-shell {
		grid-template-columns: 1fr;
	}
}

@container efe (max-width: 500px) {
	.efe-shell {
		padding: 16px;
		border-radius: 18px;
	}

	.efe-title {
		font-size: 1.55rem;
	}

	.efe-grid {
		min-width: 420px;
	}
}
