/* AG Resident Directorship — site stylesheet v2 (one file, no @import, no third-party requests).
   Tokens mirror build/design/tokens.css. Fonts are self-hosted Latin subsets in /assets/fonts/.
   Do not add Google Fonts or any CDN link: the site makes no third-party requests. */

/* ---------- Fonts (self-hosted, variable, Latin subset) ---------- */
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "AGRD Display"; src: url("../fonts/agrd-display-var.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "AGRD Display"; src: url("../fonts/agrd-display-italic-var.woff2") format("woff2"); font-weight: 400 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat Caps"; src: url("../fonts/montserrat-700-caps.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
/* Metric-matched fallbacks so the swap does not shift layout (CLS). */
@font-face { font-family: "Hanken Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Helvetica"); size-adjust: 101.6%; ascent-override: 98.4%; descent-override: 29.8%; line-gap-override: 0%; }
@font-face { font-family: "AGRD Display Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 102.9%; ascent-override: 105.1%; descent-override: 24.4%; line-gap-override: 0%; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --palette-ink: #14201C; --palette-paper: #F6F2EA; --palette-white: #FFFFFF; --palette-sand: #EDE6D8;
  --palette-eucalypt: #1E4A40; --palette-eucalypt-deep: #12302A; --palette-mist: #C9D6CF;
  --palette-ochre: #9C4A1A; --palette-wattle: #E3B04B; --palette-slate: #4E5A55; --palette-line: #DCD4C4;
  --palette-success: #2C6A47; --palette-danger: #A12F26;

  --color-bg: var(--palette-paper); --color-surface: var(--palette-white); --color-surface-alt: var(--palette-sand);
  --color-text: var(--palette-ink); --color-text-muted: var(--palette-slate);
  --color-primary: var(--palette-eucalypt); --color-primary-strong: var(--palette-eucalypt-deep); --color-on-primary: #fff;
  --color-accent: var(--palette-ochre); --color-highlight: var(--palette-wattle);
  --color-inverse-bg: var(--palette-eucalypt-deep); --color-inverse-text: var(--palette-paper); --color-inverse-muted: var(--palette-mist);
  --color-border: var(--palette-line); --color-border-strong: #857B69; --color-focus: #2F7A68;
  --color-success: var(--palette-success); --color-danger: var(--palette-danger);
  --color-tint: #E4ECE7; --header-bg: rgba(246, 242, 234, 0.94); /* eucalypt wash for key-fact boxes; ink and eucalypt pass AA on it */

  --font-heading: "AGRD Display", "AGRD Display Fallback", Georgia, serif;
  --font-label: "Montserrat Caps", "Hanken Grotesk", "Hanken Fallback", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Hanken Fallback", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --text-xs: 0.8125rem; --text-sm: 0.9375rem; --text-base: 1.0625rem; --text-lg: 1.25rem;
  --text-xl: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --text-2xl: clamp(1.625rem, 1.35rem + 1vw, 2.125rem);
  --text-3xl: clamp(2rem, 1.55rem + 1.8vw, 2.875rem);
  --text-4xl: clamp(2.375rem, 1.8rem + 3vw, 4.25rem);
  --leading-tight: 1.1; --leading-snug: 1.3; --leading-normal: 1.6;
  --tracking-tight: -0.02em; --tracking-eyebrow: 0.14em;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.5rem;
  --space-6: 2rem; --space-7: 3rem; --space-8: 4rem; --space-9: 6rem;
  --space-gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --space-section: clamp(3.5rem, 2.5rem + 5vw, 7rem);
  --width-prose: 68ch; --width-content: 74rem;

  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 14px; --radius-xl: 22px; --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(20, 32, 28, 0.06);
  --shadow-sm: 0 1px 2px rgba(20, 32, 28, 0.05), 0 2px 6px rgba(20, 32, 28, 0.06);
  --shadow-md: 0 2px 4px rgba(20, 32, 28, 0.04), 0 8px 24px rgba(20, 32, 28, 0.08);
  --shadow-lg: 0 4px 8px rgba(20, 32, 28, 0.05), 0 24px 56px rgba(20, 32, 28, 0.12);
  --shadow-focus: 0 0 0 3px var(--color-bg), 0 0 0 5px var(--color-focus);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --duration-fast: 120ms;
  --border-hairline: 1px solid var(--color-border); --border-strong: 1px solid var(--color-border-strong);
}
/* Dark mode: "night in the bush" (tokens.json pairs, all >= 4.5:1). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --color-bg: #0D1714; --color-surface: #15221E; --color-surface-alt: #1B2B26;
  --color-text: #ECE7DD; --color-text-muted: #A9B5AF;
  --color-primary: #7FC3AE; --color-primary-strong: #A3D6C5; --color-on-primary: #0D1714;
  --color-accent: #E39A62; --color-highlight: #E3B04B;
  --color-inverse-bg: #1E3B34; --color-inverse-text: #F6F2EA; --color-inverse-muted: #C9D6CF;
  --color-border: #2A3A35; --color-border-strong: #66807A; --color-focus: #7FC3AE;
  --color-success: #7CC59A; --color-danger: #F08A7E; --color-tint: #17302A; --header-bg: rgba(13, 23, 20, 0.94);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.25); --shadow-md: 0 2px 4px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 4px 8px rgba(0,0,0,.3), 0 24px 56px rgba(0,0,0,.45);
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0D1714; --color-surface: #15221E; --color-surface-alt: #1B2B26;
  --color-text: #ECE7DD; --color-text-muted: #A9B5AF;
  --color-primary: #7FC3AE; --color-primary-strong: #A3D6C5; --color-on-primary: #0D1714;
  --color-accent: #E39A62; --color-highlight: #E3B04B;
  --color-inverse-bg: #1E3B34; --color-inverse-text: #F6F2EA; --color-inverse-muted: #C9D6CF;
  --color-border: #2A3A35; --color-border-strong: #66807A; --color-focus: #7FC3AE;
  --color-success: #7CC59A; --color-danger: #F08A7E; --color-tint: #17302A; --header-bg: rgba(13, 23, 20, 0.94);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.25); --shadow-md: 0 2px 4px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 4px 8px rgba(0,0,0,.3), 0 24px 56px rgba(0,0,0,.45);
}
@media (prefers-reduced-motion: reduce) { :root { --duration-fast: 0ms; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-normal); overflow-x: hidden; font-variant-numeric: lining-nums; }
img, svg { max-width: 100%; display: block; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--weight-medium); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); margin: 0 0 var(--space-4); text-wrap: balance; }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); line-height: var(--leading-snug); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
a { color: var(--color-primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-primary-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--space-4); top: var(--space-4); background: var(--color-surface); padding: var(--space-2) var(--space-4); z-index: 50; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--width-content); margin: 0 auto; padding: 0 var(--space-gutter); }
.prose { max-width: var(--width-prose); }
.section { padding: var(--space-section) 0; }
.section--tight { padding: var(--space-7) 0; }
.section--alt { background: var(--color-surface-alt); }
.section--inverse { background: var(--color-inverse-bg); color: var(--color-inverse-text); }
.section--inverse a { color: var(--color-highlight); }
.section--inverse .muted { color: var(--color-inverse-muted); }
.eyebrow { font-family: var(--font-label); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-accent); margin: 0 0 var(--space-3); }
.section--inverse .eyebrow { color: var(--color-highlight); }
.lead { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 60ch; }
.section--inverse .lead { color: var(--color-inverse-muted); }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--text-sm); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg); border-bottom: var(--border-hairline); }
@supports (backdrop-filter: blur(1px)) { .site-header { backdrop-filter: saturate(1.4) blur(10px); } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 68px; position: relative; }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text); text-decoration: none; font-family: var(--font-heading); font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.1; }
.brand:hover { color: var(--color-text); text-decoration: none; }
.brand svg, .brand img { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); letter-spacing: 0.02em; }
@media (max-width: 480px) { .site-header .brand small { display: none; } }
#onboard-form { scroll-margin-top: 140px; }
.nav { display: flex; align-items: center; gap: var(--space-5); }
.nav a { color: var(--color-text); text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-primary); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.5em; }
.nav-toggle { display: none; background: none; border: var(--border-strong); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); color: var(--color-text); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); min-height: 44px; cursor: pointer; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--color-surface); border-bottom: var(--border-hairline); box-shadow: var(--shadow-md); padding: var(--space-2) var(--space-gutter) var(--space-5); }
  .nav.is-open { display: flex; }
  .nav a { padding: var(--space-3) 0; border-bottom: var(--border-hairline); font-size: var(--text-base); }
  .nav .btn { margin-top: var(--space-4); text-align: center; border-bottom: 0; }
}
/* No-JS fallback: the nav is reachable via the footer, which links every hub. */

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0.75rem 1.35rem; border-radius: var(--radius-pill); border: 1px solid transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: none; cursor: pointer; transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.btn:hover { text-decoration: none; }
.btn--primary, .nav a.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover, .nav a.btn--primary:hover { background: var(--color-primary-strong); color: var(--color-on-primary); }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.btn--ghost:hover { border-color: var(--color-text); color: var(--color-text); }
.section--inverse .btn--primary { background: var(--color-highlight); color: var(--palette-ink); }
.section--inverse .btn--ghost { color: var(--color-inverse-text); border-color: var(--color-inverse-muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.btn:active { transform: translateY(1px); }
.link-arrow { font-weight: var(--weight-semibold); text-decoration: none; }
.link-arrow::after { content: " \2192"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Heroes ---------- */
.hero { padding: clamp(3rem, 2rem + 6vw, 7rem) 0 var(--space-section); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--space-8); align-items: center; }
.hero h1 { max-width: 15ch; }
.hero h1 em, .page-hero h1 em { font-style: italic; color: var(--color-accent); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--space-7); } }
.page-hero { padding: clamp(2rem, 1.5rem + 3vw, 4.5rem) 0 var(--space-7); border-bottom: var(--border-hairline); }
.page-hero h1 { max-width: 22ch; }
.page-hero .lead { margin-bottom: 0; }
.page-hero--split .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-7); align-items: end; }
@media (max-width: 900px) { .page-hero--split .wrap { grid-template-columns: 1fr; gap: var(--space-5); } }

