/* ==========================================================================
   Baichdi: "worked out on paper"
   Ink on paper, a faint grid where sums happen, and one highlighter mark
   on every answer. The highlighter is the only loud thing on the page.
   ========================================================================== */

:root {
	color-scheme: light;
	/* Forest and mint, with the yellow highlighter kept for answers. */
	--ink: #0e4d3c;          /* primary: headings accents, links, buttons */
	--ink-deep: #0a3a2d;
	--ink-tint: #ddf1e8;     /* mint: selected states, input prefixes */
	--mint-soft: #eef7f2;    /* section bands */
	--text: #17201c;
	--muted: #55625c;
	--paper: #fafbf8;
	--surface: #ffffff;
	--on-ink: #ffffff;
	--grid: #dce6e0;
	--line: #c3d3ca;
	--hl: #ffe35a;
	--hl-text: #17201c;
	--ledger: #1f7a4f;
	--header-bg: rgba(250, 251, 248, 0.94);
	--footer-bg: #0a3a2d;
	--shadow: 0 1px 2px rgba(14, 77, 60, 0.06), 0 8px 24px -12px rgba(14, 77, 60, 0.18);

	--sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
	--serif: Literata, Georgia, "Times New Roman", serif;

	/* Type scale: perfect fourth from a 17px body. */
	--t-sm: 0.875rem;
	--t-base: 1.0625rem;
	--t-md: 1.25rem;
	--t-lg: 1.5rem;
	--t-xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
	--t-2xl: clamp(2rem, 1.4rem + 2.6vw, 3rem);
	--t-hero: clamp(1.85rem, 1.1rem + 3.4vw, 3.4rem);

	--wrap: 72rem;
	--wrap-text: 42rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--radius: 8px;
	--focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--text);
	font-family: var(--sans);
	font-size: var(--t-base);
	line-height: 1.55;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }

h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.2; letter-spacing: -0.015em; margin: 0; }

p { margin: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--ink); color: var(--on-ink);
	padding: 0.6rem 1rem; border-radius: var(--radius);
	font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(var(--wrap-text) + 2 * var(--gutter)); }
.wrap--media { max-width: calc(52rem + 2 * var(--gutter)); }

.site-main:focus { outline: none; }

/* Graph paper: only where numbers get worked out. */
.grid-paper {
	background-color: var(--paper);
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 24px 24px;
	background-position: -1px -1px;
}

/* ---------- Buttons ---------- */

.button {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.6rem 1.2rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--ink);
	color: var(--on-ink);
	font: 700 var(--t-base)/1.2 var(--sans);
	text-decoration: none;
	cursor: pointer;
}
.button:hover { background: var(--ink-deep); border-color: var(--ink-deep); }
.button--large { min-height: 3.5rem; padding: 0.8rem 1.75rem; font-size: var(--t-md); }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button--quiet:hover { background: var(--ink-tint); border-color: var(--ink); }

/* ---------- Header ---------- */

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--header-bg);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--grid);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }

.site-header__inner {
	display: flex; align-items: center; gap: 1rem 1.75rem;
	min-height: 4rem;
}

