/* Final cleanup: one source of truth */

/* Hapus floating investment dari halaman utama */
#givFloatingInvest,
.giv-floating-invest,
.floating-invest,
.floating-investment{
  display:none!important;
}

/* Speaker state */
.giv-speaker-off{
  opacity:.55!important;
}
.giv-speaker-speaking{
  box-shadow:0 0 0 3px rgba(107,88,170,.18)!important;
}

/* Modal profil marker */
#givFinalProfileModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:30000;
  background:rgba(20,16,30,.58);
  align-items:center;
  justify-content:center;
  padding:18px;
}
#givFinalProfileModal.show{display:flex}
#givFinalProfileCard{
  width:min(720px,94vw);
  max-height:84vh;
  overflow:auto;
  background:#fff;
  border-radius:18px;
  padding:20px;
  box-shadow:0 22px 70px rgba(0,0,0,.25);
}
#givFinalProfileCard h3{
  margin:0 0 6px;
  font-size:19px;
  color:#312843;
}
.giv-final-meta{
  font-size:11px;
  color:#786e82;
  margin-bottom:12px;
}
.giv-final-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  margin:12px 0;
}
.giv-final-fact{
  border:1px solid #ece8f1;
  border-radius:11px;
  padding:10px;
}
.giv-final-fact small{
  display:block;
  color:#887f91;
  font-size:9px;
  margin-bottom:3px;
}
.giv-final-fact strong{
  font-size:11px;
  color:#43384f;
}
.giv-final-desc{
  font-size:11px;
  line-height:1.55;
  color:#554d5e;
  margin-top:12px;
}
.giv-final-actions{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  margin-top:14px;
}
.giv-final-actions button{
  border:0;
  border-radius:9px;
  padding:8px 11px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.giv-final-close{background:#efedf3;color:#50475b}
.giv-final-invest{background:#6b58aa;color:#fff}

@media(max-width:600px){
  .giv-final-grid{grid-template-columns:1fr}
}

/* ===== V4 compact toolbar + map modal ===== */
.quick{
  display:grid!important;
  grid-template-columns:
    minmax(145px,1.05fr)
    minmax(175px,1.15fr)
    minmax(135px,.9fr)
    90px
    70px
    120px!important;
  gap:8px!important;
  align-items:stretch!important;
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}

.quick > *{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

.quick select,
.quick input,
.quick button{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  font-size:11px!important;
  line-height:1.15!important;
}

#searchBtn{
  min-width:90px!important;
  padding:0 12px!important;
}

#allProjectsBtn{
  min-width:70px!important;
  padding:0 8px!important;
}

#mapBtn{
  min-width:120px!important;
  padding:0 10px!important;
  font-size:10px!important;
}

/* map modal always fits viewport */
#mapModal{
  align-items:center!important;
  justify-content:center!important;
  overflow:auto!important;
  padding:14px!important;
  box-sizing:border-box!important;
}

#mapModal .modal-card,
#mapModal .modal-content{
  position:relative!important;
  width:min(980px,92vw)!important;
  max-width:980px!important;
  max-height:86vh!important;
  overflow:auto!important;
  margin:auto!important;
  border-radius:16px!important;
  box-sizing:border-box!important;
  padding:18px!important;
}

#potentialMap,
#map{
  width:100%!important;
  min-height:390px!important;
  height:46vh!important;
  max-height:480px!important;
  border-radius:14px!important;
}

/* force close button visible */
#mapModal .close,
#mapModal .modal-close,
#mapModal [data-close],
#mapModal button[onclick*="closeMap"]{
  position:sticky!important;
  top:0!important;
  margin-left:auto!important;
  z-index:10020!important;
}

/* in-map investment button */
#givMapInvestBtnFinal{
  border:0!important;
  border-radius:10px!important;
  padding:9px 13px!important;
  background:#16a34a!important;
  color:#fff!important;
  font-size:10px!important;
  font-weight:800!important;
  cursor:pointer!important;
  white-space:nowrap!important;
  margin-left:auto!important;
}

/* keep external floating hidden */
#givFloatingInvest,
.giv-floating-invest,
.floating-invest,
.floating-investment{
  display:none!important;
}

