/* ==========================================================
   Sama Suuf — Correctif visuel SIG V5.5
   Couches / Analyse / Mesures / Explorer / Itinéraire
   ========================================================== */

:root{
  --ss55-border:#d9e6e0;
  --ss55-border-soft:#e7efeb;
  --ss55-text:#173d33;
  --ss55-muted:#6e817a;
  --ss55-primary:#087054;
  --ss55-soft:#f5faf7;
}

/* Tous les drawers SIG : typographie sûre, jamais de mots cassés verticalement. */
#resultDrawer,
#mapControlDrawer,
#referenceLayerPanel,
#mapExplorerDrawer{
  box-sizing:border-box!important;
  overflow-x:hidden!important;
  scrollbar-width:thin;
  scrollbar-color:#a9bbb4 transparent;
}
#resultDrawer *,
#mapControlDrawer *,
#referenceLayerPanel *,
#mapExplorerDrawer *{
  min-width:0;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  hyphens:none!important;
}
#resultDrawer::-webkit-scrollbar,
#mapControlDrawer::-webkit-scrollbar,
#referenceLayerPanel::-webkit-scrollbar,
#mapExplorerDrawer::-webkit-scrollbar{width:7px}
#resultDrawer::-webkit-scrollbar-thumb,
#mapControlDrawer::-webkit-scrollbar-thumb,
#referenceLayerPanel::-webkit-scrollbar-thumb,
#mapExplorerDrawer::-webkit-scrollbar-thumb{background:#a9bbb4;border-radius:999px}

/* En-têtes : titre à gauche, croix toujours en haut à droite. */
#resultDrawer .sb-map-drawer-head,
#mapControlDrawer .sb-map-mini-drawer-head,
#referenceLayerPanel .sb-map-mini-drawer-head,
#mapExplorerDrawer .sb-map-mini-drawer-head{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:14px!important;
}
#resultDrawer .sb-map-drawer-head>div,
#mapControlDrawer .sb-map-mini-drawer-head>div,
#referenceLayerPanel .sb-map-mini-drawer-head>div,
#mapExplorerDrawer .sb-map-mini-drawer-head>div{flex:1 1 auto!important}
#resultDrawer .sb-icon-button,
#mapControlDrawer .sb-icon-button,
#referenceLayerPanel .sb-icon-button,
#mapExplorerDrawer .sb-icon-button{
  flex:0 0 48px!important;
  width:48px!important;
  height:48px!important;
  border-radius:15px!important;
}

/* ==========================================================
   ANALYSE
   ========================================================== */
@media (min-width:901px){
  #resultDrawer{
    width:470px!important;
    top:14px!important;
    right:122px!important;
    bottom:auto!important;
    height:auto!important;
    max-height:min(660px,calc(100% - 122px))!important;
    padding:18px!important;
  }
}
#resultDrawer .sb-map-drawer-head{margin-bottom:12px!important}
#resultDrawer .sb-map-drawer-head h3{font-size:1.12rem!important;line-height:1.25!important}
#resultDrawer .sb-map-result-status{padding:15px 16px!important;border-radius:18px!important;margin-bottom:10px!important}
#resultDrawer .sb-map-result-status strong{font-size:.92rem!important}
#resultDrawer .sb-map-result-status p{font-size:.72rem!important;line-height:1.45!important;margin-top:3px!important}

/* Synthèse narrative plus compacte mais confortable. */
#resultDrawer .sb-map-narrative-summary{padding:14px 15px!important;border-radius:17px!important;margin-top:10px!important}
#resultDrawer .sb-map-narrative-head{gap:10px!important;margin-bottom:8px!important}
#resultDrawer .sb-map-narrative-head strong{font-size:.82rem!important}
#resultDrawer .sb-map-narrative-head button{font-size:.67rem!important;white-space:nowrap!important}
#resultDrawer .sb-map-narrative-copy{font-size:.72rem!important;line-height:1.55!important;gap:8px!important}
#resultDrawer .sb-map-narrative-summary.is-collapsed .sb-map-narrative-copy{max-height:106px!important}