/* Breadcrumbs */
.crumbs { font-size: var(--text-xs); margin: 0 0 var(--space-5); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.crumbs li { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.crumbs li + li::before { content: "/"; color: var(--color-border-strong); }
.crumbs a { color: var(--color-text-muted); text-decoration: none; padding: var(--space-1) 0; }
.crumbs a:hover { color: var(--color-primary); text-decoration: underline; }
.crumbs [aria-current] { color: var(--color-text); }

/* Page meta line (Last reviewed, reading time, sources count) */
.meta-line { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted); }
.meta-line > * { display: inline-flex; align-items: center; gap: var(--space-2); }
.meta-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); flex: none; }
.meta-line time { color: var(--color-text); font-weight: var(--weight-semibold); }

/* ---------- Board card (home hero) ---------- */
.board { background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: var(--space-6); position: relative; }
.board h2 { font-size: var(--text-xl); margin-bottom: var(--space-1); }
.board .status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-success); text-transform: uppercase; letter-spacing: 0.08em; }
.board .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); }
.board ul { list-style: none; margin: var(--space-5) 0 0; padding: 0; }
.board li { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-top: var(--border-hairline); font-size: var(--text-sm); }
.board li span:last-child { color: var(--color-text-muted); text-align: right; font-family: var(--font-mono); font-size: var(--text-xs); padding-top: 2px; }
.board .note { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--color-text-muted); }

