.lfc-calculator {
	--lfc-bg: #f4f6f8;
	--lfc-card: #ffffff;
	--lfc-card-strong: #f9fafb;
	--lfc-text: #111827;
	--lfc-muted: #5f6875;
	--lfc-border: #d8dee6;
	--lfc-accent: #2f6fed;
	--lfc-accent-strong: #174fc2;
	--lfc-soft: #edf3ff;
	--lfc-danger: #b42318;
	--lfc-good: #027a48;
	--lfc-shadow: 0 18px 45px rgba(17, 24, 39, 0.12);
	--lfc-radius: 22px;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--lfc-text);
	box-sizing: border-box;
	width: 100%;
}

.lfc-calculator *,
.lfc-calculator *::before,
.lfc-calculator *::after {
	box-sizing: border-box;
}

.lfc-calculator[data-theme="dark"] {
	--lfc-bg: #111827;
	--lfc-card: #1f2937;
	--lfc-card-strong: #273244;
	--lfc-text: #f9fafb;
	--lfc-muted: #c6cbd3;
	--lfc-border: #3f4a5f;
	--lfc-accent: #8bb7ff;
	--lfc-accent-strong: #bfd7ff;
	--lfc-soft: #17233a;
	--lfc-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.lfc-shell {
	background: linear-gradient(135deg, var(--lfc-bg), var(--lfc-card-strong));
	border: 1px solid var(--lfc-border);
	border-radius: var(--lfc-radius);
	box-shadow: var(--lfc-shadow);
	margin: 0 auto;
	max-width: 1180px;
	overflow: hidden;
	padding: 18px;
}

.lfc-topbar {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 8px 4px 18px;
}

.lfc-title {
	color: var(--lfc-text);
	font-size: clamp(1.55rem, 2vw, 2.35rem);
	line-height: 1.1;
	margin: 0 0 8px;
}

.lfc-subtitle {
	color: var(--lfc-muted);
	font-size: 0.98rem;
	line-height: 1.55;
	margin: 0;
	max-width: 780px;
}

.lfc-theme-toggle,
.lfc-btn {
	align-items: center;
	-webkit-appearance: none;
	appearance: none;
	background: var(--lfc-card);
	border: 1px solid var(--lfc-border);
	border-radius: 999px;
	color: var(--lfc-text);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 700;
	gap: 8px;
	justify-content: center;
	min-height: 44px;
	padding: 10px 16px;
	transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.lfc-theme-toggle:hover,
.lfc-btn:hover {
	border-color: var(--lfc-accent);
	box-shadow: 0 8px 24px rgba(47, 111, 237, 0.18);
	transform: translateY(-1px);
}

.lfc-theme-toggle:focus-visible,
.lfc-btn:focus-visible,
.lfc-calculator input:focus-visible,
.lfc-calculator select:focus-visible {
	outline: 3px solid rgba(47, 111, 237, 0.35);
	outline-offset: 2px;
}

.lfc-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

.lfc-card {
	background: var(--lfc-card);
	border: 1px solid var(--lfc-border);
	border-radius: 20px;
	box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
	padding: 18px;
}

.lfc-result-card {
	position: relative;
}

.lfc-section-head {
	align-items: center;
	display: flex;
	gap: 10px;
	margin-bottom: 16px;
}

.lfc-section-head h3 {
	color: var(--lfc-text);
	font-size: 1.05rem;
	margin: 0;
}

.lfc-icon {
	align-items: center;
	background: var(--lfc-soft);
	border-radius: 12px;
	color: var(--lfc-accent-strong);
	display: inline-flex;
	font-weight: 900;
	height: 36px;
	justify-content: center;
	width: 36px;
}

.lfc-field-row {
	display: grid;
	gap: 8px;
	margin-bottom: 14px;
}

.lfc-field-row label,
.lfc-switch {
	color: var(--lfc-text);
	font-size: 0.93rem;
	font-weight: 750;
}

.lfc-calculator input[type="number"],
.lfc-calculator select {
	background: var(--lfc-card-strong);
	border: 1px solid var(--lfc-border);
	border-radius: 14px;
	color: var(--lfc-text);
	font: inherit;
	min-height: 46px;
	padding: 10px 12px;
	width: 100%;
}

.lfc-calculator input[type="range"] {
	accent-color: var(--lfc-accent);
	min-height: 36px;
	width: 100%;
}

.lfc-range-wrap {
	align-items: center;
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr auto;
}

.lfc-range-wrap output {
	background: var(--lfc-soft);
	border-radius: 999px;
	color: var(--lfc-accent-strong);
	font-size: 0.88rem;
	font-weight: 800;
	min-width: 64px;
	padding: 6px 10px;
	text-align: center;
}

.lfc-two-col {
	display: grid;
	gap: 0;
	grid-template-columns: 1fr;
}

.lfc-conditional[hidden] {
	display: none !important;
}

.lfc-toggle-row {
	margin-bottom: 0;
}

.lfc-switch {
	align-items: center;
	cursor: pointer;
	display: grid;
	gap: 10px;
	grid-template-columns: auto 1fr;
	line-height: 1.35;
}

.lfc-switch input {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.lfc-slider {
	background: #9aa4b2;
	border-radius: 999px;
	display: inline-block;
	height: 28px;
	position: relative;
	transition: background 160ms ease;
	width: 50px;
}

.lfc-slider::after {
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	content: "";
	height: 22px;
	left: 3px;
	position: absolute;
	top: 3px;
	transition: transform 160ms ease;
	width: 22px;
}

.lfc-switch input:checked + .lfc-slider {
	background: var(--lfc-accent);
}

.lfc-switch input:checked + .lfc-slider::after {
	transform: translateX(22px);
}

.lfc-main-result {
	background: linear-gradient(135deg, var(--lfc-accent), var(--lfc-accent-strong));
	border-radius: 18px;
	color: #ffffff;
	padding: 18px;
}

.lfc-main-result span,
.lfc-net-recovery span,
.lfc-mini-card span {
	display: block;
	font-size: 0.86rem;
	font-weight: 750;
	letter-spacing: 0.01em;
	opacity: 0.9;
}

.lfc-main-result strong {
	display: block;
	font-size: clamp(2rem, 4vw, 3.1rem);
	line-height: 1;
	margin-top: 8px;
}

.lfc-result-grid {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr;
	margin-top: 12px;
}

.lfc-mini-card,
.lfc-net-recovery {
	background: var(--lfc-card-strong);
	border: 1px solid var(--lfc-border);
	border-radius: 16px;
	padding: 14px;
}

.lfc-mini-card strong,
.lfc-net-recovery strong {
	color: var(--lfc-text);
	display: block;
	font-size: 1.18rem;
	margin-top: 6px;
}

.lfc-net-recovery {
	margin-top: 12px;
}

.lfc-strength {
	margin-top: 16px;
}

.lfc-strength-label {
	display: flex;
	font-size: 0.9rem;
	font-weight: 800;
	justify-content: space-between;
	margin-bottom: 8px;
}

.lfc-meter {
	background: var(--lfc-card-strong);
	border: 1px solid var(--lfc-border);
	border-radius: 999px;
	height: 12px;
	overflow: hidden;
}

.lfc-meter span {
	background: linear-gradient(90deg, #027a48, #f79009, #b42318);
	display: block;
	height: 100%;
	transition: width 180ms ease;
	width: 50%;
}

.lfc-breakdown {
	display: grid;
	gap: 10px;
	margin-top: 16px;
}

.lfc-break-row {
	align-items: center;
	display: grid;
	gap: 8px;
	grid-template-columns: 82px 1fr 48px;
}

.lfc-break-row span,
.lfc-break-row em {
	color: var(--lfc-muted);
	font-size: 0.82rem;
	font-style: normal;
	font-weight: 800;
}

.lfc-break-row div {
	background: var(--lfc-card-strong);
	border: 1px solid var(--lfc-border);
	border-radius: 999px;
	height: 10px;
	overflow: hidden;
}

.lfc-break-row b {
	background: var(--lfc-accent);
	display: block;
	height: 100%;
	transition: width 180ms ease;
	width: 0;
}

.lfc-summary {
	background: var(--lfc-soft);
	border-left: 4px solid var(--lfc-accent);
	border-radius: 14px;
	color: var(--lfc-text);
	font-size: 0.94rem;
	line-height: 1.55;
	margin: 16px 0 0;
	padding: 12px 14px;
}

.lfc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.lfc-btn-primary {
	background: var(--lfc-accent);
	border-color: var(--lfc-accent);
	color: #ffffff;
}

.lfc-btn-muted {
	color: var(--lfc-muted);
}

.lfc-status {
	color: var(--lfc-good);
	font-size: 0.88rem;
	font-weight: 800;
	min-height: 1.2em;
	padding-top: 10px;
}

.lfc-error {
	border-color: var(--lfc-danger) !important;
}

@media (min-width: 640px) {
	.lfc-shell {
		padding: 24px;
	}

	.lfc-topbar {
		align-items: center;
		flex-direction: row;
		justify-content: space-between;
	}

	.lfc-two-col,
	.lfc-result-grid {
		gap: 12px;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 980px) {
	.lfc-grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.lfc-result-card {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1120px) {
	.lfc-grid {
		grid-template-columns: 0.92fr 1fr 1fr;
	}

	.lfc-result-card {
		grid-column: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lfc-calculator *,
	.lfc-calculator *::before,
	.lfc-calculator *::after {
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

@media print {
	.lfc-actions,
	.lfc-theme-toggle {
		display: none !important;
	}

	.lfc-shell {
		box-shadow: none;
	}
}