.brand { display: inline-flex; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand__logo { max-height: 2.5rem; width: auto; }
.brand__word {
	font-size: 1.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
	padding: 0.05em 0.12em 0.1em;
	background: linear-gradient(to bottom, transparent 55%, var(--hl) 55%, var(--hl) 92%, transparent 92%);
}

.site-nav { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.site-nav__list, .site-nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
	color: var(--text); font-weight: 600; text-decoration: none;
	padding-block: 0.4rem;
	border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-nav .current-menu-item > a, .site-nav [aria-current] { border-bottom-color: var(--ink); color: var(--ink); }

.site-search { margin-left: auto; }
.site-search input {
	width: 15rem; min-height: 2.5rem;
	padding: 0.4rem 0.8rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	background: var(--surface); color: var(--text);
	font: 500 var(--t-sm) var(--sans);
}
.site-search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(14, 77, 60, 0.15); outline: none; }

.region { display: flex; align-items: center; gap: 0.5rem; }
.region__label { font-size: var(--t-sm); color: var(--muted); }
.region__select {
	min-height: 2.5rem; max-width: 11rem;
	padding: 0.35rem 2rem 0.35rem 0.7rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	background: var(--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='%230e4d3c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
	color: var(--text);
	font: 600 var(--t-sm) var(--sans);
	appearance: none; cursor: pointer;
}

.nav-toggle {
	display: none;
	align-items: center; gap: 0.5rem;
	margin-left: auto;
	min-height: 2.75rem; padding: 0.4rem 0.75rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	background: var(--surface); color: var(--text);
	font: 600 var(--t-sm) var(--sans); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

@media (max-width: 63.99rem) {
	.site-header__inner { flex-wrap: wrap; padding-block: 0.6rem; }
	.nav-toggle { display: inline-flex; order: 2; margin-left: 0; }
	.region { order: 1; margin-left: auto; }
	.region__label { display: none; }
	.region__select { max-width: 9.5rem; }
	.site-nav {
		order: 3; flex-basis: 100%;
		display: none; flex-direction: column; align-items: stretch; gap: 0.5rem;
		padding-bottom: 1rem;
	}
	.site-nav.is-open { display: flex; }
	.site-nav__list, .site-nav ul { flex-direction: column; gap: 0; }
	.site-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--grid); }
	.site-search { margin-left: 0; margin-top: 0.5rem; }
	.site-search input { width: 100%; min-height: 2.75rem; font-size: var(--t-base); }
}
@media (max-width: 26rem) {
	.site-header__inner { gap: 0.5rem; }
	.brand__word { font-size: 1.4rem; }
	.nav-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
}

/* ---------- Hero: the sentence picker ---------- */

.hero { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--grid); }

.picker { max-width: 62rem; }
.picker__sentence {
	font-size: var(--t-hero);
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -0.025em;
	margin-bottom: 1.75rem;
}
.picker__select {
	appearance: none;
	max-width: 100%;
	margin: 0 0.1em;
	padding: 0 1.05em 0.02em 0.1em;
	border: 0;
	border-bottom: 0.09em solid var(--ink);
	border-radius: 0;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1.5 1.5l6.5 6.5 6.5-6.5' fill='none' stroke='%230e4d3c' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right 0.1em center / 0.5em auto;
	color: var(--ink);
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
	text-overflow: ellipsis;
}
.picker__select:hover { background-color: rgba(255, 227, 90, 0.45); }
.picker__select:focus-visible { box-shadow: none; outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
.picker__select option { font-size: 1rem; font-weight: 500; color: var(--text); }

.hero__sub { margin-top: 1.75rem; max-width: 38rem; color: var(--muted); font-size: var(--t-md); line-height: 1.5; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section + .section { border-top: 1px solid var(--grid); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section__title { font-size: var(--t-lg); font-weight: 750; }
.section__more { font-weight: 600; white-space: nowrap; }

/* ---------- Index: tools listed like a reference book ---------- */

.index { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text); }
.index__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.2rem 2rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--grid);
}
.index__row[hidden] { display: none; }
.index__title { font-size: 1.125rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.index__title:hover { text-decoration: underline; }
.index__desc { color: var(--muted); }
.index__where { color: var(--muted); font-size: var(--t-sm); }

@media (min-width: 48rem) {
	.index__row { grid-template-columns: minmax(14rem, 1fr) 2fr minmax(7rem, auto); align-items: baseline; }
	.index__where { text-align: right; }
}

/* ---------- News ---------- */

.news { display: grid; gap: 2rem 3rem; }
@media (min-width: 64rem) { .news { grid-template-columns: 1.45fr 1fr; } }

.lead__link { display: block; color: var(--text); text-decoration: none; }
.lead__link:hover .lead__title { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.lead__media { margin-bottom: 1rem; }
.lead__media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.lead__title { font-size: var(--t-xl); font-weight: 800; line-height: 1.15; }
.lead__excerpt { margin-top: 0.75rem; font-family: var(--serif); font-size: 1.125rem; color: var(--text); line-height: 1.6; }

.news__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text); }
.row { padding: 0.9rem 0; border-bottom: 1px solid var(--grid); }
.row__title { display: block; font-weight: 650; font-size: 1.0625rem; line-height: 1.35; color: var(--text); text-decoration: none; }
.row__title:hover { color: var(--ink); text-decoration: underline; }

.meta { margin-top: 0.35rem; font-size: var(--t-sm); color: var(--muted); }

/* ---------- Promise ---------- */

.section--promise { background: var(--surface); }
.promise { display: grid; gap: 1rem 3rem; }
@media (min-width: 56rem) { .promise { grid-template-columns: 1fr 2fr; } }
.promise__title { font-size: var(--t-lg); font-weight: 750; }
.promise__body { font-family: var(--serif); font-size: 1.125rem; line-height: 1.7; max-width: 40rem; }
.promise__body p + p { margin-top: 1rem; }
.promise__body a { font-family: var(--sans); font-weight: 600; }