/* Proof strip */
.strip { border-top: var(--border-hairline); border-bottom: var(--border-hairline); background: var(--color-surface); }
.strip ul { list-style: none; margin: 0; padding: var(--space-5) 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.strip li { font-size: var(--text-sm); color: var(--color-text-muted); }
.strip strong { display: block; color: var(--color-text); font-family: var(--font-heading); font-size: var(--text-lg); font-weight: var(--weight-medium); }
@media (max-width: 800px) { .strip ul { grid-template-columns: 1fr 1fr; } }

/* ---------- Grids and cards ---------- */
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-xs); }
.card h3 { margin-bottom: var(--space-3); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); letter-spacing: 0.08em; margin-bottom: var(--space-3); display: block; }
/* Link card: whole card is the link target (hubs, related) */
.card-link { position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5) var(--space-5) var(--space-5); transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.card-link:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.card-link h3 { font-size: var(--text-lg); margin: 0; }
.card-link h3 a { color: var(--color-text); text-decoration: none; }
.card-link h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:hover h3 a { color: var(--color-primary); }
.card-link p { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
.card-link .kicker { font-family: var(--font-label); font-size: 0.6875rem; font-weight: var(--weight-bold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-accent); }
.card-link .go { margin-top: auto; padding-top: var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-primary); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: end; margin-bottom: var(--space-7); }
.section-head p { margin: 0; }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; gap: var(--space-3); } }
.ticks, .crosses { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.ticks li, .crosses li { position: relative; padding-left: 1.6em; margin-bottom: var(--space-2); }
.ticks li::before { content: ""; position: absolute; left: 0.1em; top: 0.5em; width: 0.7em; height: 0.38em; border-left: 2px solid var(--color-primary); border-bottom: 2px solid var(--color-primary); transform: rotate(-45deg); }
.section--inverse .ticks li::before { border-color: var(--color-highlight); }
.crosses li::before { content: "\2715"; position: absolute; left: 0.1em; top: 0; color: var(--color-danger); font-weight: var(--weight-bold); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--space-5); padding: var(--space-6) 0; border-top: var(--border-hairline); }
.steps > li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-heading); font-size: var(--text-3xl); color: var(--color-accent); line-height: 1; }
.steps h3 { margin-bottom: var(--space-2); }
.steps .meta { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
@media (max-width: 640px) { .steps > li { grid-template-columns: 1fr; gap: var(--space-2); } .steps > li::before { font-size: var(--text-2xl); } }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(var(--plan-count, 3), minmax(0, 1fr)); gap: var(--space-5); align-items: stretch; }
@media (max-width: 1000px) { .plans { grid-template-columns: 1fr; max-width: 34rem; margin: 0 auto; } }
.plan { display: flex; flex-direction: column; background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); padding: var(--space-6); box-shadow: var(--shadow-sm); position: relative; }
.plan--featured { border: 2px solid var(--color-primary); box-shadow: var(--shadow-lg); }
.plan .badge { font-family: var(--font-label); position: absolute; top: calc(-1 * var(--space-3)); left: var(--space-6); background: var(--color-primary); color: var(--color-on-primary); font-size: var(--text-xs); font-weight: var(--weight-bold); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); letter-spacing: 0.06em; text-transform: uppercase; }
.plan h3 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.plan .for { color: var(--color-text-muted); font-size: var(--text-sm); min-height: 3em; }
.price { font-family: var(--font-heading); font-size: var(--text-4xl); line-height: 1.15; letter-spacing: var(--tracking-tight); margin: var(--space-4) 0 var(--space-2); }
.price-note { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-5); }
.plan .ticks { flex: 1; font-size: var(--text-sm); }
.plan .btn { width: 100%; margin-top: var(--space-5); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: var(--border-hairline); border-radius: var(--radius-lg); margin: 0 0 var(--space-5);
  /* Scroll hint: an edge shadow shows only while more columns are hidden that side (covers scroll with the content) */
  background:
    linear-gradient(to right, var(--color-surface) 40%, rgb(255 255 255 / 0)) left / 3rem 100% no-repeat local,
    linear-gradient(to left, var(--color-surface) 40%, rgb(255 255 255 / 0)) right / 3rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 0.18), rgb(0 0 0 / 0)) left / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 0.18), rgb(0 0 0 / 0)) right / 0.9rem 100% no-repeat scroll,
    var(--color-surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 30rem; }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: var(--border-hairline); vertical-align: top; }
