/* ============================================================
   financeb2b — design system v2
   Modern fintech editorial: dense, tabular, monospace numerals,
   hairline borders, warm neutrals, subtle green accent.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* type */
  --f-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-sans: "Inter Tight", "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --f-mono: "DM Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* warm neutrals */
  --ink-900: oklch(18% 0.012 250);
  --ink-700: oklch(32% 0.010 250);
  --ink-500: oklch(52% 0.006 250);
  --ink-400: oklch(65% 0.006 250);
  --ink-300: oklch(80% 0.005 250);
  --hair:    oklch(90% 0.004 85);
  --hair-2:  oklch(94% 0.004 85);
  --surface: oklch(98.5% 0.006 85);
  --surface-2: oklch(96.5% 0.008 85);
  --bg:      oklch(99.2% 0.004 85);
  --ink-on-accent: oklch(99% 0.004 85);

  /* accent: graphite-green */
  --accent: oklch(52% 0.12 162);
  --accent-ink: oklch(38% 0.12 162);
  --accent-soft: color-mix(in oklch, var(--accent) 14%, var(--surface));

  /* status */
  --pos: oklch(55% 0.12 152);
  --neg: oklch(55% 0.15 28);
  --warn: oklch(68% 0.14 75);

  /* geometry */
  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 8px;
}

/* ---------- base resets (scoped to fb-root) ---------- */
.fb-root {
  color: var(--ink-900);
  background: var(--bg);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
.fb-root h1, .fb-root h2, .fb-root h3, .fb-root h4 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.fb-root p { margin: 0; }
.fb-root a { color: inherit; text-decoration: none; }
.fb-root ul, .fb-root ol { margin: 0; padding: 0; list-style: none; }
.fb-root button { font: inherit; cursor: pointer; }

/* monospace numerals */
.fb-root .num,
.fb-root .mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- layout primitives ---------- */
.fb-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
.fb-rule { height: 1px; background: var(--hair); border: 0; margin: 0; }
.fb-hr-thick { height: 1px; background: var(--ink-900); border: 0; margin: 0; }

/* type scale */
.fb-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-500);
  font-weight: 500;
}
.fb-kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.fb-display {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink-900);
}
.fb-display em { font-style: italic; color: var(--accent-ink); }
.fb-h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.fb-h3 {
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.fb-lead {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-700);
  max-width: 60ch;
}

/* ---------- site chrome ---------- */
.fb-topbar {
  border-bottom: 1px solid var(--hair);
  background: var(--bg);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-500);
}
.fb-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
}
.fb-topbar a { color: var(--ink-500); margin-left: 18px; }
.fb-topbar a:hover { color: var(--ink-900); }
.fb-topbar .frn { color: var(--ink-700); }
.fb-topbar-right { display: flex; align-items: center; }

.fb-header {
  border-bottom: 1px solid var(--hair);
  background: rgba(252, 251, 249, 0.92);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fb-header-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 64px;
}
.fb-logo {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
}
.fb-logo .logo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin: 0 4px 2px 0;
  transform: translateY(-2px);
  flex-shrink: 0;
}
.fb-logo .logo-tld {
  color: var(--ink-500);
  font-size: 13px;
  font-family: var(--f-mono);
  letter-spacing: 0;
  margin-left: 4px;
}
.fb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.fb-nav a {
  font-size: 14px;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.fb-nav a:hover { color: var(--ink-900); }
.fb-nav a.active { color: var(--ink-900); }
.fb-nav-plain {
  padding: 6px 12px;
}

/* nav item wrapper (for dropdown) */
.fb-nav-item {
  position: relative;
}
.fb-nav-item > a {
  padding: 6px 12px;
  border-radius: 4px;
}
.fb-nav-item.is-active > a { color: var(--ink-900); }
.fb-nav-item > a:hover { background: var(--surface); color: var(--ink-900); }

/* invisible bridge that fills the gap between the link and dropdown panel,
   preventing the hover state from being lost as the mouse crosses the gap */
.fb-has-drop::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px; /* must be >= the top offset of .fb-drop */
  background: transparent;
}