/* ---------- Page heads and archives ---------- */

.page-head { padding-top: clamp(1.5rem, 4vw, 2.5rem); padding-bottom: 1.75rem; }
.page-title { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -0.025em; }
.page-intro { margin-top: 0.75rem; max-width: 40rem; color: var(--muted); font-size: var(--t-md); }

.crumbs { margin-bottom: 1rem; font-size: var(--t-sm); color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.entries { border-top: 2px solid var(--text); margin-bottom: 2rem; }
.entry { display: grid; gap: 1rem 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--grid); }
@media (min-width: 40rem) { .entry:has(.entry__media) { grid-template-columns: 12rem 1fr; } }
.entry__media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.entry__title { font-size: var(--t-md); font-weight: 700; }
.entry__title a { color: var(--text); text-decoration: none; }
.entry__title a:hover { color: var(--ink); text-decoration: underline; }
.entry__excerpt { margin-top: 0.4rem; color: var(--muted); }

.nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 3rem; }
.nav-links .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.75rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	text-decoration: none; font-weight: 600;
}
.nav-links .current { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.empty { padding: 2rem 0 4rem; color: var(--muted); font-size: var(--t-md); }

.search-again { display: flex; gap: 0.5rem; margin-top: 1.25rem; max-width: 32rem; }
.search-again input {
	flex: 1; min-width: 0; min-height: 2.75rem; padding: 0.5rem 0.8rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	font: 500 var(--t-base) var(--sans);
}
.notfound { padding-bottom: 5rem; }
.notfound p:last-child { margin-top: 1.25rem; font-weight: 600; }

/* Tools browse page */
.tools-browse { display: grid; gap: 2rem 3rem; padding-bottom: 4rem; }
@media (min-width: 64rem) { .tools-browse { grid-template-columns: 13rem 1fr; } }
.filters__title { font-size: var(--t-sm); font-weight: 700; color: var(--muted); margin: 0 0 0.5rem; }
.filters__title + ul { margin-bottom: 1.5rem; }
.filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
@media (min-width: 64rem) { .filters ul { flex-direction: column; gap: 0; } }
.filters a {
	display: block; padding: 0.4rem 0.6rem;
	border-left: 3px solid transparent;
	color: var(--text); text-decoration: none; font-weight: 500;
}
.filters a:hover { color: var(--ink); background: var(--ink-tint); }
.filters a[aria-current] { border-left-color: var(--ink); color: var(--ink); font-weight: 700; background: var(--ink-tint); }

/* ---------- Articles ---------- */

.article__head { padding-top: clamp(1.5rem, 4vw, 2.5rem); padding-bottom: 1.5rem; }
.article__title { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; }
.article__standfirst { margin-top: 1rem; font-family: var(--serif); font-size: var(--t-md); line-height: 1.55; color: var(--muted); }
.byline { margin-top: 1rem; font-size: var(--t-sm); color: var(--muted); }
.byline a { color: var(--text); font-weight: 600; text-decoration: none; }

.article__media { margin: 0 auto 2rem; }
.article__media img { display: block; width: 100%; border-radius: 6px; }
.article__media figcaption { margin-top: 0.5rem; font-size: var(--t-sm); color: var(--muted); }

.article__foot { padding-top: 1rem; padding-bottom: 3rem; }
.tags { font-size: var(--t-sm); color: var(--muted); margin-bottom: 1.5rem; }

.author-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border: 1px solid var(--grid); border-radius: 10px; background: var(--surface); }
.author-box img { border-radius: 50%; }
.author-box__name { font-weight: 700; }
.author-box__name a { color: var(--text); }
.author-box__bio { margin-top: 0.3rem; color: var(--muted); font-size: var(--t-sm); }

