/* African PF/SWF Capital Mapping — Visualization Tool */

:root {
  --navy: #1a3a5c;
  --teal: #1e7b5e;
  --gold: #c8891a;
  --red: #c0392b;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #dde2ea;
  --text: #1c2733;
  --muted: #637280;
  --tag-bg: #e8f0f8;
  --tag-text: #1a3a5c;
  --shadow: 0 8px 24px rgba(26,58,92,0.07);
  --shadow-hover: 0 14px 32px rgba(26,58,92,0.12);
  --radius: 8px;

  /* Asset class colors */
  --pe: #2563eb;
  --vc: #7c3aed;
  --infra: #059669;
  --credit: #d97706;
  --direct: #dc2626;
  --fof: #0891b2;
  --mixed: #6b7280;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
#app-header {
  background: linear-gradient(135deg, #153452 0%, #1e5f58 100%);
  color: white;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#app-header h1 {
  font-size: 22px;
  font-weight: 750;
  text-align: center;
  letter-spacing: 0;
  line-height: 1.25;
  max-width: 980px;
}
#app-header h1 span {
  color: #b8ead1;
  white-space: nowrap;
}

/* ── Tabs ── */
#tab-bar {
  background: #132d47;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  gap: 4px;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: rgba(255,255,255,0.9); }
.tab-btn.active {
  color: white;
  border-bottom-color: #7ec8a4;
}

/* ── Layout ── */
.pg {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Network tab gets full-height treatment */
#tab-network {
  display: none;
  height: calc(100vh - 100px);
  padding: 12px 24px;
}
#tab-network.active { display: flex; flex-direction: column; }

/* ── Cards + sections ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.research-header {
  margin-bottom: 16px;
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.research-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.research-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  border-color: #cbd5e1;
}
.research-card h3 {
  color: var(--navy);
  font-size: 17px;
  line-height: 1.25;
}
.research-card p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.62;
  margin-bottom: 8px;
}
.research-source {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.research-card a {
  margin-top: auto;
  align-self: flex-start;
  color: var(--teal);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.research-card a:hover { text-decoration: underline; }
.timeline-header {
  margin-bottom: 16px;
}
.timeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.timeline-summary-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px;
}
.timeline-summary-card:nth-child(2) { border-top-color: #d97706; }
.timeline-summary-card:nth-child(3) { border-top-color: #7c3aed; }
.timeline-summary-card strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
  margin-bottom: 5px;
}
.timeline-summary-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.timeline-wrap {
  position: relative;
  padding: 6px 0 12px 0;
}
.timeline-wrap::before {
  content: "";
  position: absolute;
  top: 46px;
  bottom: 0;
  left: 112px;
  width: 3px;
  background: linear-gradient(#1e7b5e, #d97706 42%, #2563eb 76%, #7c3aed);
  border-radius: 999px;
}
.timeline-era {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: 18px 0 12px 86px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #132d47;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 86px 1fr;
  column-gap: 48px;
  margin-bottom: 14px;
  align-items: start;
}
.timeline-year {
  text-align: right;
  color: var(--navy);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  padding-top: 16px;
}
.timeline-dot {
  position: absolute;
  left: 101px;
  top: 17px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border), 0 2px 8px rgba(0,0,0,0.15);
  background: var(--teal);
  z-index: 2;
}
.timeline-dot.policy { background: #d97706; }
.timeline-dot.dfi { background: #2563eb; }
.timeline-dot.allocator { background: #1e7b5e; }
.timeline-dot.vehicle { background: #7c3aed; }
.timeline-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 17px 18px;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.timeline-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  border-color: #cbd5e1;
}
.timeline-card h3 {
  color: var(--navy);
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 7px;
}
.timeline-card p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.62;
}
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.timeline-tags span {
  background: #eef4f7;
  color: #24475d;
  border: 1px solid #d7e4ea;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}
.timeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}
.timeline-links a {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.timeline-links a:hover { text-decoration: underline; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}
.about-card p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.68;
  margin-bottom: 10px;
}
.method-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.method-steps div {
  border-left: 4px solid var(--teal);
  background: #f8fafc;
  border-radius: 6px;
  padding: 9px 11px;
}
.method-steps strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
  margin-bottom: 3px;
}
.method-steps span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.about-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-left: 18px;
}
.about-list li {
  font-size: 14px;
  line-height: 1.6;
}
.about-list strong {
  color: var(--navy);
}
.key-facts-section {
  margin-top: 22px;
}
.facts-band {
  margin-top: 14px;
}
.facts-band-title {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.facts-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.fact-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 14px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.fact-tile:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  border-color: #cbd5e1;
}
.fact-tile.warning { border-top-color: var(--gold); }
.fact-tile.success { border-top-color: var(--teal); }
.fact-tile.lesson { border-top-color: var(--fof); }
.fact-number {
  color: var(--navy);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 8px;
}
.fact-label {
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.fact-source {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: auto;
  padding-top: 12px;
}
.section-title {
  font-size: 17px;
  font-weight: 750;
  color: var(--navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--tag-bg);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── Filters bar ── */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.filters-bar input[type="text"],
