/* ==========================================================================
   remits.ca — remits.css
   Flat, editorial fintech design system. No framework, no gradients.
   Hand-authored, mobile-first. Breakpoints: 640px / 900px / 1200px.
   Self-contained: works inlined in <style> or linked via
   <link rel="stylesheet" href="/css/remits.css">.

   FONT LOADING (generator: emit in <head> before this sheet)
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&display=swap">
   Self-hosting? Replace the <link> with @font-face + `font-display: swap`.
   The stack degrades to a system sans if Montserrat never loads.

   TOKENS (:root)
     Brand .... --blue-50 ... --blue-900    Neutrals . --ink-50 ... --ink-950
     Text ..... --text --text-strong --text-muted --text-inverse
     Surface . --surface --surface-2 --surface-3 --surface-brand
                --surface-inverse --border --border-strong
     Semantic . --success --success-bg --success-border --warning --warning-bg
                --warning-border --danger --danger-bg --danger-border --focus-ring
     Type ..... --font-heading --font-body --font-mono
                --text-xs ... --text-display --leading-tight/-snug/-normal
                --tracking-tight/-wide
     Space .... --space-1 ... --space-24 (4px base) --space-section
     Radii .... --radius-xs/-sm/(base)/-lg/-pill
     Shadows .. --shadow-xs/-sm/-md (subtle only)
     Layout ... --container/-narrow/-wide --gutter --header-height
     Z ....... --z-raised --z-sticky --z-header --z-overlay --z-skip
     Motion ... --ease --speed
   ========================================================================== */

/* 0. TOKENS --------------------------------------------------------------- */
:root {
  --blue-50: #f2f8fe;  --blue-100: #e1f1fd; --blue-200: #c2e2fb;
  --blue-300: #94cdf9; --blue-400: #5fb6f5;  --blue-500: #3faef7;
  --blue-600: #1e9bee; --blue-700: #0b4ea2;  --blue-800: #093f85;
  --blue-900: #072f63;

  --ink-50: #f5f8fa;  --ink-100: #eaeff4; --ink-200: #d8e0e9;
  --ink-300: #b9c5d3; --ink-400: #93a3b6; --ink-500: #6e8098;
  --ink-600: #55697f; --ink-700: #3d5470; --ink-800: #263c56;
  --ink-900: #14263c; --ink-950: #0b1728;

  --text: #1b2e45;                 /* 11.6:1 on white */
  --text-strong: var(--ink-950);
  --text-muted: var(--ink-600);    /* 5.6:1 on white */
  --text-inverse: #fff;
  --text-inverse-muted: var(--blue-100);

  --surface: #fff; --surface-2: var(--ink-50); --surface-3: var(--ink-100);
  --surface-brand: var(--blue-50); --surface-inverse: var(--blue-700);
  --border: var(--ink-200); --border-strong: var(--ink-300);

  --success: #177a46; --success-bg: #e6f5ec; --success-border: #a9d9be;
  --warning: #8a5a00; --warning-bg: #fff4dc; --warning-border: #e8c56a;
  --danger: #b3261e;  --danger-bg: #fdedeb;  --danger-border: #ebb4b0;
  --focus-ring: var(--blue-700);

  --font-heading: "Montserrat", "Ubuntu Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Ubuntu Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: 0.75rem; --text-sm: 0.875rem;
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.08rem + 0.25vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.18rem + 0.35vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.6rem + 1.4vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.8rem + 2.2vw, 3.25rem);
  --text-display: clamp(2.5rem, 1.9rem + 3vw, 4rem);

  --leading-tight: 1.15; --leading-snug: 1.3; --leading-normal: 1.6;
  --tracking-tight: -0.02em; --tracking-wide: 0.08em;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
  --space-section: clamp(48px, 7vw, 88px);

  --radius-xs: 4px; --radius-sm: 6px; --radius: 10px; --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 23, 40, 0.06);
  --shadow-sm: 0 2px 6px rgba(11, 23, 40, 0.07);
  --shadow-md: 0 8px 24px rgba(11, 23, 40, 0.08);

  --container: 1120px; --container-narrow: 720px; --container-wide: 1320px;
  --gutter: clamp(16px, 4vw, 32px); --header-height: 64px;

  --z-raised: 10; --z-sticky: 100; --z-header: 200; --z-overlay: 300; --z-skip: 400;
  --ease: cubic-bezier(0.2, 0, 0.2, 1); --speed: 160ms;
}

