/**
 * Tools family (handle 'pdir-theme-tools', registered in inc/tools.php):
 * calculator, tools-index and fee-tables, plus the tool page layout.
 * Loaded only where one of those blocks renders. --sg-* tokens only.
 */

/* ---------- Tool page layout (templates/page-{tool}.html) ---------- */
.sg-tool-page__body {
	padding-top: 40px;
	padding-bottom: 96px;
}

.sg-tool-page__copy {
	margin-top: 64px;
}

/* The copy reads at most 760px wide. The calculator's figures (variant
   figures, first in the copy on the six tool pages) keep the column's full
   width, as they had inside the calculator. */
.sg-tool-page__copy > :not(.sg-calc__figures) {
	max-width: 760px;
}

.sg-tool-page__copy > * + * {
	margin-top: 48px;
}

/* The figures open the copy: on small screens after the firms sidebar, with
   the copy's own gap above them and again below them. */
.sg-tool-page__copy > .sg-calc__figures:first-child {
	margin-top: 0;
}

.sg-tool-page__copy > .sg-calc__figures + * {
	margin-top: 64px;
}

.sg-tool-page__copy .sg-prose:empty {
	display: none;
}

/* With the firms sidebar (templates name the tool's firms-aside block after
   the widget): on small screens the firms come right after the widget (the
   calculator and its result), then the copy (on the six tool pages it opens
   with the calculator's figures); from 1024px the sidebar takes a 320px
   column on the right beside both. It is not sticky: it is taller than many
   screens. */
.sg-tool-page__body--aside > .sg-firms-panel {
	margin-top: 40px;
}

@media (min-width: 1024px) {
	.sg-tool-page__body--aside {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 320px;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"widget aside"
			"copy aside";
		align-items: start;
		column-gap: clamp(48px, 4.5vw, 64px);
	}

	.sg-tool-page__body--aside > :not(.sg-firms-panel, .sg-tool-page__copy) {
		grid-area: widget;
		min-width: 0;
	}

	.sg-tool-page__body--aside > .sg-firms-panel {
		grid-area: aside;
		margin-top: 0;
	}

	.sg-tool-page__body--aside > .sg-tool-page__copy {
		grid-area: copy;
		min-width: 0;
	}

	/* The figures sit straight under the calculator, 56px down, as they did
	   inside it. */
	.sg-tool-page__body--aside > .sg-tool-page__copy:has(> .sg-calc__figures:first-child) {
		margin-top: 56px;
	}
}

/* ---------- Calculator card ---------- */
/* The calculator sizes its two columns from its own width (a query
   container), so it stays one column when a sidebar narrows it. */
.sg-calc {
	--sg-calc-pad: 32px;
	container: sg-calc / inline-size;
	color: var(--sg-text);
}

/* Figures line up, without widening hyphens in labels ("First-time"). */
.sg-calc__table td,
.sg-calc__metric dd,
.sg-calc__facts dd,
.sg-figtable__bands strong {
	font-variant-numeric: tabular-nums;
}

.sg-calc [hidden] {
	display: none !important;
}

.sg-calc__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	background: #fff;
	border: 1px solid var(--sg-line);
	border-radius: var(--sg-radius-card);
	box-shadow: var(--sg-shadow-card);
	overflow: hidden;
}

/* Two columns from 760px of the calculator's own width. The 960px screen
   condition keeps a full-width calculator exactly as before (at 960px it is
   912px wide); beside the sidebar it needs the 760px too. */
@media (min-width: 960px) {
	@container sg-calc (min-width: 760px) {
		.sg-calc--full .sg-calc__grid {
			grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		}
	}
}

.sg-calc__form,
.sg-calc__result {
	padding: var(--sg-calc-pad);
	min-width: 0;
}

.sg-calc__result {
	background: var(--sg-soft);
	border-top: 1px solid var(--sg-line);
}

@media (min-width: 960px) {
	@container sg-calc (min-width: 760px) {
		.sg-calc--full .sg-calc__result {
			border-top: 0;
			border-left: 1px solid var(--sg-line);
		}
	}
}

.sg-calc__heading {
	margin: 0 0 20px;
	font-family: var(--sg-font-head);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--sg-ink);
}

.sg-calc--compact .sg-calc__heading {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--sg-teal-700);
	margin-bottom: 14px;
}

/* Compact (inside a guide) */
.sg-calc--compact {
	--sg-calc-pad: 24px;
	margin: 2em 0;
}

.sg-calc__intro {
	margin-bottom: 16px;
}

