/* ══ EDIT COLORS HERE — theme tokens (Pathways Climate Institute brand) ══ */
:root {
  --bg:       #eaf3f7;
  --surface:  #f4f9fb;
  --surface2: #ffffff;
  --border:   #cfe0e6;
  --accent:   #3D6B35;
  --accent2:  #5CA0C7;
  --accent3:  #8DC63F;
  --accent4:  #c0533a;
  --accent-dark: #2c5227;
  --txt:      #223326;
  --txt2:     #4a6b57;
  --txt3:     #7a9a86;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body{font-family:'Nunito Sans',sans-serif;background:var(--bg);color:var(--txt);
     font-size:13px;line-height:1.5;display:flex;flex-direction:column}

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
#topbar{background:var(--accent);border-bottom:1px solid var(--accent-dark);
  height:68px;padding:0 1.2rem;display:flex;align-items:center;gap:1rem;flex-shrink:0;z-index:200}
.brand-logo{height:40px;width:auto;flex-shrink:0}
.brand-text{flex:1;min-width:0}
.brand-title{font-family:'Quicksand',sans-serif;font-size:14px;font-weight:700;color:#f4f9fb;letter-spacing:.02em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ── BODY / MAP (full-width — no side panel) ────────────────────────────── */
#body{display:flex;flex:1;overflow:hidden;min-height:0}
#mapWrap{position:relative;flex:1;min-height:0;overflow:hidden;width:100%}
#map{width:100%;height:100%;background:#1a2e3a}

/* ── VERTICAL SCENARIO SELECTOR (flexbox tick list — click to jump) ──────── */
#scSliderPanel{
  position:absolute; top:80px; left:16px; z-index:500;
  background:rgba(61,107,53,.94); border:1px solid rgba(92,160,199,.35); border-radius:12px;
  padding:1.1rem .9rem; display:flex; flex-direction:column; align-items:center; gap:.6rem;
  height:calc(100vh - 140px);
  max-height:900px;
}
.sc-slider-label{font-family:'Quicksand',sans-serif;font-size:12px;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:#bcdeee;flex-shrink:0}
.sc-slider-value{font-family:'Quicksand',sans-serif;font-size:20px;font-weight:700;color:#f4f9fb;flex-shrink:0}

.sc-tick-list{
  display:flex; flex-direction:column; justify-content:space-between;
  flex:1; min-height:0; width:100%; position:relative;
}
.sc-tick-row{
  display:flex; align-items:center; gap:6px; cursor:pointer; flex-shrink:0;
  padding:2px 0;
}
.sc-tick-row .sc-tick-label{
  font-family:'Quicksand',sans-serif; font-size:11px; font-weight:600; color:#c8dfe2;
  min-width:34px; text-align:right;
}
.sc-tick-row .sc-tick-dash{
  height:2px; flex:1; background:rgba(217,236,223,.35); border-radius:1px;
}
.sc-tick-row:hover .sc-tick-label{ color:#f4f9fb; }
.sc-tick-row:hover .sc-tick-dash{ background:rgba(217,236,223,.6); }

.sc-tick-row.active .sc-tick-label{ color:#f4f9fb; font-weight:700; }
.sc-tick-row.active .sc-tick-dash{ background:#8DC63F; height:3px; }
.sc-tick-row.active::after{
  content:''; width:10px; height:10px; border-radius:50%;
  background:#8DC63F; border:2px solid #f4f9fb; flex-shrink:0;
}

/* ── LEAFLET OVERRIDES ───────────────────────────────────────────────────── */
.leaflet-container{background:#071820!important}
.leaflet-control-attribution{background:rgba(20,40,25,.8)!important;color:var(--txt3)!important;font-size:9px!important}
.leaflet-control-attribution a{color:var(--txt3)!important}
.leaflet-bar{background:var(--surface2)!important;border-color:var(--border)!important}
.leaflet-bar a{background:var(--surface2)!important;color:var(--txt)!important;border-color:var(--border)!important}
.leaflet-bar a:hover{background:var(--surface)!important}
.map-tooltip{background:var(--surface2)!important;border:1px solid var(--border)!important;
  color:var(--txt)!important;font-family:'Nunito Sans',sans-serif!important;font-size:12px!important;
  border-radius:6px!important;box-shadow:0 4px 16px rgba(0,0,0,.5)!important;padding:6px 10px!important}
.map-tooltip::before{display:none!important}

/* ── MAP LEGEND ──────────────────────────────────────────────────────────── */
#mapLegend{position:absolute;top:10px;right:10px;z-index:500;
  background:rgba(61,107,53,.94);border:1px solid rgba(92,160,199,.3);border-radius:8px;
  padding:.6rem .8rem;min-width:220px;max-width:260px;
  max-height:calc(100% - 20px);overflow-y:auto}
.leg-title{font-family:'Quicksand',sans-serif;font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:#bcdeee;margin-bottom:5px}
.leg-row{display:flex;align-items:center;gap:6px;margin-bottom:4px;font-size:11px;color:#d9ecdf}
.leg-sep{border:none;border-top:1px solid rgba(92,160,199,.25);margin:5px 0}
.legend-row{display:flex;align-items:center;gap:6px;margin:3px 0;font-size:10px;color:#d9ecdf}
.swatch{display:inline-block;width:14px;height:10px;border-radius:2px;flex-shrink:0}

#legendToggle{display:none;position:absolute;top:10px;right:10px;z-index:600;
  background:rgba(61,107,53,.94);border:1px solid rgba(92,160,199,.4);color:#f4f9fb;
  font-family:'Quicksand',sans-serif;font-size:11px;font-weight:600;letter-spacing:.04em;
  padding:6px 10px;border-radius:8px;cursor:pointer}

/* ── LOADING OVERLAY ─────────────────────────────────────────────────────── */
#loadingOverlay{position:fixed;inset:0;background:var(--bg);z-index:9999;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem}
.load-title{font-family:'Quicksand',sans-serif;font-size:17px;font-weight:700;color:var(--accent)}
.load-bar-track{width:200px;height:3px;background:var(--surface2);border-radius:2px;overflow:hidden}
.load-bar-fill{height:100%;background:var(--accent);border-radius:2px;
  animation:lbar 1.4s ease-in-out infinite}
@keyframes lbar{0%{width:0%;margin-left:0}50%{width:60%;margin-left:20%}100%{width:0%;margin-left:100%}}

/* ── LANDING DISCLAIMER MODAL ────────────────────────────────────────────── */
.disclaimer-modal{ display:none; position:fixed; inset:0; z-index:10000;
  background:rgba(0,0,0,.55); align-items:center; justify-content:center; padding:1.5rem; }
.disclaimer-box{ background:#fff; max-width:560px; width:100%; border-radius:10px;
  padding:1.75rem 1.75rem 1.5rem; box-shadow:0 12px 40px rgba(0,0,0,.3); font-family:'Nunito Sans',sans-serif; }
.disclaimer-title{ font-family:'Quicksand',sans-serif; font-size:1.15rem; font-weight:700; color:var(--accent); margin-bottom:.75rem; }
.disclaimer-text{ font-size:.9rem; line-height:1.5; color:#333; margin-bottom:1.25rem; }
.disclaimer-text p{ margin:0 0 .85rem; }
.disclaimer-text p:last-child{ margin-bottom:0; }
.disclaimer-btn{ background:var(--accent); color:#fff; border:none; border-radius:6px;
  padding:.55rem 1.1rem; font-size:.9rem; font-weight:600; cursor:pointer; font-family:'Nunito Sans',sans-serif; }
.disclaimer-btn:hover{ background:var(--accent-dark); }

/* ══ MOBILE / NARROW SCREENS ══════════════════════════════════════════════ */
@media (max-width:768px){
  html,body{overflow:auto}
  #topbar{height:auto;flex-wrap:wrap;padding:.5rem .8rem;gap:.4rem .8rem;position:sticky;top:0}
  .brand-title{white-space:normal}
  .brand-logo{height:30px}

  #body{flex:1;overflow:hidden}
  #mapWrap{height:100%}

  #legendToggle{display:block}
  #mapLegend.collapsed{display:none}
  #mapLegend{top:48px;left:10px;right:10px;max-width:none;width:auto;max-height:calc(100% - 58px)}

  /* Tick-list panel shrinks to fit smaller screens rather than the row layout
     the old native-slider version used — the click-list works fine narrower. */
  #scSliderPanel{top:auto;bottom:16px;left:10px;height:70vh;max-height:none;width:150px}
}

/* ── Legend checkbox/radio label alignment ──────────────────────────────── */
#mapLegend label{
  display:flex; align-items:center; gap:6px; line-height:1;
}
#mapLegend input[type="checkbox"],
#mapLegend input[type="radio"]{
  margin:0; flex-shrink:0; position:relative; top:0;
}
#mapLegend .legend-row{
  display:flex; align-items:center; line-height:1;
}