@media (min-width: 900px) {
  :root { --header-height: 72px; }
}

/* 1. RESET ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; tab-size: 4; }

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue-700); }
table { border-collapse: collapse; border-spacing: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
  text-wrap: balance;
}

p { text-wrap: pretty; }

/* 2. BASE ELEMENTS -------------------------------------------------------- */
a {
  color: var(--blue-700);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--speed) var(--ease), text-decoration-thickness var(--speed) var(--ease);
}

a:hover { color: var(--blue-800); text-decoration-thickness: 2px; }
strong, b { font-weight: 700; color: var(--text-strong); }
small { font-size: var(--text-sm); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-3);
  border-radius: var(--radius-xs);
  padding: 0.15em 0.35em;
}

hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-8) 0; }
blockquote { border-left: 3px solid var(--blue-300); padding-left: var(--space-4); color: var(--ink-700); font-style: italic; }
[id] { scroll-margin-top: calc(var(--header-height) + var(--space-4)); }
::selection { background: var(--blue-200); color: var(--ink-950); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-xs); }

/* 3. LAYOUT PRIMITIVES + UTILITIES ---------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }
.section { padding-block: var(--space-section); }
.section--tight { padding-block: var(--space-10); }
.section--tinted { background: var(--surface-2); }
.section__head { max-width: var(--container-narrow); margin-bottom: var(--space-8); }
.section__title { font-size: var(--text-3xl); margin-bottom: var(--space-3); }
.section__lede { font-size: var(--text-lg); color: var(--text-muted); max-width: 62ch; }
.lede { font-size: var(--text-lg); color: var(--text-muted); max-width: 65ch; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

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

.skip-link {
  position: fixed; top: var(--space-2); left: var(--space-2); z-index: var(--z-skip);
  transform: translateY(-200%);
  background: var(--blue-700); color: #fff; font-weight: 600;
  padding: var(--space-3) var(--space-5); border-radius: var(--radius);
  text-decoration: none; transition: transform var(--speed) var(--ease);
}

.skip-link:focus { transform: translateY(0); color: #fff; }

/* 4. SITE HEADER — sticky; logo, primary nav, pure-CSS mobile menu.
   Markup contract (input -> label -> nav must stay siblings, in that order;
   the checkbox drives both the hamburger state and the panel):
     <header class="site-header"><div class="site-header__inner container">
       <a class="site-header__brand" href="/">…logo img…</a>
       <input class="nav-toggle sr-only" type="checkbox" id="nav-toggle" aria-label="Open menu">
       <label class="nav-toggle-label" for="nav-toggle">
         <span class="nav-toggle-label__bars" aria-hidden="true"></span></label>
       <nav class="site-nav" aria-label="Primary"><ul class="site-nav__list">
         <li class="site-nav__item"><a class="site-nav__link" href="/currency/">Currency</a></li>…
       </ul></nav></div></header> */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--header-height); }
.site-header__brand { display: inline-flex; align-items: center; flex: 0 0 auto; text-decoration: none; }
.site-header__brand img { height: 30px; width: auto; }

.nav-toggle-label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -10px;
  border-radius: var(--radius-sm); cursor: pointer;
}

.nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.nav-toggle-label__bars, .nav-toggle-label__bars::before, .nav-toggle-label__bars::after {
  display: block; width: 22px; height: 2px; background: var(--ink-900);
  border-radius: 1px; transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.nav-toggle-label__bars { position: relative; }
.nav-toggle-label__bars::before, .nav-toggle-label__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-label__bars::before { top: -7px; }
.nav-toggle-label__bars::after { top: 7px; }
.nav-toggle:checked + .nav-toggle-label .nav-toggle-label__bars { background: transparent; }
.nav-toggle:checked + .nav-toggle-label .nav-toggle-label__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked + .nav-toggle-label .nav-toggle-label__bars::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); padding: var(--space-2) var(--gutter) var(--space-4);
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease), visibility 0s linear var(--speed);
}