.sg-calc__title {
	margin: 0 0 6px;
	font-family: var(--sg-font-head);
	font-size: var(--sg-fs-h3);
	font-weight: 600;
	color: var(--sg-ink);
}

.sg-calc__summary {
	margin: 0;
	color: var(--sg-muted);
}

/* ---------- Fields ---------- */
.sg-calc__field {
	margin: 0 0 22px;
	min-width: 0;
}

.sg-calc__label {
	display: block;
	margin: 0 0 8px;
	padding: 0;
	font-family: var(--sg-font-head);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--sg-ink);
}

.sg-calc__hint {
	margin: -2px 0 10px;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--sg-muted);
}

.sg-calc__field--check .sg-calc__hint {
	margin: 8px 0 0;
}

/* A typed-value note by its field (also listed with the result). */
.sg-calc__error {
	margin: -2px 0 10px;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--sg-ink);
}

.sg-calc__error[hidden] {
	display: none;
}

.sg-calc__field:has(input[aria-invalid="true"]) .sg-calc__error {
	color: var(--sg-red);
}

.sg-calc__affix {
	position: relative;
	max-width: 320px;
}

.sg-calc__field--number .sg-calc__affix {
	max-width: 180px;
}

.sg-calc__unit {
	position: absolute;
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
	font-weight: 600;
	color: var(--sg-muted);
	pointer-events: none;
}

.sg-calc__unit--after {
	left: auto;
	right: 16px;
}

.sg-calc__field--money input {
	padding-left: 34px;
}

.sg-calc__affix--after input {
	padding-right: 40px;
}

.sg-calc__field input[type="text"],
.sg-calc__field input[type="number"],
.sg-calc__field input[type="date"],
.sg-calc__field select {
	width: 100%;
	min-height: 48px;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.sg-calc__field--date input,
.sg-calc__field--select select {
	max-width: 420px;
}

/* Radio and checkbox choices: whole rows are the target (44px+). */
.sg-calc__options {
	display: grid;
	gap: 8px;
}

.sg-calc__options--inline {
	grid-template-columns: repeat(auto-fit, minmax(96px, max-content));
}

.sg-calc__option {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 10px 16px;
	border: 1px solid var(--sg-line-strong);
	border-radius: var(--sg-radius-input);
	background: #fff;
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--sg-ink);
	cursor: pointer;
	transition: border-color 0.15s var(--sg-ease), background-color 0.15s var(--sg-ease);
}

.sg-calc__option:hover {
	border-color: var(--sg-muted);
}

.sg-calc__option input {
	flex: none;
	margin: 0;
}

.sg-calc__option:has(input:checked) {
	border-color: var(--sg-teal-700);
	background: var(--sg-teal-50);
}

.sg-calc__option:has(input:focus-visible) {
	outline: 2px solid var(--sg-blue);
	outline-offset: 2px;
}

.sg-calc__actions {
	margin-top: 8px;
}

/* Results update live once the script runs, so the button is only needed without it. */
.sg-calc.is-live .sg-calc__actions {
	display: none;
}

/* ---------- Result ---------- */
.sg-calc__body {
	min-height: 120px;
}

.sg-calc__headline-label {
	margin: 0 0 4px;
	font-family: var(--sg-font-head);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sg-muted);
}

.sg-calc__headline {
	margin: 0;
	font-family: var(--sg-font-head);
	font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--sg-ink);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.sg-calc--compact .sg-calc__headline {
	font-size: clamp(2rem, 1.6rem + 1.4vw, 2.5rem);
}

.sg-calc__headline--text {
	font-size: 1.25rem;
	line-height: 1.4;
	letter-spacing: 0;
}

.sg-calc__headline--text a {
	color: var(--sg-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sg-calc__sub {
	margin: 8px 0 0;
	color: var(--sg-text);
}

.sg-calc__body--past .sg-calc__sub,
.sg-calc__body--invalid .sg-calc__sub {
	color: var(--sg-red);
	font-weight: 600;
}

/* Notes about typed values: empty, not a number, or changed to fit. */
.sg-calc .sg-calc__issues {
	margin: 0 0 20px;
	padding: 12px 16px;
	list-style: none;
	background: var(--sg-gold-bg);
	border-left: 3px solid var(--sg-gold);
	border-radius: 8px;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--sg-ink);
}

.sg-calc__body--missing .sg-calc__issues {
	margin: 12px 0 0;
}

.sg-calc__issues li + li {
	margin-top: 6px;
}

.sg-calc input[aria-invalid="true"] {
	border-color: var(--sg-red);
}

.sg-calc__metrics {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 32px;
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--sg-line);
}

.sg-calc__metric dt {
	font-size: 0.8125rem;
	color: var(--sg-muted);
}

