/* US aid explorer: "Where the dollar went", agency → sector flow (src/features/aid/flow.js). */
.aidf-figure { margin: 0; }
.aidf-svg { display: block; width: 100%; height: auto; overflow: visible; }
.aidf-link { transition: opacity 0.25s ease; mix-blend-mode: multiply; }
.aidf-link[data-none] { opacity: 0.55; }
.aidf-links:hover .aidf-link { opacity: 0.22; }
.aidf-links:hover .aidf-link:hover { opacity: 1; }
.aidf-node { shape-rendering: crispEdges; }
.aidf-label { font-family: var(--font-sans, Inter, system-ui, sans-serif); font-size: 15px; font-weight: 600; fill: #2A1B45; }
.aidf-label.is-none { font-style: italic; fill: #6A6474; }
.aidf-amount { font-family: var(--font-sans, Inter, system-ui, sans-serif); font-size: 12.5px; fill: #6A6474; font-variant-numeric: tabular-nums; }
.aidf-keys { display: none; }
.aidf-cap { margin-top: 0.9rem; font-size: 0.82rem; line-height: 1.5; color: #5A5560; max-width: 80ch; }
.aidf-cap strong { color: #2A1B45; }

/* The draw-in, once JavaScript arms it: ribbons pour from left to right. */
.aidf.is-armed .aidf-links { clip-path: inset(0 100% 0 0); }
.aidf.is-in .aidf-links { clip-path: inset(0 0 0 0); transition: clip-path 1.8s cubic-bezier(0.45, 0.05, 0.2, 1); }
.aidf.is-armed .aidf-nodes rect { opacity: 0; }
.aidf.is-in .aidf-nodes rect { opacity: 1; transition: opacity 0.6s ease; }

@media (max-width: 720px) {
  /* Names are listed under the chart, in the same order top to bottom. */
  .aidf-labels { display: none; }
  .aidf-svg { margin: 0 -10%; width: 120%; max-width: none; }
  .aidf-figure { overflow: hidden; }
  .aidf-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 0.6rem; }
  .aidf-key { list-style: none; margin: 0; padding: 0; font-size: 0.74rem; line-height: 1.3; }
  .aidf-key li { display: grid; grid-template-columns: 10px 1fr; gap: 0 6px; padding: 4px 0; border-bottom: 1px solid #E6E1EC; }
  .aidf-key li.is-none .aidf-key-name { font-style: italic; }
  .aidf-sw { width: 10px; height: 10px; margin-top: 2px; border-radius: 2px; background: var(--c); grid-row: 1 / 3; }
  .aidf-key-name { color: #2A1B45; font-weight: 600; overflow-wrap: anywhere; }
  .aidf-key-v { color: #6A6474; font-variant-numeric: tabular-nums; }
  .aidf-key-s { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .aidf.is-armed .aidf-links, .aidf.is-in .aidf-links { clip-path: none; transition: none; }
  .aidf.is-armed .aidf-nodes rect { opacity: 1; }
}