.nav-toggle:checked ~ .site-nav { transform: translateY(0); opacity: 1; visibility: visible; transition-delay: 0s; }
.site-nav__list { display: grid; gap: var(--space-1); }

.site-nav__link {
  display: block; padding: var(--space-3) var(--space-2);
  font-family: var(--font-heading); font-weight: 600; font-size: var(--text-base);
  color: var(--ink-800); text-decoration: none; border-radius: var(--radius-sm);
}

.site-nav__link:hover { background: var(--surface-brand); color: var(--blue-800); text-decoration: none; }
.site-nav__link[aria-current="page"] { color: var(--blue-700); box-shadow: inset 3px 0 0 var(--blue-600); }

@media (min-width: 900px) {
  .site-header__brand img { height: 34px; }
  .nav-toggle, .nav-toggle-label { display: none; }
  .site-nav {
    position: static; display: flex; align-items: center; flex: 0 1 auto;
    padding: 0; border: 0; box-shadow: none; transform: none; opacity: 1; visibility: visible; transition: none;
  }
  .site-nav__list { display: flex; align-items: center; gap: var(--space-1); }
  .site-nav__link { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
  .site-nav__link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--blue-600); }
}

/* 5. SITE FOOTER — multi-column + disclaimer strip.
   Markup: <footer class="site-footer">
     <div class="site-footer__grid container">
       <div class="site-footer__brand">…logo + p.site-footer__blurb…</div>
       <nav class="site-footer__col" aria-label="…"><h2 class="site-footer__heading">…</h2>
         <ul class="site-footer__list"><li><a class="site-footer__link">…</a></li></ul></nav>…</div>
     <div class="site-footer__disclaimer container"><p>…</p></div>
     <div class="site-footer__bottom container">…© + .site-footer__legal…</div></footer> */