tr:last-child > td, tr:last-child > th { border-bottom: 0; }
thead th { font-family: var(--font-body); font-weight: var(--weight-semibold); font-size: var(--text-sm); background: var(--color-surface-alt); }
tbody th { font-weight: var(--weight-semibold); }
td.yes { color: var(--color-success); font-weight: var(--weight-semibold); }
td.no { color: var(--color-text-muted); }

/* ---------- FAQ ---------- */
.faq details { border-top: var(--border-hairline); padding: var(--space-4) 0; }
.faq details:last-of-type { border-bottom: var(--border-hairline); }
.faq summary { cursor: pointer; font-family: var(--font-heading); font-size: var(--text-xl); line-height: var(--leading-snug); list-style: none; display: flex; justify-content: space-between; gap: var(--space-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-body); color: var(--color-primary); font-size: var(--text-2xl); line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding-top: var(--space-3); max-width: var(--width-prose); color: var(--color-text-muted); }
.faq-group { margin-bottom: var(--space-8); }
.faq-group h2 { font-size: var(--text-2xl); }

/* Callouts */
.callout { border-left: 3px solid var(--color-accent); background: var(--color-surface); padding: var(--space-5) var(--space-6); border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 0 0 var(--space-5); }
.callout p:last-child { margin: 0; }
.callout--note { border-left-color: var(--color-primary); background: var(--color-tint); }

