/* One stylesheet, no framework, no build step - same reasoning as the CUSMA
   tool. Tokens first so the palette can be retuned without hunting.

   Visual system from the September 2026 facelift (design_handoff_site_facelift,
   section A). Every page links this file; brief.css, calculator.css,
   work-sharing.css and changes.css add only what their own page needs, and use
   these tokens rather than colours of their own. */

/* --- fonts -------------------------------------------------------------

   Self-hosted, Latin subset, only the weights the design uses. Self-hosted so
   the CSP can stay default-src 'self': no request from this site goes to
   anyone else, fonts included. Absolute URLs on purpose - scripts/fingerprint.js
   serves this file from /h/<hash>/assets/css/, where a relative ../fonts/ path
   would resolve to a folder that does not exist. Licences (OFL) sit next to
   the files. */

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/dm-serif-display-400-latin.woff2') format('woff2');
}
/* Work Sans is a variable font; one file covers 400, 500 and 600. */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/work-sans-400-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
}

/* --- tokens ------------------------------------------------------------ */

:root {
  --paper: #fbf8f3; --panel: #f3ede3; --card: #fff; --panel-soft: #fcfaf6;
  --ink: #231f1b; --ink-2: #4d453c; --ink-3: #6b6157; --ink-4: #8a7f72;
  --rule: #e8e0d4; --rule-2: #eee6da; --chip-border: #ddd3c5; --pill-border: #d9cfc1;
  --red: #c8312a; --red-hover: #a82620; --link: #b3261e; --link-hover: #7f1a15; --link-on-dark: #f08a80;
  --mixed-bg: #f4d9a8; --mixed-fg: #5c3d0a;
  --serif: 'DM Serif Display', Georgia, serif; --sans: 'Work Sans', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --max: 1120px; --r-card: 16px; --r-panel: 18px; --r-input: 14px; --r-btn: 10px;

  /* Beyond the handoff's palette: the tools and the brief carry states the
     homepage does not - "not on the list", "likely eligible", a warning - and
     they keep their meaning in these three. Each passes 4.5:1 as text on
     --card, --paper and on its own -soft background. */
  --green: #1f6b45; --green-soft: #e6f1ea;
  --amber-soft: #fbf1de;
  --red-soft: #fbeae8;
  --on-dark: #d9cfc1;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* One focus style for every interactive element on every page. Never removed. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

code, kbd, samp { font-family: var(--mono); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-btn);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; color: var(--paper); }

/* --- site header --------------------------------------------------------

   Shared by every page. Logo and wordmark on the left, the nav wrapping under
   it on a narrow screen - no hamburger, because six links fit.

   Deliberately NOT sticky. A sticky overlay over small controls swallows
   clicks - a real defect this project has already hit once on the
   Work-Sharing page. */

.site-head { border-bottom: 1px solid var(--rule); }
.site-head__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; display: block; }
.brand__name {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.01em;
}

.nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.nav a {
  display: inline-block;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  color: var(--ink);
  text-decoration: none;
}
.nav a:hover { color: var(--red-hover); }
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* --- shared bits ------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 13px 22px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--red-hover); color: #fff; }

.section-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --- homepage hero ------------------------------------------------------ */

.hero { padding-top: 64px; padding-bottom: 40px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f1ebe1;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}
.pill--red { background: var(--red); color: #fff; font-weight: 600; }

.hero__title {
  margin: 0 0 20px;
  max-width: 820px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.hero__lede {
  margin: 0 0 32px;
  max-width: 640px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* The main action on the page, moved up from below the fold. The hard offset
   shadow is the design's one flourish; it is a box-shadow, so it costs no
   layout and needs no image. */
.search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  padding: 6px 6px 6px 20px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-input);
  box-shadow: 0 5px 0 var(--ink);
}
.search:focus-within { outline: 2px solid var(--red); outline-offset: 4px; }
.search__label { flex: none; font-size: 15px; font-weight: 600; color: var(--ink-3); }
.search__input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
}
/* The wrapper draws the focus ring for the whole control. */
.search__input:focus-visible { outline: none; }
.search__input::placeholder { color: var(--ink-3); opacity: 1; }
.search__go { flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; max-width: 760px; }
.chips:empty { display: none; }

.filter {
  padding: 8px 14px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.filter:hover { border-color: var(--ink); }
.filter--on,
.filter--on:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* --- the three explainer cards ------------------------------------------ */

.explain { padding-top: 8px; padding-bottom: 56px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 24px;
}
.card__num { margin: 0 0 10px; font-family: var(--mono); font-size: 13px; color: var(--red); }
.card__title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
}
.card__body { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* --- the directory panel ------------------------------------------------ */

.directory {
  background: var(--panel);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 48px 0 56px;
  scroll-margin-top: 8px;
}

.directory__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}
.directory__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.15;
}
.directory__meta { margin: 0; font-size: 14px; color: var(--ink-3); }

