:root{
  --accent:#127a3e;
  --bar:#e5e5e5;
}

/* Base */
*{box-sizing:border-box}
body{
  font-family:system-ui, Segoe UI, Roboto, Arial, sans-serif;
  text-align:center;
  margin:0;
  padding:0 0 3rem 0;
  color:#222;
}

/* Status banner */
.status-banner{
  position:sticky;
  top:0;
  z-index:2000;
  margin:0;
  padding:.75rem 1rem;
  background:#fff4e5;
  color:#7a4b00;
  border-bottom:1px solid #f0d9b5;
  text-align:center;
  font-size:.95rem;
}

/* ------------ Top controls: align with content left edge ------------- */
.topbar{
  max-width:920px;
  margin:3.5rem auto 2.5rem auto;   /* generous spacing */
  padding:0 8px;
  text-align:left;
}

/* Rows */
.row{
  display:inline-flex;
  align-items:flex-end;
  gap:12px;
}

/* Row 1: keep on one line on wide screens */
.row-top{
  flex-wrap:nowrap;
  white-space:nowrap;
}

.row-top #copyShareLink{
  font-size:1rem;
  padding:.45rem .65rem;
  border-radius:.4rem;
  min-height:40px;
}

.share-link-wrap{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:4px;
  min-width:150px;
}

.control-label-spacer{
  display:block;
  visibility:hidden;
  margin:0 0 .35rem 0;
}



.share-link-status{
  position:absolute;
  left:0;
  top:calc(100% + 4px);
  font-size:.78rem;
  color:#666;
  white-space:nowrap;
}

/* Row 2: can wrap */
.row-sub{
  flex-wrap:wrap;
  margin-top:12px;
}

.row-sub.trends-mode{
  align-content:flex-start;
}

/* Labels + selects */
.lbl{
  font-size:.92rem;
  color:#555;
  margin:0 6px .35rem 0;
  line-height:1.2;
  vertical-align:bottom;
}

select{
  font-size:1rem;
  padding:.45rem .65rem;
  border-radius:.4rem;
  border:1px solid #cfcfcf;
  background:#fff;
}

/* Keep selects compact */
#country,
#view,
#trendMetric,
#range{
  min-width:150px;
  width:auto;
}

/* -------- Vaccine control (inserted by JS) --------
   JS replaces #vaccineControl with: <span><label for="vaccineFilter" class="lbl">Vaccine</label><select id="vaccineFilter">…</select></span>
   Force label above select no matter what. */
.row-sub > span{ display:inline-block; vertical-align:bottom; }
label[for="vaccineFilter"]{ display:block; margin:0 0 .35rem 0; }
#vaccineFilter{ display:block; min-width:150px; width:auto; }

/* ------------------------- Title ------------------------- */
.title{
  font-size:1.9rem;
  margin:0 auto 2rem auto;
}

/* ------------------------ Trackers ----------------------- */
#trackers{
  max-width:920px;
  margin:0 auto;
  text-align:center;
}

/* Tracker controls */
.tracker-controls{
  display:flex;
  justify-content:center;
  margin-bottom:1.5rem;
  gap:12px;
}

.tracker-controls > div{
  display:flex;
  align-items:center;
  gap:8px;
}

.tracker-controls select{
  font-size:.9rem;
  padding:.4rem .5rem;
}

.metric{ margin:1.8rem 0; }
.label{ font-size:1.05rem; color:#555; margin-bottom:.4rem; }
.value{ font-size:2.6rem; color:var(--accent); font-weight:700; letter-spacing:.02em; }

.bar{
  width:100%;
  max-width:420px;
  height:12px;
  background:var(--bar);
  margin:.9rem auto 0;
  border-radius:6px;
  overflow:hidden;
}
.fill{
  width:0;
  height:100%;
  background:var(--accent);
  transition:width 1s linear;
}
.timer{ font-size:.95rem; margin-top:.4rem; color:#444; }

/* Shipment note */
#ship{
  margin:2rem auto 0;
  max-width:44rem;
  font-size:.95rem;
  line-height:1.5;
  text-align:left;
  color:#333;
}

/* ------------------------- Trends ------------------------ */
#trends{
  max-width:920px;
  margin:0 auto;
  text-align:left;
}

.trendCanvasWrap{
  position:relative;
  border:1px solid #eee;
  border-radius:.6rem;
  padding:.6rem;
  background:#fff;
  margin-top:.6rem;
}