.filters-bar select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}
.filters-bar input[type="text"] { min-width: 220px; }
.filters-bar input[type="text"]:focus,
.filters-bar select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(30,123,94,0.12);
}
.filters-bar select { cursor: pointer; }
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filters-bar .result-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.btn-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  height: 38px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.15s;
}
.btn-clear:hover { background: var(--bg); }
.btn-clear:focus-visible,
.tab-btn:focus-visible,
.view-toggle-btn:focus-visible,
.research-card a:focus-visible,
.timeline-links a:focus-visible,
.source-link a:focus-visible {
  outline: 3px solid rgba(30,123,94,0.24);
  outline-offset: 2px;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  height: 38px;
  background: white;
}
.view-toggle-btn {
  border: 0;
  border-right: 1px solid var(--border);
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
}
.view-toggle-btn:last-child { border-right: 0; }
.view-toggle-btn.active {
  background: var(--navy);
  color: white;
}
.view-panel { display: none; }
.view-panel.active { display: block; }

.africa-map {
  min-height: 620px;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
}
.map-canvas {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #eef4f5;
  overflow: hidden;
}
.map-canvas svg {
  display: block;
  width: 100%;
  height: 560px;
}
.map-country {
  fill: #d9e6df;
  stroke: #ffffff;
  stroke-width: 0.7;
}
.map-country.has-data {
  fill: #c9ded3;
}
.map-bubble {
  fill: var(--teal);
  fill-opacity: 0.78;
  stroke: white;
  stroke-width: 1.5;
  cursor: pointer;
}
.map-bubble:hover,
.map-bubble.active {
  fill: var(--gold);
  fill-opacity: 0.9;
}
.map-label {
  fill: var(--navy);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  paint-order: stroke;
  stroke: white;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.map-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
  min-height: 560px;
}
.map-panel h3 {
  color: var(--navy);
  font-size: 16px;
  margin-bottom: 6px;
}
.map-panel .map-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.map-stat-card {
  background: var(--bg);
  border-radius: 6px;
  padding: 8px;
}
.map-stat-card strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}
.map-stat-card span {
  color: var(--muted);
  font-size: 11px;
}
.map-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}
.map-list-item {
  border-top: 1px solid var(--border);
  padding-top: 7px;
  font-size: 13px;
}
.map-list-item strong {
  color: var(--navy);
}
.map-muted {
  color: var(--muted);
  font-size: 13px;
}
.map-error {
  padding: 28px;
  color: var(--muted);
}

/* ── Tables ── */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  background: var(--bg);
  color: var(--navy);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