/* caret */
.fb-nav-caret {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.55;
  display: inline-block;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.fb-nav-item:hover .fb-nav-caret,
.fb-nav-item.drop-open .fb-nav-caret {
  transform: rotate(225deg) translateY(2px);
  opacity: 0.8;
}

/* dropdown panel */
.fb-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--bg);
  border: 1px solid var(--hair);
  box-shadow: 0 8px 24px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
  padding: 6px 0;
  z-index: 300;
  visibility: hidden;
  opacity: 0;
  transform: translateY(4px);
  /* slight delay on hide so mouse can cross from link to panel without flicker */
  transition: opacity .12s ease, visibility 0s linear .18s, transform .12s ease;
  pointer-events: none;
}
.fb-drop a {
  display: block;
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--ink-700) !important;
  white-space: nowrap;
  border-radius: 0;
  background: transparent !important;
}
.fb-drop a:hover {
  color: var(--ink-900) !important;
  background: var(--surface) !important;
}
.fb-nav-item:hover .fb-drop,
.fb-nav-item.drop-open .fb-drop {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  /* no delay on show */
  transition: opacity .12s ease, visibility 0s linear 0s, transform .12s ease;
}
.fb-header-cta {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- buttons ---------- */
.fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .15s ease;
  font-family: var(--f-sans);
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.fb-btn-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.fb-btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #fff !important;
}
.fb-btn-secondary {
  background: transparent;
  color: var(--ink-900);
  border-color: var(--ink-300);
}
.fb-btn-secondary:hover { border-color: var(--ink-900); color: var(--ink-900); }
.fb-btn-ghost {
  background: transparent;
  color: var(--ink-900);
  padding: 9px 0;
  border: none;
}
.fb-btn-ghost:hover { color: var(--accent-ink); }
.fb-btn-lg { padding: 13px 22px; font-size: 15px; }
.fb-btn .arr { transition: transform .15s ease; }
.fb-btn:hover .arr { transform: translateX(3px); }

/* ---------- inline SVG icons ---------- */
.fb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- cards ---------- */
.fb-card {
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  transition: border-color .15s ease;
}
.fb-card:hover { border-color: var(--ink-400); }
.fb-card-flat {
  background: var(--surface-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
}

/* ---------- tables ---------- */
.fb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.fb-table th,
.fb-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
.fb-table thead th {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-500);
  font-weight: 500;
  border-bottom: 1px solid var(--ink-900);
  padding: 10px 16px;
}
.fb-table tr.section-row td {
  background: var(--surface-2);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-700);
  padding: 8px 16px;
  border-bottom: 1px solid var(--hair);
}
.fb-table td.num,
.fb-table td.mono {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.fb-table tbody tr:hover { background: var(--surface-2); }
.fb-table td .muted { color: var(--ink-500); }
.fb-table .rail-name { font-weight: 500; color: var(--ink-900); }
.fb-table .rail-sub { color: var(--ink-500); font-size: 12px; margin-top: 2px; }
.fb-table .tag {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  color: var(--ink-700);
  letter-spacing: 0.06em;
}
.fb-table .tag.pos {
  border-color: color-mix(in oklch, var(--pos) 50%, var(--hair));
  color: var(--pos);
}
.fb-table .tag.warn {
  border-color: color-mix(in oklch, var(--warn) 50%, var(--hair));
  color: color-mix(in oklch, var(--warn) 70%, var(--ink-900));
}

/* ---------- badges ---------- */
.fb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-700);
  background: var(--bg);
}
.fb-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); }
.fb-badge.accent .dot { background: var(--accent); }

/* ---------- sections ---------- */
.fb-section {
  padding: 96px 0;
  border-top: 1px solid var(--hair);
}
.fb-section.dense { padding: 64px 0; }
.fb-section.first { border-top: 0; padding-top: 64px; }
.fb-section.hero { padding: 64px 0 80px; }
.fb-section.dark {
  background: var(--ink-900);
  color: var(--surface);
  border-top-color: var(--ink-900);
}
.fb-section.dark h2,
.fb-section.dark h3 { color: var(--surface); }
.fb-section.dark .fb-eyebrow,
.fb-section.dark .fb-kicker { color: var(--ink-400); }
.fb-section.dark .fb-lead { color: var(--ink-300); }
.fb-section.dark .fb-btn-primary { background: var(--accent); color: #fff; }
.fb-section.dark .fb-btn-secondary { border-color: var(--ink-500); color: var(--surface); }

.fb-section-head {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink-900);
}
.fb-section-head .num-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-500);
  text-transform: uppercase;
}
.fb-section-head h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.fb-section-head .lead {
  color: var(--ink-700);
  font-size: 16px;
  line-height: 1.5;
  max-width: 58ch;
  margin-top: 16px;
}