/* Left-side vertical Y label */
.y-label{
  position:absolute;
  left:2px;
  top:50%;
  transform:translateY(-50%) rotate(-90deg);
  color:#666;
  font-size:11px;
  pointer-events:none;
}

/* Tooltip */
.trendTooltip{
  position:absolute;
  display:none;
  background:#fff;
  border:1px solid #ccc;
  border-radius:.35rem;
  padding:.35rem .5rem;
  font-size:.85rem;
  color:#333;
  pointer-events:none;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
}

/* Hover dot */
.trendDot{
  position:absolute;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#127a3e;
  transform:translate(-50%,-50%) scale(1);
  transition:transform 120ms ease-out, box-shadow 120ms ease-out;
  display:none;
  pointer-events:none;
}
.trendDot.active{
  transform:translate(-50%,-50%) scale(1.2);
  box-shadow:0 0 0 2px rgba(18,122,62,0.18);
}

/* Trends metric hint */
.trend-metric-hint{
  margin:.45rem 0 0;
  font-size:.85rem;
  color:#666;
  min-height:1.4em;
}

/* Empty state */
.empty{
  display:flex;
  align-items:center;
  justify-content:center;
  height:220px;
  color:#666;
  background:#fafafa;
  border:1px dashed #e3e3e3;
  border-radius:8px;
}

/* Utilities */
.hidden{display:none}
.win{ color:#555; margin-left:10px; }

/* Loading indicator */
.loading{
  position:relative;
  pointer-events:none;
}
.loading::after{
  content:'';
  position:absolute;
  top:50%;
  left:50%;
  width:28px;
  height:28px;
  margin:-14px 0 0 -14px;
  border:3px solid #e5e5e5;
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .8s linear infinite;
}
@keyframes spin{
  to{ transform:rotate(360deg); }
}
.loading canvas,
.loading .metric,
.loading #ship{
  opacity:0.4;
}

/* Canvas defaults */
canvas{ width:100%; height:auto; display:block; }

/* Compare view */
#compare{
  max-width:920px;
  margin:0 auto;
  padding:0 8px;
}

/* Chart actions (download buttons) */
.chart-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:8px;
}

.download-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  font-size:.85rem;
  color:#555;
  background:#f8f8f8;
  border:1px solid #ddd;
  border-radius:4px;
  cursor:pointer;
  transition:all .15s;
}

.download-btn:hover{
  background:#fff;
  border-color:#127a3e;
  color:#127a3e;
}

.download-btn svg{
  flex-shrink:0;
}

/* Country picker panel */
.country-picker{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  width:min(480px, 90vw);
  max-height:80vh;
  background:#fff;
  z-index:1001;
  border-radius:.75rem;
  box-shadow:0 8px 32px rgba(0,0,0,.2);
  display:flex;
  flex-direction:column;
}

.country-picker-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1rem 1.25rem;
  border-bottom:1px solid #eee;
}

.country-picker-header h3{
  margin:0;
  font-size:1.1rem;
  color:#333;
}

.country-picker-actions{
  display:flex;
  align-items:center;
  gap:8px;
  padding:.75rem 1.25rem;
  border-bottom:1px solid #eee;
  background:#f8f8f8;
}

.picker-btn{
  padding:4px 10px;
  font-size:.85rem;
  color:#555;
  background:#fff;
  border:1px solid #ddd;
  border-radius:4px;
  cursor:pointer;
}

.picker-btn:hover{
  border-color:#127a3e;
  color:#127a3e;
}

.picker-count{
  margin-left:auto;
  font-size:.85rem;
  color:#666;
}

.country-picker-list{
  flex:1;
  overflow-y:auto;
  padding:.75rem 1.25rem;
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:6px;
  max-height:50vh;
}

.country-picker-item{
  display:flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:4px;
  cursor:pointer;
  font-size:.9rem;
  transition:background .1s;
}

.country-picker-item:hover{
  background:#f0f0f0;
}

.country-picker-item input{
  margin:0;
  cursor:pointer;
}

.country-picker-item.selected{
  background:#e8f5e9;
}

.country-picker-footer{
  padding:1rem 1.25rem;
  border-top:1px solid #eee;
  text-align:right;
}

.picker-apply-btn{
  padding:8px 20px;
  font-size:.95rem;
  font-weight:500;
  color:#fff;
  background:#127a3e;
  border:none;
  border-radius:4px;
  cursor:pointer;
  transition:background .15s;
}

.picker-apply-btn:hover{
  background:#0f6432;
}

