.icfh-calculator,
.icfh-calculator * {
	box-sizing: border-box;
}

.icfh-calculator {
	--icfh-bg: #f4f6f8;
	--icfh-surface: #ffffff;
	--icfh-surface-2: #eef1f4;
	--icfh-text: #20242a;
	--icfh-muted: #68717e;
	--icfh-border: #d8dee6;
	--icfh-primary: #4f5966;
	--icfh-primary-strong: #303844;
	--icfh-accent: #798592;
	--icfh-success: #2f7154;
	--icfh-danger: #a74343;
	--icfh-shadow: 0 18px 48px rgba(27, 35, 44, 0.12);
	--icfh-radius-lg: 24px;
	--icfh-radius: 16px;
	--icfh-radius-sm: 11px;
	--icfh-focus: 0 0 0 4px rgba(79, 89, 102, 0.24);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--icfh-text);
	background: linear-gradient(135deg, var(--icfh-bg), #ffffff);
	padding: clamp(16px, 3vw, 34px);
	border-radius: var(--icfh-radius-lg);
	line-height: 1.5;
	width: 100%;
	max-width: 1180px;
	margin: 24px auto;
}

.icfh-calculator.icfh-theme-dark {
	--icfh-bg: #11151b;
	--icfh-surface: #1a2028;
	--icfh-surface-2: #222a34;
	--icfh-text: #edf1f5;
	--icfh-muted: #aeb8c4;
	--icfh-border: #35404c;
	--icfh-primary: #9ba6b2;
	--icfh-primary-strong: #d6dce3;
	--icfh-accent: #c1c8d0;
	--icfh-success: #7ed1a8;
	--icfh-danger: #ff9b9b;
	--icfh-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
	background: radial-gradient(circle at top left, #27313d 0, var(--icfh-bg) 40%);
}

.icfh-shell {
	display: grid;
	gap: 18px;
}

.icfh-header,
.icfh-results-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.icfh-eyebrow {
	margin: 0 0 4px;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--icfh-muted);
}

.icfh-header h2,
.icfh-results h3,
.icfh-card h3 {
	margin: 0;
	color: var(--icfh-text);
	font-weight: 800;
	letter-spacing: -0.02em;
}

.icfh-header h2 {
	font-size: clamp(1.65rem, 4vw, 2.65rem);
	text-transform: capitalize;
}

.icfh-subtitle,
.icfh-section-title p,
.icfh-note,
.icfh-summary p,
.icfh-field small {
	color: var(--icfh-muted);
}

.icfh-subtitle {
	max-width: 760px;
	margin: 8px 0 0;
	font-size: clamp(0.95rem, 2.2vw, 1.05rem);
}

.icfh-theme-toggle,
.icfh-button {
	-webkit-appearance: none;
	appearance: none;
	border: 1px solid var(--icfh-border);
	background: var(--icfh-surface);
	color: var(--icfh-text);
	border-radius: 999px;
	padding: 11px 16px;
	font-weight: 800;
	font-size: 0.92rem;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	white-space: nowrap;
}

.icfh-theme-toggle:hover,
.icfh-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(30, 38, 46, 0.12);
}

.icfh-theme-toggle:focus-visible,
.icfh-button:focus-visible,
.icfh-calculator input:focus-visible,
.icfh-calculator select:focus-visible {
	outline: none;
	box-shadow: var(--icfh-focus);
	border-color: var(--icfh-primary);
}

.icfh-form {
	display: grid;
	gap: 18px;
}

.icfh-card,
.icfh-results {
	background: color-mix(in srgb, var(--icfh-surface) 94%, transparent);
	border: 1px solid var(--icfh-border);
	border-radius: var(--icfh-radius-lg);
	box-shadow: var(--icfh-shadow);
	padding: clamp(16px, 3vw, 26px);
}

.icfh-section-title {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 18px;
}

.icfh-section-title > span {
	width: 42px;
	height: 42px;
	border-radius: 14px;
	background: var(--icfh-surface-2);
	border: 1px solid var(--icfh-border);
	display: grid;
	place-items: center;
	font-size: 1.1rem;
	font-weight: 900;
	color: var(--icfh-primary-strong);
	flex: 0 0 auto;
}

.icfh-section-title p {
	margin: 3px 0 0;
	font-size: 0.94rem;
}

.icfh-grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 14px;
}

.icfh-field {
	display: grid;
	gap: 7px;
}

.icfh-field label {
	font-size: 0.92rem;
	font-weight: 800;
	color: var(--icfh-text);
}

.icfh-field small {
	font-size: 0.8rem;
}