.count { margin: 8px 0 0; font-size: 14px; color: var(--ink-3); }
.noresults { color: var(--ink-2); }
.noresults + .filter { margin-top: 6px; }

/* "How to read the labels", folded away under the heading. */
.legend {
  margin: 16px 0 24px;
  background: var(--panel-soft);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.legend__sum {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 20px;
  cursor: pointer;
}
.legend__list { margin: 0; padding: 4px 20px 18px; display: grid; gap: 10px; }
.legend__list > div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: baseline;
}
.legend__list dt { margin: 0; }
.legend__list dd { margin: 0; font-size: 14px; color: var(--ink-2); }

.group { margin: 0 0 40px; }
.group:last-child { margin-bottom: 0; }
.group__head { margin: 0 0 14px; }
.group__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
}
.group__blurb { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
/* One category chosen: the heading above already names it. */
.results--one .group__name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- entry card -------------------------------------------------------- */

.entry {
  margin: 0 0 16px;
  background: var(--card);
  border: 1px solid #e0d6c7;
  border-radius: var(--r-panel);
  overflow: hidden;
  scroll-margin-top: 16px;
}

.entry__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: start;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--rule-2);
}
.entry__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.entry__name {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.12;
}
.entry__what { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 68ch; }
.entry__official { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); font-style: italic; }

/* The rate is the hero number of the card.

   History worth keeping: this used to be a pill holding the whole rate
   sentence ("25% on power tools, 50% on the main hand-tool line, 15% on
   industrial tooling"), and it put a horizontal scrollbar on every page at
   phone width - once because the box would not shrink, and again, after that
   was fixed, because `white-space: nowrap` kept the text overflowing a box
   that now did. The lesson is about the instrument: comparing element
   rectangles against the viewport cannot see the second cause, and
   scrollWidth vs clientWidth can. The sentence now lives in the note under
   the number, which wraps; the number itself is at most "25% or 50%". */
.entry__ratebox {
  max-width: 260px;
  min-width: 0;
  text-align: right;
}
.entry__rate {
  display: block;
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1;
  color: var(--red);
  overflow-wrap: anywhere;
}
.entry__rate--none,
.entry__rate--partial { font-size: 28px; line-height: 1.1; color: var(--ink); }
.entry__rate-note { display: block; margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--ink-3); }

/* The receipts: a disclosure bar the width of the card. A <button> with
   aria-expanded when app.js is running, a native <details> in the prerendered
   HTML - they are styled as one. */
