/* The Canadian business funding directory (grants-directory.html + grants-directory/*.html).
   Built by dev-tools/build-grants-directory.js; behaviour in js/directory.src.js.
   Design: the approved "hybrid" mock (dev-assets/directory-ideation-2026-10-04/mocks2/hybrid/hybrid.css),
   ported 2026-10-04. Component-scoped: every rule lives under .fd / .fd-body, and the design tokens are
   declared on .fd (not the document root) so the site nav and footer keep their own values. */
.fd {
  --ink: #14231c; --ink-2: #3b4842; --ink-3: #5c6862; --ink-4: #7d8781;
  --forest: #1a3d2e; --forest-2: #24543f; --forest-tint: #e9f0eb; --forest-wash: #f2f6f3;
  --paper: #ffffff; --field: #f4f3ee; --field-2: #ecebe4; --rule: #e3e1d8; --rule-2: #d6d3c8;
  --signal: #b4532a; --signal-ink: #8f3d1c; --signal-tint: #fbece4;
  --ty-grant: #2f7f74; --ty-grant-ink: #1f5f56; --ty-grant-bg: #e3f0ee;
  --ty-tax: #b98a2e; --ty-tax-ink: #7d5a12; --ty-tax-bg: #f6eedb;
  --ty-loan: #5b6b7f; --ty-loan-ink: #424f60; --ty-loan-bg: #e7eaef;
  --ty-fl: #7d9a6b; --ty-fl-ink: #4d6a3d; --ty-fl-bg: #ebf1e6;
  --ty-award: #a5563b; --ty-award-ink: #87412a; --ty-award-bg: #f6e7e1;
  --ty-prog: #7a5b8c; --ty-prog-ink: #5e4370; --ty-prog-bg: #efe8f3;
  --display: 'Fraunces', Georgia, serif;
  --ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --navh: 64px; --barh: 0px;
  --pop-shadow: 0 18px 48px -16px rgba(20, 35, 28, .28), 0 2px 6px rgba(20, 35, 28, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html:has(body.fd-body) { overflow-x: clip !important; overflow-y: visible !important; }
body.fd-body { background: #f4f3ee; overflow: visible !important; overflow-x: clip !important; }
/* the sitewide verdict bar competes with this page's own handoff; the mock leaves it out */
body.fd-body .verdict-bar { display: none !important; }
.fd { font-family: var(--ui); color: var(--ink); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.fd *, .fd *::before, .fd *::after { box-sizing: border-box; }
.fd [hidden] { display: none !important; }
:where(.fd) button, :where(.fd) select, :where(.fd) input { font: inherit; color: inherit; }
:where(.fd) button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; box-shadow: none; min-height: 0; }
.fd svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fd a { color: var(--forest); }
.fd :focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.fd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fd-wrap { max-width: 1248px; margin: 0 auto; padding: 0 32px; }
.fd .fd-h1, .fd .fd-h2, .fd .fd-h3, .fd .fd-group__t, .fd .fd-count, .fd .fd-pop__q, .fd .fd-empty__t { margin: 0; letter-spacing: 0; text-transform: none; }

/* ── hero ── */
.fd-hero { padding: 56px 0 28px; }
.fd .fd-h1 {
  font-family: var(--display); font-weight: 600; font-variation-settings: 'opsz' 144;
  font-size: 54px; line-height: 1.04; letter-spacing: -.022em; color: var(--forest);
  text-wrap: balance;
}
.fd-lede { margin: 16px 0 0; font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; text-wrap: balance; }
.fd-crumbs { display: flex; align-items: center; gap: 6px; margin: 0 0 18px; font-size: 14px; color: var(--ink-3); }
.fd-crumbs a { color: var(--ink-3); text-decoration: none; }
.fd-crumbs a:hover { color: var(--forest); text-decoration: underline; }
.fd-crumbs svg { font-size: 14px; color: var(--ink-4); }
.fd-crumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* ── the search bar: the hero instrument ── */
.fd-barwrap { position: sticky; top: var(--navh); z-index: 40; padding: 0 0 8px; }
.fd-barwrap::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--field); opacity: 0; transition: opacity .2s; }
.fd-barwrap.is-stuck::before { opacity: 1; }
.fd-barwrap.is-stuck .fd-try { display: none; }
.fd-barwrap.is-stuck { padding-top: 10px; padding-bottom: 10px; }
.fd-sbar {
  position: relative; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(20, 35, 28, .05); overflow: hidden; transition: box-shadow .2s;
}
.fd-barwrap.is-stuck .fd-sbar { box-shadow: 0 12px 32px -18px rgba(20, 35, 28, .35), 0 1px 2px rgba(20, 35, 28, .05); }
.fd-search { display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 22px; cursor: text; }
.fd-search > svg { font-size: 22px; color: var(--forest); }
.fd-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 19px; color: var(--ink); -webkit-appearance: none; appearance: none;
}
.fd .fd-search input:focus, .fd .fd-search input:focus-visible { outline: 0 !important; box-shadow: none !important; }
.fd-search input::placeholder { color: var(--ink-4); }
.fd-search input::-webkit-search-cancel-button { display: none; }
.fd-search:focus-within { box-shadow: inset 0 0 0 2px var(--forest); border-radius: 20px 20px 0 0; }
.fd-kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid var(--rule-2);
  border-radius: 6px; font: 500 13px var(--ui); color: var(--ink-3); background: var(--field);
}
.fd-search:focus-within .fd-kbd, .fd-search.has-q .fd-kbd { display: none; }
.fd-search__clear { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink-3); font-size: 18px; }
.fd-search__clear:hover { background: var(--field); color: var(--ink); }