/* ---------- rail selector ---------- */
.fb-rail-selector {
  border: 1px solid var(--ink-900);
  border-radius: var(--r-md);
  background: var(--bg);
}
.fb-rail-selector .rs-row { display: flex; }
.fb-rail-selector .rs-field {
  flex: 1;
  padding: 16px 20px;
  border-right: 1px solid var(--hair);
}
.fb-rail-selector .rs-field:last-child { border-right: 0; }
.fb-rail-selector .rs-label {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-500);
  margin-bottom: 6px;
}
.fb-rail-selector .rs-value {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.fb-rail-selector .rs-value .rs-caret {
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--ink-500);
  border-bottom: 1px solid var(--ink-500);
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
}
.fb-rail-selector .rs-result {
  background: var(--ink-900);
  color: var(--bg);
  padding: 20px 24px;
  border-top: 1px solid var(--ink-900);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 32px;
  align-items: center;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.rs-rail-name {
  font-family: var(--f-display);
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--bg);
}
.rs-rail-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-300);
  margin-top: 6px;
}
.rs-metric .rs-metric-k {
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-400);
  margin-bottom: 4px;
}
.rs-metric .rs-metric-v {
  font-family: var(--f-mono);
  font-size: 20px;
  color: var(--bg);
  font-variant-numeric: tabular-nums;
}
.rs-send-btn {
  background: var(--bg) !important;
  color: var(--ink-900) !important;
  border-color: var(--bg) !important;
}
.rs-send-btn:hover {
  background: var(--surface-2) !important;
}
.fb-rail-note {
  margin-top: 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.06em;
}

/* ---------- decision matrix ---------- */
.fb-matrix {
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  overflow: hidden;
}
.fb-matrix .mx-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-bottom: 1px solid var(--hair);
}
.fb-matrix .mx-row:last-child { border-bottom: 0; }
.fb-matrix .mx-scenario {
  padding: 20px;
  background: var(--surface-2);
  border-right: 1px solid var(--hair);
}
.fb-matrix .mx-scenario .mx-title {
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-900);
}
.fb-matrix .mx-scenario .mx-sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 4px;
}
.fb-matrix .mx-answer {
  padding: 20px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: center;
}
.fb-matrix .mx-pick {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--ink-900);
}
.fb-matrix .mx-why {
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.55;
}

/* ---------- gotchas ---------- */
.fb-gotcha {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--hair);
}
.fb-gotcha:last-child { border-bottom: 0; }
.fb-gotcha .gt-n {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.12em;
  padding-top: 4px;
}
.fb-gotcha .gt-body h4 {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-900);
  margin-bottom: 6px;
}
.fb-gotcha .gt-body p {
  font-size: 14px;
  color: var(--ink-700);
  line-height: 1.6;
  max-width: 68ch;
}