/* ------------------------- Needs view ------------------------ */
#needs{
  max-width:920px;
  margin:0 auto;
  text-align:left;
}

.needs-controls{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:1.5rem;
}

.needs-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:1rem;
}

.needs-card{
  background:#fff;
  border:1px solid #e5e5e5;
  border-radius:.6rem;
  padding:1.2rem;
  text-align:left;
}

.needs-card-title{
  font-size:.9rem;
  color:#666;
  margin-bottom:.8rem;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.needs-stat{
  display:flex;
  flex-direction:column;
  gap:.2rem;
}

.needs-value{
  font-size:1.8rem;
  font-weight:700;
  color:var(--accent);
  line-height:1.1;
}

.needs-label{
  font-size:.85rem;
  color:#555;
}

.needs-detail{
  margin-top:.8rem;
  font-size:.85rem;
  color:#666;
  padding-top:.6rem;
  border-top:1px solid #eee;
}

.needs-chart-section{
  margin-top:2rem;
  padding-top:1.5rem;
  border-top:1px solid #e5e5e5;
}

.needs-chart-controls{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:1rem;
}

.needs-compare-section{
  margin-top:1.5rem;
  padding-top:1.5rem;
  border-top:1px solid #e5e5e5;
}

.needs-compare-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:0.75rem;
}

.needs-compare-header h3{
  margin:0;
  font-size:1.05rem;
  color:#333;
}

.needs-compare-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.needs-compare-table{
  width:100%;
  border-collapse:collapse;
  font-size:.9rem;
}

.needs-compare-table th,
.needs-compare-table td{
  padding:.65rem .8rem;
  text-align:left;
  border-bottom:1px solid #eee;
}

.needs-compare-table th{
  background:#f8f8f8;
  font-weight:600;
  color:#444;
  position:sticky;
  top:0;
  white-space:nowrap;
}

.needs-compare-table th.num,
.needs-compare-table td.num{
  text-align:right;
}

/* ------------------------- Shipments view ------------------------ */
#shipments{
  max-width:1100px;
  margin:0 auto;
  text-align:left;
}

.shipments-controls{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:1rem;
}

.shipments-summary{
  margin-bottom:1rem;
  font-size:.95rem;
  color:#555;
}

.table-wrap{
  overflow-x:auto;
  border:1px solid #e5e5e5;
  border-radius:.6rem;
  background:#fff;
}

.table-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin:0.5rem 0 0.75rem;
  flex-wrap:wrap;
}

.shipments-table{
  width:100%;
  border-collapse:collapse;
  font-size:.9rem;
}

.shipments-table th,
.shipments-table td{
  padding:.65rem .8rem;
  text-align:left;
  border-bottom:1px solid #eee;
}

.shipments-table th{
  background:#f8f8f8;
  font-weight:600;
  color:#444;
  position:sticky;
  top:0;
}

.shipments-table tbody tr:hover{
  background:#f5faf7;
}