/* Long-form text */
.prose { font-family: var(--serif); font-size: 1.125rem; line-height: 1.75; padding-bottom: 2rem; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: var(--t-lg); font-weight: 750; margin-top: 2.25em; }
.prose h3 { font-size: var(--t-md); font-weight: 700; margin-top: 1.75em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { margin-inline: 0; padding-left: 1.25rem; border-left: 3px solid var(--ink); color: var(--muted); font-style: italic; }
.prose img { border-radius: 6px; }
.prose figure { margin-inline: 0; }
.prose figcaption { font-family: var(--sans); font-size: var(--t-sm); color: var(--muted); margin-top: 0.5rem; }
.prose code { font-size: 0.9em; background: var(--ink-tint); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { overflow-x: auto; padding: 1rem; background: var(--text); color: var(--paper); border-radius: var(--radius); font-size: 0.875rem; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--grid); margin-block: 2.5em; }
.prose mark { background: var(--hl); color: var(--hl-text); padding: 0 0.15em; }
.prose .wp-block-table { overflow-x: auto; }
.prose table {
	width: 100%; border-collapse: collapse;
	font-family: var(--sans); font-size: 0.975rem; font-variant-numeric: lining-nums;
}
.prose th, .prose td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
.prose thead th { border-bottom: 2px solid var(--text); font-weight: 700; }
.prose td:not(:first-child), .prose th:not(:first-child) { text-align: right; }

.toc { margin: 0 0 2rem; padding: 1rem 1.25rem; border-left: 3px solid var(--ink); background: var(--surface); }
.toc__title { font-size: var(--t-sm); font-weight: 700; color: var(--muted); margin-bottom: 0.5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li + li { margin-top: 0.3rem; }
.toc a { text-decoration: none; font-weight: 500; }
.toc a:hover { text-decoration: underline; }

.section--related { background: var(--surface); }

/* ---------- Tool pages ---------- */

.tool-page__head { padding-top: clamp(1.5rem, 4vw, 2.5rem); padding-bottom: 1.5rem; }
.tool-page__title { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -0.025em; max-width: 44rem; }
.tool-page__lede { margin-top: 0.75rem; max-width: 42rem; font-size: var(--t-md); color: var(--muted); }
.tool-page__facts { margin-top: 0.75rem; font-size: var(--t-sm); color: var(--muted); }
.tool-page__facts span + span { margin-left: 0.5rem; }

.tool-page__tool {
	max-width: calc(var(--wrap) + 2 * var(--gutter));
	padding-block: clamp(1rem, 3vw, 2rem);
	border-block: 1px solid var(--grid);
	margin-bottom: 2.5rem;
}
@media (min-width: 76rem) {
	.tool-page__tool { border: 1px solid var(--grid); border-radius: 14px; padding: 2rem; max-width: var(--wrap); }
}

.tool-page__guide { padding-bottom: 2rem; }
.tool-page__guide > .byline { padding-bottom: 1rem; }

/* Calculator layout */
.tool__form { display: grid; gap: 1.5rem; }
@media (min-width: 56rem) { .tool__form { grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; } }

.tool__inputs { display: grid; gap: 1.1rem; }

.field label, .switch legend { display: block; margin-bottom: 0.35rem; font-weight: 650; font-size: 0.975rem; }
.field input, .field select {
	width: 100%; min-height: 3rem;
	padding: 0.5rem 0.85rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	background-color: var(--surface); color: var(--text);
	font: 500 var(--t-base) var(--sans);
	font-variant-numeric: lining-nums;
}
.field select {
	appearance: none; padding-right: 2.25rem; cursor: pointer;
	background: var(--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='%230e4d3c' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(14, 77, 60, 0.18); }
.field input[aria-invalid="true"] { border-color: #b3261e; }
.field__note { margin-top: 0.4rem; font-size: var(--t-sm); color: var(--muted); }
.field[hidden] { display: none; }

.field__money { display: flex; }
.field__currency {
	display: inline-flex; align-items: center;
	padding: 0 0.85rem;
	border: 1.5px solid var(--line); border-right: 0;
	border-radius: var(--radius) 0 0 var(--radius);
	background: var(--ink-tint); color: var(--ink);
	font-weight: 700;
}
.field__money input { border-radius: 0 var(--radius) var(--radius) 0; font-size: var(--t-md); font-weight: 600; }

.switch { margin: 0; padding: 0; border: 0; display: grid; gap: 0.5rem; }
.switch label {
	display: flex; align-items: center; gap: 0.6rem;
	min-height: 3rem; padding: 0.5rem 0.85rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	background: var(--surface);
	cursor: pointer; font-weight: 500;
}
.switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); margin: 0; }
.switch label:has(input:checked) { border-color: var(--ink); background: var(--ink-tint); font-weight: 650; }
.switch label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(14, 77, 60, 0.25); }

.tool__result {
	padding: clamp(1.1rem, 3vw, 1.6rem);
	border: 1.5px solid var(--text);
	border-radius: 10px;
	background: var(--surface);
	box-shadow: 4px 4px 0 var(--grid);
}
@media (min-width: 56rem) { .tool__result { position: sticky; top: 5.5rem; } }

.result__sentence { font-size: var(--t-md); font-weight: 650; line-height: 1.4; min-height: 2.8em; }

.result__table { margin: 1.25rem 0; }
.result__table > div {
	display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
	padding: 0.7rem 0;
	border-bottom: 1px dashed var(--line);
}
.result__table > div:last-child { border-bottom: 0; }
.result__table dt { color: var(--muted); font-weight: 500; }
.result__table dd { margin: 0; font-weight: 700; font-size: var(--t-md); font-variant-numeric: lining-nums; text-align: right; }

/* The answer gets the highlighter. */
.is-answer {
	color: var(--hl-text);
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem) !important;
	font-weight: 800 !important;
	padding: 0 0.2em;
	background: linear-gradient(to bottom, transparent 18%, var(--hl) 18%, var(--hl) 88%, transparent 88%) no-repeat 0 0 / 100% 100%;
	animation: highlighter 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes highlighter { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

/* More field types */
.field textarea {
	width: 100%; padding: 0.6rem 0.85rem;
	border: 1.5px solid var(--line); border-radius: var(--radius);
	background: var(--surface); color: var(--text);
	font: 500 var(--t-base)/1.5 var(--sans); resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(14, 77, 60, 0.18); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.field input { min-width: 0; }
@media (max-width: 30rem) {
	.field-row { grid-template-columns: 1fr; }
	.data-table--wide th:nth-child(4), .data-table--wide td:nth-child(4) { display: none; }
}
.field__unit { display: flex; }
.field__unit input { border-radius: var(--radius) 0 0 var(--radius); }
.field__unit input:only-child { border-radius: var(--radius); }
.field__suffix {
	display: inline-flex; align-items: center; white-space: nowrap;
	padding: 0 0.85rem;
	border: 1.5px solid var(--line); border-left: 0;
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--ink-tint); color: var(--muted); font-weight: 600; font-size: var(--t-sm);
}

.checks { margin: 0; padding: 0; border: 0; }
.checks legend { display: block; margin-bottom: 0.35rem; font-weight: 650; font-size: 0.975rem; }
.checks label {
	display: inline-flex; align-items: center; gap: 0.45rem;
	margin: 0 0.4rem 0.4rem 0; padding: 0.45rem 0.7rem;
	border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
	font-size: var(--t-sm); font-weight: 500; cursor: pointer;
}
.checks input { accent-color: var(--ink); margin: 0; }
.checks label:has(input:checked) { border-color: var(--ink); background: var(--ink-tint); color: var(--ink); font-weight: 650; }

.button[disabled], .button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.result__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.result__link { margin: 1rem 0; }
.result__link code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: 1rem; font-weight: 600; }
.result__link code.is-answer { font-size: 1.05rem !important; font-weight: 700 !important; padding: 0.1em 0.3em; }
.result__sentence .is-answer, .field__note .is-answer { font-size: inherit !important; }

/* Tables inside tools */
.tool__more { margin-top: 1.5rem; }
.tool__more summary { cursor: pointer; font-weight: 650; color: var(--ink); padding: 0.5rem 0; }
.table-scroll { overflow-x: auto; margin-top: 0.75rem; border: 1px solid var(--grid); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: lining-nums; }
.data-table th, .data-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--grid); text-align: right; white-space: nowrap; }
.data-table th:first-child { text-align: left; }
.data-table thead th { font-weight: 700; border-bottom: 2px solid var(--text); background: var(--paper); }
.data-table tbody th { font-weight: 600; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.tool__result .data-table { margin: 1rem 0; }
.data-table tr.is-total > * { border-top: 2px solid var(--text); font-weight: 800; }
.data-table td { min-width: 0; }
.tool__result .data-table th, .tool__result .data-table td { padding-inline: 0.4rem; }
.tool__result .data-table th:first-child { padding-left: 0; white-space: normal; }
.tool__result .data-table td:last-child { padding-right: 0; }
.field__note--lead { margin-top: -0.75rem; }
.data-table--times td:nth-child(2) { font-weight: 700; font-size: 1.05rem; }
.data-table--times tr.is-working th::after { content: "working hours"; display: block; color: var(--ledger); font-size: 0.75rem; font-weight: 600; }
.data-table--times tr.is-night { color: var(--muted); }
.data-table--times tr.is-night th::after { content: "night"; display: block; font-size: 0.75rem; font-weight: 500; }

/* Percentage: fill-in-the-blank sentences */
.pct { display: grid; gap: 0.75rem; }
.pct__row { padding: 1rem 1.25rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.pct__sentence { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.6rem; font-size: var(--t-md); font-weight: 600; }
.pct__input {
	width: 6.5rem; min-height: 2.6rem; padding: 0.2rem 0.5rem;
	border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
	background: var(--ink-tint); color: var(--ink);
	font: 700 var(--t-md) var(--sans); text-align: center;
}
.pct__input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.pct__out { min-width: 3rem; }
.pct__out.is-answer { font-size: var(--t-lg) !important; }
.pct__working { margin-top: 0.4rem; color: var(--muted); font-size: var(--t-sm); }

/* YouTube thumbnails */
.tool__form--stack { grid-template-columns: 1fr !important; max-width: 52rem; }
.thumbs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.thumb { margin: 0; padding: 0.6rem; border: 1px solid var(--grid); border-radius: 10px; background: var(--surface); }
.thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--grid); }
.thumb figcaption { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; font-size: var(--t-sm); }
.thumb figcaption span { color: var(--muted); }
.thumb a { font-weight: 650; }
.thumb.is-missing img { opacity: 0.35; }