.site-footer { background: var(--blue-900); color: var(--blue-100); font-size: var(--text-sm); }
.site-footer__grid { display: grid; gap: var(--space-8); padding-block: var(--space-12); grid-template-columns: 1fr; }
.site-footer__brand img { height: 30px; width: auto; background: #fff; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.site-footer__blurb { margin-top: var(--space-4); max-width: 34ch; color: var(--blue-100); }
.site-footer__heading { font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: #fff; margin-bottom: var(--space-4); }
.site-footer__list { display: grid; gap: var(--space-2); }
.site-footer__link { color: var(--blue-100); text-decoration: none; }
.site-footer__link:hover { color: #fff; text-decoration: underline; }
.site-footer__disclaimer { border-top: 1px solid rgba(255, 255, 255, 0.16); padding-block: var(--space-5); }
.site-footer__disclaimer p { max-width: 90ch; color: var(--blue-100); }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: center; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, 0.16); padding-block: var(--space-5); }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.site-footer__legal a { color: var(--blue-100); text-decoration: none; }
.site-footer__legal a:hover { color: #fff; text-decoration: underline; }

@media (min-width: 640px) {
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .site-footer__grid { grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--space-10); }
  .site-footer__brand { grid-column: auto; }
}

/* 6. HERO — light brand tint by default; .hero--brand is the deep-blue field
   for home/section landings. The 23px hairline ribbon is a hard-stop stripe
   pattern (flat), echoing the logo's sweeping arrow.
   Markup: <section class="hero"><div class="hero__inner container">…</div></section> */
.hero { background: var(--surface-brand); border-bottom: 1px solid var(--blue-100); padding-block: clamp(40px, 7vw, 72px); }
.hero__inner { max-width: 62rem; }
.hero__title { font-size: var(--text-display); margin-bottom: var(--space-4); }
.hero__lede { font-size: var(--text-lg); color: var(--text-muted); max-width: 58ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero--brand { position: relative; overflow: hidden; background: var(--blue-700); border-bottom: 0; color: #fff; }

.hero--brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(115deg, transparent 0 23px, rgba(255, 255, 255, 0.05) 23px 24px);
}

.hero--brand .hero__inner { position: relative; }
.hero--brand .hero__title { color: #fff; }
.hero--brand .hero__lede { color: var(--blue-100); }
.hero--brand :focus-visible { outline-color: #fff; }

/* 7. BREADCRUMBS — <nav class="breadcrumbs" aria-label="Breadcrumb"><ol>…</ol></nav> */
.breadcrumbs { padding-block: var(--space-4); font-size: var(--text-sm); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); }
.breadcrumbs li + li::before { content: "/"; color: var(--ink-400); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue-700); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--text-strong); font-weight: 600; }

/* 8. CARDS + CARD GRID
   Markup: <div class="card-grid"><article class="card card--link">
     <h3 class="card__title">…</h3><p class="card__text">…</p>
     <a class="card__link" href="…">…</a></article></div> */
.card-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 28px);
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.card--link { position: relative; }
.card--link:hover { border-color: var(--blue-300); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.card__title { font-size: var(--text-xl); }
.card__text { color: var(--text-muted); }
.card__meta { margin-top: auto; padding-top: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.card__link { font-family: var(--font-heading); font-weight: 600; color: var(--blue-700); text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card--link:hover .card__link { text-decoration: underline; }

/* 9. BUTTONS — .btn + --primary / --secondary / --ghost / --block / --sm / --lg */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading); font-size: var(--text-base); font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--radius);
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn--primary:hover { background: var(--blue-800); border-color: var(--blue-800); color: #fff; text-decoration: none; }
.btn--secondary { background: var(--surface); border-color: var(--blue-200); color: var(--blue-700); }
.btn--secondary:hover { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-800); text-decoration: none; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--blue-700); }
.btn--ghost:hover { background: var(--blue-50); color: var(--blue-800); text-decoration: none; }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.btn--lg { min-height: 52px; padding: var(--space-4) var(--space-8); font-size: var(--text-lg); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* 10. CTA BLOCK — swappable, provider-neutral offer slot. Never contains a
   company name or logo; the generator fills heading/copy/href from offers.json.
   Markup: <aside class="cta-block"><div class="cta-block__inner">
     <h2 class="cta-block__title">…</h2><p class="cta-block__text">…</p>
     <a class="btn btn--primary" href="…">…</a></div></aside> */
.cta-block {
  position: relative; overflow: hidden; background: var(--blue-700); color: #fff;
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 44px);
}

.cta-block::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(115deg, transparent 0 23px, rgba(255, 255, 255, 0.05) 23px 24px);
}

.cta-block__inner { position: relative; max-width: 46rem; }
.cta-block__title { font-size: var(--text-2xl); color: #fff; margin-bottom: var(--space-3); }
.cta-block__text { color: var(--blue-100); margin-bottom: var(--space-6); }
.cta-block .btn--primary { background: #fff; border-color: #fff; color: var(--blue-800); }
.cta-block .btn--primary:hover { background: var(--blue-50); border-color: var(--blue-50); color: var(--blue-900); }
.cta-block :focus-visible { outline-color: #fff; }

/* 11. DISCLOSURE — affiliate disclosure strip; keep adjacent to affiliate links.
   Copy comes from data/offers.json. */
.disclosure {
  display: flex; gap: var(--space-3); align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--blue-300);
  border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--text-muted);
}

.disclosure p { margin: 0; max-width: 90ch; }
.disclosure--plain { background: transparent; border: 0; border-left: 3px solid var(--blue-200); border-radius: 0; padding: 0 0 0 var(--space-4); }

/* 12. PROSE — long-form article body: <div class="prose">…</div> */
.prose { max-width: 68ch; font-size: var(--text-base); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { font-size: var(--text-2xl); margin-top: var(--space-10); padding-top: var(--space-2); }
.prose h3 { font-size: var(--text-xl); margin-top: var(--space-8); }
.prose h2 + *, .prose h3 + * { margin-top: var(--space-3); }
.prose ul, .prose ol { padding-left: var(--space-6); display: grid; gap: var(--space-2); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--blue-600); }
.prose blockquote { margin-block: var(--space-6); padding: var(--space-2) 0 var(--space-2) var(--space-5); }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); }
.prose table { width: 100%; font-size: var(--text-sm); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose th, .prose td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); text-align: left; }
.prose thead th { background: var(--surface-brand); color: var(--text-strong); font-weight: 700; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* 13. DATA TABLE — responsive rate/price tables. Wrap in .data-table-wrap for
   horizontal scroll on small screens; numeric cells get .num.
   Markup: <div class="data-table-wrap"><table class="data-table">…</table></div> */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; min-width: 36rem; font-size: var(--text-sm); line-height: 1.45; }