.entry__items { border-bottom: 1px solid var(--rule-2); background: var(--panel-soft); }
.entry__items-sum {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border: 0;
  background: var(--panel-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
  list-style: none;
}
.entry__items-sum::-webkit-details-marker { display: none; }
.entry__items-sum:hover { color: var(--ink); }
.entry__items-icon { font-family: var(--mono); font-size: 16px; }
details.entry__items > .entry__items-sum .entry__items-icon::before { content: '+'; }
details.entry__items[open] > .entry__items-sum .entry__items-icon::before { content: '\2212'; }
.entry__items-panel { padding: 0 24px 12px; }

.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: 100px 44px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 14px;
}
.item:last-child { border-bottom: 0; }
.item__no { font-family: var(--mono); font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.item__rate { font-weight: 600; color: var(--red); white-space: nowrap; }
.item__desc { color: var(--ink-2); min-width: 0; }

.entry__body { padding: 8px 24px 16px; }

.entry__believed,
.entry__origin {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
}
.entry__believed { background: var(--amber-soft); }
.entry__origin { background: var(--panel-soft); border: 1px solid var(--rule-2); }
.entry__believed-label,
.entry__origin-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.entry__believed-label { color: var(--mixed-fg); }
.entry__believed p:not([class]),
.entry__origin p:not([class]) { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 72ch; }

.entry__calc { margin: 14px 0 0; }
.entry__calc-link {
  display: inline-block;
  padding: 12px 0;
  line-height: 20px;
  font-size: 14px;
  font-weight: 500;
}

.entry__sub {
  margin: 0;
  padding: 14px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.entry__sub--watch { color: var(--link); }

.entry__empty {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--pill-border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink-3);
}

/* --- alternative rows -------------------------------------------------- */

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

.row { padding: 14px 0; border-top: 1px solid #f0e9de; }

.row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}
.row__who { min-width: 0; flex: 1 1 260px; }
.row__brand { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.row__product { margin: 0; font-size: 14px; color: var(--ink-3); }
.row__prov { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.row__srclink { color: var(--ink-3); }
.row__srclink:hover { color: var(--ink); }
.row__badges { display: flex; flex-wrap: wrap; gap: 6px; }

.row__made { margin: 8px 0 0; font-size: 14px; color: var(--ink); }
.row__label { color: var(--ink-3); }
.row__note { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); max-width: 78ch; }
.row__foot { margin: 2px 0 0; font-size: 14px; }
.row__link { display: inline-block; padding: 12px 0; line-height: 20px; font-weight: 600; }
.row__aff { font-size: 13px; color: var(--ink-3); }

/* --- badges -------------------------------------------------------------

   Class names are app.js's and the legend's; restyled in the facelift, never
   renamed. */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.badge--made-in-canada { background: var(--red); color: #fff; }
.badge--not-us-origin  { background: var(--ink); color: var(--paper); }
.badge--mixed          { background: var(--mixed-bg); color: var(--mixed-fg); }
.badge--unconfirmed    { background: var(--card); color: var(--ink-3); border: 1px solid var(--pill-border); padding: 3px 9px; }

.badge--conf {
  padding: 3px 9px;
  background: transparent;
  border: 1px solid var(--pill-border);
  color: var(--ink-2);
  font-weight: 500;
}
.badge--conf-verified { border-color: var(--ink-3); }
.badge--conf-unconfirmed { border-style: dashed; }

/* --- free tools ---------------------------------------------------------- */

.tools { padding-top: 56px; padding-bottom: 24px; }
.tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.tool {
  display: block;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.tool:hover { border-color: var(--red); color: var(--ink); }
.tool__name {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
}
.tool__blurb { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.tools__fine { margin: 14px 0 0; font-size: 14px; color: var(--ink-3); }

/* --- the origincert strip ------------------------------------------------ */

.xsell-wrap { padding-top: 24px; padding-bottom: 56px; }
.xsell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 20px 24px;
  border: 1px dashed var(--pill-border);
  border-radius: var(--r-card);
}
.xsell__text { margin: 0; max-width: 640px; font-size: 15px; color: var(--ink-2); }
.xsell__text strong { color: var(--ink); }
.xsell__link { display: inline-block; padding: 12px 0; font-size: 15px; font-weight: 600; }

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

   Paused: scripts/build.js strips the form out of dist/ and leaves a short
   note (.notify__fine--flush). When it is on again it is styled as a tool
   card. */

.notify {
  margin: 24px 0 0;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.notify__title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
}
.notify__blurb { margin: 0 0 16px; max-width: 60ch; font-size: 15px; color: var(--ink-2); }
.notify__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.notify__field { flex: 1 1 240px; min-width: 0; }
.notify__label { display: block; margin: 0 0 5px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.notify__input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-input);
}
.notify__submit {
  padding: 13px 22px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background-color .15s;
}
.notify__submit:hover { background: var(--red-hover); }
.notify__submit[disabled] { opacity: .55; cursor: default; }
.notify__fine { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); max-width: 60ch; }
.notify__status { margin: 12px 0 0; font-size: 15px; }

/* The paused-alerts notice sits directly under the heading with nothing above
   it, so it does not want the top margin the rule above gives every other
   .notify__fine. It was an inline style="margin:0" until 22 Sep 2026, which
   the site's own CSP (style-src 'self') refused on every live page load -
   the margin never actually applied, and it left a permanent console error. */
.notify__fine--flush { margin: 0; }
.notify__status:empty { margin: 0; }
.notify__status--ok { color: var(--green); }
.notify__status--err { color: var(--link); }

/* Honeypot. Hidden from people, left in the DOM for automated submitters.
   Not display:none - some bots skip those - and taken out of the tab order
   and the accessibility tree so nobody real ever meets it. */
.notify__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- site footer --------------------------------------------------------- */

.site-foot { background: var(--ink); color: var(--on-dark); font-size: 14px; line-height: 1.6; }
.site-foot a { color: var(--on-dark); }
.site-foot a:hover { color: #fff; }
.site-foot a:focus-visible { outline-color: var(--link-on-dark); }
.site-foot p { margin: 0 0 12px; }

.site-foot__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 32px;
}
.site-foot__brand { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.site-foot__brand .brand__name { font-size: 22px; color: var(--paper); }
.site-foot__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--paper);
}
.site-foot__grid p a { color: var(--link-on-dark); }
.site-foot__sources { margin: 0; padding: 0 0 0 18px; }
.site-foot__sources li { margin: 0 0 6px; }
.site-foot__sources a { display: inline-block; padding: 11px 0; }
.site-foot__links { list-style: none; margin: 0; padding: 0; }
.site-foot__links a { display: inline-block; padding: 11px 0; }
.site-foot__base {
  padding-top: 20px;
  padding-bottom: 40px;
  border-top: 1px solid #3a342e;
  font-size: 13px;
}
.site-foot__base p { max-width: 90ch; }

/* --- inner pages: page head ---------------------------------------------

   The long-form pages and the tools keep their own masthead markup (kicker,
   title, standfirst); it is restyled here as a plain heading block on the
   paper background, the same type as the homepage hero at a smaller size. */

.masthead { padding: 56px 0 32px; }
.masthead__kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--link);
}
.masthead__title {
  margin: 0 0 16px;
  max-width: 820px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.masthead__sub {
  margin: 0;
  max-width: 680px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* --- inner pages: "before you trust this" block ------------------------- */

.explainer { padding: 0 0 32px; }
.explainer > .wrap > * { max-width: 760px; }
.explainer .wrap {
  padding-top: 24px;
  padding-bottom: 8px;
}
.explainer__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.explainer p { margin: 0 0 12px; color: var(--ink-2); }
.explainer strong { color: var(--ink); }
.explainer__caveat {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--amber-soft);
  border-radius: 12px;
  font-size: 15px;
}

/* --- inner pages: sources and notes above the site footer ---------------- */

.foot {
  margin-top: 48px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--rule);
  background: var(--panel);
}
.foot__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.foot p { margin: 0 0 12px; max-width: 72ch; font-size: 15px; color: var(--ink-2); }
.foot__sources { margin: 0 0 16px; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.foot__sources li { margin-bottom: 4px; }
.foot__sources a { display: inline-block; min-height: 44px; padding: 11px 0; }
.foot__about { font-weight: 600; }
.foot__about a { display: inline-block; padding: 12px 0; line-height: 20px; margin-right: 14px; }
.foot__legal { font-size: 13px; color: var(--ink-3); }

/* --- 404 ------------------------------------------------------------------

   The audit bundle shipped a 404 page carrying an inline <style> block, which
   this site's CSP (style-src 'self') refuses outright - it would have
   rendered as unstyled text. The rules live here instead. */
.notfound { max-width: 44rem; padding-top: 10vh; padding-bottom: 16vh; }
.notfound__title {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
}
.notfound p { margin: 0 0 14px; color: var(--ink-2); font-size: 17px; }
.notfound__links { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 22px 0 0; font-size: 16px; font-weight: 500; }
.notfound__links a { display: inline-block; padding: 12px 0; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 720px) {
  .legend__list > div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 40px; }
  .search { flex-wrap: wrap; padding: 6px 6px 6px 16px; }
  .search__input { flex-basis: 50%; }
  .search__go { flex: 1 1 100%; text-align: center; }
  .filter { padding: 12px 14px; }
  .entry__top, .entry__body { padding-left: 18px; padding-right: 18px; }
  .entry__items-sum { padding: 12px 18px; }
  .entry__items-panel { padding: 0 18px 12px; }
  .entry__rate:not(.entry__rate--none):not(.entry__rate--partial) { font-size: 44px; }
  .item { grid-template-columns: auto 1fr; gap: 2px 12px; }
  .item__desc { grid-column: 1 / -1; }
  .directory { padding: 36px 0 44px; }
  .directory__title { font-size: 30px; }
  .card, .tool { padding: 20px; }
}

/* Below 400px the rate stacks under the title rather than squeezing it. */
@media (max-width: 400px) {
  .entry__top { grid-template-columns: minmax(0, 1fr); }
  .entry__ratebox { max-width: none; text-align: left; }
  .entry__name { font-size: 26px; }
}

/* ---- category pages (/tariffed/<id>) and the links to them ----------------
   Written by scripts/category-pages.js. The links reuse the filter chip's look
   so they read as the same categories the homepage filters by. */
.category-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.category-links a {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--chip-border); border-radius: 999px;
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 18px;
  text-decoration: none; transition: border-color .15s;
}
.category-links a:hover { border-color: var(--ink); }
.directory__cats { margin: 4px 0 22px; }
.directory__cats-label { margin: 0 0 8px; font-size: 14px; color: var(--ink-3); }
.category-page__rule { max-width: 76ch; margin: 0 0 20px; }
.category-page .group__blurb { display: none; }
.category-page__more { margin: 48px 0 64px; }
.category-page__more .category-links { margin-bottom: 20px; }