.data-table th:hover { background: #e4e8f0; }
.data-table th .sort-arrow { color: var(--muted); font-size: 10px; margin-left: 4px; }
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 280px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Tags / badges ── */
.tag {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tag-pf   { background: #dbeafe; color: #1d4ed8; }
.tag-swf  { background: #d1fae5; color: #065f46; }
.tag-dfi  { background: #fef3c7; color: #92400e; }
.tag-fund { background: #ede9fe; color: #5b21b6; }
.tag-pipeline { background: #fef3c7; color: #92400e; }
.tag-targeted { background: #ffedd5; color: #9a3412; }
.tag-expected { background: #fef9c3; color: #854d0e; }
.tag-planned { background: #e0f2fe; color: #075985; }
.tag-mou { background: #ede9fe; color: #5b21b6; }
.tag-member { background: #f3f4f6; color: #374151; }

.conf-H { color: #065f46; font-weight: 700; }
.conf-M { color: #92400e; font-weight: 700; }
.conf-L { color: #b91c1c; font-weight: 700; }

.asset-tag {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}
.asset-PE      { background: #dbeafe; color: #1d4ed8; }
.asset-VC      { background: #ede9fe; color: #5b21b6; }
.asset-Infra   { background: #d1fae5; color: #065f46; }
.asset-Credit  { background: #fef3c7; color: #92400e; }
.asset-Direct  { background: #fee2e2; color: #991b1b; }
.asset-FundOfFunds { background: #cffafe; color: #164e63; }
.asset-RealAssets { background: #d1fae5; color: #065f46; }
.asset-Guarantee { background: #ffedd5; color: #9a3412; }
.asset-Platform { background: #e0e7ff; color: #3730a3; }
.asset-Mixed   { background: #f3f4f6; color: #374151; }
.asset-Other   { background: #f3f4f6; color: #374151; }

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Overview page ── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-panel { min-height: auto; }
  .map-canvas svg { height: 460px; }
}

/* ── Chart containers ── */
.chart-wrap {
  position: relative;
  height: 300px;
  margin-top: 8px;
}
.chart-wrap.tall { height: 420px; }
.chart-wrap.short { height: 200px; }
canvas { max-width: 100%; }

.full-tab-table {
  max-height: calc(100vh - 245px);
  overflow-y: auto;
}

.full-tab-list {
  max-height: calc(100vh - 235px);
  overflow-y: auto;
  padding-right: 4px;
}

/* ── Network graph ── */
#network-container {
  flex: 1;
  display: flex;
  gap: 12px;
  min-height: 0;
}
#network-controls {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
#network-svg-wrap {
  flex: 1;
  min-width: 0;
  min-height: 520px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  touch-action: none;
}
#network-svg {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#network-tooltip {
  position: absolute;
  background: rgba(20,35,55,0.95);
  color: white;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 260px;
  pointer-events: none;
  display: none;
  z-index: 10;
  line-height: 1.6;
}
#network-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 11px;
  color: var(--muted);
}

.network-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-square { border-radius: 3px; }
.legend-diamond {
  width: 11px;
  height: 11px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.network-section { display: flex; flex-direction: column; gap: 6px; }
.network-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.net-ctrl-label { font-size: 12px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.net-ctrl-label input { cursor: pointer; }
#network-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  order: 2;
}
.network-search-results {
  order: 3;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}
.network-search-results.is-visible { display: flex; flex-direction: column; }
.network-search-result {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: white;
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
}
.network-search-result:last-child { border-bottom: 0; }
.network-search-result:hover,
.network-search-result:focus {
  background: #f1f5f9;
  outline: none;
}
.network-search-result strong {
  display: block;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.25;
}
.network-search-result span {
  color: var(--muted);
  font-size: 11px;
}
.network-search-empty {
  padding: 8px 9px;
  color: var(--muted);
  font-size: 12px;
}
.selected-info {
  background: var(--bg);
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
}
.selected-info strong { color: var(--navy); font-size: 13px; display: block; margin-bottom: 4px; }

@media (max-width: 760px) {
  #app-header {
    height: auto;
    min-height: 52px;
    padding: 10px 14px;
  }
  #app-header h1 {
    font-size: 15px;
    white-space: normal;
    line-height: 1.25;
  }
  #app-header h1 span { white-space: normal; }
  #tab-bar {
    padding: 0 10px;
    justify-content: flex-start;
  }
  .tab-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  .timeline-wrap::before {
    left: 19px;
    top: 56px;
  }
  .timeline-era {
    margin-left: 0;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    padding-left: 44px;
    row-gap: 6px;
  }
  .timeline-year {
    text-align: left;
    padding-top: 0;
  }
  .timeline-dot {
    left: 8px;
    top: 2px;
  }
  .timeline-card {
    padding: 13px 14px;
  }
  .timeline-card h3 {
    font-size: 15px;
  }
  #tab-network {
    height: auto;
    min-height: calc(100vh - 96px);
    padding: 10px;
  }
  #network-container {
    flex-direction: column;
    gap: 10px;
    min-height: 0;
  }
  #network-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
  }
  #network-controls .card {
    margin-bottom: 0;
    padding: 10px 12px !important;
  }
  #network-controls .card:nth-child(3) {
    max-height: 190px;
    overflow-y: auto;
  }
  #network-svg-wrap {
    flex: none;
    height: min(68vh, 620px);
    min-height: 430px;
    border-radius: 6px;
  }
  #network-info {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 5px 7px;
    background: rgba(255,255,255,0.88);
    border-radius: 5px;
    font-size: 10px;
    line-height: 1.35;
  }
  #network-tooltip {
    display: none !important;
  }
  .network-search-results {
    max-height: 170px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  #tab-network {
    padding: 12px 16px;
  }
  #network-controls {
    width: 250px;
  }
}

/* ── Commitments view ── */
/* ── Institution card ── */
.inst-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: box-shadow 0.15s;
  cursor: pointer;
}
.inst-card:hover { box-shadow: var(--shadow-hover); border-color: #cbd5e1; }
.inst-card .inst-name { font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.inst-card .inst-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.inst-card .inst-aum { font-weight: 700; color: var(--teal); }

.inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding: 2px;
}

/* ── Fund card ── */
.fund-card {
  border-left: 4px solid var(--border);
  padding: 12px 14px;
  background: white;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.fund-card .fund-name { font-weight: 600; color: var(--navy); }
.fund-card .fund-meta { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.fund-card .fund-lps { font-size: 13px; margin-top: 7px; line-height: 1.5; }
.fund-card.asset-PE      { border-left-color: #2563eb; }
.fund-card.asset-VC      { border-left-color: #7c3aed; }
.fund-card.asset-Infra   { border-left-color: #059669; }
.fund-card.asset-Credit  { border-left-color: #d97706; }
.fund-card.asset-Direct  { border-left-color: #dc2626; }
.fund-card.asset-FundOfFunds { border-left-color: #0891b2; }
.fund-card.asset-RealAssets { border-left-color: #059669; }
.fund-card.asset-Guarantee { border-left-color: #ea580c; }
.fund-card.asset-Platform { border-left-color: #4f46e5; }
.fund-card.asset-Mixed   { border-left-color: #6b7280; }

/* ── Misc ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .icon { font-size: 32px; margin-bottom: 8px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pill {
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
}
.entity-filter {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.entity-filter:hover {
  color: var(--green);
}
.entity-filter:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 3px;
}
.entity-filter.pill {
  border: 0;
  display: inline-block;
  margin: 2px 2px 2px 0;
  text-decoration: none;
}
.entity-filter.pill:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}
.entity-filter.dfi-pill {
  background: #fef3c7;
  color: #78350f;
}

.helper-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: -2px 0 16px;
  max-width: 980px;
}

.source-link {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.source-link a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.source-link a:hover { text-decoration: underline; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Truncate long text */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