.data-table th, .data-table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--border); }
.data-table thead th { background: var(--surface-brand); color: var(--text-strong); font-family: var(--font-heading); font-weight: 700; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); white-space: nowrap; }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th[scope="row"] { font-weight: 600; color: var(--text-strong); }

/* 14. CALLOUTS — .callout (info default) + --warn / --success / --danger
   Markup: <aside class="callout callout--warn"><p class="callout__title">…</p><p>…</p></aside> */
.callout { background: var(--surface-brand); border: 1px solid var(--blue-100); border-left: 3px solid var(--blue-600); border-radius: var(--radius-sm); padding: var(--space-4) var(--space-5); font-size: var(--text-base); }
.callout__title { font-family: var(--font-heading); font-weight: 700; color: var(--text-strong); margin-bottom: var(--space-1); }
.callout p:last-child { margin-bottom: 0; }
.callout--info { background: var(--surface-brand); border-color: var(--blue-100); border-left-color: var(--blue-600); }
.callout--warn { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: var(--warning); }
.callout--success { background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success); }
.callout--danger { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger); }

/* 15. TOC — table of contents with named anchors; .toc--sticky for sidebars.
   Markup: <nav class="toc" aria-label="On this page"><p class="toc__title">…</p><ol>…</ol></nav> */
.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4) var(--space-5); font-size: var(--text-sm); }
.toc__title { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: var(--space-3); }
.toc ol, .toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.toc a { color: var(--ink-700); text-decoration: none; display: block; padding-block: var(--space-1); }
.toc a:hover { color: var(--blue-700); text-decoration: underline; }

@media (min-width: 900px) {
  .toc--sticky { position: sticky; top: calc(var(--header-height) + var(--space-6)); max-height: calc(100dvh - var(--header-height) - var(--space-12)); overflow-y: auto; }
}

/* 16. FAQ — accordion on native <details>/<summary>, no JS.
   Markup: <div class="faq"><details class="faq__item"><summary class="faq__q">Q</summary>
     <div class="faq__a"><p>A</p></div></details>…</div> */
.faq { border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__q { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; font-family: var(--font-heading); font-weight: 600; font-size: var(--text-lg); color: var(--text-strong); cursor: pointer; list-style: none; }
.faq__q::-webkit-details-marker { display: none; }

.faq__q::after {
  content: ""; flex: 0 0 auto; width: 10px; height: 10px; margin-top: 0.35em;
  border-right: 2px solid var(--blue-700); border-bottom: 2px solid var(--blue-700);
  transform: rotate(45deg); transition: transform var(--speed) var(--ease);
}

.faq__item[open] .faq__q::after { transform: rotate(-135deg); }
.faq__q:hover { color: var(--blue-700); }
.faq__a { padding-bottom: var(--space-4); max-width: 72ch; color: var(--text); }
.faq__a > * + * { margin-top: var(--space-3); }

/* 17. TOOL — calculator/form panels: fields, range, big-number result, breakdown.
   Markup: <form class="tool"><div class="tool__grid"><div class="tool__field">
     <label class="tool__label" for="amt">…</label><input class="tool__input" id="amt"></div>…</div>
     <div class="tool__actions"><button class="btn btn--primary">…</button></div>
     <output class="tool__result"><span class="tool__result-label">…</span>
       <span class="tool__result-value">…</span><span class="tool__result-note">…</span></output>
     <dl class="tool__breakdown"><div class="tool__row"><dt class="tool__row-label">…</dt>
       <dd class="tool__row-value">…</dd></div>…</dl></form> */
.tool { display: grid; gap: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); }
.tool__grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.tool__field { display: grid; gap: var(--space-2); }
.tool__label { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-sm); color: var(--text-strong); }
.tool__hint, .tool__note { font-size: var(--text-sm); color: var(--text-muted); }

