@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Palette de fond sombre & glassmorphism */
  --bg-main: #0B0F19;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-elevated: rgba(26, 36, 56, 0.85);
  --bg-input: rgba(15, 23, 42, 0.85);

  /* Bordures et séparateurs */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-active: rgba(99, 102, 241, 0.6);

  /* Couleurs de texte */
  --text-main: #F9FAFB;
  --text-secondary: #E5E7EB;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  /* Accents & Partis */
  --accent-blue: #3B82F6;
  --accent-cyan: #06B6D4;
  --accent-purple: #8B5CF6;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-red: #EF4444;

  /* Slot A & Slot B Tags */
  --slot-a-color: #38BDF8;
  --slot-b-color: #FBBF24;

  /* Badges Chiffrage */
  --chiffre-depense-bg: rgba(239, 68, 68, 0.15);
  --chiffre-depense-border: rgba(239, 68, 68, 0.35);
  --chiffre-depense-text: #FCA5A5;

  --chiffre-recette-bg: rgba(16, 185, 129, 0.15);
  --chiffre-recette-border: rgba(16, 185, 129, 0.35);
  --chiffre-recette-text: #6EE7B7;

  --chiffre-estime-bg: rgba(245, 158, 11, 0.15);
  --chiffre-estime-border: rgba(245, 158, 11, 0.35);
  --chiffre-estime-text: #FCD34D;

  --chiffre-neutre-bg: rgba(148, 163, 184, 0.12);
  --chiffre-neutre-border: rgba(148, 163, 184, 0.25);
  --chiffre-neutre-text: #CBD5E1;

  /* Ombres & Transitions */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 35px rgba(0, 0, 0, 0.65);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.55;
  background-image: 
    radial-gradient(circle at 12% 10%, rgba(59, 130, 246, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(225, 29, 72, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.06) 0%, transparent 55%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem 1.25rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.45rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.back-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-tag.badge-republic {
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.25) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(190, 18, 60, 0.25) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  color: #F3F4F6;
}

.header-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.header-title-section h1 {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 60%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-title-section h1 .year-pill {
  font-size: 1.15rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3B82F6 0%, #EF4444 100%);
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: #FFFFFF;
}

.header-title-section p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 920px;
}

/* ==========================================================================
   RUBAN AXE POLITIQUE GAUCHE ➔ DROITE
   ========================================================================== */
.spectrum-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.spectrum-top-bar {
  margin-bottom: 0.5rem;
}

.spectrum-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 0.25rem;
}

