  :root {
    --paper: #F3F4EF;
    --paper-raised: #FBFBF8;
    --ink-900: #14213D;
    --ink-700: #33456B;
    --ink-500: #5B6B8C;
    --ink-300: #8993AC;
    --line: #D9D6C9;
    --line-strong: #C3BFAE;
    --brass: #A9822E;
    --brass-dark: #8A6A22;
    --brass-tint: #F1E6CC;
    --map-empty: #E7E5DA;
    --font-display: 'Newsreader', serif;
    --font-body: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  }
  * { box-sizing: border-box; }
  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }
  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink-900);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
  }
  .page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px 80px;
  }
  header.page-head {
    margin-bottom: 28px;
  }
  .wordmark {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass-dark);
    margin-bottom: 6px;
  }
  h1 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 30px;
    margin: 0 0 6px;
    color: var(--ink-900);
  }
  .subtitle {
    font-size: 13.5px;
    color: var(--ink-500);
  }
  .stat-row {
    display: flex;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
  }
  .stat-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 14px 18px;
    min-width: 160px;
  }
  .stat-card .value {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 26px;
    color: var(--ink-900);
  }
  .stat-card .label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-500);
    margin-top: 2px;
  }
  section {
    margin-top: 36px;
  }
  .section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .section-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    color: var(--ink-900);
  }
  .section-desc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-500);
  }
  #excludedCountryNote {
    display: block;
    margin-top: 4px;
  }
  .panel {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 20px;
    box-shadow: 0 1px 0 rgba(20,33,61,0.06), 0 1px 3px rgba(20,33,61,0.05);
  }
  /* ---------- Map ---------- */
  #mapWrap { position: relative; }
  #worldMap { width: 100%; height: auto; display: block; }
  #worldMap path.country {
    stroke: var(--paper-raised);
    stroke-width: 0.5;
    cursor: default;
    transition: opacity 0.15s ease;
  }
  #worldMap path.country:hover { opacity: 0.8; }
  #worldMap circle.country-marker {
    transition: r 0.15s ease;
  }
  #worldMap circle.country-marker:hover {
    r: 7;
  }
  .map-tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--ink-900);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 2px;
    z-index: 100;
    display: none;
    max-width: 220px;
    line-height: 1.5;
  }
  .map-tooltip .t-title { font-weight: 500; margin-bottom: 2px; }
  .legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-500);
  }
  .legend-scale {
    display: flex;
    height: 10px;
    width: 160px;
    border-radius: 2px;
    overflow: hidden;
  }
  .legend-scale span { flex: 1; }

  #sankeyWrap { position: relative; }
  #sankeySvg { width: 100%; height: auto; display: block; }
  .sankey-node rect {
    stroke: var(--paper-raised);
    stroke-width: 1;
    cursor: default;
    transition: opacity 0.15s ease;
  }
  .sankey-node:hover rect { opacity: 0.85; }
  .sankey-node text {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--ink-700);
  }
  .sankey-link path {
    fill: none;
    transition: stroke-opacity 0.15s ease;
  }
  .sankey-link:hover path {
    stroke-opacity: 0.6 !important;
  }
  .sankey-legend {
    display: flex;
    gap: 14px;
    margin-top: 14px;
    flex-wrap: wrap;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-500);
  }
  .sankey-legend-groupname {
    font-weight: 600;
    color: var(--ink-700);
    margin-left: 10px;
  }
  .sankey-legend-groupname:first-child { margin-left: 0; }
  .sankey-legend-item { display: flex; align-items: center; gap: 6px; }
  .sankey-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
  }

  .country-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
  }
  .country-year-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 12px 14px;
  }
  .cy-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }
  .cy-flag {
    width: 22px;
    height: auto;
    border-radius: 2px;
    border: 1px solid var(--line-strong);
    display: block;
    flex: 0 0 auto;
  }
  .cy-name {
    font-size: 13px;
    color: var(--ink-700);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cy-total {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-500);
    flex: 0 0 auto;
  }
  .cy-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 50px;
  }
  .cy-bars .cy-bar {
    flex: 1;
    background: var(--brass);
    border-radius: 1px 1px 0 0;
    min-height: 1px;
  }
  .cy-year-range {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ink-300);
  }

  .sdg-icon-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 14px;
  }
  .sdg-item {
    position: relative;
    aspect-ratio: 1 / 1;
    transition: transform 0.22s ease;
  }
  .sdg-item img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
  }
  .sdg-item:hover {
    animation: sdg-wiggle 0.4s ease-in-out;
  }
  @keyframes sdg-wiggle {
    0%   { transform: scale(1)    rotate(0deg); }
    25%  { transform: scale(1.08) rotate(-2deg); }
    50%  { transform: scale(1.1)  rotate(2deg); }
    75%  { transform: scale(1.08) rotate(-1deg); }
    100% { transform: scale(1.06) rotate(0deg); }
  }
  @media (prefers-reduced-motion: reduce) {
    .sdg-item:hover { animation: none; transform: scale(1.05); }
  }

  .sdg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #C0392B;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
    border: 2px solid var(--paper-raised);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
  }
  @media (max-width: 768px) {
    .sdg-icon-grid { grid-template-columns: repeat(6, 1fr); gap: 10px; }
    .sdg-badge { width: 22px; height: 22px; font-size: 9.5px; top: -5px; right: -5px; }
  }
  @media (max-width: 480px) {
    .sdg-icon-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .sdg-badge { width: 20px; height: 20px; font-size: 9px; top: -4px; right: -4px; }
  }
  .state-box {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-500);
  }
  .state-box .state-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    color: var(--ink-900);
    margin-bottom: 6px;
  }
  .state-box .state-desc { font-size: 13px; }
  .skeleton {
    height: 260px;
    border-radius: 3px;
    background: linear-gradient(100deg, var(--paper-raised) 30%, #EDEBE0 50%, var(--paper-raised) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
  }
  @keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  @media (max-width: 640px) {
    .country-year-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  }