.tool__input, .tool__select {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text); font-variant-numeric: tabular-nums;
  transition: border-color var(--speed) var(--ease);
}

.tool__input:hover, .tool__select:hover { border-color: var(--ink-400); }
.tool__input:focus-visible, .tool__select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; border-color: var(--focus-ring); }

.tool__select {
  appearance: none; padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233d5470' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}

.tool__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.tool__range { width: 100%; accent-color: var(--blue-700); }

.tool__result { display: grid; gap: var(--space-1); background: var(--surface-brand); border: 1px solid var(--blue-100); border-radius: var(--radius); padding: var(--space-5) var(--space-6); }
.tool__result-label { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }

.tool__result-value {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem); line-height: 1.1;
  letter-spacing: var(--tracking-tight); color: var(--blue-700);
  font-variant-numeric: tabular-nums;
}

.tool__result-note { font-size: var(--text-sm); color: var(--text-muted); }
.tool__breakdown { display: grid; margin: 0; border-top: 1px solid var(--border); }
.tool__row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.tool__row-label { color: var(--text-muted); }
.tool__row-value { margin: 0; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; text-align: right; }
.tool__row--total { border-bottom: 0; font-size: var(--text-base); }
.tool__row--total .tool__row-label, .tool__row--total .tool__row-value { color: var(--text-strong); font-weight: 700; }

@media (min-width: 640px) {
  .tool__grid { grid-template-columns: repeat(2, 1fr); }
  .tool__grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* 18. STATS — <dl class="stat-grid"><div class="stat"><dt class="stat__label">…</dt>
   <dd class="stat__value">…</dd></div>…</dl> */
.stat-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin: 0; }
.stat { padding-top: var(--space-4); border-top: 2px solid var(--blue-700); }
.stat__value { font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: var(--tracking-tight); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat__label { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }

/* 19. PILLS + BADGES — .badge static (labels, counts); .pill interactive
   (filters/tags, use .pill--active or aria-pressed="true"). */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-800);
  font-family: var(--font-heading); font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.02em; line-height: 1.6; white-space: nowrap;
}

.badge--brand { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.badge--success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.badge--warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.badge--danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

.pill {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-700);
  font-family: var(--font-heading); font-size: var(--text-sm); font-weight: 600;
  line-height: 1.3; text-decoration: none;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.pill:hover, .pill--active, .pill[aria-pressed="true"] { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-800); text-decoration: none; }

/* 20. RELATED LINKS — <nav class="related-links" aria-label="Related">
   <h2 class="related-links__title">…</h2><ul><li><a href="…">…</a></li></ul></nav> */
.related-links { border-top: 2px solid var(--ink-950); padding-top: var(--space-5); }
.related-links__title { font-size: var(--text-xl); margin-bottom: var(--space-4); }
.related-links ul { display: grid; gap: var(--space-3); list-style: none; padding: 0; margin: 0; }
.related-links a { display: inline-block; font-family: var(--font-heading); font-weight: 600; color: var(--blue-700); text-decoration: none; }

.related-links a::after { content: "\2192"; display: inline-block; margin-left: var(--space-2); transition: transform var(--speed) var(--ease); }
.related-links a:hover { text-decoration: underline; }
.related-links a:hover::after { transform: translateX(3px); }

@media (min-width: 640px) {
  .related-links ul { grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-8); }
}