.shipments-table .num{
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.shipments-table .status-delivered{
  color:#127a3e;
}

.shipments-table .status-scheduled{
  color:#b58105;
}

.efficacy-badge{
  display:inline-block;
  padding:.15rem .4rem;
  border-radius:.25rem;
  font-size:.8rem;
  font-weight:500;
}

.efficacy-high{ background:#d4edda; color:#155724; }
.efficacy-med{ background:#fff3cd; color:#856404; }
.efficacy-low{ background:#f8d7da; color:#721c24; }
.efficacy-na{ background:#e9ecef; color:#6c757d; }

/* ------------------------- About page ------------------------ */
#about{
  max-width:800px;
  margin:0 auto;
  text-align:left;
}

.about-content h2{
  font-size:1.5rem;
  margin-bottom:1.5rem;
  color:#222;
}

.about-section{
  margin-bottom:2rem;
  padding-bottom:1.5rem;
  border-bottom:1px solid #eee;
}

.about-section:last-child{
  border-bottom:none;
}

.about-section h3{
  font-size:1.1rem;
  margin-bottom:.8rem;
  color:#333;
}

.about-section p{
  line-height:1.6;
  color:#555;
  margin-bottom:.8rem;
}

.about-data-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.about-data-actions .share-link-status{
  position:static;
  min-height:1em;
  white-space:normal;
}

.efficacy-chart-wrap{
  border:1px solid #eee;
  border-radius:.5rem;
  padding:.8rem;
  background:#fff;
  margin:.8rem 0;
}

#efficacyChart{
  max-height:220px;
}

.efficacy-legend{
  display:flex;
  gap:1.5rem;
  justify-content:center;
  margin-top:.5rem;
}

.legend-item{
  display:flex;
  align-items:center;
  gap:.4rem;
  font-size:.85rem;
  color:#555;
}

.legend-color{
  width:14px;
  height:14px;
  border-radius:3px;
}

.legend-color.r21{ background:#127a3e; }
.legend-color.rtss{ background:#2196F3; }

.assumptions-list,
.sources-list{
  margin:0;
  padding-left:1.2rem;
  line-height:1.8;
  color:#555;
}

.assumptions-list li,
.sources-list li{
  margin-bottom:.4rem;
}

.caveat-note{
  font-size:.85rem;
  color:#666;
  font-style:italic;
  margin-top:1rem;
  padding-top:.75rem;
  border-top:1px solid #eee;
}

.last-updated{
  font-size:.85rem;
  color:#888;
  margin-top:1rem;
}

.completion-table,
.pricing-table,
.gavi-table{
  width:100%;
  border-collapse:collapse;
  margin:.8rem 0;
  font-size:.9rem;
}

.completion-table th,
.completion-table td,
.pricing-table th,
.pricing-table td,
.gavi-table th,
.gavi-table td{
  padding:.5rem .7rem;
  border:1px solid #e5e5e5;
  text-align:left;
}

.completion-table th,
.pricing-table th,
.gavi-table th{
  background:#f8f8f8;
  font-weight:600;
}

.source-note{
  font-size:.85rem;
  color:#777;
  font-style:italic;
}

.sources-list a{
  color:#127a3e;
}

.sources-list a:hover{
  text-decoration:underline;
}

/* ------------------------- Info button & panel ------------------------ */
.info-btn{
  position:fixed;
  top:50%;
  right:0;
  transform:translateY(-50%);
  width:28px;
  height:80px;
  border-radius:6px 0 0 6px;
  border:1px solid #ddd;
  border-right:none;
  background:#f8f8f8;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#666;
  transition:all .15s ease;
  z-index:100;
  box-shadow:-2px 0 6px rgba(0,0,0,.08);
  writing-mode:vertical-rl;
  text-orientation:mixed;
  font-size:.75rem;
  font-weight:500;
  letter-spacing:.03em;
}

.info-btn svg{
  transform:rotate(90deg);
  margin-bottom:4px;
}

.info-btn:hover{
  background:#fff;
  color:var(--accent);
  width:32px;
  box-shadow:-3px 0 10px rgba(0,0,0,.12);
}

/* Info panel overlay */
.info-panel-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.3);
  z-index:998;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
}

.info-panel-overlay.open{
  opacity:1;
  pointer-events:auto;
}

/* Info panel (slides from right) */
.info-panel{
  position:fixed;
  top:0;
  right:0;
  width:min(460px, 90vw);
  height:100vh;
  background:#fff;
  z-index:999;
  transform:translateX(100%);
  transition:transform .3s ease;
  display:flex;
  flex-direction:column;
  box-shadow:-4px 0 20px rgba(0,0,0,.15);
}

.info-panel.open{
  transform:translateX(0);
}

.info-panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1rem 1.25rem;
  border-bottom:1px solid #eee;
  flex-shrink:0;
}

.info-panel-header h2{
  margin:0;
  font-size:1.25rem;
  color:#222;
}

.info-panel-close{
  width:32px;
  height:32px;
  border:none;
  background:none;
  font-size:1.5rem;
  color:#666;
  cursor:pointer;
  border-radius:4px;
  transition:background .15s;
}

.info-panel-close:hover{
  background:#f0f0f0;
  color:#333;
}

.info-panel-content{
  flex:1;
  overflow-y:auto;
  padding:1.25rem;
  text-align:left;
}

/* ------------------------- Provenance badges ------------------------ */
.prov-badge{
  display:inline-block;
  padding:.1rem .35rem;
  border-radius:.2rem;
  font-size:.65rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.03em;
  vertical-align:middle;
  margin-left:.3rem;
}

.prov-sourced{
  background:#d1ecf1;
  color:#0c5460;
}

.prov-estimated{
  background:#fff3cd;
  color:#856404;
}

.provenance-legend{
  display:flex;
  flex-direction:column;
  gap:.6rem;
  margin-top:.8rem;
}

.provenance-item{
  display:flex;
  align-items:center;
  gap:.6rem;
  font-size:.9rem;
  color:#555;
}

/* ------------------------- Info tooltips ------------------------ */
.info-tooltip-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border:none;
  background:none;
  color:#888;
  cursor:pointer;
  padding:0;
  vertical-align:middle;
  margin-left:.2rem;
  transition:color .15s;
}

.info-tooltip-btn:hover{
  color:var(--accent);
}

.tooltip-popup{
  position:fixed;
  z-index:1000;
  max-width:320px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:.5rem;
  padding:.8rem 1rem;
  box-shadow:0 4px 16px rgba(0,0,0,.15);
  font-size:.85rem;
  line-height:1.5;
  color:#444;
  text-align:left;
}

.tooltip-popup strong{
  display:block;
  margin-bottom:.4rem;
  color:#222;
}

.tooltip-popup p{
  margin:0 0 .4rem 0;
}

.tooltip-popup p:last-child{
  margin-bottom:0;
}

/* Adjust needs card title for badges */
.needs-card-title{
  font-size:.85rem;
  color:#666;
  margin-bottom:.8rem;
  font-weight:500;
  text-transform:none;
  letter-spacing:0;
}

/* Adjust table header for badges */
.shipments-table th{
  white-space:nowrap;
}

/* ------------------------- Countries view ------------------------ */
#countriesView{
  max-width:1100px;
  margin:0 auto;
  text-align:left;
}

