/* Note Brokering calculators (note value, partial purchase). Loaded only on pages with data-nb-calc.
   Uses the tokens and .nb-field / .nb-btn styles from main.css. */

.nb-calc {
	margin: 2em 0;
	border: 1px solid #b9c2bd;
	border-radius: var(--radius);
	background: var(--white);
	font-size: 1rem;
	line-height: 1.5;
}

.nb-calc__form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.nb-calc__inputs,
.nb-calc__results {
	padding: 24px;
}

.nb-calc__inputs {
	border-right: 1px solid var(--rule);
	background: var(--bg-alt);
}

.nb-prose .nb-calc h2.nb-calc__title {
	margin: 0 0 16px;
	font-size: 1.375rem;
}

.nb-calc p {
	margin: 0;
}

.nb-calc .nb-field {
	margin-bottom: 20px;
}

.nb-calc .nb-field label {
	font-size: 0.9375rem;
}

.nb-calc__hint {
	margin-top: 6px !important;
	color: var(--muted);
	font-size: 0.875rem;
	line-height: 1.4;
}

.nb-calc__error {
	margin-top: 6px !important;
	color: #a4262c;
	font-size: 0.875rem;
	font-weight: 500;
}

.nb-calc .nb-field input[aria-invalid="true"] {
	border-color: #a4262c;
}

/* Range sliders */

.nb-calc__out {
	margin-left: 4px;
	color: var(--accent);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.nb-calc .nb-field input[type="range"] {
	width: 100%;
	min-height: 44px;
	margin: 4px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	accent-color: var(--accent);
	cursor: pointer;
}

.nb-calc .nb-field input[type="range"]:focus {
	outline: none;
}

.nb-calc .nb-field input[type="range"]:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.nb-calc .nb-calc__sellrange {
	margin-top: 8px !important;
}

.nb-calc__scale {
	display: flex;
	justify-content: space-between;
	color: var(--muted);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

/* Results */

.nb-calc__badge {
	display: inline-block;
	margin-bottom: 14px !important;
	padding: 3px 10px;
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	color: var(--accent);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nb-calc__label {
	color: var(--muted);
	font-size: 0.9375rem;
}

.nb-calc__figure {
	margin: 2px 0 14px !important;
	color: var(--accent);
	font-family: var(--display);
	font-size: clamp(2.25rem, 5vw, 3rem);
	font-weight: 500;
	line-height: 1.1;
	font-variant-numeric: lining-nums tabular-nums;
}

.nb-calc__list {
	margin: 0;
	border-top: 1px solid var(--rule);
}

.nb-calc__list > div {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 16px;
	padding: 9px 0;
	border-bottom: 1px solid var(--rule);
}

.nb-calc__list dt {
	color: var(--muted);
}

.nb-calc__list dd {
	margin: 0;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.nb-calc__notice {
	margin-top: 12px !important;
	padding: 12px 14px;
	border-left: 3px solid var(--accent);
	background: var(--accent-tint);
	font-size: 0.9375rem;
}

.nb-calc__detail {
	margin-top: 18px;
}

.nb-calc__tablewrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.nb-prose .nb-calc table.nb-calc__table {
	margin: 0;
	border: 1px solid var(--rule);
	font-size: 0.9375rem;
	line-height: 1.35;
}

.nb-calc__table caption {
	padding-bottom: 8px;
	font-family: var(--display);
	font-size: 1.0625rem;
	font-weight: 500;
	text-align: left;
}

.nb-prose .nb-calc .nb-calc__table th,
.nb-prose .nb-calc .nb-calc__table td,
.nb-calc__table th,
.nb-calc__table td {
	padding: 8px 10px;
	border-top: 1px solid var(--rule);
	text-align: left;
	vertical-align: top;
}

.nb-prose .nb-calc .nb-calc__table thead th,
.nb-calc__table thead th {
	border-top: 0;
	background: var(--bg-alt);
	font-family: var(--body);
	font-size: 0.875rem;
	font-weight: 500;
}

.nb-calc__table tbody th {
	font-weight: 400;
}

.nb-prose .nb-calc .nb-calc__table .num,
.nb-calc__table .num {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.nb-calc__table .is-current th,
.nb-calc__table .is-current td {
	background: var(--accent-tint);
	font-weight: 500;
}

.nb-calc__table .is-total th,
.nb-calc__table .is-total td {
	font-weight: 500;
}

.nb-calc__fine {
	margin-top: 18px !important;
	color: var(--muted);
	font-size: 0.875rem;
	line-height: 1.45;
}

.nb-calc__fine strong {
	color: var(--ink);
}

.nb-calc__cta {
	margin-top: 18px !important;
}

.nb-calc__cta .nb-btn {
	width: 100%;
	white-space: normal;
	text-align: center;
	font-size: 1.1875rem;
	padding-inline: 1.2rem;
}

.nb-calc__cta .nb-btn:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

@media (max-width: 760px) {
	.nb-calc__form {
		grid-template-columns: minmax(0, 1fr);
	}

	.nb-calc__inputs {
		border-right: 0;
		border-bottom: 1px solid var(--rule);
	}

	.nb-calc__inputs,
	.nb-calc__results {
		padding: 18px 16px;
	}

	.nb-calc__list dd {
		text-align: left;
	}

	.nb-prose .nb-calc .nb-calc__table th,
	.nb-prose .nb-calc .nb-calc__table td,
	.nb-calc__table th,
	.nb-calc__table td {
		padding: 7px 4px;
		font-size: 0.8125rem;
	}
}