/* ---------- Article layout (guides, legal, country, industry) ---------- */
.split, .article-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.article-layout--aside { grid-template-columns: 15rem minmax(0, 1fr) 17rem; gap: var(--space-7); }
@media (max-width: 1180px) { .article-layout--aside { grid-template-columns: 15rem minmax(0, 1fr); } .article-layout--aside > .rail { grid-column: 2; } }
@media (max-width: 900px) { .split, .article-layout, .article-layout--aside { grid-template-columns: 1fr; gap: var(--space-5); } .article-layout--aside > .rail { grid-column: auto; } }
.toc { position: sticky; top: 92px; font-size: var(--text-sm); max-height: calc(100vh - 110px); overflow: auto; }
.toc-title { font-family: var(--font-label); font-size: 0.6875rem; font-weight: var(--weight-bold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.toc ol, .toc ul { list-style: none; margin: 0; padding: 0; border-left: var(--border-hairline); }
.toc ul ul { border-left: 0; padding-left: var(--space-3); }
.toc a { display: block; padding: 0.4rem var(--space-4); margin-left: -1px; border-left: 2px solid transparent; color: var(--color-text-muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--color-primary); border-left-color: var(--color-primary); }
@media (max-width: 900px) {
  .toc { position: static; max-height: none; background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
  .toc ol, .toc ul { border-left: 0; } .toc a { padding: 0.35rem 0; border-left: 0; margin: 0; }
  .toc ul ul { display: none; }
}
details.toc > summary { cursor: pointer; list-style: none; }
details.toc > summary::-webkit-details-marker { display: none; }

.article { min-width: 0; max-width: var(--width-prose); font-size: 1.0938rem; }
.article > :first-child { margin-top: 0; }
.article h2 { font-size: var(--text-2xl); margin: var(--space-7) 0 var(--space-4); scroll-margin-top: 92px; }
.article h3 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-3); scroll-margin-top: 92px; }
.article h2:first-child { margin-top: 0; }
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 var(--space-5); }
.article li { margin-bottom: var(--space-2); }
.article li::marker { color: var(--color-accent); }
.article blockquote { margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5); border-left: 3px solid var(--color-accent); background: var(--color-surface); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.article blockquote p:last-child { margin: 0; }
.article table { margin: 0 0 var(--space-5); background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-lg); display: block; overflow-x: auto; min-width: 0; }
.article .table-wrap table { display: table; border: 0; border-radius: 0; margin: 0; min-width: 30rem; background: none; }
.article .related .grid, .article .grid-3 { grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.article code { font-family: var(--font-mono); font-size: 0.88em; background: var(--color-surface-alt); padding: 0.1em 0.35em; border-radius: var(--radius-sm); }
.article pre { background: var(--color-surface); border: var(--border-hairline); padding: var(--space-4); border-radius: var(--radius-md); overflow-x: auto; }
.article pre code { background: none; padding: 0; }
.article hr { border: 0; border-top: var(--border-hairline); margin: var(--space-7) 0; }
.article strong { font-weight: var(--weight-semibold); }
.article .headerlink { display: none; }
.ref { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); background: var(--color-surface-alt); padding: 0.1em 0.45em; border-radius: var(--radius-sm); white-space: nowrap; }

/* Key facts / At a glance box */
.keyfacts { background: var(--color-tint); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-6); margin: 0 0 var(--space-6); }
.keyfacts h2, .keyfacts .keyfacts-title { font-family: var(--font-label); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-primary); margin: 0 0 var(--space-3); }
.keyfacts ul { margin: 0; padding-left: 1.2em; }
.keyfacts li { margin-bottom: var(--space-2); }
.keyfacts li:last-child { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1px; background: var(--color-border); border: var(--border-hairline); border-radius: var(--radius-lg); overflow: hidden; margin: 0 0 var(--space-6); }
.facts > div { background: var(--color-surface); padding: var(--space-4) var(--space-5); }
.facts dt { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-semibold); margin-bottom: var(--space-1); }
.facts dd { margin: 0; font-family: var(--font-heading); font-size: var(--text-lg); line-height: 1.25; }