@media(max-width:1050px){
  .quick{
    grid-template-columns:
      minmax(135px,1fr)
      minmax(155px,1fr)
      minmax(125px,.85fr)
      86px
      66px
      108px!important;
    gap:6px!important;
  }
  .quick select,
  .quick input,
  .quick button{
    font-size:10px!important;
  }
}

@media(max-width:820px){
  .quick{
    grid-template-columns:1fr 1fr!important;
  }
  #searchBtn,
  #allProjectsBtn,
  #mapBtn{
    min-width:0!important;
  }
  #mapModal .modal-card,
  #mapModal .modal-content{
    width:95vw!important;
    max-height:88vh!important;
    padding:14px!important;
  }
  #potentialMap,
  #map{
    min-height:340px!important;
    height:44vh!important;
    max-height:410px!important;
  }
}

@media(max-width:560px){
  .quick{
    grid-template-columns:1fr!important;
  }
}

/* ===== V5 ultra compact toolbar ===== */
.quick{
  display:grid!important;
  grid-template-columns:
    minmax(140px,1fr)
    minmax(160px,1.08fr)
    minmax(130px,.82fr)
    88px
    62px
    112px!important;
  gap:6px!important;
  align-items:stretch!important;
  width:100%!important;
  min-width:0!important;
}
.quick > *{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.quick select,.quick input,.quick button{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:10px!important;
  padding-left:9px!important;
  padding-right:9px!important;
}
#searchBtn{min-width:88px!important;font-size:10px!important}
#allProjectsBtn{min-width:62px!important;font-size:10px!important}
#mapBtn{
  min-width:112px!important;
  max-width:112px!important;
  font-size:9px!important;
  line-height:1.05!important;
  padding-left:7px!important;
  padding-right:7px!important;
}

@media(max-width:1080px){
  .quick{
    grid-template-columns:
      minmax(125px,1fr)
      minmax(145px,1fr)
      minmax(118px,.8fr)
      80px
      58px
      100px!important;
    gap:5px!important;
  }
  .quick select,.quick input,.quick button{font-size:9px!important}
  #mapBtn{min-width:100px!important;max-width:100px!important;font-size:8px!important}
}

@media(max-width:820px){
  .quick{grid-template-columns:1fr 1fr!important}
  #mapBtn,#searchBtn,#allProjectsBtn{min-width:0!important;max-width:none!important}
}

/* ===== FIX MODAL ABOVE MAP ===== */
#mapModal{
  z-index:9000!important;
}

#interestModal{
  z-index:12000!important;
}

#givFinalProfileModal{
  z-index:12500!important;
}

#mapModal .leaflet-container{
  z-index:1!important;
}

#mapModal .leaflet-pane,
#mapModal .leaflet-top,
#mapModal .leaflet-bottom{
  z-index:400!important;
}

/* ===== FIX LEAFLET ROUTE LAYER ===== */
#mapModal .leaflet-tile-pane{
  z-index:200!important;
}

#mapModal .leaflet-overlay-pane{
  z-index:450!important;
}

#mapModal .leaflet-shadow-pane{
  z-index:500!important;
}

#mapModal .leaflet-marker-pane{
  z-index:600!important;
}

#mapModal .leaflet-tooltip-pane{
  z-index:650!important;
}

#mapModal .leaflet-popup-pane{
  z-index:700!important;
}

#mapModal .leaflet-top,
#mapModal .leaflet-bottom{
  z-index:800!important;
}

/* ===== ROUTE FINAL ===== */
#mapModal .leaflet-overlay-pane{
  z-index:450!important;
}

#mapModal .leaflet-marker-pane{
  z-index:600!important;
}

#mapModal .leaflet-popup-pane{
  z-index:700!important;
}

.giv-route-tooltip{
  background:#fff!important;
  color:#d96500!important;
  border:2px solid #ff7a00!important;
  border-radius:8px!important;
  font-size:10px!important;
  font-weight:800!important;
  padding:5px 8px!important;
  box-shadow:0 4px 12px rgba(0,0,0,.18)!important;
}