.countries-controls{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:1rem;
}

.countries-summary{
  margin-bottom:1rem;
  font-size:.95rem;
  color:#555;
}

.countries-table{
  width:100%;
  border-collapse:collapse;
  font-size:.9rem;
}

.countries-table th,
.countries-table td{
  padding:.65rem .8rem;
  text-align:left;
  border-bottom:1px solid #eee;
}

.countries-table th{
  background:#f8f8f8;
  font-weight:600;
  color:#444;
  position:sticky;
  top:0;
  white-space:nowrap;
}

.countries-table th.num,
.countries-table td.num{
  text-align:right;
}

.countries-table tbody tr:hover{
  background:#f5faf7;
}

/* Coverage bar - positioned absolutely within cell for alignment */
.coverage-cell{
  position:relative;
  min-width:90px;
}

.coverage-bar{
  position:absolute;
  left:0;
  top:50%;
  transform:translateY(-50%);
  width:50px;
  height:6px;
  background:#e5e5e5;
  border-radius:3px;
  overflow:hidden;
}

.coverage-bar-fill{
  height:100%;
  border-radius:3px;
}

/* Color scale for coverage */
.coverage-bar-fill.cov-low{ background:#dc3545; }
.coverage-bar-fill.cov-med{ background:#ffc107; }
.coverage-bar-fill.cov-high{ background:var(--accent); }

.coverage-pct{
  margin-left:56px;
  display:inline-block;
}

/* Sortable table headers */
.sortable-table th.sortable{
  cursor:pointer;
  user-select:none;
  transition:background .15s;
}

.sortable-table th.sortable:hover{
  background:#eef5ef;
}

.sortable-table th.sortable::after{
  content:'';
  display:inline-block;
  width:0;
  height:0;
  margin-left:4px;
  vertical-align:middle;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:4px solid #999;
  opacity:0.3;
}

.sortable-table th.sortable.sort-asc::after{
  border-top:none;
  border-bottom:4px solid var(--accent);
  opacity:1;
}

.sortable-table th.sortable.sort-desc::after{
  border-top:4px solid var(--accent);
  opacity:1;
}

.sort-hint{
  font-size:.8rem;
  color:#888;
  margin-left:auto;
  font-style:italic;
}

/* ------------------------- Dose flow summary ------------------------ */
.sankey-intro{
  color:#555;
  margin-bottom:.5rem;
}

.dose-flow-list{
  margin:.35rem 0 .9rem 1rem;
  padding:0;
  color:#333;
}

.dose-flow-list li{
  margin:.3rem 0;
  line-height:1.35;
}

/* ======================== Map View ======================== */
#mapView{
  max-width:920px;
  margin:0 auto;
  padding:0 8px;
}

.map-controls{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:1rem;
  justify-content:center;
}

.map-container{
  position:relative;
  background:#f8fafa;
  border-radius:.5rem;
  border:1px solid #e5e5e5;
  overflow:hidden;
}

#africaMap{
  width:100%;
  height:auto;
  max-height:600px;
  display:block;
}

#africaMap path{
  stroke:#fff;
  stroke-width:0.5;
  cursor:pointer;
  transition:opacity .15s, stroke-width .15s;
}

