/* Migration funding pages (MigFund External, MigFund Internal, Country Deep
   Dive, NDICI), 18 Oct 2026. Classes prefixed mf-; the charts come from
   static/js/prism_grapher.js and its stylesheet. White cards on a cool slate
   ground, one blue accent rule, hairlines, no shadows. */
body.mf-body { background: #F4F6F8; color: #0B1B33; font-family: 'Inter', system-ui, -apple-system, sans-serif; margin: 0; }
.mf-body *, .mf-body *::before, .mf-body *::after { box-sizing: border-box; }

.mf-wrap { --prism-shadow: none; --prism-radius: 10px; --prism-border: rgba(11, 27, 51, 0.14);
  max-width: 1180px; margin: 0 auto; padding: 0 16px 56px; }

/* section tabs, sticky under the site header */
.mf-tabs { position: sticky; top: var(--site-nav-h, 0px); z-index: 40; background: #fff; border-bottom: 1px solid rgba(11, 27, 51, 0.14); }
.mf-tabs-in { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mf-tabs-in::-webkit-scrollbar { display: none; }
.mf-tabs a { display: inline-flex; align-items: baseline; gap: 8px; padding: 14px 14px 12px; min-height: 48px; white-space: nowrap; text-decoration: none;
  font: 600 14px/1.2 'Inter', sans-serif; color: #4A5972; border-bottom: 3px solid transparent; }
.mf-tabs a span { font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.06em; color: #6B7A93; }
.mf-tabs a:hover { color: #0B1B33; }
.mf-tabs a[aria-current="page"] { color: #1e40af; border-bottom-color: #1e40af; }
.mf-tabs a[aria-current="page"] span { color: #1e40af; }
.mf-tabs a:focus-visible { outline: 2px solid #1e40af; outline-offset: -2px; }

/* page head */
.mf-head { padding: 34px 0 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end; }
.mf-kicker { display: flex; align-items: baseline; gap: 10px; font: 500 11px/1.5 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.18em;
  text-transform: uppercase; color: #1e40af; margin: 0 0 12px; }
.mf-kicker::before { content: ''; flex: none; width: 22px; height: 1px; background: #1e40af; transform: translateY(-3px); }
.mf-head h1 { font-family: 'Source Serif 4', Georgia, serif; font-size: 34px; line-height: 1.12; font-weight: 600; letter-spacing: -0.018em; color: #0B1B33; margin: 0 0 10px; max-width: 820px; }
.mf-dek { font-family: 'Source Serif 4', Georgia, serif; font-size: 17px; line-height: 1.55; color: #14294A; margin: 0; max-width: 760px; }
.mf-source { margin: 10px 0 0; font-size: 12.5px; color: #4A5972; }
.mf-source a { color: #1e40af; }
.mf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mf-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid #1e40af; border-radius: 6px; background: #fff;
  color: #1e40af; font: 600 13.5px/1.1 'Inter', sans-serif; text-decoration: none; cursor: pointer; }
.mf-btn:hover { background: #E6ECF7; }
.mf-btn:focus-visible { outline: 2px solid #1e40af; outline-offset: 2px; }
.mf-btn.is-quiet { border-color: rgba(11, 27, 51, 0.14); color: #14294A; }
.mf-btn.is-quiet:hover { border-color: rgba(11, 27, 51, 0.32); background: #fff; }
.mf-ico { width: 18px; height: 18px; display: inline-block; flex: none; background: currentColor;
  -webkit-mask: var(--mf-ico) center / contain no-repeat; mask: var(--mf-ico) center / contain no-repeat; }

/* summary and stats */
.mf-lede { background: #fff; border: 1px solid rgba(11, 27, 51, 0.14); border-left: 3px solid #1e40af; border-radius: 10px; padding: 20px 22px; margin: 0 0 22px; }
.mf-lede .prism-sum { margin: 0 0 16px; max-width: 900px; font-size: 16.5px; }
.mf-lede .prism-sum:last-child { margin-bottom: 0; }
.mf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: rgba(11, 27, 51, 0.14); border: 1px solid rgba(11, 27, 51, 0.14); border-radius: 6px; overflow: hidden; }
.mf-stat { background: #fff; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mf-stat b { font: 600 24px/1.1 'Source Serif 4', Georgia, serif; color: #0B1B33; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.mf-stat span { font: 500 10px/1.35 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #5B6A82; }
.mf-stat em { font: italic 12.5px/1.35 'Source Serif 4', Georgia, serif; color: #5B6A82; }

/* cards */
.mf-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 0 0 22px; }
.mf-grid2 > .mf-card { margin: 0; }
.mf-card { background: #fff; border: 1px solid rgba(11, 27, 51, 0.14); border-radius: 10px; padding: 20px 22px 16px; margin: 0 0 22px; min-width: 0; }
.mf-card > h2, .mf-card-h h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; color: #0B1B33; margin: 0 0 8px; }
.mf-card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mf-card .prism-sum { margin: 0 0 14px; }
.mf-foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(11, 27, 51, 0.08); font-size: 12px; line-height: 1.5; color: #4A5972; }
.mf-foot a { color: #14294A; }
.mf-grapher { margin: 0 0 22px; }
.mf-sec { font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.18em; text-transform: uppercase; color: #4A5972; margin: 34px 0 14px;
  display: flex; align-items: center; gap: 10px; }
.mf-sec::after { content: ''; flex: 1; height: 1px; background: rgba(11, 27, 51, 0.14); }

/* the grapher's hover readouts carry display:flex, which outranks the hidden
   attribute, so an empty readout box showed before the first hover */
.mf-wrap .pl-tip[hidden], .mf-wrap .pg-tip[hidden], .mf-wrap .pg-co[hidden] { display: none; }
/* long option labels (NDICI thematic areas) must not widen the page */
.mf-wrap .pg-ctrls { max-width: 100%; }
.mf-wrap .pg-ctrl { max-width: 100%; min-width: 0; }
.mf-wrap .pg-ctrl select { min-width: 0; max-width: min(100%, 460px); text-overflow: ellipsis; }
/* share-chart labels with slashes wrap inside their column */
.mf-wrap .prism-share .ps-l { min-width: 0; overflow-wrap: anywhere; }
/* side-list figures stay on one line beside long country names */
.mf-wrap .pg-row-n { min-width: 0; text-align: left; }
.mf-wrap .pg-row-v { white-space: nowrap; flex: none; }
/* a filter change in flight dims the figures until the newest answer lands */
.mf-grapher[aria-busy="true"] .pg-body, .mf-grapher[aria-busy="true"] .pg-sum, .mf-grapher[aria-busy="true"] .pg-side { opacity: 0.45; transition: opacity 0.15s; }
.mf-gmsg { margin: 0 0 10px; }
.mf-unit { margin: 0 0 4px; font: 500 11px/1.2 'Inter', sans-serif; color: #5B6A82; }

/* loading and messages */
.mf-skel { border-radius: 6px; background: #EEF1F5; animation: mf-sh 1.4s ease-in-out infinite alternate; }
.mf-skel.is-line { height: 14px; margin: 8px 0; }
.mf-skel.is-block { height: 220px; }
@keyframes mf-sh { from { opacity: 1; } to { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .mf-skel { animation: none; } }
.mf-msg { margin: 0; padding: 18px 16px; border-radius: 6px; background: #F4F6F8; color: #4A5972; font-size: 14px; line-height: 1.5; }
.mf-msg a { color: #1e40af; }

/* the segmented scope toggle on the deep dive */
.mf-seg { display: inline-flex; border: 1px solid rgba(11, 27, 51, 0.14); border-radius: 6px; overflow: hidden; }
.mf-seg button { border: 0; border-right: 1px solid rgba(11, 27, 51, 0.08); background: #fff; padding: 8px 12px; min-height: 40px; font: 500 13px/1.1 'Inter', sans-serif; color: #14294A; cursor: pointer; }
.mf-seg button:last-child { border-right: 0; }
.mf-seg button[aria-pressed="true"] { background: #E6ECF7; color: #1e40af; font-weight: 600; }
.mf-seg button:focus-visible { outline: 2px solid #1e40af; outline-offset: -2px; }

/* tables */
.mf-ttools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.mf-ttools .mf-count { font-size: 12.5px; color: #4A5972; }
.mf-tfind { position: relative; flex: 1 1 220px; max-width: 360px; }
.mf-tfind input { width: 100%; min-height: 40px; padding: 8px 10px 8px 32px; border: 1px solid rgba(11, 27, 51, 0.14); border-radius: 6px; font: 400 14px/1.2 'Inter', sans-serif; color: #0B1B33; background: #fff; }
.mf-tfind svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #5B6A82; }
.mf-csv { border: 1px solid #1e40af; color: #1e40af; background: #fff; border-radius: 6px; padding: 8px 12px; min-height: 40px; font: 600 13px/1 'Inter', sans-serif; cursor: pointer; }
.mf-csv:hover { background: #E6ECF7; }
.mf-twrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid rgba(11, 27, 51, 0.08); border-radius: 6px; max-width: 100%; }
.mf-tbl { width: 100%; border-collapse: collapse; font-size: 13px; color: #14294A; }
.mf-tbl th, .mf-tbl td { padding: 8px 10px; border-bottom: 1px solid rgba(11, 27, 51, 0.08); text-align: left; vertical-align: top; }
.mf-tbl thead th { background: #fff; position: sticky; top: 0; z-index: 1; font: 600 11px/1.3 'Inter', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: #4A5972; }
.mf-tbl thead button { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.mf-tbl thead button:focus-visible { outline: 2px solid #1e40af; outline-offset: 2px; }
.mf-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mf-tbl tbody tr:hover { background: #F8FAFC; }
.mf-tbl .wrap { min-width: 240px; max-width: 460px; overflow-wrap: anywhere; }
.mf-tbl .wrap-s { min-width: 150px; max-width: 260px; overflow-wrap: anywhere; }
.mf-tbl .wrap-xs { min-width: 100px; max-width: 180px; overflow-wrap: anywhere; }
.mf-tbl .mf-sub { display: block; margin-top: 2px; font-weight: 400; font-size: 12px; color: #4A5972; }
.mf-tbl td.clip { max-width: 360px; }
.mf-tbl a { color: #1e40af; }
.mf-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mf-bar i { display: block; height: 8px; background: #1e40af; border-radius: 2px; min-width: 1px; }
.mf-bar-t { width: 90px; flex: none; display: flex; justify-content: flex-start; background: #F4F6F8; border-radius: 2px; }
.mf-rw { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mf-rw i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.mf-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 12.5px; color: #4A5972; }
.mf-pager button { border: 1px solid rgba(11, 27, 51, 0.14); background: #fff; border-radius: 6px; padding: 7px 12px; min-height: 40px; font: 500 13px/1 'Inter', sans-serif; color: #14294A; cursor: pointer; }
.mf-pager button[disabled] { color: #A7B1BF; cursor: default; }
.mf-tbl .mf-none td { text-align: center; color: #4A5972; padding: 18px; }

/* restrictiveness key */
.mf-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 12px; color: #4A5972; }
.mf-key span { display: inline-flex; align-items: center; gap: 6px; }
.mf-key i { width: 12px; height: 12px; border-radius: 2px; }

/* about the data */
.mf-about { background: #fff; border: 1px solid rgba(11, 27, 51, 0.14); border-radius: 10px; margin: 34px 0 0; }
.mf-about summary { cursor: pointer; list-style: none; padding: 16px 22px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 600 18px/1.2 'Source Serif 4', Georgia, serif; color: #0B1B33; }
.mf-about summary::-webkit-details-marker { display: none; }
.mf-about summary::after { content: '+'; font: 400 22px/1 'Inter', sans-serif; color: #1e40af; }
.mf-about[open] summary::after { content: '\2212'; }
.mf-about summary:focus-visible { outline: 2px solid #1e40af; outline-offset: -2px; }
.mf-about-b { padding: 0 22px 20px; font-family: 'Source Serif 4', Georgia, serif; font-size: 15.5px; line-height: 1.6; color: #14294A; max-width: 860px; }
.mf-about-b h3 { font: 600 12px/1.2 'Inter', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: #4A5972; margin: 18px 0 6px; }
.mf-about-b p { margin: 0 0 10px; }
.mf-about-b ul { margin: 0 0 10px; padding-left: 20px; }
.mf-about-b a { color: #1e40af; }

/* country picker (deep dive) */
.mf-pick { background: #fff; border: 1px solid rgba(11, 27, 51, 0.14); border-left: 3px solid #1e40af; border-radius: 10px; padding: 22px; margin: 0 0 22px; }
.mf-pick-h { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.mf-pick-h .mf-ico { width: 30px; height: 30px; color: #1e40af; }
.mf-pick h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 22px; font-weight: 600; margin: 0; color: #0B1B33; }
.mf-pick p { margin: 0 0 14px; font-family: 'Source Serif 4', Georgia, serif; font-size: 15.5px; line-height: 1.5; color: #14294A; max-width: 760px; }
.mf-combo { position: relative; max-width: 520px; }
.mf-combo input { width: 100%; min-height: 48px; padding: 10px 14px 10px 40px; border: 1px solid rgba(11, 27, 51, 0.32); border-radius: 6px; font: 400 16px/1.2 'Inter', sans-serif; color: #0B1B33; background: #fff; }
.mf-combo input:focus { outline: 2px solid #1e40af; outline-offset: 1px; border-color: #1e40af; }
.mf-combo > svg { position: absolute; left: 13px; top: 24px; transform: translateY(-50%); color: #4A5972; pointer-events: none; }
.mf-combo ul { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 340px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid rgba(11, 27, 51, 0.14); border-radius: 6px; box-shadow: 0 8px 24px rgba(11, 27, 51, 0.12); }
.mf-combo ul[hidden] { display: none; }
.mf-combo li.mf-grp { padding: 10px 14px 4px; font: 600 10.5px/1.2 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #6B7A93; }
.mf-combo li[role="option"] { padding: 9px 14px; min-height: 40px; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; font-size: 14px; color: #14294A; }
.mf-combo li[role="option"] small { color: #6B7A93; font-size: 12px; white-space: nowrap; }
.mf-combo li[role="option"][aria-selected="true"], .mf-combo li[role="option"]:hover { background: #E6ECF7; color: #1e40af; }
.mf-combo li.mf-empty { padding: 12px 14px; color: #4A5972; font-size: 13.5px; }
.mf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.mf-chips button { border: 1px solid rgba(11, 27, 51, 0.14); background: #fff; border-radius: 6px; padding: 6px 10px; min-height: 36px; font: 500 13px/1 'Inter', sans-serif; color: #14294A; cursor: pointer; }
.mf-chips button:hover { border-color: #1e40af; color: #1e40af; }
.mf-notice { margin: 0 0 12px; padding: 10px 14px; border-radius: 6px; background: #F4F6F8; border: 1px solid rgba(11, 27, 51, 0.14); color: #14294A; font-size: 14px; }
.mf-profile-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.mf-profile-h h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 28px; font-weight: 600; margin: 0; color: #0B1B33; }

.mf-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 768px) {
  /* secondary columns leave the visible table and stay in its CSV */
  .mf-tbl .mf-hn { display: none; }
  .mf-tbl .wrap { min-width: 190px; }
  .mf-tbl .wrap-s { min-width: 120px; }
  .mf-wrap .pg-ctrl select { max-width: 100%; }
  /* the tab strip scrolls: a fade marks the side with more tabs */
  .mf-tabs-in.is-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .mf-tabs-in.is-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
  .mf-tabs-in.is-l.is-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
  .mf-head { grid-template-columns: minmax(0, 1fr); padding: 24px 0 14px; }
  .mf-head h1 { font-size: 27px; }
  .mf-dek { font-size: 16px; }
  .mf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mf-grid2 { grid-template-columns: minmax(0, 1fr); }
  .mf-card { padding: 16px 14px 14px; }
  .mf-lede { padding: 16px 14px; }
  .mf-tabs a { padding: 13px 10px 11px; }
  .mf-profile-h h2 { font-size: 24px; }
}
@media (max-width: 480px) {
  .mf-head h1 { font-size: 24px; }
  .mf-stat { padding: 12px 12px 10px; }
  .mf-stat b { font-size: 20px; }
  .mf-card > h2, .mf-card-h h2 { font-size: 19px; }
  .mf-actions { width: 100%; }
  .mf-actions .mf-btn { flex: 1 1 auto; justify-content: center; }
  .mf-bar-t { width: 56px; }
  .mf-tbl .wrap { min-width: 170px; }
  .mf-pick { padding: 16px 14px; }
}
