/*! Financial Core · Calculators
 * Everything is scoped under .est-calc. Colours, type and shapes come from the shared tokens
 * (assets/css/base.css). Some selectors repeat the class to outrank the theme's generic input
 * and table rules without !important.
 */
.est-calc {
	container-type: inline-size;
	box-sizing: border-box;
	margin: 2em 0;
	padding: 28px;
	background: var(--est-surface);
	border: 1px solid var(--est-grid);
	border-radius: var(--est-radius);
	color: var(--est-ink);
	font-family: var(--est-font);
	font-size: 15px;
	line-height: 1.5;
}
.est-calc *, .est-calc *::before, .est-calc *::after { box-sizing: border-box; }

/* Head */
.est-calc .est-calc__head { margin: 0 0 20px; }
/* doubled class: beats the theme's ".row .col h4" and similar heading rules */
.est-calc.est-calc .est-calc__title {
	margin: 0 0 4px; padding: 0;
	font-family: var(--est-font); font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em;
	color: var(--est-ink);
}
.est-calc .est-calc__title::before {
	content: ""; display: block; width: 32px; height: 4px; margin: 0 0 12px;
	border-radius: 2px; background: var(--est-primary);
}
.est-calc .est-calc__lead { margin: 0; padding: 0; font-size: 14.5px; color: var(--est-ink-2); }

/* Fields */
.est-calc .est-calc__fields { display: grid; grid-template-columns: 1fr; gap: 18px 32px; margin: 0 0 24px; }
@container (min-width: 560px) {
	.est-calc .est-calc__fields { grid-template-columns: 1fr 1fr; }
}
.est-calc .est-calc__field { min-width: 0; }
.est-calc .est-calc__fhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.est-calc .est-calc__flabel {
	display: block; margin: 0; padding: 0;
	font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--est-ink);
}
.est-calc .est-calc__num-in {
	display: inline-flex; align-items: center; flex: 0 0 auto;
	height: 38px; padding: 0 10px;
	border: 1px solid var(--est-grid); border-radius: var(--est-radius-sm); background: var(--est-surface);
	transition: border-color .15s, box-shadow .15s;
}
.est-calc .est-calc__num-in:focus-within { border-color: var(--est-primary); box-shadow: var(--est-ring); }
.est-calc .est-calc__affix { font-size: 14px; color: var(--est-ink-2); }
.est-calc.est-calc .est-calc__num-in input.est-calc__input {
	width: 6.5em; height: 36px; margin: 0; padding: 0 2px;
	border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0;
	font-family: var(--est-font); font-size: 15px; font-weight: 500; line-height: 36px; color: var(--est-ink);
	text-align: right; font-variant-numeric: tabular-nums;
	-webkit-appearance: none; appearance: none;
}
.est-calc .est-calc__num-in:has(input[aria-invalid="true"]) { border-color: var(--est-error); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.est-calc .est-calc__err { display: block; margin: 6px 0 0; font-size: 12.5px; color: var(--est-error); }
.est-calc .est-calc__err[hidden] { display: none; }

.est-calc.est-calc .est-calc__range {
	-webkit-appearance: none; appearance: none;
	display: block; width: 100%; height: 24px; margin: 10px 0 0; padding: 0;
	border: 0; background: transparent; box-shadow: none; cursor: pointer;
}
.est-calc .est-calc__range::-webkit-slider-runnable-track {
	height: 6px; border-radius: 6px;
	background: linear-gradient(to right, var(--est-primary) 0 var(--est-fill, 0%), var(--est-grid) var(--est-fill, 0%) 100%);
}
.est-calc .est-calc__range::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none;
	width: 20px; height: 20px; margin-top: -7px;
	border: 2px solid var(--est-primary); border-radius: 50%; background: var(--est-surface);
	box-shadow: 0 1px 3px rgba(10, 10, 10, .18);
}
.est-calc .est-calc__range::-moz-range-track { height: 6px; border-radius: 6px; background: var(--est-grid); }
.est-calc .est-calc__range::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--est-primary); }
.est-calc .est-calc__range::-moz-range-thumb {
	width: 16px; height: 16px; border: 2px solid var(--est-primary); border-radius: 50%; background: var(--est-surface);
	box-shadow: 0 1px 3px rgba(10, 10, 10, .18);
}
.est-calc .est-calc__range:focus { outline: 0; }
.est-calc .est-calc__range:focus-visible { outline: 2px solid var(--est-primary); outline-offset: 3px; border-radius: 6px; }