#africaMap path:hover{
  stroke-width:1.5;
  opacity:0.85;
}

#africaMap path.no-data{
  fill:#ddd;
  cursor:default;
}

.map-tooltip{
  position:fixed;
  background:rgba(0,0,0,.85);
  color:#fff;
  padding:8px 12px;
  border-radius:4px;
  font-size:.85rem;
  pointer-events:none;
  z-index:999;
  max-width:250px;
  line-height:1.4;
}

.map-tooltip strong{
  display:block;
  margin-bottom:4px;
  font-size:.95rem;
}

.map-legend{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:16px;
  margin-top:1rem;
  flex-wrap:wrap;
}

.map-legend-item{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.85rem;
  color:#555;
}

.map-legend-color{
  width:16px;
  height:16px;
  border-radius:3px;
  border:1px solid rgba(0,0,0,.1);
}

/* Continuous legend (gradient bar) */
.map-legend-gradient{
  display:flex;
  align-items:center;
  gap:8px;
}

.map-legend-bar{
  width:200px;
  height:12px;
  border-radius:3px;
  border:1px solid rgba(0,0,0,.1);
}

.map-legend-labels{
  display:flex;
  justify-content:space-between;
  width:200px;
  font-size:.75rem;
  color:#666;
  margin-top:2px;
}

/* ======================== Footer ======================== */
.site-footer{
  margin-top:4rem;
  padding:2rem 1rem;
  background:#f8f9fa;
  border-top:1px solid #e5e5e5;
  text-align:center;
}

.footer-content{
  max-width:800px;
  margin:0 auto;
}

.footer-attribution{
  font-size:1rem;
  color:#333;
  margin-bottom:0.75rem;
}

.footer-links{
  font-size:0.9rem;
  color:#666;
  margin-bottom:0.75rem;
}

.footer-links a{
  color:var(--accent);
  text-decoration:none;
}

.footer-links a:hover{
  text-decoration:underline;
}

.footer-sep{
  margin:0 0.5rem;
  color:#ccc;
}

.footer-note{
  color:#888;
}

.footer-disclaimer{
  font-size:0.8rem;
  color:#888;
  max-width:600px;
  margin:0.5rem auto 0;
  line-height:1.5;
}

/* ======================== Methodology Notes ======================== */
.methodology-note{
  font-size:0.85rem;
  color:#666;
  background:#f8f9fa;
  border-left:3px solid var(--accent);
  padding:0.75rem 1rem;
  margin:1rem 0;
  text-align:left;
  line-height:1.5;
  border-radius:0 4px 4px 0;
}

.methodology-note a{
  color:var(--accent);
  text-decoration:none;
}

.methodology-note a:hover{
  text-decoration:underline;
}

.methodology-note.map-note{
  text-align:center;
  border-left:none;
  border-radius:4px;
  margin-bottom:0.5rem;
}

/* ======================== Responsive ======================== */
@media (max-width: 900px){
  .topbar{
    margin:2.5rem auto 2rem auto;
  }

  .row{
    flex-wrap:wrap;
  }

  .row-top{
    white-space:normal;
  }

  .tracker-controls{
    flex-wrap:wrap;
  }

  .chart-actions{
    justify-content:center;
  }

  .map-controls{
    flex-wrap:wrap;
  }

  .table-actions{
    justify-content:center;
  }
}

@media (max-width: 640px){
  body{
    padding-bottom:2rem;
  }

  .topbar{
    margin:2rem auto 1.5rem auto;
  }

  .row{
    display:flex;
    width:100%;
  }

  .row > div{
    width:100%;
  }

  .share-link-wrap{
    width:100%;
    padding-bottom:0;
  }

  .share-link-status{
    position:static;
    white-space:normal;
    min-height:1em;
  }


  select{
    width:100%;
  }

  .tracker-controls{
    flex-direction:column;
    align-items:stretch;
  }

  .tracker-controls > div{
    justify-content:space-between;
  }

  .metric{
    margin:1.4rem 0;
  }

  .value{
    font-size:2.2rem;
  }

  .trendCanvasWrap{
    padding:.45rem;
  }

  .needs-compare-header{
    align-items:flex-start;
  }

  .shipments-table th,
  .shipments-table td,
  .countries-table th,
  .countries-table td{
    padding:.5rem .6rem;
    font-size:.85rem;
  }

  .info-panel{
    width:100%;
  }
}

#metricInfoBtn{
  display:inline-flex;
  width:20px;
  height:20px;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
}