/* Chiffres de synthèse : 2 colonnes seulement si elles restent lisibles. */
#resultDrawer .sb-map-result-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin-top:10px!important}
#resultDrawer .sb-map-result-metric{min-height:92px!important;padding:12px 13px!important;border-radius:16px!important}
#resultDrawer .sb-map-result-metric small{font-size:.62rem!important;line-height:1.25!important}
#resultDrawer .sb-map-result-metric strong{font-size:.86rem!important;line-height:1.32!important}
#resultDrawer .sb-map-result-metric em{font-size:.62rem!important;line-height:1.3!important}
#resultDrawer .sb-map-result-location,
#resultDrawer .sb-map-result-attention,
#resultDrawer .sb-map-result-geometry{margin-top:10px!important;border-radius:16px!important}
#resultDrawer .sb-map-result-location{padding:13px 15px!important}
#resultDrawer .sb-map-result-attention{min-height:52px!important;padding:10px 14px!important}
#resultDrawer .sb-map-result-geometry{gap:10px!important}

/* Actions compactes et stables. */
#resultDrawer .sb-map-result-actions{
  display:grid!important;
  grid-template-columns:1fr 1.2fr!important;
  gap:9px!important;
  position:sticky!important;
  bottom:-18px!important;
  z-index:8!important;
  padding:10px 0 1px!important;
  background:linear-gradient(to top,#fff 76%,rgba(255,255,255,0))!important;
}
#resultDrawer .sb-map-result-actions .sb-button{min-height:42px!important;padding:8px 10px!important;font-size:.66rem!important;white-space:nowrap!important}

/* Contrôles techniques : UNE colonne dans ce drawer.
   Le badge de valeur passe sous le texte, jamais en colonne étroite. */
#resultAdvancedHost .sb-check-controls{grid-template-columns:1fr!important;gap:9px!important}
#resultAdvancedHost .sb-check-control{
  grid-template-columns:34px minmax(0,1fr)!important;
  align-items:start!important;
  gap:10px!important;
  padding:12px!important;
  border-radius:14px!important;
}
#resultAdvancedHost .sb-check-control-icon{width:32px!important;height:32px!important}
#resultAdvancedHost .sb-check-control strong{font-size:.78rem!important;line-height:1.35!important}
#resultAdvancedHost .sb-check-control small{font-size:.66rem!important;line-height:1.42!important}
#resultAdvancedHost .sb-check-control .sb-map-link-label{display:inline-flex!important;margin-top:5px!important;font-size:.64rem!important;line-height:1.2!important}
#resultAdvancedHost .sb-check-control>b{
  grid-column:2!important;
  justify-self:start!important;
  max-width:100%!important;
  padding:7px 10px!important;
  border-radius:10px!important;
  text-align:left!important;
  white-space:normal!important;
  font-size:.68rem!important;
  line-height:1.3!important;
}

/* Les accordéons détails restent petits et propres. */
#resultAdvancedHost{display:grid!important;gap:9px!important;margin-top:10px!important}
#resultAdvancedHost .sb-result-fold{margin:0!important;border-radius:14px!important}
#resultAdvancedHost .sb-result-fold>summary{grid-template-columns:auto minmax(0,1fr) auto!important;padding:10px 12px!important;gap:9px!important}
#resultAdvancedHost .sb-result-fold>summary::after{grid-column:3!important}
#resultAdvancedHost .sb-fold-badge{display:none!important}
#resultAdvancedHost .sb-fold-copy strong{font-size:.72rem!important;line-height:1.3!important}
#resultAdvancedHost .sb-fold-copy small{display:none!important}

