/* Flux Montréal — Popup V3 compact pass
   Visual-only density tuning. Keeps V3 design and data intact. */

/* Global density */
.leaflet-popup .fmv3-card{
  padding:12px 13px 11px!important;
}
.leaflet-popup .fmv3-topline{
  min-height:22px!important;
  gap:9px!important;
  padding-right:31px!important;
}
.leaflet-popup .fmv3-live{
  padding:4px 7px!important;
  font-size:8px!important;
}
.leaflet-popup .fmv3-kind{
  font-size:8px!important;
}
.leaflet-popup .fmv3-heading{
  margin-top:7px!important;
  padding-bottom:8px!important;
}
.leaflet-popup .fmv3-heading h3{
  font-size:20px!important;
}
.leaflet-popup .fmv3-heading p{
  margin-top:4px!important;
  font-size:10.5px!important;
}
.leaflet-popup .fmv3-destination{
  margin-top:7px!important;
  padding:8px 9px!important;
}
.leaflet-popup .fmv3-grid{
  gap:6px!important;
  margin-top:7px!important;
}
.leaflet-popup .fmv3-metric{
  min-height:49px!important;
  padding:7px 8px!important;
  gap:7px!important;
  border-radius:10px!important;
}
.leaflet-popup .fmv3-metric-icon{
  width:25px!important;
  height:25px!important;
  flex-basis:25px!important;
  border-radius:7px!important;
}
.leaflet-popup .fmv3-metric-icon i{
  font-size:14px!important;
}
.leaflet-popup .fmv3-metric-copy{
  gap:2px!important;
}
.leaflet-popup .fmv3-metric-copy strong{
  font-size:10.5px!important;
}
.leaflet-popup .fmv3-footerinfo{
  gap:6px!important;
  margin-top:7px!important;
  padding-top:7px!important;
}
.leaflet-popup .fmv3-info{
  gap:6px!important;
}
.leaflet-popup .fmv3-info>i{
  font-size:13px!important;
}
.leaflet-popup .fmv3-footnote{
  margin-top:6px!important;
  font-size:8px!important;
}

/* Bus / train: slightly narrower while retaining the 2x2 telemetry layout */
.leaflet-popup.hm-bus-popup,
.leaflet-popup.hm-train-popup{
  width:305px!important;
  max-width:305px!important;
}

/* BIXI */
.leaflet-popup.hm-bixi-popup{
  width:315px!important;
  max-width:315px!important;
}
.leaflet-popup.hm-bixi-popup .fmv3-bixi-state{
  margin-top:7px!important;
  padding:6px 8px!important;
}
.leaflet-popup.hm-bixi-popup .fmv3-grid-3 .fmv3-metric{
  min-height:58px!important;
  padding:7px 5px!important;
  gap:4px!important;
}
.leaflet-popup.hm-bixi-popup .fmv3-grid-3 .fmv3-metric-icon{
  width:24px!important;
  height:24px!important;
  flex-basis:24px!important;
}
.leaflet-popup.hm-bixi-popup .fmv3-grid-3 .fmv3-metric-copy strong{
  font-size:14px!important;
}
.leaflet-popup.hm-bixi-popup .fmv3-gauge{
  margin-top:7px!important;
  padding:8px 9px!important;
}
.leaflet-popup.hm-bixi-popup .fmv3-gauge-track{
  margin:6px 0 5px!important;
}

/* Roadworks: substantially more compact, same information hierarchy */
.leaflet-popup.hm-entraves-popup{
  width:365px!important;
  max-width:min(365px,calc(100vw - 28px))!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-card{
  padding:11px 13px 10px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-heading{
  margin-top:6px!important;
  padding-bottom:7px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-heading h3{
  font-size:20px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-heading p{
  margin-top:3px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-impact{
  margin-top:7px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-impact>span{
  padding:5px 7px!important;
  font-size:8.5px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-section{
  margin-top:8px!important;
  padding:8px 9px!important;
  border-radius:9px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-section p{
  margin-top:5px!important;
  font-size:10px!important;
  line-height:1.35!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-timeline{
  gap:6px!important;
  margin-top:8px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-timeline>div{
  padding:15px 8px 7px!important;
  border-radius:9px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-timeline:before{
  top:6px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-timeline strong{
  margin-top:3px!important;
  font-size:9px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-road-update{
  margin-top:7px!important;
  padding-top:7px!important;
}
.leaflet-popup.hm-entraves-popup .fmv3-action{
  margin-top:8px!important;
  padding:8px 9px!important;
  font-size:9.5px!important;
}

/* Leaflet close button: a little tighter */
.leaflet-popup.hm-bus-popup .leaflet-popup-close-button,
.leaflet-popup.hm-train-popup .leaflet-popup-close-button,
.leaflet-popup.hm-bixi-popup .leaflet-popup-close-button,
.leaflet-popup.hm-entraves-popup .leaflet-popup-close-button{
  top:9px!important;
  right:9px!important;
  width:27px!important;
  height:27px!important;
  line-height:24px!important;
}

@media(max-width:768px){
  .leaflet-popup.hm-bus-popup,
  .leaflet-popup.hm-train-popup{
    width:min(300px,calc(100vw - 18px))!important;
    max-width:min(300px,calc(100vw - 18px))!important;
  }
  .leaflet-popup.hm-bixi-popup{
    width:min(305px,calc(100vw - 18px))!important;
    max-width:min(305px,calc(100vw - 18px))!important;
  }
  .leaflet-popup.hm-entraves-popup{
    width:min(310px,calc(100vw - 18px))!important;
    max-width:min(310px,calc(100vw - 18px))!important;
  }
  .leaflet-popup .fmv3-card{
    padding:11px 12px 10px!important;
  }
  .leaflet-popup .fmv3-heading h3{
    font-size:19px!important;
  }
  .leaflet-popup .fmv3-metric{
    min-height:47px!important;
    padding:6px 7px!important;
  }
  .leaflet-popup.hm-entraves-popup .fmv3-card{
    padding:10px 11px 9px!important;
  }
  .leaflet-popup.hm-entraves-popup .fmv3-timeline{
    grid-template-columns:1fr 1fr!important;
  }
  .leaflet-popup.hm-entraves-popup .fmv3-timeline:before{
    display:block!important;
  }
}