.legend-left { color: #F87171; }
.legend-center { color: #93C5FD; }
.legend-right { color: #FCA5A5; }

.spectrum-gradient-line {
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    #DC2626 0%,   /* Gauche radicale */
    #059669 15%,  /* Gauche écologiste */
    #F43F5E 30%,  /* Gauche sociale-démocrate */
    #3B82F6 48%,  /* Centre */
    #0EA5E9 62%,  /* Centre-droit */
    #1D4ED8 75%,  /* Droite républicaine */
    #1E3A8A 88%,  /* Droite nationale */
    #7F1D1D 100%  /* Droite identitaire */
  );
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.25);
  margin-bottom: 0.85rem;
}

.spectrum-nodes-ribbon {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.ribbon-node {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.ribbon-node:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.ribbon-node-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #FFFFFF;
  margin-bottom: 0.35rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.ribbon-node-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.ribbon-node-party {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.1;
  margin-top: 0.15rem;
}

/* Badges d'affectation aux volets sur l'axe */
.ribbon-slot-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.ribbon-slot-badge.badge-a {
  background: var(--slot-a-color);
}

.ribbon-slot-badge.badge-b {
  background: var(--slot-b-color);
}

.ribbon-node.active-a {
  border-color: var(--slot-a-color);
  background: rgba(56, 189, 248, 0.08);
}

.ribbon-node.active-b {
  border-color: var(--slot-b-color);
  background: rgba(251, 191, 36, 0.08);
}

/* ==========================================================================
   BARRE DE CONTRÔLE : SÉLECTION DU MODE & VOLETS
   ========================================================================== */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.view-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.mode-buttons-group {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mode-btn.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.mode-btn:not(.active):hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

/* Sélecteurs déroulants de candidats */
.split-candidate-selectors {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.selector-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.slot-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  color: #000;
}

.slot-tag.tag-a {
  background: var(--slot-a-color);
}

.slot-tag.tag-b {
  background: var(--slot-b-color);
}

.candidate-dropdown {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.candidate-dropdown:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.candidate-dropdown option {
  background: #111827;
  color: #FFFFFF;
}

.btn-swap {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-swap:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  transform: rotate(180deg);
}

/* Filtres de recherche & bascules */
.filters-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.toggles-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-toggle-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.filter-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.filter-toggle-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

/* Barre de navigation rapide par thématiques (Pills) */
.topics-nav-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding-top: 0.5rem;
  scrollbar-width: thin;
}

.topics-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.topics-pills-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topic-pill {
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.topic-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.topic-pill.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #FFFFFF;
}

/* ==========================================================================
   MOBILE TAB SWITCHER
   ========================================================================== */
.mobile-tab-switcher {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg-surface);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mobile-tab-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.mobile-tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   CONTENEUR PRINCIPAL : SPLIT VIEW (1 OU 2 VOLETS)
   ========================================================================== */
.split-view-container {
  width: 100%;
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

/* Mode Solo : 1 seul volet centré */
.split-view-container.mode-solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: 960px;
  margin: 0 auto;
}

/* Mode Comparaison : 2 volets côte à côte */
.split-view-container.mode-compare {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Le volet (Pane) d'un candidat */
.candidate-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* En-tête du volet candidat (Sticky) */
.pane-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: #0F172A;
  border-bottom: 2px solid var(--border-card);
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
}

.pane-candidate-intro {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.pane-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.pane-identity {
  flex: 1;
  min-width: 0;
}

.pane-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.pane-party-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.pane-party-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.pane-position-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

/* Slogan */
.pane-slogan {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-left: 0.65rem;
  border-left: 3px solid var(--accent-blue);
}

/* Mini-Dashboard Budgétaire du volet */
.pane-budget-dashboard {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.budget-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 800;
}

.stat-value.depense { color: var(--accent-red); }
.stat-value.recette { color: var(--accent-emerald); }
.stat-value.solde { color: #93C5FD; }

/* Contenu thématique du volet */
.pane-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Section Thématique */
.pane-topic-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.topic-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.topic-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
}

.topic-measures-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Pile des cartes de mesures */
.proposals-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.proposal-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.proposal-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.35;
}

.badge-key {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.card-description {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Badge Chiffrage */
.chiffrage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.25rem;
  width: fit-content;
}

.chiffrage-badge:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
}

.chiffrage-badge.depense {
  background: var(--chiffre-depense-bg);
  border: 1px solid var(--chiffre-depense-border);
  color: var(--chiffre-depense-text);
}

.chiffrage-badge.recette {
  background: var(--chiffre-recette-bg);
  border: 1px solid var(--chiffre-recette-border);
  color: var(--chiffre-recette-text);
}

.chiffrage-badge.estime {
  background: var(--chiffre-estime-bg);
  border: 1px solid var(--chiffre-estime-border);
  color: var(--chiffre-estime-text);
}

.chiffrage-badge.neutre {
  background: var(--chiffre-neutre-bg);
  border: 1px solid var(--chiffre-neutre-border);
  color: var(--chiffre-neutre-text);
}

.chiffrage-source {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
  padding-left: 0.4rem;
  border-left: 1px solid currentColor;
}

/* État vide */
.topic-empty-state {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.825rem;
  font-style: italic;
}

/* ==========================================================================
   MODALE DE CHIFFRAGE & DÉTAILS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s ease-out;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.site-footer a {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETTE & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .spectrum-nodes-ribbon {
    grid-template-columns: repeat(4, 1fr);
    row-gap: 0.5rem;
  }
}

@media (max-width: 860px) {
  .header-title-section h1 {
    font-size: 1.75rem;
  }

  /* Sur mobile, on bascule en 1 colonne pour les volets */
  .split-view-container.mode-compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-tab-switcher {
    display: grid;
  }

  /* Cache le volet inactif sur mobile */
  .candidate-pane.mobile-hidden {
    display: none;
  }

  .spectrum-nodes-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }

  .view-mode-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .split-candidate-selectors {
    justify-content: space-between;
  }

  .selector-slot {
    flex: 1;
  }

  .filters-subbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrapper {
    max-width: 100%;
  }
}

/* Mode Impression */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .controls-panel, .spectrum-section, .site-header .back-link, .modal-overlay {
    display: none !important;
  }
  .candidate-pane {
    box-shadow: none !important;
    border: 1px solid #CCC !important;
    break-inside: avoid;
  }
}