/* Mesures et comparaison : UNE colonne pour éviter les textes tronqués. */
#resultAdvancedHost .sb-detail-grid-compact{grid-template-columns:1fr!important;gap:10px!important}
#resultAdvancedHost .sb-detail-grid-compact>.sb-card{padding:13px 14px!important;border-radius:14px!important}
#resultAdvancedHost .sb-detail-grid-compact .sb-section-title{margin-bottom:8px!important}
#resultAdvancedHost .sb-detail-grid-compact .sb-section-title h3{font-size:.8rem!important;line-height:1.3!important}
#resultAdvancedHost .sb-detail-grid-compact .sb-eyebrow{font-size:.59rem!important}
#resultAdvancedHost .sb-key-value{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(110px,42%)!important;
  align-items:center!important;
  gap:12px!important;
  min-height:40px!important;
  padding:7px 0!important;
}
#resultAdvancedHost .sb-key-value span{font-size:.67rem!important;line-height:1.35!important}
#resultAdvancedHost .sb-key-value strong{
  max-width:none!important;
  text-align:right!important;
  font-size:.7rem!important;
  line-height:1.32!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
}

/* ==========================================================
   COUCHES
   ========================================================== */
@media (min-width:901px){
  #referenceLayerPanel{
    width:470px!important;
    right:122px!important;
    top:14px!important;
    bottom:auto!important;
    height:auto!important;
    max-height:min(650px,calc(100% - 122px))!important;
    padding:18px!important;
  }
}
#referenceLayerPanel .sb-map-mini-drawer-head{margin-bottom:12px!important}
#referenceLayerPanel .sb-map-mini-drawer-head strong{font-size:1rem!important}
#referenceLayerPanel .sb-map-mini-drawer-head small{font-size:.7rem!important;line-height:1.4!important}
#referenceLayerPanel .sb-map-layer-group{padding:13px 0!important}
#referenceLayerPanel .sb-map-layer-group-head{margin-bottom:10px!important}
#referenceLayerPanel .sb-map-layer-group-head strong{font-size:.77rem!important}
#referenceLayerPanel .sb-map-layer-group-head small{display:block!important;margin-top:3px!important;font-size:.66rem!important;line-height:1.4!important}
#referenceLayerPanel .sb-reference-layer-toggles{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:9px!important;
}
#referenceLayerPanel .sb-reference-layer-toggles label{
  min-height:50px!important;
  padding:8px 10px!important;
  border-radius:13px!important;
  display:flex!important;
  align-items:center!important;
}
#referenceLayerPanel .sb-reference-layer-toggles label>span{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  font-size:.68rem!important;
  line-height:1.25!important;
}
#referenceLayerPanel .sb-reference-layer-toggles label input{flex:0 0 auto!important}

/* ==========================================================
   EXPLORER / SERVICES / ITINÉRAIRE
   ========================================================== */
@media (min-width:901px){
  #mapExplorerDrawer{
    width:500px!important;
    right:122px!important;
    top:14px!important;
    bottom:auto!important;
    height:auto!important;
    max-height:min(690px,calc(100% - 112px))!important;
    padding:18px!important;
  }
}
#mapExplorerDrawer .sb-map-mini-drawer-head strong{font-size:1.02rem!important}
#mapExplorerDrawer .sb-map-mini-drawer-head small{font-size:.7rem!important;line-height:1.4!important}
#mapExplorerDrawer .sb-map-explorer-tabs--two{
  grid-template-columns:1fr 1fr!important;
  gap:8px!important;
  padding:6px!important;
  margin-bottom:14px!important;
  border-radius:16px!important;
}
#mapExplorerDrawer .sb-map-explorer-tabs button{min-height:44px!important;border-radius:12px!important;font-size:.72rem!important}