.sg-calc__metric dd {
	margin: 2px 0 0;
	font-family: var(--sg-font-head);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--sg-ink);
}

.sg-calc__section {
	margin-top: 28px;
}

.sg-calc__section-title {
	margin: 0 0 8px;
	font-family: var(--sg-font-head);
	font-size: 1rem;
	font-weight: 600;
	color: var(--sg-ink);
}

.sg-calc .sg-calc__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.sg-calc .sg-calc__table th,
.sg-calc .sg-calc__table td {
	padding: 10px 0;
	border-bottom: 1px solid var(--sg-line);
	text-align: left;
	vertical-align: top;
	font-weight: 400;
	font-family: var(--sg-font-body);
	background: none;
	color: var(--sg-text);
}

.sg-calc .sg-calc__table td {
	padding-left: 16px;
	text-align: right;
	white-space: nowrap;
	color: var(--sg-ink);
}

.sg-calc__detail {
	display: block;
	margin-top: 2px;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--sg-muted);
}

.sg-calc .sg-calc__row--sub th,
.sg-calc .sg-calc__row--sub td {
	font-weight: 600;
	color: var(--sg-ink);
}

.sg-calc .sg-calc__row--total th,
.sg-calc .sg-calc__row--total td {
	border-top: 2px solid var(--sg-ink);
	border-bottom: 0;
	font-family: var(--sg-font-head);
	font-weight: 600;
	color: var(--sg-ink);
}

/* Facts (time limits): a label above each wrapped value. */
.sg-calc__facts {
	margin: 0;
	font-size: 0.9375rem;
}

.sg-calc__fact {
	padding: 10px 0;
	border-bottom: 1px solid var(--sg-line);
}

.sg-calc__fact dt {
	font-size: 0.8125rem;
	color: var(--sg-muted);
}

.sg-calc__fact dd {
	margin: 2px 0 0;
	color: var(--sg-ink);
}

.sg-calc__facts a,
.sg-calc__table a,
.sg-calc__notes a,
.sg-calc__more a,
.sg-figtable a {
	color: var(--sg-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sg-calc .sg-calc__list {
	margin: 0;
	padding-left: 1.2em;
	font-size: 0.9375rem;
}

.sg-calc__list li + li {
	margin-top: 6px;
}

.sg-calc .sg-calc__notes {
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--sg-text);
}

.sg-calc__notes li {
	position: relative;
	padding-left: 16px;
}

.sg-calc__notes li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.6em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--sg-teal-700);
}

.sg-calc__notes li + li {
	margin-top: 10px;
}

.sg-calc__disclaimer {
	margin: 24px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--sg-line);
	font-size: 0.8125rem;
	color: var(--sg-muted);
}

.sg-calc__more {
	margin: 12px 0 0;
	font-size: 0.875rem;
	color: var(--sg-muted);
}

/* ---------- Guides on this topic and the glossary link ---------- */
.sg-tool-guides {
	margin: 48px 0 0;
	padding-top: 32px;
	border-top: 1px solid var(--sg-line);
}

.sg-tool-guides__title {
	margin: 0 0 16px;
	font-family: var(--sg-font-head);
	font-size: var(--sg-fs-h3);
	line-height: 1.3;
	color: var(--sg-ink);
}