.icfh-calculator input,
.icfh-calculator select {
	width: 100%;
	min-height: 48px;
	border: 1px solid var(--icfh-border);
	border-radius: var(--icfh-radius-sm);
	background: var(--icfh-surface);
	color: var(--icfh-text);
	font: inherit;
	font-weight: 650;
	padding: 11px 12px;
	transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icfh-calculator select {
	cursor: pointer;
}

.icfh-money-input,
.icfh-unit-input {
	display: flex;
	align-items: center;
	border: 1px solid var(--icfh-border);
	background: var(--icfh-surface);
	border-radius: var(--icfh-radius-sm);
	overflow: hidden;
	transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.icfh-money-input:focus-within,
.icfh-unit-input:focus-within {
	box-shadow: var(--icfh-focus);
	border-color: var(--icfh-primary);
}

.icfh-money-input span,
.icfh-unit-input span {
	min-width: 42px;
	padding: 0 12px;
	color: var(--icfh-muted);
	font-weight: 900;
	text-align: center;
}

.icfh-money-input input,
.icfh-unit-input input {
	border: 0;
	border-radius: 0;
	box-shadow: none !important;
	background: transparent;
}

.icfh-money-input input {
	padding-left: 0;
}

.icfh-checkbox-grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 10px;
}

.icfh-check {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 12px;
	border-radius: var(--icfh-radius-sm);
	border: 1px solid var(--icfh-border);
	background: var(--icfh-surface-2);
	font-weight: 720;
	cursor: pointer;
	transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icfh-check:hover {
	transform: translateY(-1px);
	border-color: var(--icfh-accent);
}

.icfh-check input {
	width: 18px;
	height: 18px;
	min-height: auto;
	accent-color: var(--icfh-primary);
	flex: 0 0 auto;
}

.icfh-divider {
	height: 1px;
	background: var(--icfh-border);
	margin: 18px 0;
}

.icfh-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: flex-start;
}

.icfh-button-primary {
	background: var(--icfh-primary-strong);
	border-color: var(--icfh-primary-strong);
	color: #ffffff;
}

.icfh-button-muted {
	background: var(--icfh-surface-2);
}

.icfh-results {
	display: grid;
	gap: 16px;
}

.icfh-status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	padding: 7px 12px;
	font-weight: 900;
	font-size: 0.78rem;
	color: var(--icfh-success);
	background: color-mix(in srgb, var(--icfh-success) 13%, transparent);
	border: 1px solid color-mix(in srgb, var(--icfh-success) 25%, var(--icfh-border));
	white-space: nowrap;
}

.icfh-status.icfh-status-error {
	color: var(--icfh-danger);
	background: color-mix(in srgb, var(--icfh-danger) 13%, transparent);
	border-color: color-mix(in srgb, var(--icfh-danger) 25%, var(--icfh-border));
}

.icfh-result-grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 12px;
}

.icfh-result-card {
	background: var(--icfh-surface-2);
	border: 1px solid var(--icfh-border);
	border-radius: var(--icfh-radius);
	padding: 15px;
	min-height: 112px;
	display: grid;
	gap: 6px;
	align-content: center;
}

.icfh-result-card span {
	font-size: 0.82rem;
	font-weight: 850;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--icfh-muted);
}

.icfh-result-card strong {
	font-size: clamp(1.35rem, 4vw, 2.15rem);
	line-height: 1.1;
	color: var(--icfh-text);
}

.icfh-result-card small {
	color: var(--icfh-muted);
	font-weight: 650;
}

.icfh-result-card-main {
	background: linear-gradient(135deg, var(--icfh-primary-strong), var(--icfh-primary));
	border-color: transparent;
	color: #ffffff;
}

.icfh-result-card-main span,
.icfh-result-card-main strong,
.icfh-result-card-main small {
	color: #ffffff;
}

.icfh-breakdown {
	display: grid;
	gap: 13px;
	padding: 15px;
	border-radius: var(--icfh-radius);
	border: 1px solid var(--icfh-border);
	background: var(--icfh-surface);
}

.icfh-bar-row {
	display: grid;
	gap: 8px;
}

.icfh-bar-row > div {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	font-size: 0.92rem;
	font-weight: 800;
}

.icfh-bar-row span {
	color: var(--icfh-muted);
}

.icfh-bar-row b {
	color: var(--icfh-text);
}

.icfh-bar-row meter {
	width: 100%;
	height: 13px;
}

.icfh-summary {
	padding: 15px;
	border-radius: var(--icfh-radius);
	background: var(--icfh-surface-2);
	border: 1px solid var(--icfh-border);
}

.icfh-summary strong {
	display: block;
	margin-bottom: 6px;
}

.icfh-summary p,
.icfh-note {
	margin: 0;
}

.icfh-note {
	font-size: 0.84rem;
}

.icfh-invalid {
	border-color: var(--icfh-danger) !important;
}

@media (min-width: 560px) {
	.icfh-grid,
	.icfh-checkbox-grid,
	.icfh-result-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 860px) {
	.icfh-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.icfh-checkbox-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.icfh-result-grid {
		grid-template-columns: 1.45fr 1fr 1fr 1fr;
	}
}

@media (max-width: 640px) {
	.icfh-header,
	.icfh-results-header {
		flex-direction: column;
	}

	.icfh-theme-toggle,
	.icfh-button,
	.icfh-actions {
		width: 100%;
	}

	.icfh-actions .icfh-button {
		flex: 1 1 100%;
	}
}

@media print {
	body * {
		visibility: hidden !important;
	}

	.icfh-calculator,
	.icfh-calculator * {
		visibility: visible !important;
	}

	.icfh-calculator {
		position: absolute;
		inset: 0 auto auto 0;
		width: 100%;
		max-width: none;
		box-shadow: none;
		background: #ffffff !important;
		color: #111111 !important;
	}

	.icfh-actions,
	.icfh-theme-toggle {
		display: none !important;
	}
}