.est-calc .est-calc__field--select { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: start; }
.est-calc.est-calc select {
	height: 38px; width: auto; min-width: 9em; margin: 0; padding: 0 34px 0 12px;
	border: 1px solid var(--est-grid); border-radius: var(--est-radius-sm); box-shadow: none;
	font-family: var(--est-font); font-size: 14.5px; font-weight: 500; color: var(--est-ink);
	-webkit-appearance: none; appearance: none; cursor: pointer;
	background: var(--est-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23565656' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.est-calc.est-calc select:focus-visible { outline: 0; border-color: var(--est-primary); box-shadow: var(--est-ring); }

/* Results */
.est-calc .est-calc__results { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 14px; }
@container (min-width: 560px) {
	.est-calc .est-calc__results { grid-template-columns: 1.15fr 1fr 1fr; }
}
.est-calc .est-calc__card {
	display: flex; flex-direction: column; min-width: 0;
	padding: 14px 16px; border: 1px solid var(--est-grid); border-radius: var(--est-radius); background: var(--est-surface);
}
.est-calc .est-calc__card--main { border-color: transparent; background: var(--est-tint); }
.est-calc .est-calc__clabel { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--est-ink-2); }
.est-calc .est-calc__cvalue {
	margin: 4px 0 2px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
	color: var(--est-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.est-calc .est-calc__card--main .est-calc__cvalue { color: var(--est-primary); font-size: 28px; }
.est-calc .est-calc__cnote { font-size: 12.5px; line-height: 1.4; color: var(--est-ink-2); }
.est-calc .est-calc__summary { margin: 0 0 18px; padding: 0; font-size: 14px; line-height: 1.55; color: var(--est-ink-2); }

/* Chart */
.est-calc .est-calc__chart { margin: 0 0 8px; padding: 0; }
.est-calc .est-calc__plot { position: relative; width: 100%; aspect-ratio: 640 / 280; touch-action: pan-y; }
@container (max-width: 519px) {
	.est-calc .est-calc__plot { aspect-ratio: 4 / 3; }
}
.est-calc .est-calc__svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.est-calc .est-calc__grid line { stroke: var(--est-grid); stroke-width: 1; }
.est-calc .est-calc__ylab text, .est-calc .est-calc__xlab text {
	font-family: var(--est-font); font-size: 12px; fill: var(--est-ink-2); font-variant-numeric: tabular-nums;
}
.est-calc .est-calc__ylab text { text-anchor: end; }
.est-calc .est-calc__xlab text { text-anchor: middle; }
.est-calc .est-calc__line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.est-calc .est-calc__marker { fill: var(--est-primary); stroke: #fff; stroke-width: 2; }
.est-calc .est-calc__hover line { stroke: var(--est-ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.est-calc .est-calc__hover circle { fill: #fff; stroke-width: 2.4; }
.est-calc .est-calc__tip {
	position: absolute; top: 6px; left: 50%; z-index: 2; transform: translateX(-50%);
	display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 8px 10px;
	border: 1px solid var(--est-grid); border-radius: var(--est-radius-sm); background: rgba(255, 255, 255, .96);
	box-shadow: 0 4px 14px rgba(10, 10, 10, .08);
	font-size: 12.5px; line-height: 1.4; color: var(--est-ink); pointer-events: none; white-space: nowrap;
}
.est-calc .est-calc__tip[hidden] { display: none; }
.est-calc .est-calc__tip strong { font-weight: 700; }
.est-calc .est-calc__tip i, .est-calc .est-calc__key i {
	display: inline-block; width: 10px; height: 10px; margin: 0 6px 0 0; border-radius: 3px; vertical-align: -1px;
}
.est-calc .est-calc__legend {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
	margin: 10px 0 0; padding: 0; font-size: 13px; line-height: 1.4; color: var(--est-ink-2); text-align: left;
}
.est-calc .est-calc__axis { margin-left: auto; color: var(--est-secondary); font-size: 12px; }

/* Table */
.est-calc .est-calc__table { margin: 14px 0 0; border-top: 1px solid var(--est-grid); }
.est-calc .est-calc__table summary {
	display: list-item; padding: 12px 0; cursor: pointer;
	font-size: 14px; font-weight: 500; color: var(--est-ink);
}
.est-calc .est-calc__table summary::marker { color: var(--est-primary); }
.est-calc .est-calc__table summary:focus-visible { outline: 2px solid var(--est-primary); outline-offset: 2px; border-radius: 4px; }
.est-calc .est-calc__scroll { max-height: 360px; overflow: auto; border: 1px solid var(--est-grid); border-radius: var(--est-radius-sm); }
.est-calc.est-calc.est-calc .est-calc__table table {
	width: 100%; margin: 0; border: 0; border-collapse: collapse; background: var(--est-surface);
	font-family: var(--est-font); font-size: 13.5px; line-height: 1.4;
}
.est-calc.est-calc.est-calc .est-calc__table tr { background: transparent; }
.est-calc.est-calc.est-calc .est-calc__table th,
.est-calc.est-calc.est-calc .est-calc__table td {
	padding: 8px 12px; border: 0; border-top: 1px solid var(--est-grid);
	color: var(--est-ink); font-size: 13.5px; font-weight: 400; text-align: left; background: transparent;
}
.est-calc.est-calc.est-calc .est-calc__table thead th {
	position: sticky; top: 0; border-top: 0; background: var(--est-surface-2); font-weight: 500; white-space: nowrap;
}
.est-calc.est-calc.est-calc .est-calc__table .est-calc__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Explanation */
.est-calc .est-calc__about { margin: 18px 0 0; font-size: 14px; line-height: 1.6; color: var(--est-ink-2); }
.est-calc.est-calc .est-calc__abouttitle {
	margin: 0 0 6px; padding: 0; font-family: var(--est-font); font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--est-ink);
}
.est-calc .est-calc__about p, .est-calc .est-calc__about ul { margin: 0 0 10px; padding: 0; font-size: 14px; color: var(--est-ink-2); }
.est-calc .est-calc__about ul { padding-left: 1.2em; list-style: disc; }
.est-calc .est-calc__about li { margin: 0 0 4px; padding: 0; font-size: 14px; }
.est-calc .est-calc__about li::marker { color: var(--est-primary); }
.est-calc .est-calc__about strong { color: var(--est-ink); font-weight: 500; }
.est-calc .est-calc__about var { font-style: italic; }
.est-calc .est-calc__about sup { font-size: .72em; line-height: 0; }
.est-calc .est-calc__nw { white-space: nowrap; }

/* Brand */
.est-calc .est-calc__brand {
	display: flex; align-items: center; justify-content: flex-end; gap: 6px;
	margin: 14px 0 0; padding: 0; font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--est-secondary);
}
.est-calc .est-calc__brand span { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--est-primary); }

/* Screen-reader only live region */
.est-calc .est-calc__sr {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

@container (max-width: 479px) {
	.est-calc .est-calc__cvalue { font-size: 22px; }
	.est-calc .est-calc__card--main .est-calc__cvalue { font-size: 26px; }
	.est-calc .est-calc__axis { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) {
	.est-calc { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.est-calc .est-calc__num-in { transition: none; }
}
@media print {
	.est-calc .est-calc__range, .est-calc .est-calc__tip { display: none; }
}

/* Hub: a grid of calculator cards; one calculator is shown at a time (core.js adds .is-ready).
 * Without JavaScript every calculator stays visible and the cards work as anchor links. */
.est-calc-hub { container-type: inline-size; margin: 1.5em 0 2em; font-family: var(--est-font); }
.est-calc-hub .est-calc-hub__group + .est-calc-hub__group { margin-top: 18px; }
.est-calc-hub.est-calc-hub .est-calc-hub__label {
	margin: 0 0 8px; padding: 0; font-size: 12px; line-height: 1.4; font-weight: 600;
	letter-spacing: .06em; text-transform: uppercase; color: var(--est-secondary);
}
.est-calc-hub .est-calc-hub__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.est-calc-hub.est-calc-hub a.est-calc-hub__card {
	display: block; padding: 12px 14px; border: 1px solid var(--est-grid); border-radius: var(--est-radius);
	background: var(--est-surface); color: var(--est-ink); text-decoration: none; box-shadow: none;
	transition: border-color .15s, background-color .15s;
}
.est-calc-hub.est-calc-hub a.est-calc-hub__card:hover { border-color: var(--est-primary); }
.est-calc-hub.est-calc-hub a.est-calc-hub__card:focus-visible { outline: none; border-color: var(--est-primary); box-shadow: var(--est-ring); }
.est-calc-hub.est-calc-hub a.est-calc-hub__card.is-active { border-color: var(--est-primary); background: var(--est-tint); }
.est-calc-hub .est-calc-hub__name { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--est-ink); }
.est-calc-hub a.is-active .est-calc-hub__name { color: var(--est-primary-text); }
.est-calc-hub .est-calc-hub__desc { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--est-ink-2); }
.est-calc-hub .est-calc-hub__panel { margin-top: 28px; scroll-margin-top: var(--est-anchor-offset); }
.est-calc-hub .est-calc-hub__panel > .est-calc { margin-top: 6px; }
.est-calc-hub.est-calc-hub a.est-calc-hub__back { display: none; font-size: 13px; line-height: 1.4; color: var(--est-ink-2); text-decoration: none; }
.est-calc-hub.est-calc-hub.is-ready a.est-calc-hub__back { display: inline-block; }
.est-calc-hub.est-calc-hub a.est-calc-hub__back:hover { color: var(--est-primary-text); }
.est-calc-hub.is-ready .est-calc-hub__panel[hidden] { display: none; }

.main-content .est-calc-reading {
	margin-block: clamp(24px, 4vw, 40px) 30px;
	padding: clamp(16px, 3vw, 28px);
	border: 1px solid var(--est-grid);
	border-radius: var(--est-radius);
	background: var(--est-surface-2);
	scroll-margin-top: var(--est-anchor-offset);
}
.est-calc-reading > h2 {
	margin: 0 0 8px;
}
.main-content .est-calc-reading > .wp-block-list {
	margin: 0;
	padding-inline-start: 1.25em;
	list-style: disc outside;
}
.est-calc-reading li::marker {
	color: var(--est-primary-text);
}
.main-content .est-calc-reading li > a {
	display: block;
	box-sizing: border-box;
	min-height: 44px;
	padding-block: 10px;
	color: var(--est-ink);
	line-height: 1.5;
	text-decoration: underline;
	text-decoration-color: var(--est-primary-text);
	text-underline-offset: .16em;
}
.main-content .est-calc-reading li > a:hover {
	text-decoration-thickness: 2px;
}
.main-content .est-calc-reading li > a:focus-visible {
	outline: 2px solid var(--est-primary-text);
	outline-offset: 2px;
	border-radius: 4px;
}
@container (max-width: 640px) {
	.est-calc-hub .est-calc-hub__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@container (max-width: 480px) {
	.est-calc-hub .est-calc-hub__desc { display: none; }
	.est-calc-hub.est-calc-hub a.est-calc-hub__card { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.est-calc-hub.est-calc-hub a.est-calc-hub__card { transition: none; }
}
