.wf-calculator {
	--wf-navy: #1f3790;
	--wf-navy-dark: #172a6e;
	--wf-orange: #f69427;
	--wf-orange-soft: #feb96c;
	--wf-text: #23232f;
	--wf-muted: #6b7280;
	--wf-line: #e5e7eb;
	--wf-surface: #f6f7fb;
	--wf-radius: 24px;
	font-family: inherit;
	color: var(--wf-text);
}

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

.wf-calculator__card {
	background: #fff;
	border: 1px solid #eef0f4;
	border-radius: var(--wf-radius);
	box-shadow: 0 18px 48px rgba(31, 55, 144, 0.08);
	padding: 36px;
}

/* Header + tabs */
.wf-calculator__top {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: 32px;
}

.wf-calculator__header {
	flex: 1 1 320px;
}

.wf-calculator__heading {
	margin: 0 0 8px;
	color: var(--wf-navy);
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	font-weight: 600;
	line-height: 1.2;
}

.wf-calculator__subheading {
	margin: 0;
	color: var(--wf-muted);
	font-size: 1rem;
	line-height: 1.6;
}

.wf-calculator__tabs {
	display: inline-flex;
	gap: 6px;
	padding: 6px;
	background: var(--wf-surface);
	border: 1px solid #eef0f4;
	border-radius: 16px;
}

.wf-calculator__tab {
	appearance: none;
	border: 0;
	cursor: pointer;
	background: transparent;
	color: var(--wf-navy);
	padding: 10px 22px;
	border-radius: 12px;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.wf-calculator__tab small {
	display: block;
	margin-top: 2px;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--wf-muted);
	transition: color 0.2s ease;
}

.wf-calculator__tab:hover {
	background: #fff;
}

.wf-calculator__tab.is-active {
	background: var(--wf-navy);
	color: #fff;
	box-shadow: 0 10px 22px rgba(31, 55, 144, 0.25);
}

.wf-calculator__tab.is-active small {
	color: rgba(255, 255, 255, 0.75);
}

.wf-calculator__tab:focus-visible,
.wf-calculator__cta:focus-visible {
	outline: 3px solid var(--wf-orange-soft);
	outline-offset: 2px;
}

/* Layout */
.wf-calculator__body {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: 32px;
	align-items: stretch;
}

.wf-calculator__panel {
	display: none;
}

.wf-calculator__panel.is-active {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

/* Fields */
.wf-calculator__field-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.wf-calculator__label {
	font-size: 1rem;
	font-weight: 600;
	color: var(--wf-text);
}

.wf-calculator__value {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 132px;
	padding: 8px 14px;
	background: #fff4e8;
	border: 1px solid transparent;
	border-radius: 12px;
	color: var(--wf-navy);
	font-weight: 700;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wf-calculator__value:focus-within {
	border-color: var(--wf-orange);
	box-shadow: 0 0 0 4px rgba(246, 148, 39, 0.15);
}

.wf-calculator__affix {
	flex: 0 0 auto;
	font-size: 1rem;
}

.wf-calculator .wf-calculator__number {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	text-align: right;
	outline: none;
}

.wf-calculator__range {
	--wf-fill: 50%;
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 6px;
	margin: 0;
	border-radius: 999px;
	background: linear-gradient(to right, var(--wf-orange) 0%, var(--wf-orange) var(--wf-fill), var(--wf-line) var(--wf-fill), var(--wf-line) 100%);
	cursor: pointer;
	outline: none;
}

.wf-calculator__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 5px solid var(--wf-navy);
	box-shadow: 0 4px 10px rgba(31, 55, 144, 0.3);
	transition: transform 0.15s ease;
}

.wf-calculator__range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 5px solid var(--wf-navy);
	box-shadow: 0 4px 10px rgba(31, 55, 144, 0.3);
}

.wf-calculator__range:active::-webkit-slider-thumb {
	transform: scale(1.12);
}

.wf-calculator__range:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 6px rgba(246, 148, 39, 0.3);
}

.wf-calculator__scale {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 0.8rem;
	color: var(--wf-muted);
}

/* Result panel */
.wf-calculator__result {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 28px;
	border-radius: 20px;
	background: linear-gradient(160deg, var(--wf-navy) 0%, var(--wf-navy-dark) 100%);
	color: #fff;
}

.wf-calculator__chart {
	position: relative;
	width: 190px;
	max-width: 100%;
	aspect-ratio: 1;
	margin: 0 auto;
}