/* ---------- stats strip ---------- */
.fb-stats-strip {
  margin-top: 64px;
  border-top: 1px solid var(--ink-900);
  border-bottom: 1px solid var(--hair);
  display: grid;
  padding-top: 24px;
}
.fb-stat {
  padding: 4px 24px 24px;
  border-right: 1px solid var(--hair);
}
.fb-stat:last-child { border-right: 0; }
.fb-stat-v {
  font-family: var(--f-mono);
  font-size: 40px;
  margin-top: 12px;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.fb-stat-d {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 8px;
  line-height: 1.5;
  max-width: 28ch;
}

/* ---------- footer ---------- */
.fb-footer {
  background: var(--ink-900);
  color: var(--ink-300);
  padding: 72px 0 32px;
  font-size: 13px;
}
.fb-footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-400);
  margin-bottom: 16px;
  font-weight: 500;
}
.fb-footer a {
  color: var(--ink-300);
  display: block;
  padding: 4px 0;
  text-decoration: none;
}
.fb-footer a:hover { color: var(--bg); }
.fb-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid oklch(28% 0.012 250);
}
.fb-footer-brand p {
  color: var(--ink-400);
  margin-top: 16px;
  max-width: 42ch;
  line-height: 1.5;
}
.fb-footer-brand .fb-logo {
  color: var(--bg);
}
.fb-footer-brand .fb-logo .logo-tld { color: var(--ink-400); }
.fb-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-400);
}
.fb-footer-bottom a {
  display: inline;
  margin-left: 20px;
  color: var(--ink-400);
  padding: 0;
}
.fb-footer-bottom a:hover { color: var(--bg); }
.fb-footer-regulatory {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid oklch(28% 0.012 250);
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink-400);
  line-height: 1.6;
  max-width: 960px;
}
.fb-footer-regulatory strong {
  color: var(--ink-300);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- dark code block ---------- */
.fb-code {
  background: oklch(14% 0.012 250);
  border: 1px solid oklch(28% 0.012 250);
  border-radius: 5px;
  padding: 24px;
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-300);
}
.fb-code .code-url {
  color: var(--ink-400);
  margin-bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.fb-code .code-key { color: oklch(75% 0.1 85); }
.fb-code .code-val { color: oklch(80% 0.12 160); }
.fb-code .code-result {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid oklch(28% 0.012 250);
  color: var(--ink-400);
}

/* ---------- integration list ---------- */
.fb-integration-item {
  padding: 20px 0;
  border-bottom: 1px solid oklch(28% 0.012 250);
}
.fb-integration-item h4 { color: var(--surface); font-size: 17px; font-weight: 500; }
.fb-integration-item p { color: var(--ink-300); font-size: 14px; margin-top: 6px; line-height: 1.6; }

/* ---------- mobile ---------- */
.fb-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.fb-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink-900);
  transition: all .2s ease;
}

@media (max-width: 1024px) {
  .fb-container { padding: 0 20px; }
  .fb-section { padding: 64px 0; }
  .fb-section.hero { padding: 48px 0 64px; }
  .fb-section-head { grid-template-columns: 1fr; gap: 24px; }
  .fb-display { font-size: clamp(32px, 8vw, 56px); }
  .fb-stats-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .fb-stat:nth-child(2n) { border-right: 0; }
  .fb-stat { padding: 12px 16px 20px; }
  .fb-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  .fb-nav { display: none; }
  .fb-mobile-toggle { display: flex; }
  .fb-header-cta { display: none; }
  .fb-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 96px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hair);
    padding: 16px 20px 24px;
    gap: 0;
    z-index: 99;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
  .fb-nav.open .fb-nav-item { width: 100%; }
  .fb-nav.open .fb-nav-item > a,
  .fb-nav.open .fb-nav-plain {
    font-size: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hair);
    width: 100%;
    background: transparent !important;
    border-radius: 0;
  }
  /* Mobile dropdown */
  .fb-nav.open .fb-drop {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--hair);
    padding: 0;
    display: none;
    background: var(--surface);
  }
  .fb-nav.open .fb-nav-item.drop-open .fb-drop { display: block; }
  .fb-nav.open .fb-drop a {
    font-size: 14px !important;
    padding: 10px 16px !important;
    color: var(--ink-600) !important;
    border-bottom: none;
  }
  .fb-nav.open .fb-drop a:hover { color: var(--ink-900) !important; }
}

@media (max-width: 768px) {
  .fb-rail-selector .rs-row { flex-direction: column; }
  .fb-rail-selector .rs-field { border-right: 0; border-bottom: 1px solid var(--hair); }
  .fb-rail-selector .rs-result { grid-template-columns: 1fr 1fr; gap: 16px; }
  .fb-matrix .mx-row { grid-template-columns: 1fr; }
  .fb-matrix .mx-answer { grid-template-columns: 1fr; }
  .fb-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .fb-topbar-right { display: none; }
  .fb-h2 { font-size: 30px; }
}

/* ---------- utils ---------- */
.fb-mt-4 { margin-top: 16px; }
.fb-mt-6 { margin-top: 24px; }
.fb-mt-8 { margin-top: 32px; }
.fb-dim { color: var(--ink-500); }
.fb-accent-ink { color: var(--accent-ink); }
.fb-flex { display: flex; }
.fb-gap-2 { gap: 8px; }
.fb-gap-3 { gap: 12px; }
.fb-items-center { align-items: center; }

/* ---------- CTA bottom block ---------- */
.fb-cta-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--ink-900);
}
@media (max-width: 768px) {
  .fb-cta-block {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 32px;
    align-items: start;
  }
}

/* ---------- responsive grid helpers ----------
   Replace inline grid-template-columns styles with these classes
   so they collapse correctly on mobile/tablet.
*/

