.nav-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 230;
  background: rgba(10, 18, 50, 0.85);
  border: 1px solid rgba(90, 140, 255, 0.24);
  border-radius: 4px;
  padding: 10px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.3s;
  backdrop-filter: blur(6px);
}

.nav-toggle:hover {
  border-color: rgba(120, 180, 255, 0.9);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(208, 224, 255, 0.95);
  transition: all 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-discover-hint {
  position: fixed;
  top: 27px;
  right: 74px;
  z-index: 229;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: rgba(140, 170, 220, 0.85);
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  opacity: 0.9;
  transition: color 0.2s, opacity 0.2s;
  animation: menuHintFloat 2.6s ease-in-out infinite;
}

.menu-discover-hint:hover {
  color: #e6f1ff;
  opacity: 1;
}

.menu-discover-hint .menu-discover-arrow {
  width: 10px;
  height: 10px;
  border-top: 2px solid rgba(120, 180, 255, 0.95);
  border-right: 2px solid rgba(120, 180, 255, 0.95);
  transform: rotate(45deg);
  opacity: 0.9;
}

.nav-toggle.open + .menu-discover-hint {
  opacity: 0;
  pointer-events: none;
}

.side-nav {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: linear-gradient(175deg, rgba(6, 12, 38, 0.97), rgba(3, 6, 20, 0.99));
  border-left: 1px solid rgba(90, 140, 255, 0.24);
  z-index: 220;
  padding: 80px 30px 40px;
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}

.side-nav.open {
  right: 0;
}

.side-nav h3 {
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(140, 170, 220, 0.8);
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Toggle FR / EN en haut du menu nav */
.lang-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 24px;
  border: 1px solid rgba(120, 170, 255, 0.32);
  border-radius: 4px;
  padding: 2px;
  background: rgba(10, 18, 50, 0.6);
}
.lang-switch .lang-btn {
  background: none;
  border: none;
  color: rgba(180, 210, 255, 0.7);
  font-family: 'Space Mono', 'SF Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.4px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.18s ease;
}
.lang-switch .lang-btn:hover {
  color: #d0e8ff;
}
.lang-switch .lang-btn.active {
  background: rgba(40, 80, 180, 0.45);
  color: #ffffff;
}

.side-nav a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgba(80, 130, 255, 0.1);
  text-decoration: none;
  color: rgba(208, 224, 255, 0.95);
  font-size: 15px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.side-nav a:hover,
.side-nav a.current {
  color: #ffffff;
  padding-left: 8px;
}

.side-nav .nav-badge {
  display: inline-block;
  font-size: 9px;
  padding: 2px 7px;
  border: 1px solid rgba(90, 140, 255, 0.24);
  border-radius: 3px;
  margin-left: 8px;
  color: rgba(140, 170, 220, 0.8);
  vertical-align: middle;
}

/* Toggle bilingue pour pages text long: éléments avec data-lang="fr"
   visibles uniquement quand <html lang="fr">, idem pour "en".
   Scopé à .doc pour ne pas masquer les boutons FR/EN du switch. */
html[lang="fr"] .doc > [data-lang="en"] { display: none !important; }
html[lang="en"] .doc > [data-lang="fr"] { display: none !important; }

/* Logo GitHub à la place du texte — dernier item du nav */
.side-nav a.nav-github {
  padding: 14px 0;
  display: inline-flex;
  align-items: center;
  color: rgba(208, 224, 255, 0.85);
  border-bottom: none;
  transition: color 0.18s ease, transform 0.18s ease;
}
.side-nav a.nav-github:hover {
  color: #ffffff;
  transform: translateX(2px);
  padding-left: 0;
}
.side-nav a.nav-github svg { display: block; }

.rp-issue-menu {
  position: fixed;
  z-index: 9998;
  display: none;
  min-width: 210px;
  border: 1px solid rgba(90, 140, 255, 0.3);
  border-radius: 6px;
  background: rgba(6, 12, 38, 0.98);
  box-shadow: 0 12px 28px rgba(0, 8, 30, 0.45);
  backdrop-filter: blur(8px);
}

.rp-issue-menu.open {
  display: block;
}

.rp-issue-menu button {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(212, 230, 255, 0.96);
  text-align: left;
  padding: 12px 14px;
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
}

.rp-issue-menu button:hover {
  background: rgba(46, 88, 182, 0.35);
}

.rp-issue-modal {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(1, 6, 20, 0.7);
}

.rp-issue-modal.open {
  display: flex;
}

.rp-issue-dialog {
  width: min(680px, 96vw);
  border: 1px solid rgba(95, 150, 255, 0.36);
  border-radius: 10px;
  background: linear-gradient(165deg, rgba(9, 19, 56, 0.98), rgba(4, 9, 28, 0.98));
  padding: 20px;
  box-shadow: 0 24px 40px rgba(0, 10, 34, 0.55);
}

.rp-issue-kicker {
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: rgba(160, 198, 255, 0.85);
  margin-bottom: 10px;
}

.rp-issue-dialog h2 {
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: clamp(17px, 2.4vw, 24px);
  letter-spacing: 1.1px;
  color: rgba(236, 245, 255, 0.98);
  margin-bottom: 8px;
}

.rp-issue-dek {
  color: rgba(190, 214, 250, 0.86);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.rp-issue-context {
  color: rgba(160, 196, 246, 0.9);
  font-size: 11px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.rp-issue-field-label {
  display: block;
  margin-bottom: 6px;
  color: rgba(176, 208, 250, 0.88);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.rp-issue-dialog input[type="text"] {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(96, 142, 230, 0.42);
  background: rgba(6, 16, 46, 0.9);
  color: rgba(227, 240, 255, 0.98);
  font-family: 'Space Mono', 'SF Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  outline: none;
}

.rp-issue-dialog input[type="text"]::placeholder {
  color: rgba(155, 190, 238, 0.62);
}

.rp-issue-dialog input[type="text"]:focus {
  border-color: rgba(135, 180, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(73, 118, 210, 0.28);
}

.rp-issue-dialog textarea {
  width: 100%;
  min-height: 130px;
  padding: 12px;
  resize: vertical;
  border-radius: 6px;
  border: 1px solid rgba(96, 142, 230, 0.42);
  background: rgba(6, 16, 46, 0.9);
  color: rgba(227, 240, 255, 0.98);
  font-family: 'Space Mono', 'SF Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  outline: none;
}

.rp-issue-dialog textarea:focus {
  border-color: rgba(135, 180, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(73, 118, 210, 0.28);
}

.rp-issue-note {
  min-height: 20px;
  margin-top: 10px;
  color: rgba(160, 196, 246, 0.86);
  font-size: 11px;
}

.rp-issue-note.ok {
  color: rgba(136, 229, 188, 0.96);
}

.rp-issue-note.error {
  color: rgba(255, 148, 148, 0.98);
}

.rp-issue-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.rp-issue-btn {
  border: 1px solid rgba(95, 150, 255, 0.52);
  border-radius: 6px;
  background: rgba(58, 108, 215, 0.45);
  color: rgba(240, 247, 255, 0.98);
  padding: 9px 14px;
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
}

.rp-issue-btn:hover {
  border-color: rgba(150, 192, 255, 0.95);
}

.rp-issue-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.rp-issue-btn.ghost {
  background: transparent;
  color: rgba(190, 215, 248, 0.9);
}

body.has-shared-menu .top,
body.has-shared-menu .topbar {
  padding-right: 72px;
}

@media (max-width: 900px) {
  .side-nav {
    width: 280px;
    right: -280px;
  }

  .menu-discover-hint {
    display: none;
  }

  body.has-shared-menu .top,
  body.has-shared-menu .topbar {
    padding-right: 64px;
  }
}

@keyframes menuHintFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* ================================================================
   BANDEAU D'ALERTE GLOBAL
================================================================ */

:root {
  --alert-bar-h: 32px;
}

#global-alert-bar {
  display: none; /* masqué jusqu'au chargement des alertes */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 215;
  height: var(--alert-bar-h);
  align-items: stretch;
  background: linear-gradient(to right, rgba(82,68,18,0.97), rgba(58,48,12,0.97));
  border-bottom: 1px solid rgba(242,205,80,0.32);
  overflow: hidden;
}

#global-alert-bar.ready {
  display: flex;
}

/* Niveau « élevé » (jaune/gold) — palier de base */
#global-alert-bar.bar-eleve {
  background: linear-gradient(to right, rgba(82,68,18,0.97), rgba(58,48,12,0.97));
  border-bottom-color: rgba(242,205,80,0.32);
}
/* Niveau « très élevé » (orange) */
#global-alert-bar.bar-tres-eleve {
  background: linear-gradient(to right, rgba(72,28,10,0.97), rgba(54,20,8,0.97));
  border-bottom-color: rgba(255,143,92,0.32);
}
/* Niveau « extrême » (rouge avec glow pulsant) */
#global-alert-bar.bar-extreme {
  background: linear-gradient(to right, rgba(80,12,20,0.97), rgba(60,10,16,0.97));
  border-bottom: 1px solid rgba(255,90,90,0.5);
  box-shadow: 0 1px 16px rgba(255,90,90,0.22);
}

/* Label gauche */
.alert-bar-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-right: 1px solid rgba(242,205,80,0.22);
  text-decoration: none;
  font-family: 'Orbitron', 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 1.8px;
  color: rgba(250,225,140,0.92);
  text-transform: uppercase;
  transition: background 0.2s;
  white-space: nowrap;
  cursor: pointer;
}
.alert-bar-label:hover { background: rgba(242,205,80,0.12); }