/* 21. MOTION PREFERENCES — kill motion, keep states. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 22. >=1200px REFINEMENTS */
@media (min-width: 1200px) {
  .hero { padding-block: clamp(64px, 7vw, 96px); }
  .card-grid { gap: var(--space-6); }
}

/* 23. CONTENT PAGE LAYOUT + EXTRAS (added by the generator integration).
   Two-column article layout with a sticky side rail for the offer slot and
   related links. Collapses to one column below 900px. */
.site-main { display: block; }

.page-layout {
  display: grid; gap: var(--space-8);
  grid-template-columns: 1fr;
  padding-block: var(--space-10);
}

@media (min-width: 900px) {
  .page-layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-10); align-items: start; }
  .page-layout__side { position: sticky; top: calc(var(--header-height) + var(--space-6)); display: grid; gap: var(--space-6); }
}

/* Sections rendered inside .prose keep prose rhythm but reset the article box. */
.prose__section > h2 { scroll-margin-top: calc(var(--header-height) + var(--space-4)); }

/* Byline — visible last-reviewed date (QualityTimebasedSyntacticDate). */
.byline {
  font-size: var(--text-sm); color: var(--text-muted);
  padding-bottom: var(--space-4); border-bottom: 1px solid var(--border);
}
.byline time { font-variant-numeric: tabular-nums; }

/* Quick facts / at-a-glance stats block. */
.quick-facts { margin-block: var(--space-6); }
.quick-facts__title { font-size: var(--text-xl); margin-bottom: var(--space-5); }
.stat__source { font-weight: 400; color: var(--text-muted); font-size: var(--text-xs); }

/* At-a-glance definition list: short label above a plain-language value.
   Deliberately NOT the oversized .stat treatment — these values are sentences. */
.quick-facts__list { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.quick-facts__item { display: grid; gap: var(--space-1); padding-block: var(--space-4); border-bottom: 1px solid var(--border); }
.quick-facts__label {
  font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm);
  color: var(--text-strong); letter-spacing: var(--tracking-tight);
}
.quick-facts__value { margin: 0; font-size: var(--text-base); color: var(--text); max-width: 68ch; }
.quick-facts__source { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--text-muted); }

@media (min-width: 640px) {
  .quick-facts__item { grid-template-columns: 14rem minmax(0, 1fr); gap: var(--space-6); align-items: baseline; }
}

/* Citations / sources list. */
.citations { margin-top: var(--space-10); padding-top: var(--space-6); border-top: 2px solid var(--ink-950); }
.citations__title { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.citations__note { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-4); }
.citations__list { display: grid; gap: var(--space-2); padding-left: var(--space-6); list-style: decimal; font-size: var(--text-sm); }
.citations__list li::marker { color: var(--blue-600); }
.citations__list a { color: var(--blue-700); }
.citations__publisher { color: var(--text-muted); }
.citations__publisher::before { content: " — "; }

/* Hub intro copy sits above the card grid. */
.prose--intro { max-width: 68ch; margin-bottom: var(--space-8); }

/* Hub listings need breathing room under the hero. */
.page--hub .card-grid { padding-block: var(--space-10); }


/* 24. TOOL COMPAT LAYER — classes emitted by src/pages/tools.js that extend the
   base .tool contract in section 17. Kept separate so the base component stays
   unchanged. */
.tool__intro { color: var(--text-muted); max-width: 68ch; }
.tool__form { display: grid; gap: var(--space-5); }
.tool__fields { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.tool__unit { font-weight: 400; color: var(--text-muted); font-size: var(--text-xs); }

/* .input mirrors .tool__input so tool fields are styled consistently. */
.input {
  width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--speed) var(--ease);
}
.input:hover { border-color: var(--ink-400); }
.input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; border-color: var(--focus-ring); }

.tool__error {
  color: var(--danger); background: var(--danger-bg);
  border: 1px solid var(--danger-border); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); font-size: var(--text-sm);
}
.tool__output { display: grid; gap: var(--space-4); }
.tool__output-title { font-size: var(--text-lg); }
.tool__results { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

@media (min-width: 640px) {
  .tool__fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
}
