/* Convaincre Lab — styles encapsulés : résistants aux règles du thème WordPress. */
.conv-lab-container {
  --conv-lab-ink: #1e293b;
  --conv-lab-muted: #475569;
  --conv-lab-accent: #744ba3;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--conv-lab-ink) !important;
  color-scheme: light;
  background: #fff !important;
  border: 1px solid #e2e6ec;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.2rem 0;
  box-shadow: 0 4px 18px rgba(25, 33, 46, .07);
}

/* En-tête : le titre n'est plus un span susceptible d'hériter d'un bandeau du thème. */
.conv-lab-container .conv-lab-toolbar {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1rem;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.conv-lab-container .conv-lab-card-title {
  display: flex !important;
  align-items: center;
  flex: 1 1 230px;
  gap: .65rem;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #18243a !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
}
.conv-lab-container .conv-lab-card-title::before {
  content: "";
  flex: 0 0 4px;
  align-self: stretch;
  min-height: 20px;
  border-radius: 4px;
  background: var(--conv-lab-accent);
}
.conv-lab-container .conv-lab-toolbar label {
  margin: 0 !important;
  padding: 0 !important;
  font-size: .84rem !important;
  font-weight: 650 !important;
  color: #334155 !important;
  background: transparent !important;
  opacity: 1 !important;
}
.conv-lab-container .conv-lab-toolbar select {
  min-width: 195px;
  flex: 1;
  max-width: 450px;
  border: 1px solid #bac6d4 !important;
  border-radius: 7px;
  color: #1e293b !important;
  background: #fff !important;
  padding: .48rem .65rem;
  font-size: .9rem !important;
  opacity: 1 !important;
}
.conv-lab-container .conv-lab-toolbar button.conv-lab-reset {
  flex: 0 0 auto;
  margin: 0 !important;
  border: 1px solid #6e469b !important;
  border-radius: 7px !important;
  padding: .48rem .8rem !important;
  font-family: inherit !important;
  font-size: .84rem !important;
  font-weight: 650 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #fff !important;
  background: #744ba3 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: pointer;
}
.conv-lab-container .conv-lab-toolbar button.conv-lab-reset:hover { background: #603c89 !important; }
.conv-lab-container .conv-lab-toolbar button.conv-lab-reset:focus-visible,
.conv-lab-container .conv-lab-toolbar select:focus-visible {
  outline: 3px solid #c5a9e7 !important;
  outline-offset: 2px;
}

.conv-lab-container .conv-lab-map {
  width: 100%;
  min-height: 320px;
  background: #e9eef0;
  z-index: 0;
}

/* Légende et notes : couleurs fixées à l'élément, pas héritées du thème. */
.conv-lab-container .conv-lab-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 1.5rem;
  flex-wrap: wrap;
  padding: .7rem 1rem;
  font-size: .82rem !important;
  line-height: 1.5 !important;
  color: #273449 !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0;
  opacity: 1 !important;
}
.conv-lab-container .conv-lab-legend span,
.conv-lab-container .conv-lab-legend small {
  margin: 0 !important;
  padding: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: #334155 !important;
  background: transparent !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
.conv-lab-container .conv-lab-legend small { color: #475569 !important; }
.conv-lab-container p.conv-lab-status,
.conv-lab-container p.conv-lab-method {
  display: block;
  margin: 0 !important;
  font-family: inherit !important;
  font-style: normal !important;
  line-height: 1.6 !important;
  text-shadow: none !important;
  background: #fff !important;
  opacity: 1 !important;
}
.conv-lab-container p.conv-lab-status {
  padding: .65rem 1rem !important;
  font-size: .82rem !important;
  color: #334155 !important;
}
.conv-lab-container p.conv-lab-method {
  padding: .7rem 1rem !important;
  border-top: 1px solid #e7e9ef;
  font-size: .77rem !important;
  color: #475569 !important;
}

/* Fenêtre Leaflet : neutraliser les typographies/fonds pâles du thème WP. */
.conv-lab-container .leaflet-popup-content-wrapper {
  padding: 1px;
  color: #1e293b !important;
  background: #fff !important;
  opacity: 1 !important;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .2);
}
.conv-lab-container .leaflet-popup-content {
  margin: 15px 18px !important;
  color: #1e293b !important;
  opacity: 1 !important;
}
.conv-lab-container .leaflet-popup-tip { background: #fff !important; }
.conv-lab-container .conv-lab-popup {
  min-width: 220px;
  max-width: 290px;
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif !important;
  color: #1e293b !important;
  background: #fff !important;
  opacity: 1 !important;
}
.conv-lab-container .conv-lab-popup strong,
.conv-lab-container .conv-lab-popup small,
.conv-lab-container .conv-lab-popup p,
.conv-lab-container .conv-lab-popup span,
.conv-lab-container .conv-lab-popup b,
.conv-lab-container .conv-lab-popup div {
  color: #1e293b !important;
  background: transparent !important;
  opacity: 1 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.conv-lab-container .conv-lab-popup > strong {
  display: block;
  margin: 0 0 2px !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  font-weight: 750 !important;
}
.conv-lab-container .conv-lab-popup > small {
  display: block;
  margin: 0 0 .45rem !important;
  font-size: 12px !important;
  color: #475569 !important;
}
.conv-lab-container .conv-lab-popup p.conv-lab-pop-sub {
  margin: .25rem 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: #475569 !important;
  overflow-wrap: anywhere;
}
.conv-lab-container .conv-lab-popup .conv-lab-pop-sub b {
  font-weight: 700 !important;
  color: #334155 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-pop-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 !important;
  padding: .48rem 0 !important;
  border-top: 1px solid #e2e8f0 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-pop-line span { min-width: 0; }
.conv-lab-container .conv-lab-popup .conv-lab-pop-line b {
  font-size: 12px !important;
  font-weight: 750 !important;
  white-space: nowrap;
  color: #172033 !important;
}
.conv-lab-container .leaflet-popup-close-button {
  color: #475569 !important;
  opacity: 1 !important;
}
.conv-lab-container .leaflet-popup-close-button:hover { color: #1e293b !important; }

@media (max-width: 600px) {
  .conv-lab-container .conv-lab-toolbar { gap: .65rem; padding: .75rem; }
  .conv-lab-container .conv-lab-card-title { flex-basis: calc(100% - 100px); font-size: .94rem !important; }
  .conv-lab-container .conv-lab-toolbar select { min-width: 0; width: 100%; }
  .conv-lab-container .conv-lab-map { height: 430px !important; }
  .conv-lab-container .conv-lab-legend { flex-direction: column; align-items: flex-start; }
  .conv-lab-container .leaflet-popup-content { margin: 12px 14px !important; }
  .conv-lab-container .conv-lab-popup { min-width: 185px; }
}

/* Résultats comparés : chaque ensemble porte son nom et son scrutin. */
.conv-lab-container .conv-lab-popup { min-width: 255px; max-width: 345px; }
.conv-lab-container .conv-lab-popup .conv-lab-group {
  display: block;
  padding: .7rem 0 !important;
  margin: 0 !important;
  border-top: 1px solid #e2e8f0;
  color: #1e293b !important;
  background: transparent !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-label {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-names {
  margin: .16rem 0 0 !important;
  font-size: 13px !important;
  line-height: 1.42 !important;
  font-weight: 720 !important;
  color: #1e293b !important;
  overflow-wrap: anywhere;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-election {
  margin: .14rem 0 0 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  color: #475569 !important;
  overflow-wrap: anywhere;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .6rem;
  align-items: baseline;
  margin: .45rem 0 0 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-votes {
  font-size: 12px !important;
  color: #334155 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-votes b {
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
  color: #18243a !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-share {
  font-size: 11px !important;
  color: #475569 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-group-metrics .is-selected {
  color: #5b368a !important;
  font-weight: 760 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-gap {
  background: #f8fafc !important;
  border-radius: 7px;
  margin: .1rem 0 .4rem !important;
  padding: .45rem .55rem !important;
  gap: .6rem;
}
.conv-lab-container .conv-lab-popup .conv-lab-gap span {
  color: #334155 !important;
  font-size: 11px !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-pop-note,
.conv-lab-container .conv-lab-popup .conv-lab-pop-quality {
  font-size: 10.5px !important;
  line-height: 1.45 !important;
  margin: .45rem 0 0 !important;
  color: #475569 !important;
}
.conv-lab-container .conv-lab-popup .conv-lab-pop-quality { color: #8a3b16 !important; }
@media (max-width: 600px) {
  .conv-lab-container .conv-lab-popup { min-width: 185px; max-width: 270px; }
}