#global-alert-bar.bar-tres-eleve .alert-bar-label {
  border-right-color: rgba(255,143,92,0.22);
  color: rgba(255,210,180,0.9);
}
#global-alert-bar.bar-tres-eleve .alert-bar-label:hover { background: rgba(255,143,92,0.12); }

#global-alert-bar.bar-extreme .alert-bar-label {
  border-right-color: rgba(255,90,90,0.28);
  color: rgba(255,200,200,0.95);
}
#global-alert-bar.bar-extreme .alert-bar-label:hover { background: rgba(255,80,80,0.12); }

.alert-bar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(242,205,80,0.95);
  flex-shrink: 0;
  animation: alert-dot-pulse 1.6s ease-in-out infinite;
}
#global-alert-bar.bar-tres-eleve .alert-bar-dot {
  background: rgba(255,160,100,0.95);
}
#global-alert-bar.bar-extreme .alert-bar-dot {
  background: rgba(255,120,120,0.95);
}
@keyframes alert-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* Zone de défilement */
.alert-bar-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.alert-bar-strip {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 0;
  --alert-strip-dur: 30s;
  animation: alert-strip-scroll var(--alert-strip-dur) linear infinite;
  will-change: transform;
}
.alert-bar-track:hover .alert-bar-strip { animation-play-state: paused; }