/* Sources box */
.sources { margin-top: var(--space-7); background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-6); font-size: var(--text-sm); }
.sources h2 { font-family: var(--font-label); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 var(--space-3); }
.sources ol { margin: 0; padding-left: 1.4em; }
.sources li { margin-bottom: var(--space-2); overflow-wrap: anywhere; }
.sources li::marker { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.sources .host { color: var(--color-text-muted); font-size: var(--text-xs); }
.sources .note { margin: var(--space-4) 0 0; color: var(--color-text-muted); font-size: var(--text-xs); }

/* Right rail (sticky CTA on guides) */
.rail { position: sticky; top: 92px; display: grid; gap: var(--space-4); }
.rail-card { background: var(--color-inverse-bg); color: var(--color-inverse-text); border-radius: var(--radius-lg); padding: var(--space-5); font-size: var(--text-sm); }
.rail-card h2 { font-size: var(--text-lg); color: var(--color-inverse-text); margin-bottom: var(--space-2); }
.rail-card p { color: var(--color-inverse-muted); }
.rail-card .btn { width: 100%; background: var(--color-highlight); color: var(--palette-ink); }
.rail-card .btn:hover { background: #F0C66E; color: var(--palette-ink); }
.rail-card a:not(.btn) { color: var(--color-highlight); }
@media (max-width: 1180px) { .rail { position: static; } }

/* Related */
.related { margin-top: var(--space-8); }
.related h2 { font-size: var(--text-2xl); }

/* Disclaimer */
.disclaimer { margin-top: var(--space-6); font-size: var(--text-xs); color: var(--color-text-muted); border-top: var(--border-hairline); padding-top: var(--space-4); }

/* ---------- Hubs ---------- */
.hub-intro { max-width: var(--width-prose); }
.hub-intro p { color: var(--color-text-muted); }
.hub-group { margin-top: var(--space-7); }
.hub-group > h2 { font-size: var(--text-2xl); display: flex; align-items: baseline; gap: var(--space-3); }
.hub-group > h2 .count { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-text-muted); font-weight: var(--weight-medium); letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: var(--space-6) 0 0; padding: 0; }
.chips a { display: inline-flex; align-items: center; min-height: 36px; padding: 0.35rem 0.9rem; border: var(--border-strong); border-radius: var(--radius-pill); font-size: var(--text-sm); color: var(--color-text); text-decoration: none; background: var(--color-surface); }
.chips a:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---------- Glossary ---------- */
.az { position: sticky; top: 68px; z-index: 5; background: var(--color-bg); border-bottom: var(--border-hairline); padding: var(--space-3) 0; margin-bottom: var(--space-6); }
.az ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.az a, .az span { display: inline-grid; place-items: center; width: 1.95rem; height: 2.25rem; border-radius: var(--radius-sm); font-weight: var(--weight-semibold); font-size: var(--text-sm); text-decoration: none; }
.az a { color: var(--color-primary); }
.az a:hover { background: var(--color-surface); }
.az span { color: var(--color-text-muted); opacity: 0.55; }
.terms { margin: 0; }
.term-letter { font-size: var(--text-3xl); color: var(--color-accent); border-bottom: var(--border-hairline); padding-bottom: var(--space-2); margin: var(--space-7) 0 var(--space-4); scroll-margin-top: 150px; }
.term { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: var(--space-2) var(--space-6); padding: var(--space-4) 0; border-bottom: var(--border-hairline); scroll-margin-top: 150px; }
.term dt { font-family: var(--font-heading); font-size: var(--text-lg); line-height: 1.3; }
.term dd { margin: 0; }
.term dd p:last-child { margin-bottom: 0; }
.term .see { font-size: var(--text-sm); color: var(--color-text-muted); }
@media (max-width: 700px) { .term { grid-template-columns: 1fr; } }

/* ---------- Tool pages ---------- */
.tool-shell { background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: clamp(1.25rem, 0.8rem + 2vw, 2.5rem); margin: 0 0 var(--space-7); }
/* Widgets that bring their own card (.agt, tools.css) sit directly on the page: no card inside a card */
.tool-shell:has(> .agt) { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.tool-shell .tool-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); align-items: baseline; border-bottom: var(--border-hairline); padding-bottom: var(--space-4); margin-bottom: var(--space-5); }
.tool-shell .tool-head p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.tool-result { margin-top: var(--space-5); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-tint); }
.tool-result[hidden] { display: none; }
.tool-result h3 { margin-top: 0; }
.privacy-note { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-4); }
.output-num { font-family: var(--font-heading); font-size: var(--text-3xl); line-height: 1.1; }

