.tfc-calculator {
	--tfc-navy: #0b1526;
	--tfc-panel: #142238;
	--tfc-panel-hover: #1b2c47;
	--tfc-border: #223452;
	--tfc-text-soft: #7c8aa6;
	--tfc-teal: #2dd4bf;
	--tfc-teal-deep: #26b3a1;

	max-width: 460px;
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.tfc-calculator *,
.tfc-calculator *::before,
.tfc-calculator *::after {
	box-sizing: inherit;
}

.tfc-panel {
	background: var(--tfc-navy);
	border: 1px solid var(--tfc-border);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.tfc-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--tfc-border);
}

.tfc-header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1.5px solid var(--tfc-teal);
	color: var(--tfc-teal);
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
}

.tfc-heading {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: -0.01em;
}

.tfc-body {
	padding: 20px 22px 22px;
}

.tfc-field-row {
	display: flex;
	gap: 10px;
}

.tfc-field {
	flex: 1;
	min-width: 0;
	margin-bottom: 14px;
}

.tfc-field-unit {
	flex: 0 0 auto;
}

.tfc-label {
	display: block;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--tfc-text-soft);
	margin-bottom: 6px;
}

.tfc-input {
	width: 100%;
	padding: 11px 12px;
	font-size: 15px;
	font-family: inherit;
	font-variant-numeric: tabular-nums;
	border: none;
	background: #ffffff;
	border-radius: 10px;
	color: var(--tfc-navy);
	transition: box-shadow 0.15s ease;
}

.tfc-input:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.45);
}

.tfc-seg-group {
	display: flex;
	gap: 4px;
	background: var(--tfc-panel);
	border: 1px solid var(--tfc-border);
	border-radius: 10px;
	padding: 4px;
	height: 44px;
	align-items: center;
}

.tfc-seg-btn {
	padding: 9px 12px;
	font-size: 12.5px;
	font-weight: 700;
	font-family: inherit;
	border: none;
	border-radius: 7px;
	background: transparent;
	color: var(--tfc-text-soft);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.tfc-seg-btn:hover {
	background: var(--tfc-panel-hover);
	color: #ffffff;
}

.tfc-seg-btn.is-active {
	background: var(--tfc-teal);
	color: #06231f;
}

.tfc-example-note {
	margin: 0 0 4px;
	font-size: 11.5px;
	font-style: italic;
	color: var(--tfc-teal);
}

.tfc-button-row {
	display: flex;
	gap: 10px;
	margin-top: 14px;
}

.tfc-btn {
	flex: 1;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
}

.tfc-btn-primary {
	background: var(--tfc-teal);
	color: #06231f;
}

.tfc-btn-primary:hover {
	background: var(--tfc-teal-deep);
}

.tfc-btn-ghost {
	background: var(--tfc-panel);
	color: #ffffff;
	border: 1px solid var(--tfc-border);
}

.tfc-btn-ghost:hover {
	background: var(--tfc-panel-hover);
}

.tfc-btn:active {
	transform: translateY(1px);
}

.tfc-btn:focus-visible {
	outline: 2px solid var(--tfc-teal);
	outline-offset: 2px;
}

.tfc-error {
	min-height: 16px;
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: #ff9d8a;
}

/* Results */
.tfc-results:not(.has-result) {
	display: none;
}

.tfc-result-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-top: 22px;
}

.tfc-result-box {
	background: var(--tfc-panel);
	border: 1px solid var(--tfc-border);
	border-radius: 10px;
	padding: 12px 8px;
	text-align: center;
}

.tfc-result-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--tfc-text-soft);
	margin-bottom: 6px;
	font-style: italic;
}

.tfc-result-value {
	display: block;
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--tfc-teal);
	word-break: break-word;
}

/* Solution */
.tfc-solution {
	margin-top: 20px;
}

.tfc-section-title {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tfc-text-soft);
}

.tfc-step {
	margin-bottom: 12px;
}

.tfc-step:last-child {
	margin-bottom: 0;
}

.tfc-step p {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--tfc-text-soft);
	line-height: 1.5;
}

.tfc-formula {
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #ffffff !important;
	background: var(--tfc-panel);
	border: 1px solid var(--tfc-border);
	padding: 8px 12px;
	border-radius: 8px;
	display: inline-block;
	line-height: 1.7;
}

@media (max-width: 420px) {
	.tfc-result-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tfc-btn,
	.tfc-seg-btn {
		transition: none;
	}
}