@keyframes alert-strip-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Items */
.alert-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(250,225,160,0.88);
  text-decoration: none;
  transition: color 0.15s, filter 0.15s;
}
a.alert-bar-item { cursor: pointer; }
a.alert-bar-item:hover .alert-bar-item-name { text-decoration: underline; }
a.alert-bar-item:hover { filter: brightness(1.15); }
.alert-bar-item.level-tres-eleve { color: rgba(255,220,190,0.88); }
.alert-bar-item.level-extreme    { color: rgba(255,210,210,0.92); }

.alert-bar-item-badge {
  font-family: 'Orbitron', monospace;
  font-size: 7px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(242,205,80,0.55);
  background: rgba(98,80,22,0.55);
  color: rgba(250,225,140,0.98);
  flex-shrink: 0;
}
.alert-bar-item.level-tres-eleve .alert-bar-item-badge {
  border-color: rgba(255,143,92,0.55);
  background: rgba(88,40,24,0.55);
  color: rgba(255,210,175,0.98);
}
.alert-bar-item.level-extreme .alert-bar-item-badge {
  border-color: rgba(255,110,110,0.6);
  background: rgba(98,22,28,0.6);
  color: rgba(255,200,200,0.98);
  animation: alert-bar-extreme-pulse 1.4s ease-in-out infinite;
}
@keyframes alert-bar-extreme-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,90,90,0); }
  50%      { box-shadow: 0 0 8px rgba(255,90,90,0.55); }
}

.alert-bar-item-name {
  font-weight: 700;
  text-transform: capitalize;
  color: rgba(255,240,200,0.95);
}
.alert-bar-item.level-tres-eleve .alert-bar-item-name { color: rgba(255,235,215,0.95); }
.alert-bar-item.level-extreme    .alert-bar-item-name { color: rgba(255,230,230,0.98); }

.alert-bar-item-score {
  font-size: 8px;
  color: rgba(255,190,190,0.65);
}
/* Format spécial pour les pivots d'événement dans le défilement:
   pivot en gras et plus visible, membres listés en plus discret à côté. */