/* ---------- CTA band ---------- */
.cta-band .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-6); align-items: center; }
.cta-band h2 { margin-bottom: var(--space-3); }
.cta-band .btn-row { justify-content: flex-end; margin-top: 0; }
@media (max-width: 800px) { .cta-band .wrap { grid-template-columns: 1fr; } .cta-band .btn-row { justify-content: flex-start; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-inverse-bg); color: var(--color-inverse-muted); padding: var(--space-8) 0 var(--space-6); font-size: var(--text-sm); }
.site-footer a { color: var(--color-inverse-text); text-decoration: none; }
.site-footer a:hover { color: var(--color-highlight); text-decoration: underline; }
.foot-grid { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-6); margin-bottom: var(--space-7); }
.foot-grid > * { flex: 1 1 8.5rem; }
.foot-grid > :first-child { flex: 2 1 18rem; max-width: 26rem; }
.foot-grid h2 { font-family: var(--font-label); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--color-highlight); font-weight: var(--weight-bold); margin-bottom: var(--space-3); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: var(--space-2); }
.foot-grid li a { display: inline-block; padding: 2px 0; }
.site-footer .brand { color: var(--color-inverse-text); margin-bottom: var(--space-4); }
.site-footer .brand small { color: var(--color-inverse-muted); }
.legal { border-top: 1px solid rgba(246, 242, 234, 0.16); padding-top: var(--space-5); font-size: var(--text-xs); }
@media (max-width: 960px) { .foot-grid > :first-child { flex-basis: 100%; max-width: none; } }

/* ---------- Onboarding form (start) ---------- */
.onboard { display: grid; grid-template-columns: 1fr 20rem; gap: var(--space-7); align-items: start; }
@media (max-width: 960px) { .onboard { grid-template-columns: 1fr; } }
.progress { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); }
.progress li { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-semibold); padding-top: var(--space-3); border-top: 4px solid var(--color-border); }
.progress li.is-active { color: var(--color-text); border-color: var(--color-primary); }
.progress li.is-done { color: var(--color-primary); border-color: var(--color-primary); }
@media (max-width: 640px) { .progress li span { display: none; } .progress li { font-size: 0; padding-top: 0; } }
.form-card { background: var(--color-surface); border: var(--border-hairline); border-radius: var(--radius-xl); padding: clamp(1.25rem, 0.8rem + 2vw, 2.5rem); box-shadow: var(--shadow-md); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-family: var(--font-heading); font-size: var(--text-2xl); letter-spacing: var(--tracking-tight); padding: 0; margin-bottom: var(--space-2); }
.step-intro { color: var(--color-text-muted); margin-bottom: var(--space-6); }
.field { margin-bottom: var(--space-5); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
label, .label { display: block; font-weight: var(--weight-semibold); font-size: var(--text-sm); margin-bottom: var(--space-2); }
.hint { display: block; font-weight: var(--weight-regular); color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 2px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], input[type="search"], select, textarea { width: 100%; font: inherit; font-size: var(--text-base); color: var(--color-text); background: var(--color-surface); border: var(--border-strong); border-radius: var(--radius-md); padding: 0.7rem 0.85rem; min-height: 48px; }
textarea { min-height: 6rem; resize: vertical; }
input:focus, input:focus-within, select:focus, textarea:focus { outline: none; box-shadow: var(--shadow-focus); border-color: var(--color-focus); }
.choice-grid { display: grid; gap: var(--space-3); }
.choice { display: flex; gap: var(--space-3); align-items: flex-start; border: var(--border-strong); border-radius: var(--radius-md); padding: var(--space-4); cursor: pointer; font-weight: var(--weight-regular); margin: 0; background: var(--color-surface); }
.choice:has(input:checked) { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.choice input { margin-top: 0.3em; accent-color: var(--color-primary); width: 1.1rem; height: 1.1rem; flex: none; }
.choice strong { display: block; }
.choice .hint { font-size: var(--text-sm); }
.choice .price-tag { margin-left: auto; font-family: var(--font-heading); font-size: var(--text-lg); white-space: nowrap; }
.form-nav { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-5); border-top: var(--border-hairline); }
.form-nav .btn[hidden] { display: none; }
.error { color: var(--color-danger); font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-top: var(--space-2); }
[aria-invalid="true"] { border-color: var(--color-danger) !important; }
.review dl { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-5); font-size: var(--text-sm); }
.review dt { color: var(--color-text-muted); }
.review dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .review dl { grid-template-columns: 1fr; } .review dd { margin-bottom: var(--space-2); } }
.aside-card { background: var(--color-surface-alt); border-radius: var(--radius-lg); padding: var(--space-6); font-size: var(--text-sm); position: sticky; top: 96px; }
.aside-card h2 { font-size: var(--text-xl); }
@media (max-width: 960px) { .aside-card { position: static; } }
.confirm { text-align: left; }
.confirm .refno { font-family: var(--font-mono); font-size: var(--text-xl); color: var(--color-primary); background: var(--color-surface-alt); display: inline-block; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); margin: var(--space-2) 0 var(--space-5); }
.js-only { display: none; }
.has-js .js-only { display: block; }