.fd-segs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.fd-seg:last-child { border-right: 0; }
.fd-seg {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px;
  align-content: center; min-height: 66px; padding: 10px 18px 10px 22px; border-right: 1px solid var(--rule);
  transition: background-color .15s;
}
.fd-seg:hover { background: #f9f9f5; }
.fd-seg[aria-expanded="true"] { background: var(--forest-wash); }
.fd-seg:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--forest); }
.fd-seg__k { grid-column: 1; font-size: 13px; font-weight: 500; color: var(--ink-3); line-height: 1.3; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.fd-seg__v { grid-column: 1; font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-seg__chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 18px; color: var(--ink-4); transition: transform .2s var(--ease); }
.fd-seg[aria-expanded="true"] .fd-seg__chev { transform: rotate(180deg); }
.fd-seg.is-set .fd-seg__v { color: var(--forest); }
.fd-seg.is-set .fd-seg__k::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--forest); }
.fd-seg.is-locked .fd-seg__chev { opacity: .5; }

.fd-open { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--paper); cursor: pointer; user-select: none; transition: background-color .15s, border-color .15s; }
.fd-open:hover { border-color: var(--ink-4); }
.fd-open:has(input:checked) { background: var(--forest-tint); border-color: #b9cdbf; }
.fd-open input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fd-switch { position: relative; width: 36px; height: 22px; border-radius: 11px; background: var(--rule-2); transition: background-color .2s; flex: none; }
.fd-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 35, 28, .3); transition: transform .2s var(--ease); }
.fd-open input:checked + .fd-switch { background: var(--forest); }
.fd-open input:checked + .fd-switch::after { transform: translateX(14px); }
.fd-open:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; }
.fd-open__l { font-size: 15px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fd-open__l b { font-weight: 650; color: var(--ink); }

/* stuck: one compact row */
@media (min-width: 1024px) {
  .fd-barwrap.is-stuck .fd-sbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; }
  .fd-barwrap.is-stuck .fd-search { height: 58px; }
  .fd-barwrap.is-stuck .fd-search input { font-size: 17px; }
  .fd-barwrap.is-stuck .fd-search:focus-within { border-radius: 20px 0 0 20px; }
  .fd-barwrap.is-stuck .fd-segs { border-top: 0; border-left: 1px solid var(--rule); grid-template-columns: repeat(4, minmax(132px, max-content)); }
  .fd-barwrap.is-stuck .fd-seg__v { max-width: 200px; }
  .fd-barwrap.is-stuck .fd-try { display: none; }
  .fd-barwrap.is-stuck .fd-seg { padding: 0 12px 0 18px; grid-template-rows: auto; }
  .fd-barwrap.is-stuck .fd-seg__k { display: none; }
  .fd-barwrap.is-stuck .fd-seg__chev { grid-row: 1; }
  .fd-barwrap.is-stuck .fd-seg__v { font-size: 15px; display: flex; align-items: center; gap: 7px; }
  .fd-barwrap.is-stuck .fd-seg.is-set .fd-seg__v::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--forest); }
  .fd-barwrap.is-stuck .fd-kbd { display: none; }
}

/* ── layout ── */
.fd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 404px; gap: 32px; align-items: start; padding-top: 28px; padding-bottom: 72px; }
.fd-results { min-width: 0; }

/* results header */
.fd-rhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; min-height: 44px; }
.fd .fd-count { display: flex; align-items: baseline; gap: 8px; font: 600 17px var(--ui); color: var(--ink); }
.fd-count__n { font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1; letter-spacing: -.02em; color: var(--forest); font-variant-numeric: tabular-nums lining-nums; font-variation-settings: 'opsz' 72; }
.fd-delta { font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 3px 9px; border-radius: 999px; background: var(--field-2); opacity: 0; transform: translateY(2px); transition: opacity .25s, transform .25s var(--ease); font-variant-numeric: tabular-nums; }
.fd-delta.is-on { opacity: 1; transform: none; }
.fd-sort { margin-left: auto; position: relative; display: inline-flex; align-items: center; gap: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink-2); }
.fd-sort > svg:first-of-type { font-size: 17px; color: var(--ink-3); margin-right: 8px; }
.fd-sort > svg:last-child { font-size: 16px; color: var(--ink-3); pointer-events: none; margin-left: -22px; }
.fd-sort select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; height: 100%; padding: 0 28px 0 0; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; outline: 0; }
.fd-sort:focus-within { box-shadow: 0 0 0 2px var(--forest); border-color: transparent; }
.fd-sort:hover { border-color: var(--ink-4); }