.alert-bar-event-tag {
  font-size: 9px;
  color: rgba(180,220,255,0.85);
  margin: 0 2px;
}
.alert-bar-event-pivot {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  text-transform: capitalize;
  color: rgba(255,240,210,0.98);
  letter-spacing: 0.3px;
}
.alert-bar-item.level-tres-eleve .alert-bar-event-pivot { color: rgba(255,225,200,0.98); }
.alert-bar-item.level-extreme    .alert-bar-event-pivot { color: rgba(255,235,235,0.98); }
.alert-bar-event-link {
  font-size: 9px;
  color: rgba(255,180,180,0.4);
  margin: 0 2px;
}
.alert-bar-event-members {
  font-size: 8px;
  color: rgba(255,200,200,0.62);
  letter-spacing: 0.2px;
  text-transform: capitalize;
}
.alert-bar-event-member {
  white-space: nowrap;
}
.alert-bar-event-sep {
  color: rgba(255,170,170,0.3);
}

.alert-bar-item-country {
  font-size: 7px;
  letter-spacing: 1px;
  color: rgba(255,170,170,0.45);
  text-transform: uppercase;
}

.alert-bar-sep {
  color: rgba(242,205,80,0.28);
  padding: 0 6px;
  font-size: 10px;
}
#global-alert-bar.bar-tres-eleve .alert-bar-sep { color: rgba(255,143,92,0.28); }
#global-alert-bar.bar-extreme    .alert-bar-sep { color: rgba(255,100,100,0.28); }

/* Badge compteur alerte dans le menu nav */
.nav-badge-alert {
  background: rgba(180,30,40,0.55) !important;
  border-color: rgba(255,90,90,0.45) !important;
  color: rgba(255,190,190,0.9) !important;
}
.nav-badge-alert.active {
  background: rgba(200,30,40,0.7) !important;
  border-color: rgba(255,100,100,0.65) !important;
  color: rgba(255,210,210,0.98) !important;
}

/* Pousse le contenu en flow naturel sous le bandeau (pages text:
   radarplus, methodologie, partenaires, acces-donnees, unes, etc.).
   Sans effet sur les enfants position:fixed/absolute, qui sont gérés
   au cas par cas plus bas. */
body.has-alert-bar {
  padding-top: var(--alert-bar-h);
}

/* Décale le contenu de la page quand le bandeau est actif */
body.has-alert-bar .nav-toggle {
  top: calc(20px + var(--alert-bar-h));
}
body.has-alert-bar .menu-discover-hint {
  top: calc(27px + var(--alert-bar-h));
}
body.has-alert-bar .home-logo {
  top: calc(18px + var(--alert-bar-h));
}
/* evolution.html: panneau gauche + barre de navigation période */
body.has-alert-bar #left-panel {
  top: var(--alert-bar-h);
}
body.has-alert-bar #period-nav-row {
  top: calc(14px + var(--alert-bar-h));
}
/* constellation.html: header titres/boutons */
body.has-alert-bar #header {
  top: var(--alert-bar-h);
}
/* Slide-in panels qui prennent 100vh — header ne doit pas
   passer sous le bandeau quand ils s'ouvrent */
body.has-alert-bar .article-panel,
body.has-alert-bar .detail-panel,
body.has-alert-bar #object-panel {
  top: var(--alert-bar-h);
  height: calc(100vh - var(--alert-bar-h));
}

/* ================================================================
   LOGO R+ "RETOUR À L'ACCUEIL" (toutes pages sauf accueil/evolution)
================================================================ */

.home-logo {
  position: fixed;
  top: 18px;
  left: 20px;
  width: 36px;
  height: 36px;
  z-index: 220;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.2s ease;
}
.home-logo:hover { transform: scale(1.06); }
.home-logo:focus-visible {
  outline: 2px solid rgba(120,170,255,0.6);
  outline-offset: 3px;
}
.home-logo svg { width: 100%; height: 100%; display: block; }
.home-logo .rp-r { fill: rgba(195, 220, 255, 0.92); }
.home-logo .rp-plus {
  fill: #dde64a;
  animation: home-logo-pulse 1.6s ease-in-out infinite;
  transform-origin: 70% 30%;
}
@keyframes home-logo-pulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(221,230,74,0.55)); }
  50%      { opacity: 0.45; filter: drop-shadow(0 0 1px rgba(221,230,74,0.10)); }
}