/* Tool extras (v1.2) */
.tool__subhead { margin-top: 0.75rem; padding-top: 1rem; border-top: 1px dashed var(--line); font-size: 1rem; font-weight: 750; }
.field-row--swap { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; }
.swap {
	display: inline-grid; place-items: center; width: 3rem; height: 3rem;
	border: 1.5px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
}
.swap:hover { border-color: var(--ink); background: var(--ink-tint); }
@media (max-width: 30rem) { .field-row--swap { grid-template-columns: 1fr; } .swap { justify-self: center; transform: rotate(90deg); } }
.states { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px dashed var(--line); }
.states__title { font-size: 1.05rem; font-weight: 750; margin-bottom: 0.75rem; }
.state-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.state-picker a { display: inline-block; padding: 0.3rem 0.6rem; border: 1px solid var(--grid); border-radius: 6px; background: var(--surface); font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.state-picker a:hover, .state-picker a[aria-current] { border-color: var(--ink); background: var(--ink-tint); }


/* ---------- Articles (v1.4) ---------- */
.article__kind {
	display: inline-flex; align-items: center; gap: 0.4rem;
	margin-bottom: 0.9rem; padding: 0.3rem 0.75rem; border-radius: 999px;
	background: var(--ink-tint); color: var(--ink-deep); font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
.article__kind::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink); }
.article__kind:hover { background: var(--ink); color: var(--on-ink); }
.article__kind:hover::before { background: var(--on-ink); }
.article .toc { margin-top: 0; }
.article__media img { aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--grid); }
.report { margin: 1.5rem 0; padding: 0.9rem 1.1rem; border-left: 3px solid var(--hl); background: var(--surface); font-size: var(--t-sm); color: var(--muted); }
.report a { font-weight: 650; }
.linked-tools { margin: 0 0 1.75rem; padding: 1.25rem 1.25rem 0.5rem; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--surface); box-shadow: 5px 5px 0 var(--ink-tint); }
.linked-tools__title { font-size: 1.05rem; font-weight: 750; margin-bottom: 0.5rem; }
.linked-tools ul { list-style: none; margin: 0; padding: 0; }
.linked-tools li { border-top: 1px solid var(--grid); }
.linked-tools li:first-child { border-top: 0; }
.linked-tools a { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0; color: var(--text); text-decoration: none; }
.linked-tools .icon { flex-shrink: 0; width: 2.5rem; height: 2.5rem; padding: 0.45rem; border-radius: 10px; background: var(--ink-tint); color: var(--ink); }
.linked-tools strong { display: block; color: var(--ink); font-weight: 700; }
.linked-tools em { display: block; font-style: normal; font-size: var(--t-sm); color: var(--muted); }
.linked-tools a:hover strong { text-decoration: underline; }
/* Listing thumbnails crop to the figure card on the right of each cover, so they stay readable at small sizes. */
.entry__media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--grid); border-radius: 6px; background: var(--mint-soft); }
.entry__media img { position: absolute; right: -2%; top: 50%; width: 236%; max-width: none; height: auto; transform: translateY(-51%); border: 0; border-radius: 0; aspect-ratio: auto; }
.lead__media img { border: 1px solid var(--grid); }

