:root {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --pour-color: #059669;       /* Vert émeraude */
  --pour-bg: #ecfdf5;
  --contre-color: #0e7490;     /* Bleu pétrole / Indigo */
  --contre-bg: #e0f2fe;
  --diff-color: #d97706;       /* Ambre doux */
  --diff-bg: #fef3c7;
  --diff-text: #92400e;
  --primary: #2563eb;
}

[data-theme="dark"] {
  --bg-color: #0b0f19;
  --card-bg: #111827;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --pour-color: #10b981;
  --pour-bg: rgba(16, 185, 129, 0.15);
  --contre-color: #38bdf8;
  --contre-bg: rgba(14, 165, 233, 0.15);
  --diff-color: #f59e0b;
  --diff-bg: rgba(245, 158, 11, 0.15);
  --diff-text: #fde68a;
  --primary: #3b82f6;
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --pour-color: #059669;
  --pour-bg: #ecfdf5;
  --contre-color: #0e7490;
  --contre-bg: #e0f2fe;
  --diff-color: #d97706;
  --diff-bg: #fef3c7;
  --diff-text: #92400e;
  --primary: #2563eb;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 1.5rem clamp(0.75rem, 2.5vw, 2rem);
  background: var(--bg-color);
  color: var(--text-main);
  box-sizing: border-box;
}
h1 { margin: 0 0 0.25rem 0; font-size: 1.6rem; }
.subtitle { color: var(--text-muted); margin-top: 0; margin-bottom: 1.25rem; font-size: 0.95rem; }

/* Bannière Onboarding Pédagogique Vivante & Boussole Citoyenne */
.onboarding-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  position: relative;
  transition: all 0.2s ease;
}
.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 1rem;
}
.onboarding-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.onboarding-badge {
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.onboarding-header-hint {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
}
.onboarding-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.onboarding-toggle-btn:hover { background: #e2e8f0; color: #0f172a; }

.onboarding-collapsed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #e2e8f0;
}

.onboarding-content {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.onboarding-hero {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
}
.onboarding-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.15rem;
}
.onboarding-pillar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.onboarding-pillar-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.onboarding-pillar-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #475569;
}
.inline-arrow {
  display: inline-block;
  margin: 0 0.2rem;
  color: var(--primary);
  font-size: 1.1em;
  font-weight: 700;
  line-height: 1;
  vertical-align: -0.05em;
}
.onboarding-destinations {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.onboarding-destinations-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.onboarding-nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.onboarding-nav-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.onboarding-nav-card:hover {
  background: #eff6ff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.08);
}
.onboarding-nav-card-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.onboarding-nav-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.onboarding-quick-link {
  background: #f1f5f9;
  color: var(--primary);
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.onboarding-quick-link:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================
   EN-TÊTE D'OUTIL ÉPURÉ, TITRE INTERACTIF & COCKPIT UNIFIÉ
   ========================================================== */
.clean-tool-header {
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.clean-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.clean-tool-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.clean-title-label {
  color: #0f172a;
}

.interactive-group-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.interactive-group-picker:hover, .interactive-group-picker:focus-within {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}

.group-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.interactive-group-select {
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  padding-right: 0.25rem;
}

.clean-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.compact-theme-select {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.compact-theme-select:hover, .compact-theme-select:focus {
  border-color: var(--primary);
}

.clean-help-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.clean-help-btn:hover, .clean-help-btn.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.15);
}

.clean-guide-drawer {
  display: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-top: 0.75rem;
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.clean-guide-drawer.open {
  display: block;
}
.clean-guide-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.5;
}
.clean-guide-item strong {
  color: #0f172a;
}

/* Cockpit unifié : Identité du groupe & Insights clés */
.group-cockpit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.95rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.cockpit-meta-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cockpit-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.cohesion-val {
  color: var(--primary);
}

.cockpit-insights {
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.4;
  flex: 1;
  min-width: 280px;
}
.cockpit-insights strong {
  color: #0f172a;
}

/* Duel interactif Face-à-face */
.duel-title-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.duel-swap-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}
.duel-swap-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(180deg);
}

.share-card-trigger-btn.compact {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.segmented-control.compact-seg {
  gap: 0.15rem;
  padding: 2px;
}
.segmented-control.compact-seg .seg-btn {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  border-radius: 4px;
}

/* Rétro-compatibilité */
.tool-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border-color);
}

.tool-guide-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 0.45rem;
}

.guide-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
}