/* Services : catégories lisibles et cartes en une colonne. */
#mapExplorerDrawer .sb-nearby-card{padding:0!important}
#mapExplorerDrawer .sb-feature-intro{font-size:.7rem!important;line-height:1.45!important}
#mapExplorerDrawer .sb-nearby-choice-head{gap:8px!important;align-items:flex-start!important}
#mapExplorerDrawer .sb-nearby-choice-head>span{font-size:.71rem!important;line-height:1.35!important}
#mapExplorerDrawer .sb-nearby-categories{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
}
#mapExplorerDrawer .sb-nearby-categories button{
  min-height:46px!important;
  padding:8px 10px!important;
  gap:8px!important;
  border-radius:12px!important;
  font-size:.67rem!important;
  line-height:1.25!important;
}
#mapExplorerDrawer .sb-nearby-selection-hint{font-size:.63rem!important;line-height:1.4!important}
#mapExplorerDrawer .sb-nearby-radius-tools{grid-template-columns:1fr!important;gap:8px!important}
#mapExplorerDrawer .sb-radius-field>span{display:block!important;margin-bottom:5px!important;font-size:.67rem!important;font-weight:750!important}
#mapExplorerDrawer .sb-radius-field select{width:100%!important;height:44px!important;border-radius:12px!important;padding:0 12px!important}
#mapExplorerDrawer .sb-nearby-radius-switch{min-height:46px!important;padding:9px 11px!important;border-radius:12px!important}
#mapExplorerDrawer .sb-nearby-status{font-size:.65rem!important;line-height:1.45!important}
#mapExplorerDrawer .sb-nearby-list{grid-template-columns:1fr!important;gap:10px!important}
#mapExplorerDrawer .sb-nearby-item{
  grid-template-columns:42px minmax(0,1fr)!important;
  align-items:start!important;
  gap:10px!important;
  padding:12px!important;
  border-radius:15px!important;
}
#mapExplorerDrawer .sb-nearby-item-copy{gap:3px!important}
#mapExplorerDrawer .sb-nearby-item-copy strong{font-size:.78rem!important;line-height:1.35!important}
#mapExplorerDrawer .sb-nearby-item-copy span{font-size:.66rem!important;line-height:1.35!important}
#mapExplorerDrawer .sb-nearby-item-copy small{font-size:.62rem!important;line-height:1.35!important}
#mapExplorerDrawer .sb-nearby-item-actions{
  grid-column:1/-1!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:8px!important;
  padding-left:52px!important;
  margin:0!important;
}
#mapExplorerDrawer .sb-nearby-item-actions button{
  width:100%!important;
  min-height:38px!important;
  padding:7px 9px!important;
  border-radius:10px!important;
  font-size:.64rem!important;
  line-height:1.2!important;
  white-space:normal!important;
}

/* Itinéraire : toujours vertical DANS LE DRAWER.
   Plus aucun label comprimé ou mot affiché lettre par lettre. */
#mapExplorerDrawer #routePlannerDetails{margin-top:2px!important;border:0!important;background:transparent!important}
#mapExplorerDrawer #routePlannerDetails>summary{display:none!important}
#mapExplorerDrawer #routePlannerDetails .sb-route-planner{display:grid!important;gap:13px!important;padding:2px 0!important}
#mapExplorerDrawer #routePlannerDetails .sb-route-planner>div:first-child{display:grid!important;gap:4px!important}
#mapExplorerDrawer #routePlannerDetails .sb-route-planner>div:first-child strong{font-size:.95rem!important;line-height:1.3!important}
#mapExplorerDrawer #routePlannerDetails .sb-route-planner>div:first-child small{font-size:.72rem!important;line-height:1.5!important}
#mapExplorerDrawer #routePlannerDetails .sb-route-form{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:12px!important;
  align-items:stretch!important;
}
#mapExplorerDrawer #routePlannerDetails .sb-route-form .sb-field{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:6px!important;
  width:100%!important;
}
#mapExplorerDrawer #routePlannerDetails .sb-route-form .sb-field>span{
  display:block!important;
  width:auto!important;
  font-size:.7rem!important;
  font-weight:800!important;
  line-height:1.3!important;
  white-space:normal!important;
}
#mapExplorerDrawer #routePlannerDetails .sb-route-form input,
#mapExplorerDrawer #routePlannerDetails .sb-route-form select{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  height:48px!important;
  padding:0 13px!important;
  border:1px solid #d3dfda!important;
  border-radius:12px!important;
  box-sizing:border-box!important;
  background:#fff!important;
  color:var(--ss55-text)!important;
  font:inherit!important;
  font-size:.75rem!important;
}
#mapExplorerDrawer #calculateRouteButton{
  width:100%!important;
  min-height:48px!important;
  border-radius:13px!important;
  justify-content:center!important;
  font-size:.74rem!important;
}
#mapExplorerDrawer #routeResult{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:7px!important;
  margin-top:2px!important;
  padding:13px 14px!important;
  border-radius:14px!important;
  font-size:.7rem!important;
  line-height:1.4!important;
}
#mapExplorerDrawer #routeResult[hidden]{display:none!important}
#mapExplorerDrawer #routeResult a{justify-self:start!important;margin-left:0!important;white-space:normal!important}