/* Hero: copy left / sidebar right (e.g. FX widget) */
.fb-grid-hero {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 72px;
  align-items: end;
}

/* Trust strip: kicker label + 4 metric cells */
.fb-grid-trust {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr 1fr;
  gap: 24px;
  align-items: center;
}

/* 3-column card row */
.fb-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* 4-column row (industries strip with internal borders) */
.fb-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* Generic split 1:1 */
.fb-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
}

/* Articles: feature first, two standard */
.fb-grid-articles {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
}

/* Tablet — collapse multi-column rows to 2 cols */
@media (max-width: 1024px) {
  .fb-grid-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: stretch;
  }
  .fb-grid-trust {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }
  .fb-grid-trust > .fb-kicker {
    grid-column: 1 / -1;
  }
  .fb-grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .fb-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  /* second column items lose their right border on tablet */
  .fb-grid-4 > .fb-grid-cell:nth-child(2n) {
    border-right: 0 !important;
  }
  .fb-grid-4 > .fb-grid-cell:nth-child(-n+2) {
    border-bottom: 1px solid var(--hair);
  }
  .fb-grid-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .fb-grid-articles {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .fb-grid-articles > a:first-child {
    grid-column: 1 / -1;
  }
}

/* Mobile — full single-column stack */
@media (max-width: 640px) {
  .fb-grid-trust {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .fb-grid-trust > div[style*="border-left"] {
    border-left: 0 !important;
    padding-left: 0 !important;
    border-top: 1px solid var(--hair);
    padding-top: 12px;
  }
  .fb-grid-3,
  .fb-grid-articles {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .fb-grid-4 {
    grid-template-columns: 1fr;
  }
  .fb-grid-4 > .fb-grid-cell {
    border-right: 0 !important;
    border-bottom: 1px solid var(--hair);
  }
  .fb-grid-4 > .fb-grid-cell:last-child {
    border-bottom: 0;
  }
}

/* Hero FX widget: keep readable on small screens */
@media (max-width: 1024px) {
  .fb-hero-widget {
    max-width: 480px;
    width: 100%;
  }
}

/* Section padding tightens on mobile */
@media (max-width: 640px) {
  .fb-section { padding: 56px 0; }
  .fb-section.dense { padding: 44px 0; }
  .fb-section.hero { padding: 32px 0 48px; }
  .fb-section.first { padding-top: 32px; }
  .fb-h2 { font-size: 26px; }
  .fb-lead { font-size: 16px; }
  .fb-display { font-size: clamp(28px, 9vw, 40px); }
}

/* Buttons stretch on very small screens */
@media (max-width: 480px) {
  .fb-btn-lg { width: 100%; justify-content: center; }
  .fb-btn-lg .arr { margin-left: auto; }
}

/* Table — allow horizontal scroll if needed instead of breaking layout */
@media (max-width: 768px) {
  .fb-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .fb-table { min-width: 560px; }
  .fb-table th,
  .fb-table td { padding: 12px 14px; font-size: 13px; }
}

/* ============================================================
   GLOBAL MOBILE SAFETY NET
   Catches inline grid styles and other patterns that don't have
   their own responsive overrides on resource/how-to/guide pages.
   ============================================================ */

/* Tablet (<=768px): inline grids with 3+ columns collapse to 2 */
@media (max-width: 768px) {
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:1.2fr 1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr 1fr"],
  [style*="grid-template-columns:1.1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Mobile (<=640px): collapse everything to single column */
@media (max-width: 640px) {
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:1.2fr 1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1.1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns:1fr 400px"],
  [style*="grid-template-columns: 1fr 400px"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  /* Big inline gaps tighten on mobile */
  [style*="gap:48px"],
  [style*="gap: 48px"],
  [style*="gap:72px"],
  [style*="gap: 72px"] {
    gap: 24px !important;
  }
}

/* Long monospace strings (IBANs, CSV samples, code) — let them scroll
   horizontally inside their container instead of stretching the page. */
@media (max-width: 768px) {
  pre,
  code,
  [style*="font-family: monospace"],
  [style*="font-family:monospace"] {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    word-break: break-word;
  }
  /* Ensure flex/grid items can actually shrink below intrinsic content size */
  main * {
    min-width: 0;
  }
  /* Avoid horizontal scroll appearing at the page level */
  html, body { overflow-x: hidden; }
}