.sg-tool-guides .sg-tool-guides__list {
	display: grid;
	gap: 0 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 700px) {
	.sg-tool-guides .sg-tool-guides__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.sg-tool-guides__list li {
	border-bottom: 1px solid var(--sg-line);
}

.sg-tool-guides__list a {
	display: block;
	padding: 12px 0;
	min-height: 44px;
	box-sizing: border-box;
	font-weight: 600;
	color: var(--sg-blue);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	transition: text-decoration-color var(--sg-dur-hover, 0.15s) var(--sg-ease, ease);
}

.sg-tool-guides__list a:hover {
	text-decoration-color: currentColor;
}

.sg-tool-guides__glossary {
	margin: 20px 0 0;
	color: var(--sg-text);
}

.sg-tool-guides__glossary a {
	color: var(--sg-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Figures table (calculator and fee-tables) ---------- */
.sg-calc__figures {
	margin-top: 56px;
}

.sg-calc__figures-lead {
	max-width: 720px;
	margin: -8px 0 20px;
	color: var(--sg-muted);
}

/* A query container: the table stacks by its own width (see below). */
.sg-figtable-wrap {
	container: sg-figtable / inline-size;
	background: #fff;
	border: 1px solid var(--sg-line);
	border-radius: var(--sg-radius-card);
	overflow: hidden;
}

.sg-figtable {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.sg-figtable-wrap .sg-figtable th,
.sg-figtable-wrap .sg-figtable td {
	padding: 14px 20px;
	border-bottom: 1px solid var(--sg-line);
	text-align: left;
	vertical-align: top;
}

.sg-figtable tbody tr:last-child th,
.sg-figtable tbody tr:last-child td {
	border-bottom: 0;
}

.sg-figtable thead th {
	background: var(--sg-soft);
	font-family: var(--sg-font-head);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--sg-muted);
}

.sg-figtable tbody th {
	width: 40%;
	font-weight: 400;
	color: var(--sg-ink);
}

.sg-figtable__value {
	width: 26%;
	min-width: 15rem;
	color: var(--sg-ink);
	font-variant-numeric: tabular-nums;
}

.sg-figtable__value strong {
	font-weight: 600;
}

/* Keep a band ("£925,001 to £1,500,000") or an amount ("Up to £2,657 a
   month") on one line. The longest amount is about 22 characters. */
.sg-figtable__bands span,
.sg-figtable__value > strong {
	white-space: nowrap;
}

.sg-figtable__label {
	display: block;
}

.sg-figtable__meta,
.sg-figtable__note {
	display: block;
	margin-top: 4px;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--sg-muted);
}

.sg-figtable__bands {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-figtable__bands li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.sg-figtable__bands li + li {
	margin-top: 4px;
}

.sg-figtable__check {
	font-weight: 600;
}

/* Stacked rows when the table's box is at most 685px wide inside its border:
   on a full-width page that is a screen under 720px, as before; beside the
   firms sidebar it is the main column from 1024px to about 1100px. */
@container sg-figtable (max-width: 685px) {
	.sg-figtable thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.sg-figtable tr {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 4px 16px;
		padding: 14px 16px;
		border-bottom: 1px solid var(--sg-line);
	}

	.sg-figtable tbody tr:last-child {
		border-bottom: 0;
	}

	.sg-figtable-wrap .sg-figtable th,
	.sg-figtable-wrap .sg-figtable td,
	.sg-figtable-wrap .sg-figtable tbody th {
		width: auto;
		padding: 0;
		border: 0;
	}

	/* The amount sits on its own line under the label, so it never breaks. */
	.sg-figtable-wrap .sg-figtable .sg-figtable__value {
		grid-column: 1 / -1;
		min-width: 0;
		text-align: left;
	}

	.sg-figtable__source {
		grid-column: 1 / -1;
		font-size: 0.875rem;
	}
}

/* Browsers without container queries (Safari 15, Chrome 104, Firefox 109
   and older) stack the rows on screens under 720px, as before. */
@supports not (container-type: inline-size) {
	@media (max-width: 719px) {
		.sg-figtable thead {
			position: absolute;
			width: 1px;
			height: 1px;
			overflow: hidden;
			clip: rect(0 0 0 0);
			white-space: nowrap;
		}

		.sg-figtable tr {
			display: grid;
			grid-template-columns: minmax(0, 1fr) auto;
			gap: 4px 16px;
			padding: 14px 16px;
			border-bottom: 1px solid var(--sg-line);
		}

		.sg-figtable tbody tr:last-child {
			border-bottom: 0;
		}

		.sg-figtable-wrap .sg-figtable th,
		.sg-figtable-wrap .sg-figtable td,
		.sg-figtable-wrap .sg-figtable tbody th {
			width: auto;
			padding: 0;
			border: 0;
		}

		.sg-figtable-wrap .sg-figtable .sg-figtable__value {
			grid-column: 1 / -1;
			min-width: 0;
			text-align: left;
		}

		.sg-figtable__source {
			grid-column: 1 / -1;
			font-size: 0.875rem;
		}
	}
}

/* ---------- Tools hub (tools-index) ---------- */
.sg-tools-index__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-tool-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	padding: 28px;
	background: #fff;
	border: 1px solid var(--sg-line);
	border-radius: var(--sg-radius-card);
	box-shadow: var(--sg-shadow-card);
	transition: border-color 0.18s var(--sg-ease), box-shadow 0.18s var(--sg-ease), transform 0.18s var(--sg-ease);
}

.sg-tool-card:hover {
	border-color: var(--sg-line-strong);
	box-shadow: var(--sg-shadow-raised);
	transform: translateY(-2px);
}

.sg-tool-card:active {
	transform: translateY(0);
}

.sg-tool-card:focus-within {
	outline: 2px solid var(--sg-blue);
	outline-offset: 2px;
}

.sg-tool-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--sg-teal-50);
	color: var(--sg-teal-700);
}

