/* Halewell Core: calculators. Reads the theme's --hw-* names (Halewell sets them from its tokens) with
   neutral fallbacks for any other theme. No framework, no icon font, no !important; overflow: clip never hidden.
   Layout: the form on the left, the result panel on the right (stacked under 880 px); the panel shows an
   empty state until the first calculation. */

.hw-calc,
.hw-calc-index,
.hw-calc-mini {
	--hwcore-calc-ink: var(--hw-ink, #161616);
	--hwcore-calc-mut: var(--hw-muted, #5e5e5e);
	--hwcore-calc-faint: var(--hw-faint, #9a9a94);
	--hwcore-calc-bg: var(--hw-surface, #fff);
	--hwcore-calc-paper: var(--hw-surface-2, #f5f5f2);
	--hwcore-calc-paper-2: var(--hw-surface-3, #ebebe6);
	--hwcore-calc-line: var(--hw-line, #e6e6e3);
	--hwcore-calc-acc: var(--hw-accent, #ffe45c);
	--hwcore-calc-acc-2: var(--hw-accent-2, #ffd400);
	--hwcore-calc-acc-ink: var(--hw-accent-ink, #161616);
	--hwcore-calc-ok: var(--hw-ok, #2e7d5b);
	--hwcore-calc-warn: var(--hw-warn, #c24e3a);
	--hwcore-calc-info: #3b6fb6;
	--hwcore-calc-caution: #b8791a;
	--hwcore-calc-r: var(--hw-radius, 22px);
	--hwcore-calc-r-sm: var(--hw-radius-sm, 12px);
	--hwcore-calc-font: var(--hw-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	--hwcore-calc-disp: var(--hw-disp, var(--hwcore-calc-font));
	--hwcore-calc-ease: var(--hw-ease, cubic-bezier(0.2, 0.7, 0.2, 1));

	font-family: var(--hwcore-calc-font);
	color: var(--hwcore-calc-ink);
	font-size: 1rem;
	line-height: 1.5;
}

.hw-calc *,
.hw-calc *::before,
.hw-calc *::after,
.hw-calc-index *,
.hw-calc-index *::before,
.hw-calc-index *::after,
.hw-calc-mini *,
.hw-calc-mini *::before,
.hw-calc-mini *::after {
	box-sizing: border-box;
}

.hw-calc [hidden],
.hw-calc-index [hidden] {
	display: none;
}

/* ---------- the card ---------- */

.hw-calc {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin: 0 0 2rem;
	background: var(--hwcore-calc-bg);
	border: 1px solid var(--hwcore-calc-line);
	border-radius: var(--hwcore-calc-r);
	overflow: clip;
}

.hw-calc__side {
	display: grid;
	gap: 1.25rem;
	align-content: start;
	padding: clamp(1.25rem, 3vw, 2rem);
}

.hw-calc__panel {
	position: relative;
	display: grid;
	gap: 1rem;
	align-content: start;
	padding: clamp(1.25rem, 3vw, 2rem);
	background: var(--hwcore-calc-paper);
}

.hw-calc__foot {
	display: grid;
	gap: 0.9rem;
	padding: 1.1rem clamp(1.25rem, 3vw, 2rem) 1.35rem;
	border-top: 1px solid var(--hwcore-calc-line);
	font-size: 0.9rem;
	color: var(--hwcore-calc-mut);
}

@media (width >= 880px) {
	.hw-calc {
		grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
	}

	.hw-calc__foot {
		grid-column: 1 / -1;
	}
}

/* ---------- head ---------- */

.hw-calc__head {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	gap: 0.15rem 1rem;
	align-items: center;
}

.hw-calc__icon {
	grid-row: 1 / 3;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--hwcore-calc-acc);
	color: var(--hwcore-calc-acc-ink);
}

.hw-calc__icon svg {
	width: 26px;
	height: 26px;
}

.hw-calc__title {
	font-family: var(--hwcore-calc-disp);
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.hw-calc .hw-calc__sub {
	margin: 0;
	font-size: 0.95rem;
	color: var(--hwcore-calc-mut);
}

.hw-calc__updated {
	grid-column: 2;
	justify-self: start;
	margin-top: 0.4rem;
	padding: 0.2rem 0.65rem;
	border-radius: 999px;
	background: var(--hwcore-calc-paper);
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--hwcore-calc-mut);
}

/* ---------- form ---------- */

.hw-calc__form {
	display: grid;
	gap: 1rem;
}

.hw-calc__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem 0.75rem;
}

.hw-calc__field {
	display: grid;
	gap: 0.35rem;
	min-width: 0;
}

.hw-calc__field--full {
	grid-column: 1 / -1;
}

.hw-calc__contents {
	display: contents;
}

.hw-calc__contents[hidden] {
	display: none;
}

.hw-calc__field label,
.hw-calc__label {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--hwcore-calc-ink);
}

.hw-calc__inwrap {
	position: relative;
	display: flex;
	align-items: center;
}

.hw-calc__field input[type="number"],
.hw-calc__field input[type="date"],
.hw-calc__field input[type="time"],
.hw-calc__field select {
	width: 100%;
	min-height: 48px;
	padding: 0.55rem 0.9rem;
	border: 1px solid var(--hwcore-calc-line);
	border-radius: var(--hwcore-calc-r-sm);
	background: var(--hwcore-calc-paper);
	color: var(--hwcore-calc-ink);
	font: inherit;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s, background 0.15s;
}

.hw-calc__field input[type="number"] {
	appearance: textfield;
}

.hw-calc__field input[type="number"]::-webkit-inner-spin-button,
.hw-calc__field input[type="number"]::-webkit-outer-spin-button {
	appearance: none;
	margin: 0;
}

.hw-calc__inwrap input {
	padding-inline-end: 3.2rem;
}

.hw-calc__unit {
	position: absolute;
	inset-inline-end: 0.9rem;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--hwcore-calc-mut);
	pointer-events: none;
}

.hw-calc__field select {
	appearance: none;
	padding-inline-end: 2.4rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8rem center;
	background-size: 18px;
}

.hw-calc__field input:hover,
.hw-calc__field select:hover {
	border-color: var(--hwcore-calc-faint);
}

/* The focus ring is ink with a page-coloured halo around it, never the accent. #FFD400 is 1.43:1 against a
   white page and 1.13:1 against the accent button it most often lands on, so the ring was invisible exactly
   where it mattered, in the default light scheme, while the theme advertised accessibility-ready. Two tones
   mean one of them always contrasts with whatever sits behind: WCAG 1.4.11 wants 3:1 and this clears it on
   the page, on a dark panel and on paper. */
.hw-calc__field input:focus-visible,
.hw-calc__field select:focus-visible {
	outline: 3px solid var(--hwcore-calc-ink);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--hwcore-calc-bg);
	border-color: var(--hwcore-calc-ink);
	background: var(--hwcore-calc-bg);
}

.hw-calc__duo {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.hw-calc__field--spacer {
	display: block;
}

/* segmented controls: units, sex, modes */
.hw-calc__seg {
	position: relative;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: 4px;
	padding: 4px;
	border-radius: 999px;
	background: var(--hwcore-calc-paper);
}

.hw-calc__seg input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.hw-calc__seg label {
	display: grid;
	place-items: center;
	min-height: 40px;
	padding: 0.4rem 0.8rem;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	color: var(--hwcore-calc-mut);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.hw-calc__seg label:hover {
	color: var(--hwcore-calc-ink);
}

.hw-calc__seg input:checked + label {
	background: var(--hwcore-calc-ink);
	color: var(--hwcore-calc-bg);
}

.hw-calc__seg input:focus-visible + label {
	outline: 3px solid var(--hwcore-calc-ink);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--hwcore-calc-bg);
}

.hw-calc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 52px;
	padding: 0.8rem 1.5rem;
	border: 0;
	border-radius: var(--hwcore-calc-r-sm);
	background: var(--hwcore-calc-acc);
	color: var(--hwcore-calc-acc-ink);
	font: inherit;
	font-size: 1.05rem;
	font-weight: 800;
	cursor: pointer;
	transition: transform 0.15s var(--hwcore-calc-ease), filter 0.15s;
}

.hw-calc__btn:hover {
	filter: brightness(0.96);
	transform: translateY(-1px);
}

.hw-calc__btn:active {
	transform: translateY(0);
}

.hw-calc__btn:focus-visible {
	outline: 3px solid var(--hwcore-calc-ink);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--hwcore-calc-bg);
}

.hw-calc .hw-calc__error {
	padding: 0.7rem 0.9rem;
	border-radius: var(--hwcore-calc-r-sm);
	background: color-mix(in srgb, var(--hwcore-calc-warn) 12%, var(--hwcore-calc-bg));
	color: var(--hwcore-calc-warn);
	font-size: 0.95rem;
	font-weight: 600;
}

/* ---------- empty state ---------- */

.hw-calc__empty {
	display: grid;
	justify-items: center;
	gap: 0.6rem;
	padding: clamp(1.5rem, 5vw, 3rem) 1rem;
	text-align: center;
	color: var(--hwcore-calc-mut);
}

.hw-calc__empty-art {
	display: grid;
	place-items: center;
	width: 112px;
	height: 112px;
	margin-bottom: 0.5rem;
	border-radius: 50%;
	background: repeating-radial-gradient(circle at center, var(--hwcore-calc-line) 0 1px, transparent 1px 13px);
	color: var(--hwcore-calc-ink);
}

.hw-calc__empty-art svg {
	width: 40px;
	height: 40px;
	stroke-width: 1.4;
}

.hw-calc__empty-title {
	font-family: var(--hwcore-calc-disp);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--hwcore-calc-ink);
}

.hw-calc .hw-calc__empty p {
	max-width: 30ch;
	margin: 0;
	font-size: 0.95rem;
}

/* ---------- result ---------- */

.hw-calc__result {
	display: grid;
	gap: 1.1rem;
}

.hw-calc__hero {
	display: grid;
	gap: 0.45rem;
}

.hw-calc__hero-label {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hwcore-calc-mut);
}

.hw-calc__hero-num {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4rem;
	font-family: var(--hwcore-calc-disp);
	font-size: clamp(2.5rem, 1.9rem + 2.4vw, 3.5rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
	color: var(--hwcore-calc-ink);
}

.hw-calc__hero-num small {
	font-family: var(--hwcore-calc-font);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0;
	color: var(--hwcore-calc-mut);
}

.hw-calc__hero-badge,
.hw-calc__center {
	display: flex;
}

/* The band a result falls in, as a label rather than a capsule. A tinted pill with coloured text is the
   shape every generated interface reaches for and it adds nothing the word does not already say. The rule
   underneath carries the band's colour, which is the same colour as its segment of the gauge above, so the
   two read as one thing; the band is named in words as well, so colour is never the only signal. */
.hw-calc__badge {
	display: inline-block;
	padding: 0.1rem 0 0.25rem;
	border: 0;
	border-bottom: 2px solid var(--hwcore-calc-line);
	border-radius: 0;
	background: none;
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hwcore-calc-ink);
}

.hw-calc__badge--ink {
	border-bottom-color: var(--hwcore-calc-ink);
}

.hw-calc__badge--green {
	border-bottom-color: var(--hwcore-calc-ok);
}

.hw-calc__badge--orange {
	border-bottom-color: var(--hwcore-calc-caution);
}

.hw-calc__badge--red {
	border-bottom-color: var(--hwcore-calc-warn);
}

.hw-calc__badge--blue {
	border-bottom-color: var(--hwcore-calc-info);
}

/* gauge: four bands and a marker at --pos */
.hw-calc__gauge-wrap {
	position: relative;
	padding-top: 16px;
}

.hw-calc__gauge {
	display: flex;
	gap: 2px;
	height: 12px;
	border-radius: 999px;
	overflow: clip;
}

.hw-calc__band {
	flex: 0 0 var(--hwcore-calc-w, 25%);
	background: var(--hwcore-calc-line);
}

.hw-calc__band--blue { background: color-mix(in srgb, var(--hwcore-calc-info) 40%, var(--hwcore-calc-bg)); }
.hw-calc__band--green { background: color-mix(in srgb, var(--hwcore-calc-ok) 55%, var(--hwcore-calc-bg)); }
.hw-calc__band--orange { background: color-mix(in srgb, var(--hwcore-calc-caution) 55%, var(--hwcore-calc-bg)); }
.hw-calc__band--red { background: color-mix(in srgb, var(--hwcore-calc-warn) 50%, var(--hwcore-calc-bg)); }

.hw-calc__marker {
	position: absolute;
	top: 2px;
	left: var(--hwcore-calc-pos, 50%);
	width: 3px;
	height: 26px;
	margin-left: -1.5px;
	border-radius: 2px;
	background: var(--hwcore-calc-ink);
}

.hw-calc__marker::before {
	content: "";
	position: absolute;
	top: -5px;
	left: 50%;
	width: 13px;
	height: 13px;
	margin-left: -6.5px;
	border-radius: 50%;
	background: var(--hwcore-calc-ink);
	box-shadow: 0 0 0 3px var(--hwcore-calc-paper);
}

.hw-calc__gauge-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 0.4rem;
	font-size: 0.75rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--hwcore-calc-mut);
}

/* rows */
.hw-calc .hw-calc__rows {
	display: grid;
	margin: 0;
}

.hw-calc__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.6rem 0;
	border-top: 1px solid var(--hwcore-calc-line);
}

.hw-calc__row:first-child {
	border-top: 0;
}

.hw-calc .hw-calc__k,
.hw-calc .hw-calc__v {
	margin: 0;
}

.hw-calc__k {
	font-size: 0.92rem;
	color: var(--hwcore-calc-mut);
}

.hw-calc__v {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: end;
}

.hw-calc__row--hl {
	position: relative;
	padding-inline-start: 0.85rem;
}

.hw-calc__row--hl::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.75rem;
	bottom: 0.75rem;
	width: 4px;
	border-radius: 2px;
	background: var(--hwcore-calc-acc-2);
}

.hw-calc__row--hl .hw-calc__v {
	font-weight: 800;
}

/* tiles */
.hw-calc__chips {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
	gap: 0.6rem;
}

/* four tiles never leave one alone on a row */
.hw-calc__chips:has(> :nth-child(4):last-child) {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (width >= 1100px) {
	.hw-calc__chips:has(> :nth-child(4):last-child) {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.hw-calc__chip {
	display: grid;
	gap: 0.15rem;
	padding: 0.85rem 0.9rem;
	border: 1px solid var(--hwcore-calc-line);
	border-radius: var(--hwcore-calc-r-sm);
	background: var(--hwcore-calc-bg);
}

.hw-calc__chip strong {
	font-family: var(--hwcore-calc-disp);
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.hw-calc__chip small {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hwcore-calc-mut);
}

.hw-calc__chip--best {
	background: var(--hwcore-calc-acc);
	border-color: transparent;
	color: var(--hwcore-calc-acc-ink);
}

.hw-calc__chip--best small {
	color: inherit;
	opacity: 0.75;
}

/* tables */
.hw-calc .hw-calc__subhead {
	margin: 0.25rem 0 0;
	font-family: var(--hwcore-calc-disp);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--hwcore-calc-ink);
}

.hw-calc__scroll {
	overflow-x: auto;
	border: 1px solid var(--hwcore-calc-line);
	border-radius: var(--hwcore-calc-r-sm);
	background: var(--hwcore-calc-bg);
}

.hw-calc .hw-calc__table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.hw-calc .hw-calc__table th {
	padding: 0.55rem 0.8rem;
	background: var(--hwcore-calc-paper-2);
	font-size: 0.76rem;
	font-weight: 700;
	text-align: start;
	color: var(--hwcore-calc-mut);
}

.hw-calc .hw-calc__table td {
	padding: 0.55rem 0.8rem;
	border-top: 1px solid var(--hwcore-calc-line);
	vertical-align: top;
}

.hw-calc__num-cell {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-align: end;
}

.hw-calc .hw-calc__table th:not(:first-child) {
	text-align: end;
}

.hw-calc .hw-calc__tr--hl td {
	background: color-mix(in srgb, var(--hwcore-calc-acc) 35%, var(--hwcore-calc-bg));
	font-weight: 800;
}

/* paragraphs */
.hw-calc .hw-calc__desc {
	margin: 0;
}

.hw-calc .hw-calc__fine {
	margin: 0;
	font-size: 0.85rem;
	color: var(--hwcore-calc-mut);
}

.hw-calc .hw-calc__warn {
	margin: 0;
	padding: 0.7rem 0.9rem;
	border-radius: var(--hwcore-calc-r-sm);
	background: color-mix(in srgb, var(--hwcore-calc-warn) 12%, var(--hwcore-calc-bg));
	color: var(--hwcore-calc-warn);
	font-weight: 600;
}

/* ---------- foot: note, related tools, sources ---------- */

.hw-calc .hw-calc__note {
	margin: 0;
}

.hw-calc__rel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.5rem;
}

.hw-calc__rel-label {
	font-weight: 700;
	color: var(--hwcore-calc-ink);
}

.hw-calc__rel a {
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	background: var(--hwcore-calc-paper);
	font-weight: 600;
	color: var(--hwcore-calc-ink);
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.hw-calc__rel a:hover {
	background: var(--hwcore-calc-acc);
	color: var(--hwcore-calc-acc-ink);
}

.hw-calc__rel-all {
	font-weight: 700;
}

.hw-calc__share {
	margin-inline-start: auto;
	padding: 0.3rem 0.9rem;
	border: 0;
	border-radius: 999px;
	background: var(--hwcore-calc-acc);
	font: inherit;
	font-weight: 700;
	color: var(--hwcore-calc-acc-ink);
	cursor: pointer;
}

.hw-calc__share:hover {
	filter: brightness(0.96);
}

.hw-calc__share[disabled] {
	opacity: 0.6;
	cursor: default;
}

.hw-calc__share + .hw-calc__copy {
	margin-inline-start: 0;
}

.hw-calc__copy {
	margin-inline-start: auto;
	padding: 0.3rem 0.8rem;
	border: 1px solid var(--hwcore-calc-line);
	border-radius: 999px;
	background: transparent;
	font: inherit;
	font-weight: 600;
	color: var(--hwcore-calc-ink);
	cursor: pointer;
}

.hw-calc__copy:hover {
	border-color: var(--hwcore-calc-ink);
}

.hw-calc__copy--done {
	border-color: var(--hwcore-calc-ok);
	color: var(--hwcore-calc-ok);
}

.hw-calc__sources {
	padding-top: 0.75rem;
	border-top: 1px solid var(--hwcore-calc-line);
}

.hw-calc .hw-calc__sources-title {
	margin: 0 0 0.5rem;
	font-family: var(--hwcore-calc-disp);
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--hwcore-calc-ink);
}

.hw-calc .hw-calc__sources-list {
	display: grid;
	gap: 0.3rem;
	margin: 0;
	padding-inline-start: 1.1rem;
	font-size: 0.85rem;
}

.hw-calc__sources-list a {
	color: var(--hwcore-calc-ink);
	text-decoration: underline;
	text-decoration-color: var(--hwcore-calc-acc-2);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

.hw-calc__source-org::before {
	content: " \00b7 ";
}

/* ---------- motion (transform and opacity only; nothing on load) ---------- */

@media (prefers-reduced-motion: no-preference) {
	.hw-calc__result:not(.is-live) {
		transition: opacity 0.45s var(--hwcore-calc-ease), transform 0.45s var(--hwcore-calc-ease);

		@starting-style {
			opacity: 0;
			transform: translateY(10px);
		}
	}

	.hw-calc__result:not(.is-live) .hw-calc__marker {
		transition: left 0.7s var(--hwcore-calc-ease);

		@starting-style {
			left: 1%;
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.hw-calc__btn,
	.hw-calc__seg label,
	.hw-calc__field input,
	.hw-calc__field select,
	.hw-calc__rel a {
		transition: none;
	}
}

/* ---------- small screens ---------- */

@media (width <= 479px) {
	.hw-calc__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hw-calc__field--spacer {
		display: none;
	}

	.hw-calc__btn {
		width: 100%;
	}

	.hw-calc__copy,
	.hw-calc__share {
		margin-inline-start: 0;
	}
}

/* ---------- the index ---------- */

.hw-calc-index {
	display: grid;
	gap: 2rem;
	margin: 1.75rem 0 2rem;
}

.hw-calc-index__cat {
	display: grid;
	gap: 1rem;
}

.hw-calc-index .hw-calc-index__cat-title {
	margin: 0;
	font-family: var(--hwcore-calc-disp);
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.hw-calc-index__cards {
	display: grid;
	grid-template-columns: repeat(var(--hwcore-calc-cols, 3), minmax(0, 1fr));
	gap: 1rem;
}

.hw-calc-index[data-cols="1"] { --hwcore-calc-cols: 1; }
.hw-calc-index[data-cols="2"] { --hwcore-calc-cols: 2; }
.hw-calc-index[data-cols="4"] { --hwcore-calc-cols: 4; }

.hw-calc-index__card {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 0.2rem 0.9rem;
	align-content: start;
	padding: 1.1rem 1.2rem;
	border-radius: var(--hwcore-calc-r);
	background: var(--hwcore-calc-paper);
	color: var(--hwcore-calc-ink);
	text-decoration: none;
	transition: transform 0.2s var(--hwcore-calc-ease), background 0.2s;
}

.hw-calc-index__icon {
	grid-row: 1 / 4;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--hwcore-calc-bg);
	transition: background 0.2s, color 0.2s;
}

.hw-calc-index__icon svg {
	width: 24px;
	height: 24px;
}

.hw-calc-index__name {
	font-family: var(--hwcore-calc-disp);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.hw-calc-index__blurb {
	font-size: 0.9rem;
	color: var(--hwcore-calc-mut);
}

.hw-calc-index__cta {
	margin-top: 0.4rem;
	font-size: 0.9rem;
	font-weight: 700;
}

.hw-calc-index__cta::after {
	content: " \2192";
}

.hw-calc-index__card:hover {
	background: var(--hwcore-calc-paper-2);
}

.hw-calc-index__card:hover .hw-calc-index__icon {
	background: var(--hwcore-calc-acc);
	color: var(--hwcore-calc-acc-ink);
}

.hw-calc-index__card:focus-visible {
	outline: 3px solid var(--hwcore-calc-ink);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--hwcore-calc-bg);
}

@media (prefers-reduced-motion: no-preference) {
	.hw-calc-index__card:hover {
		transform: translateY(-3px);
	}
}

@media (width <= 899px) {
	.hw-calc-index__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (width <= 559px) {
	.hw-calc-index__cards {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media print {
	.hw-calc__btn,
	.hw-calc__copy,
	.hw-calc__share,
	.hw-yn,
	.hw-calc__empty {
		display: none;
	}

	.hw-calc {
		break-inside: avoid;
	}
}

/* ---------- the mini widget (a hero or sidebar teaser: gauge, number, two sliders) ---------- */

.hw-calc-mini {
	display: grid;
	gap: 0.85rem;
	padding: 1.25rem 1.35rem 1.35rem;
	border: 1px solid var(--hwcore-calc-line);
	border-radius: var(--hwcore-calc-r);
	background: var(--hwcore-calc-bg);
	box-shadow: var(--hw-shadow, 0 20px 40px -28px rgb(0 0 0 / 35%));
}

.hw-calc-mini__head {
	display: grid;
	gap: 0.1rem;
}

.hw-calc-mini__kicker {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--hwcore-calc-mut);
}

.hw-calc-mini__title {
	font-family: var(--hwcore-calc-disp);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.hw-calc-mini__gauge {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.hw-calc-mini__band {
	fill: none;
	stroke-width: 14;
}

.hw-calc-mini__band--blue { stroke: color-mix(in srgb, var(--hwcore-calc-info) 40%, var(--hwcore-calc-bg)); }
.hw-calc-mini__band--green { stroke: color-mix(in srgb, var(--hwcore-calc-ok) 55%, var(--hwcore-calc-bg)); }
.hw-calc-mini__band--orange { stroke: color-mix(in srgb, var(--hwcore-calc-caution) 55%, var(--hwcore-calc-bg)); }
.hw-calc-mini__band--red { stroke: color-mix(in srgb, var(--hwcore-calc-warn) 50%, var(--hwcore-calc-bg)); }

.hw-calc-mini__needle {
	transform-box: view-box;
	transform-origin: 100px 100px;
	transform: rotate(var(--hwcore-calc-angle, 0deg));
}

.hw-calc-mini__needle line {
	stroke: var(--hwcore-calc-ink);
	stroke-width: 3;
	stroke-linecap: round;
}

.hw-calc-mini__needle circle {
	fill: var(--hwcore-calc-ink);
}

.hw-calc-mini__num {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.6rem;
	margin-top: -0.5rem;
}

.hw-calc-mini__value {
	font-family: var(--hwcore-calc-disp);
	font-size: 2.6rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
}

.hw-calc-mini__badge {
	display: inline-block;
	padding: 0.1rem 0 0.2rem;
	border: 0;
	border-bottom: 2px solid var(--hwcore-calc-line);
	border-radius: 0;
	background: none;
	color: var(--hwcore-calc-ink);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.3;
}

.hw-calc-mini__badge--green { border-bottom-color: var(--hwcore-calc-ok); }
.hw-calc-mini__badge--orange { border-bottom-color: var(--hwcore-calc-caution); }
.hw-calc-mini__badge--red { border-bottom-color: var(--hwcore-calc-warn); }
.hw-calc-mini__badge--blue { border-bottom-color: var(--hwcore-calc-info); }

.hw-calc-mini__fields {
	display: grid;
	gap: 0.5rem;
}

.hw-calc-mini__field {
	display: grid;
	gap: 0.2rem;
	font-size: 0.85rem;
	font-weight: 700;
}

.hw-calc-mini__legend {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.hw-calc-mini__field output {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--hwcore-calc-mut);
}

.hw-calc-mini input[type="range"] {
	width: 100%;
	height: 28px;
	margin: 0;
	accent-color: var(--hwcore-calc-ink);
	cursor: pointer;
}

.hw-calc-mini input[type="range"]:focus-visible {
	outline: 3px solid var(--hwcore-calc-ink);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--hwcore-calc-bg);
	border-radius: 4px;
}

.hw-calc-mini__link {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--hwcore-calc-ink);
	text-decoration: underline;
	text-decoration-color: var(--hwcore-calc-acc-2);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

@media (prefers-reduced-motion: no-preference) {
	.hw-calc-mini__needle {
		transition: transform 0.6s var(--hwcore-calc-ease);

		@starting-style {
			transform: rotate(-90deg);
		}
	}
}