/* ==========================================================
   PARCELLE — Informations professionnelles
   ========================================================== */
#mapControlDrawer #parcelTechnicalHost .sb-technical-details-inline{margin-top:12px!important}
#mapControlDrawer #parcelTechnicalHost .sb-technical-details-inline>summary{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:12px 14px!important;
}
#mapControlDrawer #parcelTechnicalHost .sb-technical-details-inline>summary span{font-size:.77rem!important;line-height:1.35!important}
#mapControlDrawer #parcelTechnicalHost .sb-technical-details-inline>summary small{max-width:190px!important;text-align:right!important;font-size:.67rem!important;line-height:1.4!important}
#mapControlDrawer #parcelTechnicalHost .sb-technical-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:9px!important;
  padding:0 0 2px!important;
}
#mapControlDrawer #parcelTechnicalHost .sb-technical-grid>div{padding:11px 12px!important;border-radius:12px!important}
#mapControlDrawer #parcelTechnicalHost .sb-technical-grid small{font-size:.64rem!important;line-height:1.35!important}
#mapControlDrawer #parcelTechnicalHost .sb-technical-grid strong{font-size:.77rem!important;line-height:1.35!important;word-break:normal!important;overflow-wrap:break-word!important}

/* ==========================================================
   TABLETTE / MOBILE
   ========================================================== */
@media (max-width:900px){
  #resultDrawer,
  #mapControlDrawer,
  #referenceLayerPanel,
  #mapExplorerDrawer{
    width:100%!important;
    max-width:none!important;
    max-height:76vh!important;
    top:auto!important;
    right:0!important;
    bottom:0!important;
    border-radius:22px 22px 0 0!important;
    padding:16px!important;
  }
  #resultDrawer .sb-map-result-metrics{grid-template-columns:1fr 1fr!important}
  #referenceLayerPanel .sb-reference-layer-toggles{grid-template-columns:1fr 1fr!important}
}
@media (max-width:620px){
  #resultDrawer .sb-map-result-metrics,
  #referenceLayerPanel .sb-reference-layer-toggles,
  #mapExplorerDrawer .sb-nearby-categories,
  #mapControlDrawer #parcelTechnicalHost .sb-technical-grid{grid-template-columns:1fr!important}
  #resultDrawer .sb-map-result-actions{grid-template-columns:1fr!important}
  #mapExplorerDrawer .sb-nearby-item-actions{grid-template-columns:1fr!important;padding-left:0!important}
  #resultAdvancedHost .sb-key-value{grid-template-columns:1fr!important;gap:4px!important}
  #resultAdvancedHost .sb-key-value strong{text-align:left!important}
  #mapControlDrawer #parcelTechnicalHost .sb-technical-details-inline>summary{display:grid!important;padding-right:48px!important;position:relative!important}
  #mapControlDrawer #parcelTechnicalHost .sb-technical-details-inline>summary small{max-width:none!important;text-align:left!important}
}


/* V5.6 — Analyse : Synthèse prioritaire, actions redondantes supprimées */
#resultDrawer .sb-map-narrative-summary{display:block!important;border:1px solid #cfe2da!important;background:linear-gradient(135deg,#f8fcfa,#fff)!important}
#resultDrawer .sb-map-narrative-head .sb-eyebrow{font-weight:900!important;letter-spacing:.10em!important;color:#0b6d52!important}
#resultDrawer .sb-map-result-actions{display:none!important}