.wf-calculator__chart svg {
	display: block;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.wf-calculator__ring,
.wf-calculator__seg {
	fill: none;
	stroke-width: 5.5;
}

.wf-calculator__ring {
	stroke: rgba(255, 255, 255, 0.12);
}

.wf-calculator__seg {
	stroke-dasharray: 0 100;
	transition: stroke-dasharray 0.45s ease, stroke-dashoffset 0.45s ease;
}

.wf-calculator__seg--a {
	stroke: #ffffff;
}

.wf-calculator__seg--b {
	stroke: var(--wf-orange);
}

.wf-calculator__chart-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	line-height: 1.2;
}

.wf-calculator__chart-center span {
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.7);
}

.wf-calculator__chart-center strong {
	margin-top: 4px;
	font-size: 1.25rem;
	font-weight: 700;
}

.wf-calculator__breakdown {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wf-calculator__breakdown li {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.8);
}

.wf-calculator__breakdown strong {
	margin-left: auto;
	color: #fff;
	font-weight: 700;
}

.wf-calculator__dot {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.wf-calculator__dot--a {
	background: #fff;
}

.wf-calculator__dot--b {
	background: var(--wf-orange);
}

.wf-calculator__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.wf-calculator__total span {
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.8);
}

.wf-calculator__total strong {
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	font-weight: 700;
	color: var(--wf-orange);
	text-align: right;
}

.wf-calculator__message {
	display: none;
	padding: 12px 14px;
	border-radius: 12px;
	background: rgba(246, 148, 39, 0.16);
	color: #ffe2bf;
	font-size: 0.9rem;
	line-height: 1.5;
}

.wf-calculator__message.is-visible {
	display: block;
}

.wf-calculator .wf-calculator__cta {
	display: block;
	margin-top: auto;
	padding: 14px 20px;
	border-radius: 999px;
	background: var(--wf-orange);
	color: var(--wf-navy);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.wf-calculator .wf-calculator__cta,
.wf-calculator .wf-calculator__cta:visited {
	background: var(--wf-orange) !important;
	color: var(--wf-navy) !important;
}

.wf-calculator .wf-calculator__cta:hover,
.wf-calculator .wf-calculator__cta:focus-visible {
	background: #fff !important;
	color: var(--wf-navy) !important;
	transform: translateY(-1px);
}

.wf-calculator__disclaimer {
	margin: 24px 0 0;
	font-size: 0.8rem;
	line-height: 1.6;
	color: var(--wf-muted);
	text-align: center;
}

/* Guard against theme/kit button, label and input styles leaking in. */
.wf-calculator .wf-calculator__tab {
	background: transparent !important;
	color: var(--wf-navy) !important;
	border: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.wf-calculator .wf-calculator__tab:hover {
	background: #fff !important;
}

.wf-calculator .wf-calculator__tab.is-active {
	background: var(--wf-navy) !important;
	color: #fff !important;
	box-shadow: 0 10px 22px rgba(31, 55, 144, 0.25) !important;
}

.wf-calculator .wf-calculator__label {
	margin: 0;
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: var(--wf-text) !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.wf-calculator .wf-calculator__value input.wf-calculator__number {
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit !important;
	font-size: 1.05rem !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
	text-align: right !important;
}

@media (prefers-reduced-motion: reduce) {
	.wf-calculator__seg,
	.wf-calculator__tab,
	.wf-calculator .wf-calculator__cta {
		transition: none;
	}
}

/* Tablet */
@media (max-width: 1024px) {
	.wf-calculator__card {
		padding: 28px;
	}

	.wf-calculator__body {
		grid-template-columns: 1fr;
	}

	.wf-calculator__result {
		display: grid;
		grid-template-columns: 190px minmax(0, 1fr);
		grid-template-areas:
			"chart breakdown"
			"chart total"
			"message message"
			"cta cta";
		column-gap: 28px;
		align-items: center;
	}

	.wf-calculator__chart {
		grid-area: chart;
	}

	.wf-calculator__breakdown {
		grid-area: breakdown;
		align-self: end;
	}

	.wf-calculator__total {
		grid-area: total;
		align-self: start;
	}

	.wf-calculator__message {
		grid-area: message;
	}

	.wf-calculator .wf-calculator__cta {
		grid-area: cta;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.wf-calculator__card {
		padding: 20px;
		border-radius: 20px;
	}

	.wf-calculator__top {
		margin-bottom: 24px;
	}

	.wf-calculator__tabs {
		display: flex;
		width: 100%;
	}

	.wf-calculator__tab {
		flex: 1 1 50%;
	}

	.wf-calculator__panel.is-active {
		gap: 26px;
	}

	.wf-calculator__value {
		flex: 0 1 46%;
		min-width: 0;
		padding: 8px 12px;
	}

	.wf-calculator .wf-calculator__label {
		font-size: 0.95rem !important;
	}

	.wf-calculator__result {
		display: flex;
		padding: 22px;
	}

	.wf-calculator__chart {
		width: 170px;
	}
}