/* ── the list ── */
.fd-list { list-style: none; margin: 0; padding: 0; }
.fd-group { display: flex; align-items: baseline; gap: 10px; padding: 30px 4px 12px; }
.fd-group.is-lead { padding-top: 2px; }
.fd .fd-group__t { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); font-variation-settings: 'opsz' 48; }
.fd-group__n { font-size: 14px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fd-group__note { margin-left: auto; font-size: 14px; color: var(--ink-3); text-align: right; }

.fd-row { position: relative; background: var(--paper); border: 1px solid var(--rule); border-top-width: 0; }
.fd-row.is-first { border-top-width: 1px; border-top-left-radius: 14px; border-top-right-radius: 14px; }
.fd-row.is-last { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
.fd-row.is-first .fd-row__hit { border-top-left-radius: 13px; border-top-right-radius: 13px; }
.fd-row.is-last .fd-row__hit { border-bottom-left-radius: 13px; border-bottom-right-radius: 13px; }
.fd-row__hit {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(112px, auto) 16px; column-gap: 16px; align-items: start;
  padding: 18px 16px 18px 20px; color: inherit; text-decoration: none; transition: background-color .12s;
}
.fd a.fd-row__hit { color: inherit; text-decoration: none; }
.fd-row__hit:hover { background: #fafaf6; }
.fd-row__hit:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--forest); }
.fd-row.is-sel .fd-row__hit { background: var(--forest-wash); box-shadow: inset 3px 0 0 var(--forest); }
.fd-row.is-sel .fd-row__hit:focus-visible { box-shadow: inset 3px 0 0 var(--forest), inset 0 0 0 2px var(--forest); }

/* funder monogram */
.fd-mono {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 11px; margin-top: 1px;
  font: 700 12.5px/1 var(--ui); letter-spacing: .03em; white-space: nowrap; overflow: hidden;
}
.fd-mono--federal { background: var(--forest); color: #fff; }
.fd-mono--provincial, .fd-mono--territorial { background: #fff; color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.fd-mono--municipal { background: var(--field-2); color: #4b4a40; }
.fd-mono--private { background: #e8eef1; color: #2e4655; }

.fd-row__main { min-width: 0; display: flex; flex-direction: column; }
.fd-row__title { font-size: 16.5px; line-height: 1.35; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.fd-row__hit:hover .fd-row__title { color: var(--forest); }
.fd-row__sum { margin-top: 4px; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.fd-row__meta { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.fd-type { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fd-type::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: .85; }
.fd-type--grant { background: var(--ty-grant-bg); color: var(--ty-grant-ink); }
.fd-type--tax-credit { background: var(--ty-tax-bg); color: var(--ty-tax-ink); }
.fd-type--loan { background: var(--ty-loan-bg); color: var(--ty-loan-ink); }
.fd-type--forgivable-loan { background: var(--ty-fl-bg); color: var(--ty-fl-ink); }
.fd-type--award { background: var(--ty-award-bg); color: var(--ty-award-ink); }
.fd-type--program { background: var(--ty-prog-bg); color: var(--ty-prog-ink); }
.fd-where { flex: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink-2); }
.fd-where svg { font-size: 14px; color: var(--ink-4); }
.fd-org { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }

.fd-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; text-align: right; padding-top: 1px; }
.fd-amt { font-size: 15.5px; line-height: 1.35; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; max-width: 184px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-st { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fd-st__dot { width: 7px; height: 7px; border-radius: 50%; background: #2f8a5a; }
.fd-st--between { color: var(--ink-3); }
.fd-st--between .fd-st__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.fd-st--soon .fd-st__dot { background: transparent; box-shadow: inset 0 0 0 1.5px #2f8a5a; }
.fd-st__n { padding: 2px 7px; border-radius: 6px; background: var(--field-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.fd-st__n.is-hot { background: #f8e1d6; color: #8a2f12; font-weight: 700; }
.fd-st__n.is-warn { background: #faf0d8; color: #6f4d06; }
.fd-row__go { align-self: center; font-size: 16px; color: var(--ink-4); opacity: 0; transform: translateX(-3px); transition: opacity .15s, transform .15s var(--ease); }
.fd-row__hit:hover .fd-row__go, .fd-row.is-sel .fd-row__go { opacity: 1; transform: none; }
.fd-row.is-sel .fd-row__go { color: var(--forest); }

/* empty state */
.fd-empty { background: var(--paper); border: 1px dashed var(--rule-2); border-radius: 20px; padding: 40px 36px; }
.fd .fd-empty__t { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.fd-empty__p { margin: 8px 0 18px; color: var(--ink-2); }
.fd-empty__opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fd-empty__opts button {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 52px; padding: 10px 16px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); font-size: 15.5px; font-weight: 500;
}
.fd-empty__opts button:hover { border-color: var(--forest); background: var(--forest-wash); }
.fd-empty__opts b { font-weight: 600; color: var(--forest); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── detail pane ── */
.fd-detail { position: sticky; top: calc(var(--navh) + var(--barh) + 20px); display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - var(--navh) - var(--barh) - 36px); }
.fd-pane { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border: 1px solid var(--rule); border-radius: 20px; outline: 0; }
.fd-pane__body { flex: 0 1 auto; min-height: 0; overflow: auto; padding: 26px 28px 22px; overscroll-behavior: contain; scrollbar-width: thin; }
.fd-pane__body.is-clipped { -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent); mask-image: linear-gradient(#000 calc(100% - 36px), transparent); }
.fd-pane__foot { flex: none; padding: 14px 28px 18px; border-top: 1px solid var(--rule); }
.fd-pane__foot .fd-btn { width: 100%; }
.fd-pane__hint { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.fd-d__head { display: flex; align-items: center; gap: 14px; }
.fd-d__head .fd-mono { width: 52px; height: 52px; border-radius: 13px; font-size: 14px; margin: 0; }
.fd-d__org { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-d__lvl { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.fd .fd-d__t { margin: 18px 0 0; font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.2; letter-spacing: -.012em; color: var(--ink); font-variation-settings: 'opsz' 48; text-wrap: balance; }
.fd-d__sum { margin: 10px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.fd-d__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.fd-d__fact { padding: 13px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.fd-d__fact--wide { grid-column: 1 / -1; }
.fd-d__fact dt { font-size: 13px; color: var(--ink-3); margin: 0 0 3px; }
.fd-d__fact dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-variant-numeric: tabular-nums; }
.fd-d__fact dd .fd-type { font-size: 13px; }
.fd-d__fact dd .fd-st__n { font-weight: 600; }
.fd-d__scales { margin: 20px 0 0; display: grid; gap: 12px; }
.fd-scale { display: grid; grid-template-columns: 112px auto minmax(0, 1fr); align-items: center; gap: 14px; font-size: 14px; }
.fd-scale__l { color: var(--ink-2); }
.fd-scale__bar { display: flex; gap: 3px; }
.fd-scale__bar i { width: 20px; height: 6px; border-radius: 3px; background: var(--field-2); }
.fd-scale__bar i.on { background: var(--forest-2); }
.fd-scale__w { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-d__flags { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.fd-d__flags li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.fd-d__flags svg { font-size: 17px; color: var(--forest-2); margin-top: 1px; }
.fd-d__cta { margin-top: 22px; }

.fd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px;
  font: 600 16px var(--ui); text-decoration: none; transition: background-color .15s, transform .1s;
}
.fd a.fd-btn--primary, .fd .fd-btn--primary { background: var(--forest); color: #fff; }
.fd a.fd-btn--primary:hover, .fd .fd-btn--primary:hover { background: #10291e; }
.fd .fd-btn--primary:active { transform: translateY(1px); }
.fd a.fd-btn--ghost { background: var(--paper); color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--forest); }
.fd-btn--block { width: 100%; }
.fd-btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.fd-textbtn { margin-top: 14px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* the handoff */
.fd-handoff { flex: none; border-radius: 20px; padding: 22px 26px 24px; border: 1px solid var(--rule); background: var(--paper); transition: background-color .3s, border-color .3s; }
.fd-handoff[data-state="idle"] .fd-handoff__ready, .fd-handoff[data-state="ready"] .fd-handoff__idle { display: none; }
.fd-handoff[data-state="ready"] { background: var(--forest-tint); border-color: #cfdcd3; }
.fd-handoff__lead { margin: 0; font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.25; color: var(--forest); letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.fd-handoff__idle .fd-handoff__lead { font-size: 18px; color: var(--ink); }
.fd-handoff__q { margin: 4px 0 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.fd-handoff__p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.fd-handoff .fd-btn { margin-top: 16px; width: 100%; }
.fd-handoff .fd-handoff__start { margin-top: 14px; min-height: 44px; width: auto; padding: 0 16px; font-size: 15px; border-radius: 10px; background: var(--paper); color: var(--forest); box-shadow: inset 0 0 0 1.5px var(--forest); }
.fd-handoff .fd-handoff__start:hover { background: var(--forest-wash); }

/* ── popover (desktop) / sheet (phone) ── */
.fd-pop {
  position: fixed; z-index: 60; width: 360px; max-height: min(560px, calc(100vh - 140px)); display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--pop-shadow); padding: 18px 12px 12px;
  transform-origin: top left;
}
.fd-pop.is-in { animation: fd-pop-in .18s var(--ease); }
@keyframes fd-pop-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.fd-pop.is-wide { width: 560px; }
.fd-pop__grab { display: none; }
.fd-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 8px 12px 10px; }
.fd .fd-pop__q { text-wrap: balance; font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
.fd-iconbtn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-3); font-size: 20px; flex: none; }
.fd-iconbtn:hover { background: var(--field); color: var(--ink); }
.fd-pop__head .fd-iconbtn { margin: -8px -4px -8px 0; }
.fd-pop__opts { overflow: auto; display: grid; grid-template-columns: 1fr; gap: 2px; padding: 2px; overscroll-behavior: contain; }
.fd-pop.is-wide .fd-pop__opts { grid-template-columns: 1fr 1fr; column-gap: 6px; }
.fd-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px 6px 10px; border-radius: 10px; font-size: 15.5px; color: var(--ink); }
.fd-opt:hover { background: var(--field); }
.fd-opt:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--forest); }
.fd-opt svg { font-size: 18px; color: var(--forest); stroke-width: 2.4; visibility: hidden; }
.fd-opt[aria-checked="true"] { background: var(--forest-wash); font-weight: 600; }
.fd-opt[aria-checked="true"] svg { visibility: visible; }
.fd-opt__l { min-width: 0; line-height: 1.3; }
.fd-opt__n { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.fd-opt.is-zero { color: var(--ink-3); }
.fd-opt--any { grid-column: 1 / -1; margin-bottom: 6px; }
.fd-pop__sep { grid-column: 1 / -1; height: 1px; background: var(--rule); margin: 2px 8px 6px; }
.fd-pop__note { grid-column: 1 / -1; margin: 8px 10px 2px; font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }
.fd-pop__foot { display: none; padding: 12px 4px 0; }
a.fd-opt { text-decoration: none; }

.fd-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(20, 35, 28, .42); }
.fd-scrim.is-in { animation: fd-fade .2s ease-out; }
@keyframes fd-fade { from { opacity: 0; } }

.fd-sheet { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; max-height: 90vh; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--pop-shadow); display: flex; flex-direction: column; }
.fd-sheet.is-in { animation: fd-up .28s var(--ease); }
@keyframes fd-up { from { transform: translateY(100%); } }
.fd-sheet__x { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--paper); }
.fd-sheet__body { overflow: auto; padding: 8px 22px 20px; overscroll-behavior: contain; min-height: 0; }
.fd-sheet__foot { flex: none; padding: 12px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); }
.fd-sheet__foot .fd-btn { width: 100%; }
.fd-sheet .fd-pop__grab, .fd-pop.is-sheet .fd-pop__grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--rule-2); margin: 10px auto 6px; flex: none; }

/* phone sticky bar */
.fd-mbar {
  position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 18px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--pop-shadow);
}
.fd-mbar.is-in { animation: fd-up .3s var(--ease); }
.fd-mbar__t { font-size: 15px; color: var(--ink-2); line-height: 1.3; min-width: 0; }
.fd-mbar .fd-btn { white-space: nowrap; flex: none; }
.fd-mbar__t b { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--forest); font-variant-numeric: tabular-nums lining-nums; }

/* ── what's in this directory ── */
.fd-about { border-top: 1px solid var(--rule); background: var(--paper); padding: 64px 0 56px; }
.fd-about__grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; }
.fd .fd-h2 { font-family: var(--display); font-weight: 600; font-size: 33px; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); font-variation-settings: 'opsz' 72; }
.fd .fd-h3 { font: 600 15px/1.35 var(--ui); color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.fd-h3__n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fd-about__lede { margin: 14px 0 0; font-size: 17px; line-height: 1.65; color: var(--ink-2); max-width: 64ch; }
.fd-about__lede strong { color: var(--ink); font-weight: 600; }
.fd-about__bars { display: grid; gap: 28px; margin-top: 32px; }
.fd-bar { display: flex; gap: 2px; height: 12px; margin: 12px 0 12px; border-radius: 6px; overflow: hidden; }
.fd-bar__seg { min-width: 3px; }
.fd-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--ink-2); }
.fd-legend li { display: inline-flex; align-items: center; gap: 7px; }
.fd-legend i { width: 9px; height: 9px; border-radius: 2px; }
.fd-legend__n { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.fd-ty--grant { background: var(--ty-grant); } .fd-ty--tax-credit { background: var(--ty-tax); } .fd-ty--loan { background: var(--ty-loan); }
.fd-ty--forgivable-loan { background: var(--ty-fl); } .fd-ty--award { background: var(--ty-award); } .fd-ty--program { background: var(--ty-prog); }
.fd-lv--federal { background: var(--forest); } .fd-lv--provincial { background: #5f7fa8; } .fd-lv--territorial { background: #9fb4cf; }
.fd-lv--municipal { background: #b5b09c; } .fd-lv--private { background: #d9d6ca; }
.fd-close { list-style: none; margin: 14px 0 0; padding: 0; }
.fd-close li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.fd-close li:last-child { border-bottom: 1px solid var(--rule); }
.fd-cal { display: grid; place-items: center; align-content: center; flex: none; width: 44px; height: 46px; border-radius: 10px; background: #faf0d8; color: #6f4d06; line-height: 1; }
.fd-cal.is-hot { background: #f8e1d6; color: #8a2f12; }
.fd-cal b { font: 600 18px var(--display); font-variant-numeric: lining-nums; }
.fd-cal span { font-size: 11.5px; font-weight: 600; margin-top: 3px; }
.fd-close__t { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.35; }
.fd-close__t a { color: var(--ink); font-weight: 600; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-close__t a:hover { color: var(--forest); text-decoration: underline; }
.fd-close__w { font-size: 13.5px; color: var(--ink-3); }
.fd-about__foot { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--rule); display: grid; gap: 6px; font-size: 14.5px; color: var(--ink-3); }
.fd-about__foot p { margin: 0; max-width: 92ch; }
.fd-about__foot a { color: var(--forest); font-weight: 500; }

/* motion */
.fd-row.is-enter { animation: fd-enter .26s var(--ease) both; }
@keyframes fd-enter { from { opacity: 0; transform: translateY(6px); } }
.fd-pane.is-swap > * { animation: fd-swap .22s var(--ease) both; }
@keyframes fd-swap { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .fd *, .fd *::before, .fd *::after { animation: none !important; transition: none !important; }
}

/* ── tablet: no master-detail; details open as a sheet ── */
@media (max-width: 1023px) {
  .fd-layout { grid-template-columns: minmax(0, 1fr); }
  .fd-detail { display: none; }
  .fd-row__go { opacity: 1; transform: none; }
  .fd-row.is-sel .fd-row__hit { background: transparent; box-shadow: none; }
  .fd-row.is-sel .fd-row__hit:hover { background: #fafaf6; }
  .fd-about__grid { grid-template-columns: 1fr; gap: 40px; }
  .fd-segs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fd-seg { padding-left: 18px; padding-right: 12px; }
  .fd-barwrap.is-stuck .fd-search { height: 54px; }
  .fd-barwrap.is-stuck .fd-seg__k { display: none; }
  .fd-barwrap.is-stuck .fd-seg { min-height: 50px; }
  .fd-barwrap.is-stuck .fd-seg__chev { grid-row: 1; }
}

/* ── phone ── */
@media (max-width: 719px) {
  .fd-wrap { padding: 0 16px; }
  .fd-hero { padding: 20px 0 14px; }
  .fd .fd-h1 { font-size: 33px; line-height: 1.06; letter-spacing: -.02em; }
  .fd-lede { display: none; }
  .fd-lede.fd-lede--short { display: block; font-size: 15.5px; margin-top: 8px; color: var(--ink-3); }
  .fd-crumbs { margin-bottom: 12px; }
  .fd-barwrap { position: relative; top: auto; padding: 0; }
  .fd-sbar { background: transparent; border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
  .fd-search { height: 54px; padding: 0 8px 0 16px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 14px; }
  .fd-search:focus-within { border-radius: 14px; border-color: transparent; }
  .fd-search input { font-size: 16.5px; }
  .fd-search > svg { font-size: 20px; }
  .fd-kbd { display: none; }
  .fd-segs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; margin: 10px 0 0; }
  .fd-seg { min-height: 54px; padding: 7px 10px 7px 14px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--paper); }
  .fd-seg:last-child { border-right: 1px solid var(--rule-2); }
  .fd-seg__k { font-size: 12px; }
  .fd-seg__v { font-size: 15px; font-weight: 600; }
  .fd-seg__chev { font-size: 16px; }
  .fd-seg.is-set { background: var(--forest-tint); border-color: #b9cdbf; }
  .fd-seg:not(.is-set) .fd-seg__v { color: var(--ink); }

  .fd-layout { padding-top: 14px; padding-bottom: 40px; }
  .fd-rhead { flex-wrap: nowrap; gap: 8px; margin-bottom: 4px; }
  .fd .fd-count { gap: 6px; font-size: 15px; white-space: nowrap; }
  .fd-open { height: 44px; padding: 0 10px 0 6px; gap: 7px; }
  .fd-open__l { font-size: 14px; }
  .fd-open__w { display: none; }

  .fd-count__n { font-size: 26px; }
  .fd-delta { display: none; }
  .fd-sort { margin-left: auto; flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; border-color: var(--rule); }
  .fd-sort > svg:first-of-type { margin: 0; font-size: 18px; }
  .fd-sort > svg:last-child { display: none; }
  .fd-sort select { position: absolute; inset: 0; width: 100%; opacity: 0; padding: 0; }
  .fd-group { padding-top: 18px; }
  .fd-group.is-lead { padding-top: 6px; }
  .fd-group { flex-wrap: wrap; padding: 24px 2px 10px; gap: 2px 8px; }
  .fd .fd-group__t { font-size: 20px; }
  .fd-group__note { margin-left: 0; width: 100%; text-align: left; font-size: 13.5px; margin-top: 2px; }

  .fd-row__hit { grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding: 16px 14px 16px 14px; }
  .fd-mono { width: 40px; height: 40px; border-radius: 10px; font-size: 11.5px; }
  .fd-row__title { font-size: 16px; }
  .fd-row__sum { -webkit-line-clamp: 2; font-size: 14px; }
  .fd-row__meta { margin-top: 10px; gap: 6px 12px; flex-wrap: wrap; }
  .fd-org { display: none; }
  .fd-row__side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; text-align: left; }
  .fd-amt { max-width: none; font-size: 15px; }
  .fd-row__side .fd-st { margin-left: auto; }
  .fd-row__go { display: none; }

  .fd-pop, .fd-pop.is-wide { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 86vh; border-radius: 22px 22px 0 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); border: 0; transform-origin: bottom; }
  .fd-pop.is-in { animation: fd-up .26s var(--ease); }
  .fd-pop.is-wide .fd-pop__opts { grid-template-columns: 1fr; }
  .fd-pop__note { display: none; }
  .fd-pop__head { padding: 4px 4px 10px 10px; }
  .fd-pop__foot { display: block; }
  .fd-pop .fd-pop__grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--rule-2); margin: 10px auto 8px; }
  .fd-opt { min-height: 48px; }

  .fd-about { padding: 44px 0 40px; }
  .fd .fd-h2 { font-size: 27px; }
  .fd-about__lede { font-size: 16px; }
}
@media (min-width: 1024px) {
  .fd-mbar { display: none !important; }
}

@media (max-width: 1023px) { .fd-body.has-mbar .gcx-footer { padding-bottom: 96px; } }
.fd-d__sub { flex-basis: 100%; font-size: 13.5px; font-weight: 400; color: var(--ink-3); }
.fd-d__muted { font-weight: 400; color: var(--ink-3); }

/* search suggestions */
.fd-try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.fd-try__l { font-size: 14px; color: var(--ink-3); margin-right: 2px; }
.fd .fd-try__b { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--rule-2); background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color .15s, border-color .15s; }
.fd .fd-try__b:hover { background: var(--paper); border-color: var(--ink-4); color: var(--ink); }
.fd-try__b span { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fd-try__b span:empty { display: none; }
@media (max-width: 719px) { .fd-try { display: none; } }

.fd-lede--short { display: none; }
@media (max-width: 1023px) and (min-width: 720px) { .fd-open__w { display: none; } }

/* rail value card */
.fd-value { background: var(--paper); border: 1px solid var(--rule); border-radius: 20px; padding: 26px 26px 22px; overflow: auto; min-height: 0; }
.fd-value__intro { padding-bottom: 22px; margin-bottom: 20px; border-bottom: 1px solid var(--rule); }
.fd .fd-value__t { margin: 0; font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.2; letter-spacing: -.012em; color: var(--forest); font-variation-settings: 'opsz' 48; }
.fd-value__p { margin: 8px 0 16px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.fd-value__intro .fd-btn { width: 100%; }
.fd-vlist { list-style: none; margin: 12px 0 0; padding: 0; }
.fd-vlist li { border-top: 1px solid var(--rule); }
.fd-vlist li:last-child { border-bottom: 1px solid var(--rule); }
.fd .fd-vlist a { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 6px; margin: 0 -6px; border-radius: 10px; color: inherit; text-decoration: none; }
.fd .fd-vlist a:hover { background: #fafaf6; }
.fd-vlist__t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fd-vlist__n { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd .fd-vlist a:hover .fd-vlist__n { color: var(--forest); }
.fd-vlist__w { font-size: 13px; color: var(--ink-3); }
.fd-vlist__none { padding: 14px 0; font-size: 14.5px; color: var(--ink-3); }
.fd-value__hint { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-3); }
.fd-pane__bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0 14px; }
.fd .fd-pane__back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 4px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--forest); }
.fd .fd-pane__back:hover { background: var(--forest-wash); }
.fd-pane__back svg { font-size: 18px; }
.fd .fd-pane__x { width: 40px; height: 40px; font-size: 18px; }
.fd-pane__bar + .fd-pane__body { padding-top: 10px; }

/* ── the field (from Haystack): one square per program ── */
.fd-field { background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 16px 18px 12px; margin: 0 0 20px; }
.fd-field__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6px, 1fr)); gap: 2px; }
.fd .sq { display: block; aspect-ratio: 1; min-width: 0; border-radius: 1.5px; background: #e4e2da; transition: background-color .32s ease-out; cursor: pointer; }
.fd .sq.on.t-grant, .fd-field__legend .sq.t-grant { background: var(--ty-grant); }
.fd .sq.on.t-tax-credit, .fd-field__legend .sq.t-tax-credit { background: var(--ty-tax); }
.fd .sq.on.t-loan, .fd-field__legend .sq.t-loan { background: var(--ty-loan); }
.fd .sq.on.t-forgivable-loan, .fd-field__legend .sq.t-forgivable-loan { background: var(--ty-fl); }
.fd .sq.on.t-award, .fd-field__legend .sq.t-award { background: var(--ty-award); }
.fd .sq.on.t-program, .fd-field__legend .sq.t-program { background: var(--ty-prog); }
.fd .sq.is-hot { position: relative; z-index: 1; box-shadow: 0 0 0 1.5px var(--paper), 0 0 0 3px var(--ink); }
.fd-field__legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-3); }
.fd-field__legend li { display: inline-flex; align-items: center; gap: 6px; }
.fd-field__legend .sq { width: 8px; height: 8px; aspect-ratio: auto; border-radius: 2px; cursor: default; }
.lg-s { display: none; }
.fd-field__legend b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fd-field__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--rule); min-height: 34px; }
.fd-field__dock { margin: 0; font-size: 13.5px; color: var(--ink-3); min-width: 0; flex: 1 1 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-field__dock.is-name b { color: var(--ink); font-weight: 600; margin-right: 8px; }
.fd-field__off { margin: 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fd-field__off [data-offn] { font-weight: 650; color: var(--ink); }
.fd .fd-linkbtn { display: inline; min-height: 0; padding: 0; font-size: 14px; font-weight: 600; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.fd .fd-linkbtn:hover { text-decoration-thickness: 2px; }

/* switched-off rows, shown on request */
.fd-row.is-off .fd-row__hit { background: #fbfbf8; }
/* switched off: faded by colour, not opacity, so every line still meets AA contrast */
.fd-row.is-off .fd-mono { background: var(--field-2); color: #4b4a40; box-shadow: none; }
.fd-row.is-off .fd-row__title, .fd-row.is-off .fd-amt { color: var(--ink-3); font-weight: 500; }
.fd-row.is-off .fd-type { filter: grayscale(1); }
.fd-row__why { display: none; }
.fd-row.is-off .fd-row__why { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 9px; border-radius: 6px; background: #f3ede4; color: #6b4a2e; font-size: 13px; font-weight: 600; line-height: 1.4; }
.fd-group[data-g="off"] .fd-group__t { color: var(--ink-2); }
.fd-row.is-flash .fd-row__hit { animation: fd-flash 1.4s ease-out; }
@keyframes fd-flash { 0%, 30% { box-shadow: inset 0 0 0 2px var(--forest); background: var(--forest-tint); } 100% { box-shadow: inset 0 0 0 2px transparent; } }

@media (max-width: 719px) {
  .fd-field { padding: 0; margin: 4px 0 6px; border: 0; border-radius: 0; background: transparent; }
  .lg-f { display: none; } .lg-s { display: inline; }
  .fd-field__legend { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .fd-group { padding-top: 14px; }
  .fd-field__grid { grid-template-columns: repeat(auto-fill, minmax(3px, 1fr)); gap: 1px; }
  .fd .sq { border-radius: .5px; cursor: default; }
  .fd-field__legend { margin-top: 7px; gap: 2px 9px; font-size: 11.5px; }
  .fd-field__legend b { display: none; }
  .fd-field__legend .sq { width: 6px; height: 6px; }
  .fd-field__legend li { gap: 4px; }
  .fd-field__foot { border-top: 0; padding-top: 0; min-height: 0; margin-top: 4px; }
  .fd-field__dock { display: none; }
  .fd-field__off { font-size: 13.5px; }
  .fd-field__off .fd-linkbtn { font-size: 13.5px; display: inline-block; min-height: 32px; line-height: 32px; }
  .fd-hero { padding-top: 16px; padding-bottom: 12px; }
  .fd-search { height: 50px; }
  .fd-segs { gap: 6px; margin-top: 8px; }
  .fd-seg { min-height: 50px; padding-top: 5px; padding-bottom: 5px; }
  .fd-layout { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .fd .sq { transition: none; } }

.fd-field__foot.is-hover .fd-field__off { display: none; }
.fd-field__foot.is-hover .fd-field__dock { flex-basis: 100%; }
.fd-handoff[data-state="ready"] { order: -1; }

/* ── polish round: the field breathes ── */
.fd-field { padding: 28px 30px 22px; margin: 0 0 28px; border-radius: 20px; }
.fd-field__grid { grid-template-columns: repeat(auto-fill, minmax(9px, 1fr)); gap: 3px; }
.fd .sq { border-radius: 2px; }
.fd-field__legend { margin-top: 22px; gap: 10px 24px; font-size: 14px; }
.fd-field__legend .sq { width: 10px; height: 10px; border-radius: 2.5px; }
.fd-field__legend li { gap: 8px; }
.fd-field__foot { margin-top: 18px; padding-top: 16px; min-height: 0; }
.fd-field__dock { font-size: 14px; }
.fd-opt__l small { display: block; margin-top: 1px; font-size: 13px; font-weight: 400; color: var(--ink-3); line-height: 1.35; }
.fd-opt[aria-checked="true"] .fd-opt__l small { color: var(--ink-2); }
.fd-pop:not(.is-wide) .fd-opt { min-height: 52px; }
.fd .fd-opt--edit { grid-template-columns: 92px minmax(0, 1fr) auto; min-height: 56px; padding: 8px 12px; }
.fd-opt__k { font-size: 13px; color: var(--ink-3); }
.fd-opt--edit .fd-opt__l { font-weight: 600; }
.fd-opt--edit .fd-opt__n { color: var(--forest); font-weight: 600; font-size: 14px; }
.fd-opt--edit[disabled] .fd-opt__n { color: var(--ink-4); font-weight: 400; }
.fd-prog { display: flex; gap: 3px; margin: 12px 0 10px; }
.fd-prog i { flex: 1; height: 6px; border-radius: 3px; background: #d2dcd4; }
.fd-prog i.on { background: var(--forest); }
.fd-mbar__sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.fd-mbar__t b { font-family: var(--display); }
.fd-sum { display: none; }

@media (max-width: 719px) {
  .fd-field { padding: 16px 14px 14px; margin: 6px 0 14px; border: 1px solid var(--rule); border-radius: 16px; background: var(--paper); }
  .fd-field__grid { grid-template-columns: repeat(auto-fill, minmax(6px, 1fr)); gap: 2px; }
  .fd .sq { border-radius: 1.5px; }
  .fd-field__legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 14px; font-size: 12.5px; white-space: normal; overflow: visible; }
  .fd-field__legend li { gap: 6px; min-width: 0; }
  .fd-field__legend b { display: inline; margin-left: auto; }
  .fd-field__legend .sq { width: 8px; height: 8px; flex: none; }
  .fd-field__foot { margin-top: 0; padding-top: 0; border-top: 0; }
  .fd-field__off:not([hidden]) { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); width: 100%; }
  .fd-try { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 10px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
  .fd-try::-webkit-scrollbar { display: none; }
  .fd .fd-try__b { flex: none; min-height: 36px; background: var(--paper); }
  .fd-sum { position: fixed; z-index: 45; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 16px; background: var(--paper); border: 0; border-bottom: 1px solid var(--rule); box-shadow: 0 8px 20px -14px rgba(20, 35, 28, .35); font: inherit; text-align: left; cursor: pointer; }
  .fd-sum[hidden] { display: none; }
  .fd-sum.is-in { animation: fd-down .22s var(--ease); }
  .fd-sum__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
  .fd-sum__t::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--forest); }
  .fd-sum__e { flex: none; font-size: 14px; font-weight: 600; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
}
@keyframes fd-down { from { transform: translateY(-100%); opacity: 0; } }

@media (max-width: 719px) {
  .fd-off-long { display: none; }
  .fd-seg { min-height: 48px; padding-top: 4px; padding-bottom: 4px; }
  .fd .fd-try__b { min-height: 34px; }
  .fd-try { margin-top: 8px; }
  .fd-field { padding-top: 14px; }
  .fd-field__legend { margin-top: 12px; gap: 6px 10px; }
  .fd-rhead { margin-bottom: 2px; }
}

.fd-pop:not(.is-wide) { width: 400px; }
.fd-field__legend { gap: 10px 20px; font-size: 13.5px; }
@media (max-width: 719px) { .fd-pop:not(.is-wide) { width: auto; } }
@media (min-width: 720px) {
  .fd-field__legend { display: grid; grid-template-columns: repeat(3, max-content); gap: 10px 40px; }
}
.fd-handoff[data-state="idle"] { display: none; }

/* ── production additions (2026-10-04) ── */
/* icons drawn by CSS, not repeated as inline SVG in ~880 rows */
.fd-where::before { content: ''; flex: none; width: 14px; height: 14px; background: var(--ink-4);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E") center / contain no-repeat; }
.fd-row__go { width: 16px; height: 16px; position: relative; }
.fd-row__go::before { content: ''; position: absolute; left: 3px; top: 4px; width: 7px; height: 7px; border-right: 1.9px solid currentColor; border-top: 1.9px solid currentColor; transform: rotate(45deg); border-radius: 1px; }

/* who can apply: positive public evidence only (builder) */
.fd-row__who { margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-row__whok { color: var(--ink-3); }
.fd-row.is-off .fd-row__who, .fd-row.is-off .fd-row__who .fd-row__whok { color: var(--ink-3); }

/* route to the curated guide (desktop hero line; the about foot carries it on every width) */
.fd-guide { margin: 12px 0 0; font-size: 15px; color: var(--ink-3); }
.fd-guide a { color: var(--forest); font-weight: 600; }
@media (max-width: 719px) { .fd-guide { display: none; } }

/* letter groups (A to Z sort) are plain headings */
.fd-group[data-gs="3"] .fd-group__t { font-size: 20px; }

/* other directories */
.fd-dirs { margin-top: 18px; display: grid; gap: 10px; }
.fd-dirs .fd-h3 { margin: 0 0 2px; }
.fd-dirs__row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fd-dirs a, .fd-dirs [aria-current] { font-size: 14.5px; min-height: 24px; display: inline-flex; align-items: center; }
.fd-dirs [aria-current] { color: var(--ink); font-weight: 600; }
.fd-close__none { margin: 14px 0 0; font-size: 14.5px; color: var(--ink-3); }

/* phone: after narrowing, the switched-off squares fold into a compact heap so the list comes up sooner */
.fd-heap { display: none; }
@media (max-width: 719px) {
  .fd-field.is-narrow .fd-field__grid .sq:not(.on) { display: none; }
  .fd-field.is-narrow .fd-heap:not([hidden]) { display: block; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--rule-2); }
  .fd-heap__t { display: flex; flex-wrap: wrap; gap: 1px; }
  .fd-heap__t i { width: 2px; height: 2px; background: #d6d3c8; }
  .fd-field.is-narrow { padding-top: 12px; padding-bottom: 8px; }
  .fd-field.is-narrow .fd-heap:not([hidden]) { margin-top: 8px; padding-top: 6px; }
  .fd-field.is-narrow .fd-field__legend { margin-top: 8px; row-gap: 4px; }
  .fd-field.is-narrow .fd-field__off:not([hidden]) { margin-top: 8px; padding-top: 6px; }
}

/* the sitewide verdict bar never renders here (body[data-no-verdict-bar]); belt and braces */
body.fd-body .verdict-bar { display: none !important; }

.fd-opt[aria-current="page"] { background: var(--forest-wash); font-weight: 600; }
.fd-opt[aria-current="page"] svg { visibility: visible; }
.fd-mbar__t [data-mk] { font-weight: 650; color: var(--ink); }

/* the per-group cap: "Show all N …" after the 12th row of a group (rows past it stay in the HTML) */
.fd-more { list-style: none; padding: 10px 0 0; }
.fd .fd-more__b { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 16px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--paper); font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--forest); text-align: center; transition: background-color .15s, border-color .15s; }
.fd .fd-more__b:hover { border-color: var(--forest); background: var(--forest-wash); }
.fd .fd-more__b svg { font-size: 17px; }
.fd-field__legend li[hidden] { display: none; }

/* switched-off rows: the reason is the strongest thing on the row (7A2E12 on FFF1E8, about 9:1) */
.fd-row.is-off .fd-row__why { background: #fff1e8; color: #7a2e12; font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1px #f3d2bf; }

/* Switched-off rows are a diagnosis, not a second catalogue (2026-10-05 QA): one line each, the
   title plus the reason. No summary, no amount, no green "open" dot on a program that is not for you. */
.fd-row.is-off .fd-row__sum, .fd-row.is-off .fd-row__who, .fd-row.is-off .fd-row__meta,
.fd-row.is-off .fd-amt, .fd-row.is-off .fd-st { display: none; }
.fd-row.is-off .fd-row__hit { padding-top: 10px; padding-bottom: 10px; }
.fd-row.is-off .fd-row__why { margin-top: 6px; }
/* an amount with no figure ("Not published", "Varies by CFDC") is a note, not a number */
.fd-amt.fd-amt--text { font-weight: 400; color: var(--ink-3); }