/* ---------- Ads ---------- */

.ad-slot { min-height: 280px; margin-block: 2rem; display: grid; place-items: center; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 0; background: var(--footer-bg); color: #d3e3da; font-size: 0.975rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer :focus-visible { box-shadow: 0 0 0 3px var(--footer-bg), 0 0 0 5px var(--hl); }
.site-footer__inner { display: grid; gap: 2rem 3rem; padding-block: 3rem 2rem; }
@media (min-width: 56rem) { .site-footer__inner { grid-template-columns: 1.3fr 0.8fr 1.2fr 0.9fr; } }
.site-footer__about p { margin-top: 1rem; max-width: 26rem; line-height: 1.6; }
.brand--footer .brand__word { color: var(--ink-deep); background: var(--hl); padding: 0.1em 0.2em 0.15em; border-radius: 2px; }
.site-footer h2 { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 0.45rem; }
.site-footer__legal { padding-block: 1.25rem 2rem; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: var(--t-sm); color: #a7c2b5; }

/* ==========================================================================
   Home page and directory (v1.1)
   ========================================================================== */

.icon { flex-shrink: 0; }

/* Hero: sentence picker on the left, a real worked example on the right. */
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.hero__inner > * { min-width: 0; }
@media (min-width: 64rem) { .hero__inner { grid-template-columns: minmax(0, 1fr) 21rem; gap: 4rem; } }

.shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; margin-top: 2rem; }
.shortcuts__label { font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.shortcuts__list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.shortcuts__list li[hidden] { display: none; }
.chip {
	display: inline-flex; align-items: center; gap: 0.45rem;
	min-height: 2.5rem; padding: 0.4rem 0.85rem 0.4rem 0.65rem;
	border: 1.5px solid var(--line); border-radius: 999px;
	background: var(--surface); color: var(--text);
	font-size: 0.95rem; font-weight: 600; text-decoration: none;
}
.chip .icon { color: var(--ink); }
.chip:hover { border-color: var(--ink); background: var(--ink-tint); color: var(--ink-deep); }

.worked__card {
	display: grid; gap: 0.35rem;
	padding: 1.5rem 1.5rem 1.25rem;
	border: 1.5px solid var(--text); border-radius: 14px;
	background: var(--surface);
	box-shadow: 6px 6px 0 var(--ink-tint);
	color: var(--text); text-decoration: none;
	transform: rotate(-1deg);
	transition: transform 0.2s ease;
}
.worked__card[hidden] { display: none; }
.worked__card:hover { transform: rotate(0); }
.worked__label { font-size: 0.8rem; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.worked__in { font-size: 1.05rem; font-weight: 600; }
.worked__rule { height: 0; margin: 0.4rem 0; border-top: 2px dashed var(--line); }
.worked__out { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.worked__out mark { background: linear-gradient(to bottom, transparent 16%, var(--hl) 16%, var(--hl) 90%, transparent 90%); color: var(--hl-text); padding: 0 0.12em; }
.worked__note { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.worked__go { margin-top: 0.75rem; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 63.99rem) { .worked { max-width: 26rem; } }

.section__intro { color: var(--muted); }
.section__head:has(.section__intro) { flex-wrap: wrap; }

/* Countries: big two-letter codes, like luggage tags. */
.countries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 40rem) { .countries { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.country {
	position: relative;
	display: grid; gap: 0.1rem;
	padding: 1rem 1.1rem;
	border: 1.5px solid var(--grid); border-radius: 12px;
	background: var(--surface); color: var(--text); text-decoration: none;
}
.country:hover { border-color: var(--ink); }
.country__code { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.country__name { font-weight: 600; margin-top: 0.4rem; }
.country__count { font-size: var(--t-sm); color: var(--muted); }
.country[aria-current] { border-color: var(--ink); background: var(--ink-tint); }
.country[aria-current]::after {
	content: "Your country"; position: absolute; top: 0.9rem; right: 0.9rem;
	padding: 0.15rem 0.5rem; border-radius: 999px;
	background: var(--ink); color: var(--on-ink); font-size: 0.72rem; font-weight: 700;
}

/* Directory: one band, a block per tool type. */
.section--directory { background: var(--mint-soft); border-block: 1px solid var(--grid); }
.section--directory + .section { border-top: 0; }
.directory { display: grid; gap: 1rem; }
.directory__col { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 56rem) { .directory { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.group { padding: 1.25rem 1.25rem 0.75rem; border: 1px solid var(--grid); border-radius: 14px; background: var(--surface); }
.group__title { display: flex; align-items: center; gap: 0.65rem; font-size: 1.15rem; font-weight: 750; margin-bottom: 0.5rem; }
.group__title a { color: var(--text); text-decoration: none; }
.group__title a:hover { color: var(--ink); text-decoration: underline; }
.group__icon { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--ink-tint); color: var(--ink); }
.group__list { list-style: none; margin: 0; padding: 0; }
.group__list li { break-inside: avoid; padding: 0.6rem 0; border-top: 1px solid var(--grid); }
.group__list li:first-child { border-top: 0; }
.group__list a { display: block; font-weight: 650; color: var(--ink); text-decoration: none; }
.group__list a:hover { text-decoration: underline; }
.group__where { font-size: var(--t-sm); color: var(--muted); }

/* How we work. */
.section--promise { background: var(--paper); }
.promises { display: grid; gap: 1.5rem 2.5rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 48rem) { .promises { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.promises__icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 0.75rem; border-radius: 50%; background: var(--ink-tint); color: var(--ink); }
.promises h3 { font-size: 1.1rem; font-weight: 750; margin-bottom: 0.35rem; }
.promises p { color: var(--muted); line-height: 1.6; }

/* Tool rows get their icon. */
.index__row { position: relative; }
.index__title { display: inline-flex; align-items: center; gap: 0.55rem; }
.index__title .icon { color: var(--ink); background: var(--ink-tint); border-radius: 8px; padding: 5px; width: 30px; height: 30px; }

/* Tool page header band. */
.tool-page__head { position: relative; }
.tool-page__badge {
	display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: 0.9rem;
	border-radius: 14px; background: var(--ink); color: var(--on-ink);
}
.tool-page__facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tool-page__facts span {
	display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 !important;
	padding: 0.3rem 0.7rem; border-radius: 999px;
	background: var(--ink-tint); color: var(--ink-deep); font-weight: 600; font-size: 0.85rem;
}
.tool-page__facts .icon { width: 16px; height: 16px; }

/* Navigation: a quiet pill for the current section. */
.site-nav a { padding: 0.45rem 0.75rem; border-radius: 999px; border-bottom: 0; }
.site-nav a:hover { background: var(--ink-tint); color: var(--ink-deep); }
.site-nav .current-menu-item > a, .site-nav .current-menu-parent > a, .site-nav [aria-current] { background: var(--ink); color: var(--on-ink); }
.site-nav__list, .site-nav ul { gap: 0.25rem; }
@media (max-width: 63.99rem) {
	.site-nav a { border-radius: 8px; border-bottom: 0; padding: 0.75rem; }
}

/* ---------- Dark mode ---------- */

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--ink: #7fd1ae;
		--ink-deep: #a8e3c9;
		--ink-tint: #1d3a30;
		--mint-soft: #121c18;
		--text: #e6eee9;
		--muted: #9db0a6;
		--paper: #0e1512;
		--surface: #16201b;
		--on-ink: #0b1310;
		--grid: #22302a;
		--line: #34463d;
		--header-bg: rgba(14, 21, 18, 0.92);
		--footer-bg: #08100d;
		--shadow: none;
	}
	.brand__word { background: linear-gradient(to bottom, transparent 55%, rgba(255, 227, 90, 0.35) 55%, rgba(255, 227, 90, 0.35) 92%, transparent 92%); }
	.worked__card { box-shadow: 6px 6px 0 var(--ink-tint); border-color: var(--line); }
	.tool__result { border-color: var(--line); }
	.prose pre { background: #050907; }
	.region__select, .field select {
		background-image: 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='%237fd1ae' stroke-width='2'/%3E%3C/svg%3E");
	}
	.picker__select {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1.5 1.5l6.5 6.5 6.5-6.5' fill='none' stroke='%237fd1ae' stroke-width='2.5'/%3E%3C/svg%3E");
	}
	img { opacity: 0.95; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.worked__card { transform: none; }
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print: tools print as a clean worksheet ---------- */

@media print {
	.site-header, .site-footer, .ad-slot, .section--related, .crumbs, [data-copy] { display: none !important; }
	.grid-paper { background: none; }
	.tool__result { box-shadow: none; }
}