.sg-tool-card__icon svg {
	width: 22px;
	height: 22px;
}

.sg-tool-card__title {
	margin: 6px 0 0;
	font-family: var(--sg-font-head);
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--sg-ink);
}

.sg-tool-card__title a {
	color: inherit;
	text-decoration: none;
}

.sg-tool-card__title a:focus-visible {
	outline: none;
}

/* The whole card is the link target. */
.sg-tool-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.sg-tool-card__summary {
	margin: 0;
	color: var(--sg-text);
	line-height: 1.55;
}

.sg-tool-card__scope {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--sg-muted);
}

.sg-tool-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
	font-family: var(--sg-font-head);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sg-teal-700);
}

.sg-tool-card__cta svg {
	transition: transform 0.18s var(--sg-ease);
}

.sg-tool-card:hover .sg-tool-card__cta svg {
	transform: translateX(3px);
}

.sg-tool-card--fees {
	background: var(--sg-tint-2);
}

/* The fees card closes the grid as one full-width row. */
.sg-tools-index__grid > li:has(.sg-tool-card--fees) {
	grid-column: 1 / -1;
}

@media (min-width: 700px) {
	.sg-tool-card--fees {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		align-items: center;
		gap: 4px 20px;
	}

	.sg-tool-card--fees .sg-tool-card__icon {
		grid-row: 1 / span 2;
	}

	.sg-tool-card--fees .sg-tool-card__title {
		grid-column: 2;
		margin: 0;
	}

	.sg-tool-card--fees .sg-tool-card__summary {
		grid-column: 2;
	}

	.sg-tool-card--fees .sg-tool-card__cta {
		grid-column: 3;
		grid-row: 1 / span 2;
		margin: 0;
		padding: 0;
	}
}

.sg-tools-index__note {
	margin: 24px 0 0;
	font-size: 0.875rem;
	color: var(--sg-muted);
}

/* ---------- Fee tables (/legal-fees/) ---------- */
.sg-fee-tables__nav {
	margin: 0 0 40px;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid var(--sg-line);
	border-radius: var(--sg-radius-card);
}

.sg-fee-tables__nav-title {
	margin: 0 0 10px;
	font-family: var(--sg-font-head);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sg-ink);
}

.sg-fee-tables__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-fee-tables__nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--sg-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sg-fee-area + .sg-fee-area {
	margin-top: 56px;
}

.sg-fee-area__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 16px;
}

.sg-fee-area__title {
	margin: 0;
	font-family: var(--sg-font-head);
	font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
	font-weight: 600;
	color: var(--sg-ink);
	scroll-margin-top: calc(var(--sg-header-h) + 24px);
}

.sg-fee-area__scope {
	margin: 4px 0 0;
	font-size: 0.875rem;
	color: var(--sg-muted);
}

.sg-fee-area__tool {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-family: var(--sg-font-head);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sg-teal-700);
	text-decoration: none;
}

.sg-fee-area__tool:hover {
	text-decoration: underline;
}

.sg-fee-tables__note {
	margin: 32px 0 0;
	font-size: 0.875rem;
	color: var(--sg-muted);
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.sg-calc {
		--sg-calc-pad: 20px;
	}

	.sg-tool-page__body {
		padding-top: 24px;
		padding-bottom: 64px;
	}

	.sg-tool-page__copy {
		margin-top: 48px;
	}

	.sg-tool-page__copy > .sg-calc__figures + * {
		margin-top: 48px;
	}

	.sg-calc__affix,
	.sg-calc__field--date input,
	.sg-calc__field--select select {
		max-width: none;
	}

	.sg-tool-card {
		padding: 22px;
	}
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.sg-calc__option,
	.sg-tool-card,
	.sg-tool-card__cta svg,
	.sg-tool-guides__list a {
		transition: none;
	}

	.sg-tool-card:hover,
	.sg-tool-card:hover .sg-tool-card__cta svg {
		transform: none;
	}
}

/* ---------- Print: the static result and figures, no controls ---------- */
@media print {
	.sg-calc__grid,
	.sg-figtable-wrap,
	.sg-tool-card {
		box-shadow: none;
	}

	.sg-calc__result {
		background: none;
	}

	.sg-calc__actions {
		display: none;
	}

	/* The firms sidebar is not printed: the figures follow the calculator
	   56px down, as they did inside it. */
	.sg-tool-page__copy:has(> .sg-calc__figures:first-child) {
		margin-top: 56px;
	}

	.sg-calc__table a::after,
	.sg-figtable a::after {
		content: " (" attr(href) ")";
		font-size: 0.75rem;
		word-break: break-all;
	}
}