/* ---------- Generator v2 hooks ---------- */
.breadcrumbs { font-size: var(--text-xs); padding-top: var(--space-5); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.breadcrumbs li + li::before { content: "/"; color: var(--color-border-strong); }
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; display: inline-block; padding: var(--space-2) 0; }
.breadcrumbs a:hover { color: var(--color-primary); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--color-text); }
.breadcrumbs + .page-hero, .breadcrumbs + .hero { padding-top: var(--space-5); }
.link-cards { list-style: none; padding: 0; margin: 0; }
.related .link-cards { margin-top: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.hub-group .link-cards { margin-top: var(--space-5); }
.tool-widget { max-width: 52rem; }
.tool-section + .section { padding-top: 0; }
.tool-section .privacy-note { max-width: 52rem; margin-top: calc(-1 * var(--space-5)); }
.t-glossary .article h2 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-2); padding-top: var(--space-5); border-top: var(--border-hairline); }
.t-glossary .article h3 { font-size: var(--text-lg); margin: var(--space-5) 0 var(--space-2); }
.t-glossary .article { max-width: 52rem; }
.article .faq { margin-top: var(--space-7); }
.article .faq h2 { margin-top: 0; }
.article .faq summary { font-size: var(--text-lg); }

/* ---------- Polish pass 2 ---------- */
.nav a { white-space: nowrap; }
.site-header .brand small { white-space: nowrap; }
@media (max-width: 1500px) { .nav { gap: var(--space-4); } }
@media (max-width: 1400px) and (min-width: 1081px) { .site-header .brand small { display: none; } .nav { gap: var(--space-4); } }
.wrap.article-layout--aside { grid-template-columns: 13rem minmax(0, 1fr) 15rem; gap: var(--space-6); }
@media (max-width: 1180px) { .wrap.article-layout--aside { grid-template-columns: 13rem minmax(0, 1fr); } }
@media (max-width: 640px) { .breadcrumbs li:last-child { display: none; } }
@media (max-width: 900px) { .wrap.article-layout--aside { grid-template-columns: 1fr; } }
.article table { line-height: 1.45; }
.article th, .article td { padding: var(--space-3); }

/* ---------- 404 ---------- */
.notfound { min-height: 50vh; display: grid; align-content: center; }

/* ---------- Print ---------- */
@media print {
  .site-header, .nav, .cta-band, .js-only, .skip, .site-footer .foot-grid, .toc, .rail, .crumbs, .az { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section, .page-hero { padding: 12pt 0; border: 0; }
  .article-layout, .split { display: block; }
  .section--alt, .section--inverse, .card, .callout, .keyfacts, .sources { background: #fff !important; color: #000 !important; box-shadow: none; }
  .site-footer { background: #fff; color: #333; padding: 12pt 0 0; }
  .site-footer a, .legal { color: #333; }
  .steps > li, .card, .section-head, .term { break-inside: avoid; }
  .section-head, h2, h3 { break-after: avoid; }
  .print-break { break-before: page; }
  .article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #444; }
  h1 { font-size: 24pt; } h2 { font-size: 16pt; }
}

/* Windows High Contrast / forced colours: box-shadow focus rings are dropped, so restore a real outline. */
@media (forced-colors: active) {
  :focus-visible,
  a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
  input:focus, input:focus-within, input[type="date"]:focus, select:focus, textarea:focus {
    outline: 3px solid Highlight; outline-offset: 2px; box-shadow: none;
  }
  input[type="date"]:focus-within { outline-color: Highlight; }
  .skip:focus { outline: 3px solid CanvasText; outline-offset: 2px; }
  .btn, button { border: 1px solid ButtonText; }
}