.guide-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.guide-close-btn:hover { color: #0f172a; }

.tool-guide-drawer-body {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
}

.tool-guide-drawer-body p {
  margin: 0.35rem 0;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sélecteur de format de la carte citoyenne (Hémicycle vs Liste) */
.share-card-format-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.format-selector-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.format-btn-group {
  display: inline-flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.format-btn {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.format-btn:hover {
  color: #0f172a;
}

.format-btn.active {
  background: #ffffff;
  color: var(--primary, #0284c7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

/* Modale de partage compacte et ajustée (sans défilement) */
#shareModal .modal-box,
.modal-box.share-modal-box {
  max-width: 520px;
  max-height: 96vh;
}

#shareModal .modal-header {
  padding: 0.75rem 1.25rem;
}

#shareModal .modal-body {
  padding: 0.5rem 1.25rem 0.65rem 1.25rem;
  gap: 0.45rem;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(96vh - 140px);
}

/* Aperçu de la carte citoyenne Canvas 2D (Style Spotify) */
.share-canvas-preview-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

#shareCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(65vh, 560px);
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin: 0 auto;
}

.share-status-toast {
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastFadeIn 0.2s ease-out;
  text-align: center;
  border: 1px solid #334155;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.share-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.share-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

@media (max-height: 620px) {
  #shareCanvas {
    max-height: 38vh;
  }
  #shareModal .modal-header {
    padding: 0.5rem 1rem;
  }
  #shareModal .share-modal-actions {
    padding: 0.5rem 0.75rem;
  }
}
.share-action-btn.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.share-action-btn.primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.share-action-btn.secondary {
  background: #0f172a;
  color: #ffffff;
}
.share-action-btn.secondary:hover {
  background: #334155;
  transform: translateY(-1px);
}
.share-action-btn.outline {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
.share-action-btn.outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.share-action-btn.text-only {
  background: transparent;
  color: #64748b;
  border: 1px dashed #cbd5e1;
}
.share-action-btn.text-only:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

@media (max-width: 600px) {
  .share-modal-actions {
    flex-direction: column;
    width: 100%;
  }
  .share-action-btn {
    width: 100%;
  }
}

/* Barre de contrôle globale */
.global-controls-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.global-controls-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.global-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.major-filter-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.major-filter-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* Synthèse dynamique */
.dynamic-summary-box {
  background: linear-gradient(to right, #f8fafc, #eff6ff);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.5;
}
.dynamic-summary-box strong {
  color: #0f172a;
}

/* Liens externes des groupes */
.group-external-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.15s;
}
.group-external-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.group-external-icon {
  font-size: 0.75rem;
  color: #94a3b8;
}
.group-external-link:hover .group-external-icon {
  color: var(--primary);
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #eff6ff;
  border-radius: 6px 6px 0 0;
}

.tab-content { 
  display: none; 
}
.tab-content.active { 
  display: block; 
}

@keyframes slideTabRight {
  from {
    opacity: 0;
    transform: translateX(26px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideTabLeft {
  from {
    opacity: 0;
    transform: translateX(-26px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tab-content.slide-from-right {
  animation: slideTabRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.tab-content.slide-from-left {
  animation: slideTabLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.card {
  background: var(--card-bg);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.filter-item { display: flex; flex-direction: column; gap: 0.35rem; }
label { font-size: 0.8rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.03em; }
select, input {
  padding: 0.55rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  background: #fff;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--border-color); text-align: left; }
th { background: #f1f5f9; font-weight: 600; font-size: 0.85rem; color: #334155; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { background: #e2e8f0; }

.stacked-bar-container {
  width: 100%;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  height: 1.4rem;
  display: flex;
}
.bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.segment-pour { background: var(--pour-color); }
.segment-contre { background: var(--contre-color); }
.segment-diff { background: var(--diff-color); color: #ffffff; }

.cohesion-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
}

.presence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

.presence-badge strong {
  color: #0f172a;
}

.presence-pct {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

/* ==========================================================
   CONTRÔLES SEGMENTÉS (STYLE iOS / APPLE)
   ========================================================== */
.tool-segmented-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.tool-segmented-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.segmented-control {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  padding: 0.42rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.seg-btn:hover {
  color: #0f172a;
}

.seg-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Échelle relative dynamique (Heatmap Range Legend) */
.heatmap-range-legend {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: #64748b;
}

.range-legend-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.range-bound-pill {
  font-size: 0.78rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  color: #0f172a;
}

.range-gradient-bar {
  width: 140px;
  height: 10px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.range-legend-right {
  font-size: 0.8rem;
  color: #475569;
}

/* ==========================================================
   HEATMAP (AUCUNE BARRE DE SCROLL HORIZONTALE - 100% FLUIDE)
   ========================================================== */
.heatmap-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important; /* Interdiction formelle du scroll horizontal */
  margin-top: 1.25rem;
  box-sizing: border-box;
}

.heatmap-table {
  table-layout: fixed; /* Force le tableau à respecter strictement 100% de la largeur disponible */
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  margin: 0 auto;
  box-sizing: border-box;
}

.hm-corner-th,
.heatmap-table th {
  padding: clamp(4px, 0.6vw, 8px) 1px;
  text-align: center;
  border: none;
  background: #f8fafc;
  font-weight: 700;
  color: #1e293b;
  font-size: clamp(0.62rem, 0.85vw, 0.82rem);
  line-height: 1.15;
}

/* Colonne d'en-tête de ligne */
.hm-row-th {
  text-align: right !important;
  padding-right: clamp(4px, 0.8vw, 10px) !important;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 18%; /* Largeur sur grand écran */
}

.hm-row-full {
  display: inline;
}
.hm-row-short {
  display: none;
}

/* En-têtes de colonnes (triables) */
.heatmap-table th.sortable-hm {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heatmap-table th.sortable-hm:hover {
  background: #e2e8f0;
  color: var(--primary);
}

.hm-th-short {
  display: inline-block;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hm-sort-indicator {
  font-size: 0.65rem;
  color: var(--primary);
  margin-left: 1px;
}

/* Cellules de la matrice */
.heatmap-cell {
  border-radius: 4px;
  font-weight: 700;
  text-align: center;
  font-size: clamp(0.6rem, 0.95vw, 0.82rem);
  padding: clamp(5px, 0.8vw, 10px) 1px;
  transition: transform 0.1s ease, filter 0.15s ease;
  user-select: none;
  cursor: default;
}

.heatmap-cell:hover {
  filter: brightness(1.1);
  transform: scale(1.06);
  z-index: 2;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hm-pct-sign {
  font-size: 0.78em;
  font-weight: 500;
  opacity: 0.85;
}

/* Adaptation responsive Heatmap selon taille d'écran */
@media (max-width: 1060px) {
  .hm-row-th {
    width: 13%;
  }
}

@media (max-width: 880px) {
  .hm-row-th {
    width: 36px;
    text-align: center !important;
    padding-right: 1px !important;
  }
  .hm-row-full {
    display: none;
  }
  .hm-row-short {
    display: inline;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.72rem;
  }
}

@media (max-width: 640px) {
  .hm-pct-sign {
    display: none; /* Affiche "78" au lieu de "78%" pour éviter tout débordement sur mobile */
  }
  .heatmap-table {
    border-spacing: 1.5px;
  }
  .heatmap-cell {
    font-size: 0.66rem;
    padding: 6px 0;
  }
  .hm-row-th {
    width: 30px;
  }
}

/* ==========================================================
   FACE-À-FACE PARLEMENTAIRE (DUEL & HERO SCORE CARD)
   ========================================================== */
.duel-picker-bar {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.duel-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 200px;
}

.duel-select-group select {
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
}

.duel-vs-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: #64748b;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  user-select: none;
}

.duel-action-group {
  display: flex;
  align-items: center;
}

.share-card-trigger-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  white-space: nowrap;
}

.share-card-trigger-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* Face-à-face Hero Score Card */
.face-score-hero-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.05);
}

.face-score-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.face-score-eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.face-score-names {
  margin: 0.2rem 0 0 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.face-score-badge {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  padding: 0.5rem 1.15rem;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.face-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.face-metric-cell {
  padding: 1.15rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform 0.15s ease;
}

.face-metric-cell:hover {
  transform: translateY(-2px);
}

.metric-pour {
  background: var(--pour-bg);
  border: 1px solid rgba(5, 150, 105, 0.2);
}
.metric-pour .metric-label { color: var(--pour-color); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.metric-pour .metric-value { font-size: 2rem; font-weight: 900; color: #065f46; line-height: 1.1; }
.metric-pour .metric-hint { font-size: 0.82rem; color: #047857; }

.metric-contre {
  background: var(--contre-bg);
  border: 1px solid rgba(14, 116, 144, 0.2);
}
.metric-contre .metric-label { color: var(--contre-color); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.metric-contre .metric-value { font-size: 2rem; font-weight: 900; color: #155e75; line-height: 1.1; }
.metric-contre .metric-hint { font-size: 0.82rem; color: #0e7490; }

.metric-diff {
  background: var(--diff-bg);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.metric-diff .metric-label { color: var(--diff-text); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.metric-diff .metric-value { font-size: 2rem; font-weight: 900; color: #92400e; line-height: 1.1; }
.metric-diff .metric-hint { font-size: 0.82rem; color: #b45309; }

/* Grille de Graphiques aérée (Option B) */
.chart-container-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .chart-container-grid { grid-template-columns: 1fr; }
}

.chart-card-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.chart-card-header h4 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
}

.chart-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* ==========================================================
   EXPLORATEUR DE SCRUTINS (SPOTLIGHT SEARCH & TIROIR FILTRES)
   ========================================================== */
.spotlight-search-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.spotlight-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.45rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spotlight-input-wrapper:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.spotlight-icon {
  font-size: 1.2rem;
  color: #64748b;
}

.spotlight-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 0.4rem 0.25rem !important;
  font-size: 0.96rem !important;
  color: #0f172a;
  outline: none !important;
}

.btn-toggle-filters {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-toggle-filters:hover, .btn-toggle-filters.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

/* Mots-clés fréquents en 1 clic */
.quick-keywords-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #e2e8f0;
}

.quick-kw-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.quick-kw-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-kw-chip:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

/* Tiroir de filtres avancés */
.advanced-filters-drawer {
  display: none;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.advanced-filters-drawer.open {
  display: block;
}

.advanced-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.mini-segmented {
  display: flex;
  gap: 0.35rem;
}

/* Barre de statut & Légende de l'explorateur */
.explorer-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.95rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.82rem;
}

.explorer-count-label {
  font-weight: 700;
  color: #1e293b;
}

.explorer-legend-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.legend-hint {
  font-weight: 600;
  color: #64748b;
}

.legend-pill-item {
  display: inline-flex;
  align-items: center;
}

/* Styles pour les filtres chips & cartes scrutins */
.filter-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}
.filter-chip-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.filter-chip-btn:hover {
  background: #e2e8f0;
}
.filter-chip-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

.scrutins-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.vote-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  position: relative;
}
.vote-item-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.vote-item-card.adopte-card { border-left: 4px solid var(--pour-color); }
.vote-item-card.rejete-card { border-left: 4px solid #991b1b; }

/* Frise panoramique compacte */
.panoramic-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}
.panoramic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.55rem;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  user-select: none;
  white-space: nowrap;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.panoramic-chip:hover {
  transform: translateY(-1px);
}
.panoramic-chip.pour {
  background: var(--pour-bg);
  color: var(--pour-color);
  border: 1px solid rgba(5, 150, 105, 0.4);
}
.panoramic-chip.contre {
  background: var(--contre-bg);
  color: var(--contre-color);
  border: 1px solid rgba(14, 116, 144, 0.4);
}
.panoramic-chip.abstention {
  background: var(--diff-bg);
  color: var(--diff-text);
  border: 1px solid rgba(217, 119, 6, 0.4);
}
.panoramic-chip.absent {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
  opacity: 0.75;
}

.vote-tag-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.vote-tag-badge.pour { background: var(--pour-bg); color: var(--pour-color); }
.vote-tag-badge.contre { background: var(--contre-bg); color: var(--contre-color); }
.vote-tag-badge.abstention { background: #fef3c7; color: #b45309; }

.outcome-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.outcome-badge.adopte {
  background: var(--pour-bg);
  color: var(--pour-color);
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.outcome-badge.rejete {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid rgba(185, 28, 28, 0.25);
}

/* Triptyque de sélection de niveau de lecture */
.filter-item-wide {
  min-width: 320px;
}
.range-segmented {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
}
.range-segmented .filter-chip-btn {
  flex: 1;
  text-align: center;
  padding: 0.38rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.range-segmented .filter-chip-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
}
.range-segmented .filter-chip-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Encart de synthèse factuelle d'un scrutin pivot */
.vote-item-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #64748b;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.summary-badge-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.summary-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.summary-badge.parent {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}
.summary-meta-info {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
}
.summary-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}
.vote-item-official-title {
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.4;
}

/* Accordéon des Débats Pivots sous un Texte Majeur */
.pivot-accordion-wrapper {
  margin-top: 0.35rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.55rem;
}
.pivot-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.9rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.pivot-accordion-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.pivot-accordion-toggle.active {
  background: #0f172a;
  color: #f8fafc;
  border-color: #0f172a;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.pivot-toggle-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}
.pivot-accordion-toggle.active .pivot-toggle-arrow {
  transform: rotate(180deg);
}
.pivot-accordion-panel {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.pivot-child-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pivot-child-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transform: translateX(2px);
}
.pivot-child-card.adopte-card { border-left-color: var(--pour-color); }
.pivot-child-card.rejete-card { border-left-color: #991b1b; }
.pivot-child-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
}
.pivot-child-summary {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.pivot-child-official {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
}
.panoramic-strip.mini {
  padding-top: 0.35rem;
  gap: 0.35rem;
}
.panoramic-strip.mini .panoramic-chip {
  padding: 0.16rem 0.42rem;
  font-size: 0.7rem;
}

/* Fenêtre Modale (Pop-up de détail de scrutin) */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.modal-backdrop.active {
  display: flex;
}
#shareModal {
  z-index: 1100;
}
.modal-box {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 780px;
  max-width: 840px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 30px rgba(0,0,0,0.2);
  animation: modalFadeIn 0.2s ease-out;
  overflow: hidden;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: #f8fafc;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin: 0;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.92rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: #f8fafc;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.modal-meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.modal-meta-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

/* ==========================================
   CHANTIER 6 : MINI-HÉMICYCLE PARLEMENTAIRE SVG
   ========================================== */

.modal-hemicycle-section {
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.25rem 0.85rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hemicycle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hemicycle-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hemicycle-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.hemicycle-subtitle {
  font-size: 0.78rem;
  color: #64748b;
}

.hemicycle-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hemicycle-toggle-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.hemi-toggle-btn {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hemi-toggle-btn:hover {
  color: #0f172a;
}

.hemi-toggle-btn.active {
  background: #ffffff;
  color: var(--primary, #0284c7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.hemicycle-canvas-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hemicycle-svg {
  width: 100%;
  max-width: 540px;
  height: auto;
  overflow: visible;
  display: block;
}

/* Secteurs de groupes */
.hemi-group-sector {
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hemi-group-sector:hover,
.hemi-group-sector:focus,
.hemi-group-sector.hemi-sector-highlighted {
  filter: brightness(1.15) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.hemi-main-wedge {
  transition: fill 0.2s ease, opacity 0.15s ease;
}

.hemi-dissidence-notch,
.hemi-absent-notch {
  transition: opacity 0.15s ease;
}

.hemi-group-label {
  font-size: 8.5px;
  font-weight: 800;
  fill: #475569;
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
  transition: fill 0.15s ease;
}

.hemi-group-sector:hover .hemi-group-label {
  fill: #0f172a;
  font-weight: 900;
}

/* Barre de légende sous l'hémicycle */
.hemi-legend-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  width: 100%;
  max-width: 540px;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.78rem;
  color: #475569;
}

.hemi-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hemi-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.hemi-legend-hatch {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  border: 1px dashed #94a3b8;
  background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 2px, #f8fafc 2px, #f8fafc 4px);
  display: inline-block;
}

/* Surbrillance synchronisée de la table */
.modal-table tr.table-row-highlighted {
  background-color: #f0f9ff !important;
  border-left: 3px solid var(--primary, #0284c7);
  transition: background-color 0.15s ease;
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
.modal-table th, .modal-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
.modal-table th {
  background: #f1f5f9;
  font-size: 0.82rem;
  color: #334155;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}
.an-official-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.an-official-btn:hover {
  opacity: 0.9;
}

/* Bouton Partage Scrutin dans la modale */
.share-scrutin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-scrutin-btn:hover {
  background: #1e293b;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Toast de chargement complet en arrière-plan / au clic */
.full-loading-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid #334155;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeInToast 0.25s ease forwards;
}
@keyframes fadeInToast {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   NOUVEAU HEADER & NAVIGATION MODERNE
   ========================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border-color);
  margin: -1.5rem calc(-1 * clamp(0.75rem, 2.5vw, 2rem)) 1.5rem calc(-1 * clamp(0.75rem, 2.5vw, 2rem));
  padding: 0.75rem clamp(0.75rem, 2.5vw, 2rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.brand-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}
.site-header .tabs-nav {
  margin-bottom: 0;
  border-bottom: none;
  gap: 0.35rem;
}
.site-header .tab-btn {
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
  border-radius: 6px;
  border-bottom: none;
  margin-bottom: 0;
}
.site-header .tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.site-header .tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

/* Contrôles compacts intégrés au Header */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.scope-toggle-pill {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.scope-pill-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.scope-pill-btn:hover {
  color: #0f172a;
}

.scope-pill-btn.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.scale-toggle-pill {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.scale-pill-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.scale-pill-btn:hover {
  color: #0f172a;
}

.scale-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.btn-config-coalitions {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-config-coalitions:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.period-select-wrapper {
  display: inline-flex;
  align-items: center;
}

.period-select-compact {
  padding: 0.32rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.period-select-compact:hover, .period-select-compact:focus {
  border-color: var(--primary);
}

.header-count-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.25rem 0.55rem;
  border-radius: 12px;
  white-space: nowrap;
}

/* ==========================================================
   PAGE D'ACCUEIL CITOYENNE AÉRÉE (TAB-HOME)
   ========================================================== */
.home-hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  margin: clamp(1rem, 2.5vw, 2rem) auto 1.25rem auto;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.home-hero-title {
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0 auto 1.25rem auto;
  color: #0f172a;
  line-height: 1.18;
  max-width: 820px;
  text-align: center;
}

.home-hero-title .accent-text {
  background: linear-gradient(135deg, #2563eb 0%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero-desc {
  font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  line-height: 1.75;
  color: #475569;
  max-width: 740px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem) auto;
  text-align: center;
}

/* Grille des KPIs en direct (Airy Floating Cards) */
.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  max-width: 1060px;
  width: 100%;
  margin: 0 auto clamp(3.5rem, 6.5vw, 5.5rem) auto;
  box-sizing: border-box;
}

.home-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: clamp(1.4rem, 2.2vw, 1.85rem) 1.25rem;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.home-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.08);
}

.home-kpi-card.highlight {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.home-kpi-icon {
  font-size: 1.65rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.home-kpi-num {
  font-size: clamp(1.9rem, 2.8vw, 2.45rem);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.home-kpi-card.highlight .home-kpi-num {
  color: #059669;
}

.home-kpi-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* En-tête de section Hub */
.home-section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(1.75rem, 3.5vw, 2.5rem) auto;
  padding: 0 1rem;
}

.home-section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.home-section-header h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem 0;
}

.home-section-header p {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================
   STICKY STACK APPLE - PARCOURS THÉMATIQUE
   ========================================================== */
.home-sticky-stack {
  position: relative;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto clamp(2.5rem, 5vw, 4.5rem) auto;
  box-sizing: border-box;
}

.home-stack-card {
  position: sticky;
  top: calc(75px + var(--stack-idx, 0) * 20px);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: 2.25rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03), 0 20px 40px -15px rgba(15, 23, 42, 0.09);
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  box-sizing: border-box;
  background-clip: padding-box;
}

.home-stack-card:hover {
  transform: translateY(-3px) scale(1.006);
  border-color: var(--primary);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.05), 0 24px 48px -12px rgba(37, 99, 235, 0.16);
}

.stack-card-content {
  display: flex;
  flex-direction: column;
}

.stack-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  width: fit-content;
  margin-bottom: 0.9rem;
}

.stack-card-title {
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.32;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem 0;
}

.stack-card-desc {
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  color: #475569;
  line-height: 1.65;
  margin: 0 0 1.5rem 0;
}

.stack-card-footer {
  margin-top: auto;
}

.stack-card-btn {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--primary);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.home-stack-card:hover .stack-card-btn {
  background: #1d4ed8;
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* Mockup Windows (Apple style preview) */
.mockup-window {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.06);
}

.mockup-header {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mockup-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.mockup-dot.red { background: #ef4444; }
.mockup-dot.yellow { background: #f59e0b; }
.mockup-dot.green { background: #10b981; }

.mockup-title {
  margin-left: 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mockup-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Mockup rows (Alliances) */
.mockup-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.mockup-grp {
  width: 70px;
  color: #334155;
  white-space: nowrap;
}
.mockup-bar-bg {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.mockup-bar-fill {
  height: 100%;
  border-radius: 4px;
}
.fill-green { background: var(--pour-color); }
.fill-amber { background: var(--diff-color); }
.fill-blue { background: #3b82f6; }
.mockup-pct {
  width: 34px;
  text-align: right;
  color: #0f172a;
  font-weight: 700;
}

/* Mockup Heatmap Mini Grid */
.mockup-heatmap-grid {
  display: grid;
  grid-template-columns: 36px repeat(4, 1fr);
  gap: 4px;
  padding: 0.85rem;
}
.mockup-hm-cell {
  text-align: center;
  padding: 0.4rem 0.2rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}
.mockup-hm-cell.hm-th, .mockup-hm-cell.hm-th-left {
  background: transparent;
  color: #64748b;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mockup-hm-cell.hm-diag {
  background: #f1f5f9;
  color: #94a3b8;
}
.mockup-hm-cell.hm-low {
  background: hsl(158, 25%, 92%);
  color: #0f172a;
}
.mockup-hm-cell.hm-mid {
  background: hsl(158, 55%, 75%);
  color: #0f172a;
}
.mockup-hm-cell.hm-high {
  background: hsl(158, 85%, 52%);
  color: #0f172a;
}

/* Mockup Versus body */
.mockup-versus-body {
  align-items: center;
  text-align: center;
  gap: 0.9rem;
}
.mockup-duel-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.duel-grp-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.88rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
.duel-vs-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
}
.mockup-duel-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.duel-score {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.duel-score-lbl {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.2rem;
}
.mockup-radar-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
}
.radar-bar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #475569;
}
.radar-mini-track {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.radar-mini-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* Mockup Explorer */
.mockup-search-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
  text-align: left;
}
.mockup-vote-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
}
.mockup-vote-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mockup-vote-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}
.mockup-outcome-adopte {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--pour-bg);
  color: var(--pour-color);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.mockup-chips-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (max-width: 820px) {
  .home-stack-card {
    grid-template-columns: 1fr;
    top: calc(65px + var(--stack-idx, 0) * 12px);
    padding: 1.5rem;
    gap: 1.25rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
  }
}


/* ==========================================================
   FOOTER CITOYEN UNIFIÉ
   ========================================================== */
.site-footer {
  margin: 4.5rem calc(-1 * clamp(0.75rem, 2.5vw, 2rem)) -1.5rem calc(-1 * clamp(0.75rem, 2.5vw, 2rem));
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem clamp(0.75rem, 2.5vw, 2rem) 2rem clamp(0.75rem, 2.5vw, 2rem);
  border-top: 1px solid #1e293b;
  box-sizing: border-box;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #1e293b;
}
.footer-brand {
  max-width: 500px;
}
.footer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}
.footer-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0.4rem 0 0 0;
  line-height: 1.5;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.footer-btn-link {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.footer-btn-link:hover {
  color: #38bdf8;
}
.theme-toggle-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-toggle-footer-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #38bdf8;
  color: #ffffff;
}
.footer-a-link {
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-a-link:hover {
  color: #38bdf8;
}
.footer-bottom {
  max-width: 1400px;
  margin: 1.25rem auto 0 auto;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

@media (max-width: 768px) {
  .site-header .tabs-nav {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .site-header .tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.35rem;
    border-top: 1px dashed #e2e8f0;
  }
  .clean-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .clean-header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .group-cockpit-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .interactive-group-select {
    max-width: 220px;
  }
}

/* ==========================================================
   CHANTIER 5 : MODALE DU CONSTRUCTEUR DE COALITIONS (DRAG & DROP)
   ========================================================== */
.coalition-presets-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.coalition-presets-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-preset {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.btn-preset-reset {
  color: #ef4444;
  border-color: #fca5a5;
  margin-left: auto;
}

.btn-preset-reset:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.coalition-builder-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  max-height: 68vh;
  overflow-y: auto;
}

/* Grille des coalitions */
.coalitions-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.coalition-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid var(--coalition-color, #2563eb);
  border-radius: 10px;
  padding: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.15s ease;
}

.coalition-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.coalition-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.coalition-title-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.coalition-color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: transparent;
}

.coalition-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.coalition-color-picker::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 50%;
}

.coalition-name-input {
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  width: 100%;
  transition: border-color 0.15s;
}

.coalition-name-input:focus, .coalition-name-input:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-del-coalition {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.btn-del-coalition:hover {
  opacity: 1;
}

/* Jauge de sièges et seuil fatidique des 289 */
.coalition-seat-gauge {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
}

.gauge-bar-track {
  position: relative;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 0.4rem;
}

.gauge-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.25s ease;
}

.gauge-majority-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: #ef4444;
  z-index: 2;
}

.gauge-majority-marker::after {
  content: '289';
  position: absolute;
  top: -14px;
  left: -8px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #ef4444;
}

.gauge-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}

.gauge-seats-count {
  font-weight: 700;
  color: #475569;
}

.gauge-seats-count.majority-reached {
  color: #16a34a;
}

.gauge-pct-share {
  color: #94a3b8;
}

/* Zone de dépôt Dropzone */
.coalition-dropzone {
  min-height: 84px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-content: flex-start;
  transition: all 0.18s ease;
}

.coalition-dropzone.drag-active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.dropzone-empty-placeholder {
  color: #94a3b8;
  font-size: 0.78rem;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  pointer-events: none;
}

/* Zone des partis indépendants / hors coalition */
.unassigned-dock-container {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.85rem;
}

.unassigned-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.unassigned-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: #1e293b;
}

.badge-seats {
  background: #334155;
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.unassigned-hint {
  font-size: 0.76rem;
  color: #64748b;
}

.unassigned-dropzone {
  min-height: 70px;
  background: #ffffff;
}

/* Jetons des partis déplaçables (Chips) */
.group-drag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.group-drag-chip:active {
  cursor: grabbing;
}

.group-drag-chip.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.group-drag-chip:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.drag-handle {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1;
}

.group-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.group-chip-name {
  white-space: nowrap;
}

.group-chip-seats {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.group-chip-move-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 0.78rem;
  border-radius: 3px;
  margin-left: 0.15rem;
}

.group-chip-move-btn:hover {
  color: #2563eb;
  background: #eff6ff;
}

/* Boutons d'action */
.btn-add-coalition {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-add-coalition:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.coalition-table-label, .coalition-row-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ==========================================================
   ONGLET ASSIDUITÉ & MOBILISATION
   ========================================================== */

.attendance-subnav-bar {
  display: flex;
  justify-content: center;
  margin: 1rem 0 1.5rem 0;
}

.attendance-subnav-pill {
  display: inline-flex;
  background: #f1f5f9;
  padding: 0.3rem;
  border-radius: 9999px;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.attendance-subnav-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.attendance-subnav-btn:hover {
  color: #0f172a;
}

.attendance-subnav-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.attendance-subview {
  display: none;
}

.attendance-subview.active {
  display: block;
  animation: fadeInSubView 0.25s ease-out;
}

@keyframes fadeInSubView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.attendance-loading {
  text-align: center;
  padding: 3.5rem 1rem;
  color: #64748b;
}

/* Législature Switcher pour Assiduité */
.attendance-leg-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}

.attendance-leg-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

.attendance-leg-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.attendance-leg-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.attendance-leg-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}

/* KPIs & Synthèse Baromètre */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.kpi-card.highlight-green::before {
  background: #10b981;
}

.kpi-card.highlight-amber::before {
  background: #f59e0b;
}

.kpi-card.highlight-blue::before {
  background: #3b82f6;
}

.kpi-card .kpi-icon {
  font-size: 1.6rem;
  margin-bottom: 0.2rem;
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-card .kpi-value {
  font-size: 2.1rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
}

.kpi-card .kpi-sub {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.highlight-cell .pct-badge {
  display: inline-block;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.attendance-chart-card, .quadrant-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.attendance-chart-head, .quadrant-chart-head {
  margin-bottom: 1rem;
}

.attendance-chart-head h3, .quadrant-chart-head h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.chart-subtitle {
  font-size: 0.83rem;
  color: #64748b;
}

.attendance-chart-canvas-wrap {
  position: relative;
  height: 380px;
  width: 100%;
}

.quadrant-canvas-wrap {
  position: relative;
  height: 550px;
  width: 100%;
}

/* Tableau Groupes */
.attendance-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.attendance-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.attendance-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.attendance-table tbody tr:hover {
  background: #f8fafc;
}

.num-cell {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.group-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.table-progress-bar {
  background: #f1f5f9;
  height: 8px;
  border-radius: 9999px;
  overflow: hidden;
  width: 100%;
}

.progress-fill.fill-majeurs {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  height: 100%;
  border-radius: 9999px;
}

/* Quadrant Legend & Pills */
.quadrant-legend-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.q-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
}

.q-pill-pilier { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.q-pill-stratege { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.q-pill-marathonien { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.q-pill-fantome { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.q-pill-standard { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.q-pill-mediane { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }
.q-pill-quartile { background: #faf5ff; color: #7c3aed; border: 1px dashed #c4b5fd; }

/* Députoscope Filtres & Layout */
.deputoscope-filter-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.deputoscope-search-wrap input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.92rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.deputoscope-search-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.deputoscope-selects-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.deputoscope-selects-row select {
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #ffffff;
  color: #334155;
  outline: none;
}

.deputoscope-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .deputoscope-layout {
    grid-template-columns: 1fr;
  }
}

.deputoscope-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  max-height: 850px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.deputy-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--group-color, #94a3b8);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.deputy-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.deputy-summary-card.selected {
  background: #eff6ff;
  border-color: #cbd5e1;
  border-left: 4px solid var(--group-color, #3b82f6) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.deputy-card-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.deputy-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.deputy-info-text {
  overflow: hidden;
}

.deputy-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deputy-circo {
  font-size: 0.74rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deputy-metrics-row {
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
  background: #f8fafc;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
}

.metric-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-label {
  font-size: 0.65rem;
  color: #64748b;
}

.metric-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.metric-val.val-high {
  color: #2563eb;
}

.quadrant-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.quadrant-badge.badge-pilier { background: #dcfce7; color: #166534; }
.quadrant-badge.badge-stratege { background: #dbeafe; color: #1e40af; }
.quadrant-badge.badge-marathonien { background: #fef3c7; color: #92400e; }
.quadrant-badge.badge-fantome { background: #fee2e2; color: #991b1b; }
.quadrant-badge.badge-standard { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* Fiche profil détaillée (Sticky) */
.deputy-sticky-container {
  position: sticky;
  top: 80px;
}

.deputy-profile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.profile-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 0.5rem;
}

.profile-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-fallback-avatar {
  font-size: 2rem;
}

.profile-identity {
  overflow: hidden;
}

.profile-group-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.profile-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.profile-mandat {
  margin: 0.2rem 0 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.profile-quadrant-box {
  padding: 0.85rem 1rem;
  border-radius: 10px;
}

.profile-quadrant-box.badge-pilier { background: #f0fdf4; border: 1px solid #bbf7d0; }
.profile-quadrant-box.badge-stratege { background: #eff6ff; border: 1px solid #bfdbfe; }
.profile-quadrant-box.badge-marathonien { background: #fffbeb; border: 1px solid #fde68a; }
.profile-quadrant-box.badge-fantome { background: #fef2f2; border: 1px solid #fecaca; }
.profile-quadrant-box.badge-standard { background: #f8fafc; border: 1px solid #cbd5e1; }

.quadrant-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.quadrant-explanation {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #475569;
}

.profile-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.stat-number {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.2rem 0;
}

.stat-detail {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.45rem;
}

.stat-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 9999px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn-share-deputy {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-share-deputy:hover {
  background: #1d4ed8;
}

.btn-an-link {
  width: 100%;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-sizing: border-box;
}

.btn-an-link:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Scrutins au couteau */
.couteau-intro-card {
  display: flex;
  gap: 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.couteau-intro-icon {
  font-size: 2.2rem;
}

.couteau-intro-text h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #92400e;
}

.couteau-intro-text p {
  margin: 0;
  font-size: 0.85rem;
  color: #78350f;
  line-height: 1.5;
}

.close-votes-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.razor-vote-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.razor-vote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.razor-vote-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.badge-adopte {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.badge-rejete {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.razor-diff-badge {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.razor-date {
  font-size: 0.78rem;
  color: #64748b;
}

.btn-inspect-razor {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-inspect-razor:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.razor-vote-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.breakdown-bar-wrap {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.breakdown-bar-pour {
  background: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.breakdown-bar-contre {
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.breakdown-bar-contre.censure-bar {
  background: #64748b; /* Gris ardoise pour les non-votants / contre de motions de censure */
}

.censure-note {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.razor-impact-callout {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  padding: 0.75rem 0.95rem;
  border-radius: 0 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.razor-impact-callout.callout-adopte {
  border-left: 4px solid #10b981;
}

.razor-impact-callout.callout-rejete {
  border-left: 4px solid #ef4444;
}

.callout-header {
  font-size: 0.8rem;
  color: #1e40af;
  margin-bottom: 0.2rem;
}

.callout-text {
  margin: 0 0 0.4rem 0;
  font-size: 0.78rem;
  color: #475569;
}

.callout-groups-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.impact-group-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  color: #334155;
}

.callout-conclusion {
  margin-top: 0.2rem;
  font-size: 0.77rem;
  line-height: 1.45;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
}

.callout-conclusion.conclusion-sufficient {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.callout-conclusion.conclusion-insufficient {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ==========================================================
   CHANTIER 3 : STYLES DU DEEP LINKING & TOAST NOTIFICATION
   ========================================================== */

.btn-share-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  padding: 0.42rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-share-link-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-share-link:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-share-link-pill,
[data-theme="dark"] .btn-share-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

[data-theme="dark"] .btn-share-link-pill:hover,
[data-theme="dark"] .btn-share-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
  color: #60a5fa;
}

/* Toast de confirmation de lien direct */
.deep-link-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.85rem 1.4rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.deep-link-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

[data-theme="dark"] .deep-link-toast {
  background: #1e293b;
  border-color: rgba(96, 165, 250, 0.4);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}


