/* ═══════════════════════════════════════════════════════════════════════════
   SCI‑AUTONOME v7.0 — CYBER·GOV EDITION
   CLASSIFICATION: RESTRICTED ACCESS — AUTHORIZED PERSONNEL ONLY
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── @property — custom properties animables nativement (Chrome/Safari/Edge) ── */
@property --ang {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@property --glow-sz {
  syntax: '<length>';
  initial-value: 8px;
  inherits: false;
}
@property --shimmer-x {
  syntax: '<percentage>';
  initial-value: -60%;
  inherits: false;
}

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  /* Core palette */
  --bg:        #000000;
  --bg2:       #030a0f;
  --bg3:       #061018;
  --panel:     #07111c;
  --panel2:    #0b1825;

  /* Borders */
  --border:    #162c42;
  --border2:   #0f2035;

  /* Text */
  --text:      #a8c8e0;
  --textdim:   #8fb2ce;
  --textbright:#d8eef8;

  /* Red accent */
  --red:       #c0392b;
  --red-glow:  rgba(192,57,43,0.25);

  /* Domain colors */
  --med:       #00e5ff;
  --cyber:     #ff2d6b;
  --tech:      #ff9f0a;
  --phy:       #30d158;

  /* Gov accent */
  --gov:       #c8a84b;
  --gov-dim:   rgba(200,168,75,0.2);

  /* Active domain (changed via JS) */
  --active:      #00e5ff;
  --active-glow: rgba(0,229,255,0.25);
  --glow1:       0 0 16px rgba(0,229,255,0.25);

  /* Alert */
  --alert:     #ff4020;

  /* Sizing */
  --radius:    3px;
  --radius-lg: 6px;

  /* Touch target */
  --touch:     44px;
}
/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
#btn-auto-all {
    width: 100%;
    border-color: rgba(48,209,88,0.5);
    color: #30d158;
    background: rgba(48,209,88,0.05);
    padding: 8px;
    margin-top: 6px;
    font-weight: 700;
}
#btn-auto-all.running {
    border-color: var(--cyber);
    color: var(--cyber);
    background: rgba(255,45,107,0.06);
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

/* ── Body & Scanlines ─────────────────────────────────────────────────────── */
html {
  background: #000008;
}
body {
  background: transparent;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
#space-journey {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;          /* renvoyé au fond : ne recouvre plus les données */
  opacity: 0.5;         /* décor atténué pour la lisibilité des chiffres */
  pointer-events: none;
}

/* Moving grid — dual frequency */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.032) 1px, transparent 1px),
    linear-gradient(rgba(0,229,255,0.009) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.009) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  pointer-events: none;
  z-index: -1;
  animation: grid-drift 30s linear infinite;
}

/* CRT scanlines + vignette radiale */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 92% 88% at 50% 50%, transparent 52%, rgba(0,0,0,0.82) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,0.09) 3px,
      rgba(0,0,0,0.09) 4px
    );
  pointer-events: none;
  z-index: -1;
}

@keyframes grid-drift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 40px 40px, 40px 40px; }
}

/* ── Classification banner ────────────────────────────────────────────────── */
body::before {
  content: '';
  display: block;
}

.classification-banner {
  position: relative;
  z-index: 20;
  background: repeating-linear-gradient(
    90deg,
    rgba(200,168,75,0.06) 0px, rgba(200,168,75,0.06) 2px,
    transparent 2px, transparent 18px
  );
  border-top: 1px solid rgba(255,64,32,0.12);
  border-bottom: 1px solid rgba(200,168,75,0.35);
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gov);
  text-transform: uppercase;
}

.classification-banner span { opacity: 0.55; }

.classification-banner strong {
  color: var(--alert);
  background: rgba(255,64,32,0.12);
  border: 1px solid rgba(255,64,32,0.45);
  padding: 1px 10px;
  border-radius: 2px;
  letter-spacing: 4px;
  animation: restrict-pulse 2.8s ease-in-out infinite;
}

@keyframes restrict-pulse {
  0%,80%,100% { background: rgba(255,64,32,0.12); box-shadow: none; color: var(--alert); }
  90%         { background: rgba(255,64,32,0.28); box-shadow: 0 0 14px rgba(255,64,32,0.4); color: #ff6040; }
}

/* ── Corner bracket mixin (applied via class) ─────────────────────────────── */
.hud-panel {
  position: relative;
}

.hud-panel::before,
.hud-panel::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 2;
}

.hud-panel::before {
  top: 0; left: 0;
  border-top: 2px solid var(--active);
  border-left: 2px solid var(--active);
  border-radius: 2px 0 0 0;
  box-shadow: -3px -3px 10px rgba(0,229,255,0.25), inset 2px 2px 6px rgba(0,229,255,0.08);
}

.hud-panel::after {
  bottom: 0; right: 0;
  border-bottom: 2px solid var(--active);
  border-right: 2px solid var(--active);
  border-radius: 0 0 2px 0;
  box-shadow: 3px 3px 10px rgba(0,229,255,0.25), inset -2px -2px 6px rgba(0,229,255,0.08);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
header {
  position: relative;
  z-index: 10;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0,229,255,0.12);
  background: linear-gradient(180deg, #060000 0%, #010508 55%, #000c14 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 2px 0 rgba(0,229,255,0.04), 0 6px 32px rgba(0,0,0,0.9);
}

/* Top accent line animée — tri-couleur */
header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--alert) 8%,
    var(--gov) 25%,
    var(--active) 50%,
    var(--gov) 75%,
    var(--alert) 92%,
    transparent 100%);
  animation: header-shimmer 6s ease-in-out infinite;
  opacity: 0.9;
}

/* Bottom glow line */
header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.25), transparent);
  pointer-events: none;
}

@keyframes header-shimmer {
  0%,100% { opacity: 0.75; filter: blur(0); }
  50%     { opacity: 1;    filter: blur(0.4px); }
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--active);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--active);
  background: rgba(0,229,255,0.06);
  box-shadow: var(--glow1);
  animation: logo-pulse 4s ease-in-out infinite;
  transition: transform 0.4s ease;
  cursor: default;
}

.logo-icon:hover {
  transform: rotate(30deg);
}

@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0,229,255,0.2); }
  50%      { box-shadow: 0 0 28px rgba(0,229,255,0.45), 0 0 50px rgba(0,229,255,0.1); }
}

.logo-text h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: var(--active);
  letter-spacing: 5px;
  text-shadow: 0 0 12px var(--active-glow), 0 0 30px rgba(0,229,255,0.15);
  animation: glitch-text 8s infinite;
}

@keyframes glitch-text {
  0%, 88%, 100% { text-shadow: 0 0 12px var(--active-glow); transform: none; clip-path: none; }
  89%  { transform: translateX(3px) skewX(-2deg);
         text-shadow: -3px 0 var(--cyber), 3px 0 var(--med), 0 0 20px var(--active); }
  90%  { transform: translateX(-2px) skewX(1deg);
         text-shadow: 3px 0 var(--alert), -3px 0 var(--med); }
  91%  { transform: translateX(1px);
         clip-path: inset(20% 0 40% 0);
         text-shadow: -2px 0 var(--cyber), 2px 0 var(--tech); }
  92%  { transform: translateX(-1px);
         clip-path: inset(60% 0 10% 0);
         text-shadow: 2px 0 var(--alert), -2px 0 var(--med); }
  93%  { transform: none; clip-path: none; text-shadow: 0 0 12px var(--active-glow); }
}

.logo-text p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--textdim);
  letter-spacing: 2px;
  margin-top: 2px;
}

.header-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hstat {
  text-align: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: rgba(0,229,255,0.025);
  position: relative;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}

.hstat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--active);
  line-height: 1;
}

.hstat-lbl {
  font-size: 7px;
  color: var(--textdim);
  letter-spacing: 1px;
  margin-top: 1px;
  text-transform: uppercase;
  font-family: 'Share Tech Mono', monospace;
}

.sys-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: var(--textdim);
  letter-spacing: 1px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 6px #30d158;
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ── Domain Bar ───────────────────────────────────────────────────────────── */
.domain-bar {
  position: relative;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.domain-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--textdim);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  text-align: center;
  white-space: nowrap;
  text-transform: uppercase;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.domain-tab:hover { color: var(--text); }

.domain-tab.active-med {
  color: var(--med); border-bottom-color: var(--med);
  background: rgba(0,229,255,0.07);
  box-shadow: inset 0 -3px 14px rgba(0,229,255,0.08), 0 3px 0 var(--med);
  animation: neon-breathe-cyan 2.5s ease-in-out infinite;
}
.domain-tab.active-cyber {
  color: var(--cyber); border-bottom-color: var(--cyber);
  background: rgba(255,45,107,0.07);
  box-shadow: inset 0 -3px 14px rgba(255,45,107,0.08), 0 3px 0 var(--cyber);
  animation: neon-breathe-red 2.5s ease-in-out infinite;
}
.domain-tab.active-tech {
  color: var(--tech); border-bottom-color: var(--tech);
  background: rgba(255,159,10,0.07);
  box-shadow: inset 0 -3px 14px rgba(255,159,10,0.08), 0 3px 0 var(--tech);
  animation: neon-breathe-amber 2.5s ease-in-out infinite;
}
.domain-tab.active-physics {
  color: var(--phy); border-bottom-color: var(--phy);
  background: rgba(48,209,88,0.07);
  box-shadow: inset 0 -3px 14px rgba(48,209,88,0.08), 0 3px 0 var(--phy);
  animation: neon-breathe-green 2.5s ease-in-out infinite;
}

@keyframes neon-breathe-cyan {
  0%, 100% { text-shadow: 0 0 6px rgba(0,229,255,0.5); }
  50%      { text-shadow: 0 0 14px rgba(0,229,255,0.9), 0 0 28px rgba(0,229,255,0.3); }
}
@keyframes neon-breathe-red {
  0%, 100% { text-shadow: 0 0 6px rgba(255,45,107,0.5); }
  50%      { text-shadow: 0 0 14px rgba(255,45,107,0.9), 0 0 28px rgba(255,45,107,0.3); }
}
@keyframes neon-breathe-green {
  0%, 100% { text-shadow: 0 0 6px rgba(48,209,88,0.5); }
  50%      { text-shadow: 0 0 14px rgba(48,209,88,0.9), 0 0 28px rgba(48,209,88,0.3); }
}

.domain-icon {
  font-size: 12px;
}

/* ── Main Layout ──────────────────────────────────────────────────────────── */
.main-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px 1fr 288px;
  min-height: calc(100vh - 112px);
}

.sidebar-left {
  border-right: 1px solid rgba(255,64,32,0.22);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: linear-gradient(180deg,
    rgba(192,57,43,0.06) 0%,
    rgba(0,0,0,0) 18%,
    rgba(0,0,0,0) 82%,
    rgba(0,229,255,0.03) 100%),
    rgba(0,0,0,0.75);
  box-shadow: inset -1px 0 28px rgba(255,64,32,0.04);
}
.sidebar-left::-webkit-scrollbar { display: none; }

/* Data-flow rouge — descend */
.sidebar-left::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 1px;
  height: 35%;
  background: linear-gradient(180deg, transparent, var(--alert), transparent);
  animation: data-flow 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* Data-flow cyan — monte (bordure droite intérieure) */
.sidebar-left::after {
  content: '';
  position: absolute;
  right: 0; bottom: 0;
  width: 1px;
  height: 28%;
  background: linear-gradient(0deg, transparent, rgba(0,229,255,0.5), transparent);
  animation: data-flow-up 4.2s ease-in-out infinite 1.8s;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

@keyframes data-flow {
  0%   { transform: translateY(-100%); opacity: 0; }
  15%  { opacity: 0.65; }
  85%  { opacity: 0.65; }
  100% { transform: translateY(260%); opacity: 0; }
}

@keyframes data-flow-up {
  0%   { transform: translateY(100%);  opacity: 0; }
  15%  { opacity: 0.5; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(-260%); opacity: 0; }
}

.sidebar-right {
  border-left: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: linear-gradient(180deg,
    rgba(0,229,255,0.03) 0%,
    rgba(0,0,0,0) 18%,
    rgba(0,0,0,0) 82%,
    rgba(192,57,43,0.06) 100%),
    rgba(0,0,0,0.75);
}

.center-panel {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* ── Section Titles ──────────────────────────────────────────────────────── */
.section-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gov);
  text-shadow: 0 0 8px rgba(200,168,75,0.35);
  text-transform: uppercase;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(200,168,75,0.18);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.section-title::before {
  content: '//';
  color: var(--gov);
  opacity: 0.7;
  font-size: 9px;
}

/* Underline glow beam */
.section-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--gov), transparent);
  opacity: 0.55;
  animation: section-beam 3s ease-in-out infinite;
}

@keyframes section-beam {
  0%,100% { width: 35%; opacity: 0.45; }
  50%     { width: 65%; opacity: 0.7; }
}

/* ── Phase Buttons ────────────────────────────────────────────────────────── */
.phase-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  min-height: var(--touch);
}

.phase-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.04), transparent);
  transition: left 0.4s ease;
}

.phase-btn:hover::before { left: 100%; }

.phase-btn:hover {
  border-left-color: var(--active);
  border-color: rgba(0,229,255,0.35);
  transform: translateX(3px);
  box-shadow:
    inset 2px 0 16px rgba(0,229,255,0.07),
    -3px 0 14px rgba(0,229,255,0.1),
    0 0 20px rgba(0,229,255,0.04);
}

.phase-btn.loading {
  --ang: 0deg;
  border: 2px solid transparent !important;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from var(--ang),
      transparent 0deg, var(--alert) 60deg,
      #ff9f0a 100deg, transparent 160deg) border-box;
  animation: plasma 1.2s linear infinite;
}

@keyframes plasma { to { --ang: 360deg; } }

.phase-btn.success {
  border-left-color: #30d158;
  box-shadow: inset 0 0 8px rgba(48,209,88,0.04);
}
.phase-btn.error {
  border-left-color: var(--alert);
  border-color: rgba(255,64,32,0.25);
  box-shadow: 0 0 10px rgba(255,64,32,0.06);
}

.phase-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(0,229,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--active);
  flex-shrink: 0;
  transition: transform 0.4s ease, background 0.3s;
  text-shadow: 0 0 6px var(--active);
}

.phase-btn:hover .phase-num {
  transform: rotate(30deg);
  background: rgba(0,229,255,0.22);
}

.phase-btn.loading .phase-num {
  animation: hex-spin 1.8s linear infinite;
  background: rgba(255,64,32,0.2);
  color: var(--alert);
  text-shadow: 0 0 8px var(--alert);
}

@keyframes hex-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.phase-info { flex: 1; min-width: 0; }
.phase-name { font-size: 12px; font-weight: 700; color: var(--textbright); letter-spacing: 0.5px; }
.phase-desc { font-size: 9px; color: var(--textdim); margin-top: 2px; }

.phase-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.phase-btn.success .phase-indicator {
  background: #30d158;
  box-shadow: 0 0 6px #30d158, 0 0 14px rgba(48,209,88,0.3);
}

.phase-btn.loading .phase-indicator {
  background: var(--alert);
  box-shadow: 0 0 8px var(--alert), 0 0 18px rgba(255,64,32,0.4);
  animation: dot-beat 0.7s ease-in-out infinite;
}

.phase-btn.error .phase-indicator {
  background: var(--alert);
  box-shadow: 0 0 6px var(--alert);
}

@keyframes dot-beat {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.8); opacity: 0.6; }
}

/* ── Utility Buttons ──────────────────────────────────────────────────────── */
.util-row {
  display: flex;
  gap: 5px;
}

.util-btn {
  flex: 1;
  padding: 7px 10px;
  background: #15151f;                  /* fond solide sombre */
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: var(--radius);
  color: #d4d4dc;                       /* texte clair lisible */
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.util-btn:hover {
  background: #1c2230;
  border-color: var(--active);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(0,229,255,0.20);
}

.util-btn.danger:hover {
  border-color: var(--cyber);
  color: var(--cyber);
  background: rgba(255,45,107,0.04);
}

/* ── Auto-cycle block ─────────────────────────────────────────────────────── */
.auto-block {
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auto-label {
  font-size: 9px;
  color: var(--textdim);
  margin-bottom: 6px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

.auto-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auto-btn {
  padding: 8px 14px;
  background: rgba(0,229,255,0.05);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--radius);
  color: var(--active);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  cursor: pointer;
  transition: background 0.25s, filter 0.25s, border-color 0.25s, transform 0.15s;
  letter-spacing: 1px;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep interne */
.auto-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}
.auto-btn:hover::before { left: 140%; }

.auto-btn:hover {
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.5);
  transform: translateY(-1px);
  /* drop-shadow suit la forme clip-path */
  filter: drop-shadow(0 0 8px rgba(0,229,255,0.45))
          drop-shadow(0 0 18px rgba(0,229,255,0.15));
}

.auto-btn.active {
  background: rgba(255,159,10,0.1);
  border-color: var(--tech);
  color: var(--tech);
  animation: neon-breathe-amber 1.8s ease-in-out infinite;
}

@keyframes neon-breathe-amber {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(255,159,10,0.4)); }
  50%      { filter: drop-shadow(0 0 18px rgba(255,159,10,0.75))
                     drop-shadow(0 0 36px rgba(255,159,10,0.25)); }
}

.cycle-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  color: var(--tech);
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  padding: 0 12px;
  position: relative;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab {
  padding: 11px 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--textdim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  text-transform: uppercase;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--active);
  border-bottom-color: var(--active);
  text-shadow: 0 0 8px rgba(0,229,255,0.6);
  position: relative;
}

/* Beam glow sous l'onglet actif */
.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--active);
  box-shadow: 0 0 10px var(--active), 0 0 22px rgba(0,229,255,0.4);
  border-radius: 2px 2px 0 0;
  pointer-events: none;
}

/* Dropdown */
.tab-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  display: flex !important;
  align-items: center;
  gap: 5px;
  background: rgba(0,229,255,0.04) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
}

.dropdown-btn:hover {
  background: rgba(0,229,255,0.1) !important;
  border-color: var(--active) !important;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 160px;
  z-index: 1000;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6), 0 0 20px rgba(0,229,255,0.05);
}

.dropdown-content .tab {
  display: flex !important;
  width: 100%;
  text-align: left;
  padding: 10px 14px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(22,44,66,0.5) !important;
  font-size: 9px !important;
}

.dropdown-content .tab:last-child { border-bottom: none !important; }
.dropdown-content .tab:hover { background: rgba(0,229,255,0.06) !important; color: var(--active) !important; }
.dropdown-content.show { display: block; }
.dropdown-btn.active { color: var(--active) !important; border-color: var(--active) !important; }

/* État normal : fond bien plus opaque */
.tab-content {
  flex: 1;
  border-radius: 8px;
  overflow: auto;
  padding: 14px;
  /*background: rgba(0, 0, 0, 0.92);  /* 0.92 = très opaque, presque noir pur */
  transition: background 0.3s ease;
}

/* En mode normal, le hover ne change RIEN */
.tab-content:hover {
  border-radius: 8px;
  /*background: rgba(0, 0, 0, 0.92);  /* Même valeur pour cohérence */
}

/* Mode immersif : le fond disparaît COMPLÈTEMENT */
body.immersive-mode .tab-content {
  background: transparent !important;
}

/* Même en hover en mode immersif, reste transparent */
body.immersive-mode .tab-content:hover {
  background: transparent !important;
}

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

/* ── Console — GOV Terminal ───────────────────────────────────────────────── */
/* ════════════════════════════════════════════════════════
   TERMINAL — Style Ubuntu / GNOME Terminal
   ════════════════════════════════════════════════════════ */
.console {
  position: relative;
  background: #0e0010;           /* violet sombre Ubuntu */
  border: 1px solid #8b1a1a;       /* bordure rouge */
  border-radius: 8px;
  padding: 0;
  font-family: 'Share Tech Mono', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 170px;
  max-height: 360px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.85),
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 18px rgba(139,26,26,0.30);  /* lueur rouge externe */
}

/* ── Barre de titre Ubuntu (3 boutons en radial-gradient, 0 HTML) ── */
.console::before {
  content: 'root@sci-autonome: ~';
  display: block;
  height: 34px;
  line-height: 34px;
  padding: 0 16px 0 68px;
  background:
    radial-gradient(circle at 16px 17px, #ff5f57 5.5px, rgba(255,95,87,0.2) 6.5px, transparent 8px),
    radial-gradient(circle at 34px 17px, #febc2e 5.5px, rgba(254,188,46,0.2) 6.5px, transparent 8px),
    radial-gradient(circle at 52px 17px, #28c840 5.5px, rgba(40,200,64,0.2)  6.5px, transparent 8px),
    linear-gradient(180deg, #07111c 0%, #07111c 100%);  /* fond rouge */
  border-bottom: 1px solid #6b1010;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: normal;
  letter-spacing: 0.3px;
  color: #ffffff;                  /* texte blanc sur rouge */
  flex-shrink: 0;
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
  padding-left: 0;
}

/* Corps du terminal */
.console-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 12px 14px;
  color: #e0e0e0;               /* texte blanc/gris clair par défaut */
  scrollbar-width: thin;
  scrollbar-color: #8b1a1a #000000; /* scrollbar rouge */
  background: #000000;              /* fond noir */
}
.console-body::-webkit-scrollbar { width: 4px; }
.console-body::-webkit-scrollbar-track { background: #000000; }
.console-body::-webkit-scrollbar-thumb { background: #8b1a1a; border-radius: 2px; }
.console-body::-webkit-scrollbar-thumb:hover { background: #b02020; }

/* Sélection style terminal */
.console-body ::selection { background: #8b1a1a; color: #fff; }

/* Scan-line très subtile */
.console::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 34px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,229,255,0.06) 30%,
    rgba(0,229,255,0.15) 50%,
    rgba(0,229,255,0.06) 70%,
    transparent 100%);
  pointer-events: none;
  animation: scan-line 7s linear infinite;
  z-index: 2;
}
@keyframes scan-line {
  0%   { top: 34px;             opacity: 0; }
  5%   { opacity: 1; }
  93%  { top: calc(100% - 2px); opacity: 0.5; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

/* ── Curseur bloc clignotant ── */
.log-line:last-child::after {
  content: '█';
  color: #e0e0e0;
  margin-left: 1px;
  font-size: 12px;
  animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── Lignes de log avec couleurs du site ── */
/* ── Animation de frappe sur chaque nouvelle ligne ── */
@keyframes log-line-in {
  from { clip-path: inset(0 100% 0 0); opacity: 0.6; }
  to   { clip-path: inset(0 0%   0 0); opacity: 1;   }
}

.log-line {
  display: block;
  padding: 1px 0;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  background: #000000;             /* fond noir derrière le texte d'activité */
  animation: log-line-in 0.28s steps(18, end) forwards;
}

/* ok → vert site (domaine médical) */
.log-line.ok {
  color: #26a269;               /* vert Ubuntu authentique */
}
/* info → cyan site */
.log-line.info {
  color: #00e5ff;
  text-shadow: 0 0 4px rgba(0,229,255,0.3);
}
/* warn → orange site */
.log-line.warn {
  color: #ff9f0a;
  text-shadow: 0 0 4px rgba(255,159,10,0.3);
}
/* error → rouge site */
.log-line.error {
  color: #ff2d6b;
  text-shadow: 0 0 4px rgba(255,45,107,0.3);
  border-left: 2px solid rgba(255,45,107,0.4);
  padding-left: 8px;
}
/* dim → gris sombre */
.log-line.dim { color: #4a3a5a; }

/* ── Prompt bash : root@sci:~$ avant chaque ligne ── */
.log-line.ok::before,
.log-line.info::before,
.log-line.warn::before,
.log-line.error::before {
  content: 'root@sci:~$ ';
  color: #26a269;                  /* vert Ubuntu */
}
.log-line.dim::before {
  content: 'root@sci:~$ ';
  color: #3a2a4a;
}

/* ── Bouton COPY du terminal ─────────────────────────────────────────────── */
.console-copy-btn {
  position: absolute;
  top: 7px;
  right: 10px;
  z-index: 10;
  background: transparent;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 3px;
  padding: 2px 9px;
  font-family: 'Share Tech Mono', 'Ubuntu Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 18px;
}
.console-copy-btn:hover {
  background: rgba(139,26,26,0.65);
  color: #ffffff;
  border-color: rgba(255,255,255,0.45);
}
.console-copy-btn.copied {
  background: #26a269;
  color: #ffffff;
  border-color: #26a269;
  letter-spacing: 1px;
}

/* ── Séparateur barre de filtre ──────────────────────────────────────────── */
.cf-sep { color: #2a1a3a; margin: 0 3px; font-size: 12px; user-select: none; }

/* ── Boutons action terminal (TS / scroll / expand / CLR) ────────────────── */
.cf-action {
  padding: 1px 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  cursor: pointer;
  color: rgba(255,255,255,0.28);
  letter-spacing: 1px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 16px;
}
.cf-action:hover         { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.05); }
.cf-action.active        { color: rgba(255,255,255,0.65); border-color: rgba(255,255,255,0.25); }
.cf-action.danger:hover  { color: #ff2d6b; border-color: rgba(255,45,107,0.4); background: rgba(255,45,107,0.07); }

/* ── Timestamp sur chaque ligne terminal ─────────────────────────────────── */
.log-ts {
  display: none;
  color: rgba(110,80,150,0.6);
  font-size: 9px;
  margin-right: 5px;
  letter-spacing: 0;
  font-style: normal;
}
.console.show-ts .log-ts { display: inline; }

/* ── Console plein écran ─────────────────────────────────────────────────── */
.console.console-fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  max-height: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.console.console-fs .console-body {
  max-height: calc(100vh - 62px) !important;
}

/* ── Mode focus (sidebars masquées) ──────────────────────────────────────── */
.focus-mode .sidebar-left,
.focus-mode .sidebar-right,
.focus-mode .classification-banner  { display: none !important; }
.focus-mode .main-layout            { grid-template-columns: 1fr !important; }
#btn-focus-mode                     { margin-left: auto; }
#btn-focus-mode.active              { color: var(--active) !important; border-color: var(--active) !important; background: rgba(0,229,255,0.06) !important; }

/* ── Mission time dans le header ─────────────────────────────────────────── */
.hstat-session { border-color: rgba(255,64,32,0.22) !important; }
#mission-time  { font-size: 11px !important; letter-spacing: 1px; color: var(--alert) !important; }

/* ── Recherche de nœud graphe ────────────────────────────────────────────── */
.graph-search {
  max-width: 175px;
  padding: 4px 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  outline: none;
  letter-spacing: 1px;
  transition: border-color 0.2s;
  min-height: 28px;
}
.graph-search:focus       { border-color: rgba(0,229,255,0.4); }
.graph-search::placeholder { color: var(--textdim); }

/* ── Bouton SAVE / export logs ───────────────────────────────────────────── */
.console-save-btn {
  position: absolute;
  top: 7px;
  right: 62px;
  z-index: 10;
  background: transparent;
  color: rgba(255,255,255,0.40);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  padding: 2px 7px;
  font-family: 'Share Tech Mono', 'Ubuntu Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 18px;
}
.console-save-btn:hover {
  background: rgba(48,209,88,0.2);
  color: #30d158;
  border-color: rgba(48,209,88,0.45);
}
.console-save-btn.saved {
  background: rgba(48,209,88,0.25);
  color: #30d158;
  border-color: #30d158;
}

/* ── Barre de filtre terminal ────────────────────────────────────────────── */
.console-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #000;
  border-bottom: 1px solid #110808;
  flex-shrink: 0;
}
.cf-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: #3a2a3a;
  letter-spacing: 2px;
  margin-right: 3px;
  user-select: none;
}
.cf-btn {
  padding: 1px 7px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  line-height: 16px;
}
.cf-btn.active                        { opacity: 1; }
.cf-btn[data-type="ok"]               { color: #26a269; }
.cf-btn[data-type="info"]             { color: #00e5ff; }
.cf-btn[data-type="warn"]             { color: #ff9f0a; }
.cf-btn[data-type="error"]            { color: #ff2d6b; }
.cf-btn.active[data-type="ok"]        { border-color: rgba(38,162,105,0.4);  background: rgba(38,162,105,0.1); }
.cf-btn.active[data-type="info"]      { border-color: rgba(0,229,255,0.35);  background: rgba(0,229,255,0.07); }
.cf-btn.active[data-type="warn"]      { border-color: rgba(255,159,10,0.4);  background: rgba(255,159,10,0.1); }
.cf-btn.active[data-type="error"]     { border-color: rgba(255,45,107,0.4);  background: rgba(255,45,107,0.1); }

/* Masquage des lignes filtrées */
.console.hide-ok    .log-line.ok    { display: none; }
.console.hide-info  .log-line.info  { display: none; }
.console.hide-warn  .log-line.warn  { display: none; }
.console.hide-error .log-line.error { display: none; }

/* ── Toast notifications (coin bas-gauche) ───────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 9998;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  pointer-events: none;
  max-width: 290px;
}
.toast {
  padding: 7px 14px 7px 11px;
  background: rgba(6,14,22,0.97);
  border-left: 3px solid #444;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 0 4px 4px 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #d0d0d0;
  animation: toast-in 0.22s ease-out forwards, toast-out 0.28s ease-in 2.72s forwards;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}
.toast.ok    { border-left-color: #26a269; }
.toast.info  { border-left-color: #00e5ff; }
.toast.warn  { border-left-color: #ff9f0a; }
.toast.error { border-left-color: #ff2d6b; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-14px); }
}
@media (max-width: 768px) {
  #toast-container { bottom: 16px; left: 12px; right: 72px; max-width: none; }
  .toast { font-size: 10px; padding: 6px 10px 6px 9px; }
}

/* ── Bouton retour en haut (fixe, coin bas-droite, responsive) ───────────── */
.back-to-top {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  min-width: 44px;    /* cible tactile mobile minimale */
  min-height: 44px;
  border-radius: 50%;
  background: rgba(139,26,26,0.88);
  border: 1px solid #8b1a1a;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* caché par défaut, apparaît au scroll */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.18s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), 0 0 10px rgba(139,26,26,0.35);
  line-height: 1;
  -webkit-tap-highlight-color: transparent; /* supprime le flash bleu sur mobile */
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: #8b1a1a;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.65), 0 0 16px rgba(139,26,26,0.55);
}
.back-to-top:active {
  transform: scale(0.93);
}

/* Mobile : cible plus grande, position ajustée */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    font-size: 22px;
  }
}

/* ── Kinetic Simulator Controls ──────────────────────────────────────────── */
.kinetic-chart { position: relative; }

.ks-controls {
  padding: 6px 0 2px;
}
.ks-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.ks-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--textdim);
  width: 28px;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.ks-val {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  color: var(--active);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}
.ks-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ks-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 6px var(--active);
  cursor: pointer;
}
.ks-slider::-moz-range-thumb {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 6px var(--active);
  border: none;
  cursor: pointer;
}
.ks-btn {
  width: 100%;
  margin-top: 4px;
  padding: 5px;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: var(--radius);
  color: var(--active);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s, filter 0.2s;
}
.ks-btn:hover {
  background: rgba(0,229,255,0.12);
  filter: drop-shadow(0 0 6px rgba(0,229,255,0.4));
}

.ks-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-top: 5px;
  padding: 5px 4px;
  background: rgba(0,229,255,0.04);
  border: 1px solid rgba(0,229,255,0.12);
  border-radius: 3px;
}
.ks-stat { text-align: center; }
.ks-stat-label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 7px;
  color: var(--textdim);
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}
.ks-stat-val {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  color: var(--active);
  font-weight: 600;
}

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 160px;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 1px rgba(0,229,255,0.15), inset 0 0 12px rgba(0,229,255,0.03);
}

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

.search-scope {
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--textdim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  cursor: pointer;
}

.search-btn {
  padding: 9px 16px;
  background: rgba(0,229,255,0.07);
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: var(--radius);
  color: var(--active);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s, box-shadow 0.2s;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  text-transform: uppercase;
}

.search-btn:hover {
  background: rgba(0,229,255,0.15);
  box-shadow: 0 0 12px rgba(0,229,255,0.2);
}

.search-results { margin-top: 8px; }

.search-result-item {
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-result-item:hover {
  border-color: rgba(0,229,255,0.35);
  box-shadow: 0 0 16px rgba(0,0,0,0.3);
}

.sr-type {
  font-family: 'Share Tech Mono', monospace;
  font-size: 7px;
  letter-spacing: 2px;
  padding: 2px 6px;
  border-radius: 2px;
  margin-right: 6px;
  text-transform: uppercase;
}

.sr-type-concept { background: rgba(0,229,255,0.1); color: var(--med); }
.sr-type-edge    { background: rgba(255,159,10,0.1); color: var(--tech); }
.sr-type-report  { background: rgba(48,209,88,0.1); color: #30d158; }
.sr-type-article { background: rgba(255,45,107,0.1); color: var(--cyber); }

.sr-title {
  font-weight: 600;
  color: var(--textbright);
  font-size: 13px;
}

.sr-sub {
  font-size: 9px;
  color: var(--textdim);
  margin-top: 3px;
  font-family: 'Share Tech Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dashboard cards ──────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Top holographic line */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg,
    transparent 20%, rgba(255,255,255,0.04) 40%,
    rgba(0,229,255,0.07) 50%, rgba(255,255,255,0.04) 60%, transparent 80%);
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}
.card:hover::before { left: 140%; }

/* HUD corner accent bas-droite + top line */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--active), transparent);
  opacity: 0.2;
  transition: opacity 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 36px rgba(0,0,0,0.6),
    0 0 24px var(--active-glow),
    inset 0 1px 0 rgba(0,229,255,0.1),
    inset 0 0 30px rgba(0,229,255,0.025);
  border-color: rgba(0,229,255,0.4);
}

.card:hover::after { opacity: 0.5; }

.card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: var(--active);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.card-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.card-sub {
  font-size: 9px;
  color: var(--textdim);
  margin-top: 4px;
  font-family: 'Share Tech Mono', monospace;
}

/* ── Domain mini-cards ────────────────────────────────────────────────────── */
.dom-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.dom-card {
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid;
  text-align: center;
  transition: transform 0.25s, filter 0.25s;
}

.dom-card:hover {
  transform: scale(1.03);
  filter: brightness(1.2);
}

.dom-card-med    { border-color: rgba(0,229,255,0.2); background: rgba(0,229,255,0.03); }
.dom-card-cyber  { border-color: rgba(255,45,107,0.2); background: rgba(255,45,107,0.03); }
.dom-card-tech   { border-color: rgba(255,159,10,0.2); background: rgba(255,159,10,0.03); }
.dom-card-physics{ border-color: rgba(48,209,88,0.2); background: rgba(48,209,88,0.03); }

.dom-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.dom-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 7px;
  letter-spacing: 1px;
  margin-top: 3px;
  color: var(--textdim);
}

/* ── Graph ────────────────────────────────────────────────────────────────── */
#graphCanvas {
  width: 100%;
  height: 460px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: block;
  cursor: grab;
  transition: box-shadow 0.3s;
}

#graphCanvas:hover {
  box-shadow: 0 0 40px rgba(0,229,255,0.08), inset 0 0 60px rgba(0,229,255,0.02);
}

#graphCanvas:active { cursor: grabbing; }

.graph-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.graph-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--textdim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: border-color 0.2s, color 0.2s;
  text-transform: uppercase;
  min-height: 32px;
}

.graph-btn:hover {
  border-color: var(--active);
  color: var(--active);
}

.graph-tooltip {
  position: fixed;
  background: rgba(4,12,18,0.97);
  border: 1px solid var(--active);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text);
  pointer-events: none;
  z-index: 1000;
  display: none;
  max-width: 220px;
  box-shadow: 0 0 20px rgba(0,229,255,0.15);
}

.graph-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--textdim);
}

.legend-item { display: flex; align-items: center; gap: 5px; }

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ── Reports ──────────────────────────────────────────────────────────────── */
.report-domain-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.report-dtab {
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;                          /* augmenté pour lisibilité */
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1.2px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.report-dtab.active { font-weight: 700; transform: translateY(-1px); }
.report-dtab:hover { filter: brightness(1.25); }

/* TOUS */
.report-dtab-all {
  background: #15151f;
  border-color: rgba(170,170,180,0.4);
  color: #d4d4dc;
}
.report-dtab-all.active {
  background: #1f1f2e;
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* MÉDICAL — cyan */
.report-dtab-med {
  background: #061821;
  border-color: rgba(0,229,255,0.45);
  color: #5fe5ff;
}
.report-dtab-med.active {
  background: #0a2a3a;
  color: #ffffff;
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0,229,255,0.40);
}

/* CYBER — rose */
.report-dtab-cyber {
  background: #1f0810;
  border-color: rgba(255,45,107,0.45);
  color: #ff6b94;
}
.report-dtab-cyber.active {
  background: #3a0d1d;
  color: #ffffff;
  border-color: #ff2d6b;
  box-shadow: 0 0 12px rgba(255,45,107,0.40);
}

/* TECH — orange */
.report-dtab-tech {
  background: #1f1408;
  border-color: rgba(255,159,10,0.45);
  color: #ffc266;
}
.report-dtab-tech.active {
  background: #3a2710;
  color: #ffffff;
  border-color: #ff9f0a;
  box-shadow: 0 0 12px rgba(255,159,10,0.40);
}

/* PHYSIQUE — vert */
.report-dtab-physics {
  background: #08200f;
  border-color: rgba(48,209,88,0.45);
  color: #6ee592;
}
.report-dtab-physics.active {
  background: #0c3a1c;
  color: #ffffff;
  border-color: #30d158;
  box-shadow: 0 0 12px rgba(48,209,88,0.40);
}

/* Badges chiffrés à droite du label */
.rdc-badge {
  background: rgba(0,0,0,0.4);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 2px;
  min-width: 18px;
  text-align: center;
}

/* 🌉 CONVERGENCE — onglet premium look "luxe" : fond très sombre + texte or */
.report-dtab-cross,
.report-dtab.report-dtab-cross {
  background: #0d0218 !important;          /* presque noir avec hint violet */
  background-color: #0d0218 !important;
  border: 1px solid #ffd700 !important;     /* bordure or */
  color: #ffd700 !important;                /* texte OR — fort contraste sur noir */
  font-weight: 700 !important;
  text-shadow: 0 0 4px rgba(255,215,0,0.4);
  position: relative;
  box-shadow: 0 0 10px rgba(255,215,0,0.25), inset 0 0 8px rgba(191,90,242,0.20);
  animation: convergencePulse 3s ease-in-out infinite;
}
.report-dtab-cross:hover,
.report-dtab.report-dtab-cross:hover {
  background: #1a0a2e !important;
  background-color: #1a0a2e !important;
  color: #fff !important;
  border-color: #fff !important;
}
.report-dtab-cross.active,
.report-dtab.report-dtab-cross.active {
  background: #1f0a35 !important;
  background-color: #1f0a35 !important;
  color: #ffd700 !important;
  border-color: #ffd700 !important;
  box-shadow: 0 0 22px rgba(255,215,0,0.50), inset 0 0 12px rgba(191,90,242,0.30);
}
@keyframes convergencePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.25), inset 0 0 8px rgba(191,90,242,0.20); }
  50%      { box-shadow: 0 0 20px rgba(255,215,0,0.45), inset 0 0 12px rgba(191,90,242,0.30); }
}

/* Carte premium pour les rapports CONVERGENCE — bordure violet + glow doux */
.report-item.dom-cross {
  border: 1px solid #bf5af2 !important;
  background: linear-gradient(135deg, #0c0c18, #14081f) !important;
  box-shadow: 0 0 16px rgba(191,90,242,0.18) !important;
}

/* Le badge déjà rendu en haut-gauche (.rdb-cross) est stylé en look "or premium"
   → pas de duplicata, pas de chevauchement avec les boutons d'action,
     et responsive par construction (inline-block, pas d'absolute) */
.rdb-cross {
  background: linear-gradient(135deg, #bf5af2, #ffd700) !important;
  color: #000 !important;
  border: 1px solid #ffd700 !important;
  font-weight: 700 !important;
  text-shadow: 0 0 2px rgba(255,255,255,0.3);
  box-shadow: 0 0 8px rgba(255,215,0,0.30);
  padding: 3px 9px !important;
}

.report-item {
  background: var(--panel) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.report-item:hover { border-color: rgba(0,229,255,0.25); }

.report-item.dom-medical  { border-left: 2px solid var(--med); }
.report-item.dom-cyber    { border-left: 2px solid var(--cyber); }
.report-item.dom-tech     { border-left: 2px solid var(--tech); }
.report-item.dom-physics  { border-left: 2px solid var(--phy); }

.report-header {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.report-title {
  font-weight: 700;
  color: var(--textbright);
  margin-bottom: 3px;
  font-size: 13px;
}

.report-meta {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #7d9bb5;
  letter-spacing: .2px;
}

/* Résumé (aperçu du contenu) sous le titre du rapport : lisibilité renforcée.
   Cible le <div> stylé inline en 'Share Tech Mono' du template JS (index.php),
   d'où les !important pour surpasser les styles inline sans toucher au HTML. */
.report-item .report-header div[style*="Share Tech Mono"] {
  color: #b9d4e8 !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
  margin-top: 5px !important;
}

.report-domain-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  margin-right: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rdb-medical  { background: rgba(0,229,255,0.08); color: var(--med); border: 1px solid rgba(0,229,255,0.25); }
.rdb-cyber    { background: rgba(255,45,107,0.08); color: var(--cyber); border: 1px solid rgba(255,45,107,0.25); }
.rdb-tech     { background: rgba(255,159,10,0.08); color: var(--tech); border: 1px solid rgba(255,159,10,0.25); }
.rdb-physics  { background: rgba(48,209,88,0.08); color: var(--phy); border: 1px solid rgba(48,209,88,0.25); }

.report-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.report-toggle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--active);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 1px;
}

.dl-btn {
  padding: 8px 14px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 4px;
  color: var(--active);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1.5px;
  white-space: nowrap;
  text-transform: uppercase;
}

.dl-btn:hover {
  background: rgba(0,229,255,0.12);
  border-color: var(--active);
}

.dl-btn.pdf {
  border-color: rgba(255,45,107,0.25);
  color: var(--cyber);
  background: rgba(255,45,107,0.05);
}

.dl-btn.pdf:hover {
  background: rgba(255,45,107,0.12);
  border-color: var(--cyber);
}

.report-body {
  display: none;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.report-body.open { display: block; }

/* 🆕 Virtualisation native — le navigateur saute le rendu des items hors écran */
.report-item {
  content-visibility: auto;
  contain-intrinsic-size: 0 90px;
}

.report-content {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  line-height: 1.75;
  color: var(--text);
  white-space: normal;
  max-height: 460px;
  overflow-y: auto;
  background: #020c10;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
}

/* ── Markdown elements inside reports ───────────────────────────────────── */
.report-content .md-p   { margin: 0 0 8px; }
.report-content .md-h1  { font-family:'Orbitron',sans-serif; font-size:13px; font-weight:700; color:var(--active); letter-spacing:2px; margin:14px 0 6px; padding-bottom:4px; border-bottom:1px solid rgba(0,229,255,0.2); }
.report-content .md-h2  { font-family:'Orbitron',sans-serif; font-size:11px; font-weight:700; color:var(--active); letter-spacing:2px; margin:12px 0 5px; padding-bottom:3px; border-bottom:1px solid rgba(0,229,255,0.15); }
.report-content .md-h3  { font-family:'Share Tech Mono',sans-serif; font-size:10px; font-weight:700; color:var(--gov); letter-spacing:1.5px; margin:10px 0 4px; }
.report-content .md-h4  { font-size:10px; color:var(--textdim); letter-spacing:1px; margin:8px 0 3px; }
.report-content .md-hr  { border:none; border-top:1px solid var(--border); margin:10px 0; opacity:0.5; }
.report-content .md-ul  { margin:4px 0 8px 16px; }
.report-content .md-li  { margin:2px 0; list-style:none; padding-left:12px; position:relative; }
.report-content .md-li::before { content:'›'; position:absolute; left:0; color:var(--active); opacity:0.7; }
.report-content .md-code { background:rgba(0,229,255,0.08); border:1px solid rgba(0,229,255,0.15); border-radius:2px; padding:0 4px; font-size:10px; color:var(--active); }
.report-content .md-pre  { background:#010a06; border:1px solid rgba(48,209,88,0.2); border-radius:3px; padding:10px 12px; margin:8px 0; overflow-x:auto; font-size:10px; color:#30d158; line-height:1.6; }

/* Table in reports */
.report-content .md-table { width:100%; border-collapse:collapse; margin:8px 0 12px; font-size:10px; }
.report-content .md-table th {
  background: rgba(0,229,255,0.07);
  color: var(--active);
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  letter-spacing: 1.5px;
  padding: 6px 10px;
  border: 1px solid rgba(0,229,255,0.18);
  text-align: left;
  text-transform: uppercase;
}
.report-content .md-table td {
  padding: 6px 10px;
  border: 1px solid var(--border2);
  color: var(--text);
  vertical-align: top;
  line-height: 1.5;
}
.report-content .md-table tr:nth-child(even) td { background: rgba(255,255,255,0.018); }
.report-content .md-table tr:hover td { background: rgba(0,229,255,0.04); }
.report-content .md-table td strong { color: var(--gov); }
.report-content .md-link { color: var(--active); text-decoration: none; border-bottom: 1px solid rgba(0,229,255,0.3); transition: color 0.2s, border-bottom-color 0.2s; }
.report-content .md-link:hover { color: #fff; border-bottom-color: var(--active); }

/* ── Badge NEW ────────────────────────────────────────────────────────────── */
.report-item .badge-new {
  display: inline-block;
  background: var(--cyber);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 7px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 2px;
  margin-left: 7px;
  animation: new-blink 1.2s infinite;
  vertical-align: middle;
  letter-spacing: 1px;
}

@keyframes new-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--cyber); }
  50%      { opacity: 0.5; box-shadow: 0 0 12px var(--cyber); }
}

/* ── Generic badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  margin: 2px;
  text-transform: uppercase;
}

.badge-valid {
  background: rgba(48,209,88,0.08);
  color: #30d158;
  border: 1px solid rgba(48,209,88,0.25);
}

.badge-reject {
  background: rgba(255,45,107,0.08);
  color: var(--cyber);
  border: 1px solid rgba(255,45,107,0.25);
}

/* ── Right Sidebar ────────────────────────────────────────────────────────── */
.kinetic-chart {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

#kineticCanvas {
  width: 100%;
  height: 130px;
  display: block;
}

.kinetic-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 8px;
}

.kparam {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px;
  text-align: center;
}

.kparam-label {
  font-size: 7px;
  color: var(--textdim);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.kparam-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  color: var(--tech);
  margin-top: 2px;
}

.live-feed {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  max-height: 240px;
  overflow-y: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
}

.feed-item {
  padding: 4px 0;
  border-bottom: 1px solid rgba(22,44,66,0.3);
  color: var(--textdim);
  line-height: 1.5;
}

.feed-time {
  color: rgba(0,229,255,0.35);
  font-size: 8px;
}

.ring-container {
  position: relative;
  display: inline-block;
  margin: 6px auto;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-pct {
  font-family: 'Orbitron', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--active);
}

.ring-sub {
  font-size: 7px;
  color: var(--textdim);
  letter-spacing: 1px;
}

#progress-ring {
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* 🆕 v7.14d — Barre de progression linéaire (remplace le cercle SVG)
   Gradient jaune→orange→rouge qui se révèle progressivement avec le %.
   À 100% + cycle terminé, passe vert pulsé pour signaler la complétion. */
.progress-bar-wrap {
  margin: 6px 2px 0;
}
.progress-bar-track {
  position: relative;
  height: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd60a 0%, #ff9f0a 50%, #ff453a 100%);
  border-radius: 5px 0 0 5px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1),
              background 0.5s ease,
              box-shadow 0.3s ease;
  box-shadow: 0 0 8px rgba(255,159,10,0.45);
}
.progress-bar-track.running .progress-bar-fill {
  box-shadow: 0 0 14px rgba(255,69,58,0.7);
}
.progress-bar-shine {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 50%);
  border-radius: 5px;
}
.progress-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
  font-family: 'Share Tech Mono', monospace;
}
.progress-bar-pct {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--active);
  transition: color 0.3s;
}
.progress-bar-track.running ~ .progress-bar-meta .progress-bar-pct {
  color: var(--tech);
}
.progress-bar-track.complete ~ .progress-bar-meta .progress-bar-pct {
  color: #30d158;
}
.progress-bar-sub {
  font-size: 7px;
  color: var(--textdim);
  letter-spacing: 1.2px;
}

/* Pulse vert "cycle complet" */
@keyframes bar-complete-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(48,209,88,0.7); }
  50%      { box-shadow: 0 0 22px rgba(48,209,88,1);   }
}
.progress-bar-track.complete .progress-bar-fill {
  background: linear-gradient(90deg, #30d158, #30d158) !important;
  animation: bar-complete-pulse 1.2s ease-in-out infinite;
}

/* ── Logs ─────────────────────────────────────────────────────────────────── */
.logs-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.logs-info {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--textdim);
  letter-spacing: 1px;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--active); }

/* ── Selection ────────────────────────────────────────────────────────────── */
::selection {
  background: rgba(0,229,255,0.25);
  color: #fff;
}

/* ── Focus ────────────────────────────────────────────────────────────────── */
*:focus-visible {
  outline: 1px solid var(--active);
  outline-offset: 2px;
}

/* ── Help button ──────────────────────────────────────────────────────────── */
.help-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--active);
  background: rgba(0,229,255,0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  animation: help-pulse 3s ease-in-out infinite;
}

.help-btn:hover {
  background: rgba(0,229,255,0.12);
  box-shadow: 0 0 18px rgba(0,229,255,0.3);
}

.help-icon {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: var(--active);
}

@keyframes help-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(0,229,255,0.15); }
  50%      { box-shadow: 0 0 12px rgba(0,229,255,0.35); }
}

/* ── Help overlay / popup ─────────────────────────────────────────────────── */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.help-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.help-popup {
  background: var(--panel);
  border: 1px solid var(--active);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 700px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 0 60px rgba(0,229,255,0.15), 0 0 120px rgba(0,229,255,0.06);
  animation: slideUp 0.35s ease;
  position: relative;
}

/* Corner accents on popup */
.help-popup::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 16px; height: 16px;
  border-top: 2px solid var(--active);
  border-left: 2px solid var(--active);
  border-radius: var(--radius-lg) 0 0 0;
}

.help-popup::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 16px; height: 16px;
  border-bottom: 2px solid var(--active);
  border-right: 2px solid var(--active);
  border-radius: 0 0 var(--radius-lg) 0;
}

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

.help-popup h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  color: var(--active);
  letter-spacing: 4px;
  margin-bottom: 6px;
  text-align: center;
}

.help-popup .subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: var(--textdim);
  text-align: center;
  margin-bottom: 22px;
  letter-spacing: 2px;
}

.help-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--textdim);
  font-size: 16px;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: 'Share Tech Mono', monospace;
}

.help-close:hover {
  border-color: var(--cyber);
  color: var(--cyber);
  background: rgba(255,45,107,0.08);
}

.help-footer {
  text-align: center;
  margin-top: 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--textdim);
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Notification button ──────────────────────────────────────────────────── */
.notif-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0,229,255,0.02);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.notif-btn:hover {
  border-color: var(--tech);
  background: rgba(255,159,10,0.08);
}

.notif-btn.new-discovery {
  border-color: var(--tech);
  animation: notif-glow 1s ease-in-out infinite;
}

@keyframes notif-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(255,159,10,0.25); }
  50%      { box-shadow: 0 0 16px rgba(255,45,107,0.5); border-color: var(--cyber); }
}

.notif-icon { font-size: 15px; }

.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--cyber);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  font-weight: 900;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(255,45,107,0.5);
  animation: badge-pulse 1s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

/* ── Particles canvas ─────────────────────────────────────────────────────── */
/* ── CIA logo hex header ───────────────────────────────────── */
.cia-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: grayscale(1) sepia(1) hue-rotate(160deg) saturate(8) brightness(1.4);
  opacity: 0.88;
}

/* ── CIA fond répété opacifié (derrière particles) ─────────── */
#cia-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Seal_of_the_Central_Intelligence_Agency.svg/120px-Seal_of_the_Central_Intelligence_Agency.svg.png');
  background-repeat: repeat;
  background-size: 140px 140px;
  opacity: 0.035;
  filter: grayscale(1) sepia(1) hue-rotate(160deg) saturate(5);
}

#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -4;
  opacity: 0.55;
}
body[data-domain="cyber"]   #particles-canvas { opacity: 0.62; }
body[data-domain="medical"] #particles-canvas { opacity: 0.48; }
body[data-domain="tech"]    #particles-canvas { opacity: 0.55; }
body[data-domain="physics"] #particles-canvas { opacity: 0.58; }

/* Canvas dédié constellations — derrière tout le layout */
#const-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: -4;
  opacity: 0.68;
}

/* Dashboard — Clusters : grille de puces lisibles (avant : micro-texte 8px tassé) */
#clusters-display { display: flex; flex-wrap: wrap; gap: 6px; }
#clusters-display .badge {
  font-size: 10px;
  padding: 3px 9px;
  line-height: 1.4;
  letter-spacing: .3px;
}

/* ── Timeline animations ──────────────────────────────────────────────────── */
#timeline-container > div {
  animation: fadeInUp 0.35s ease both;
}

#timeline-container > div:nth-child(1) { animation-delay: 0.04s; }
#timeline-container > div:nth-child(2) { animation-delay: 0.08s; }
#timeline-container > div:nth-child(3) { animation-delay: 0.12s; }
#timeline-container > div:nth-child(4) { animation-delay: 0.16s; }
#timeline-container > div:nth-child(5) { animation-delay: 0.20s; }

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

/* ── Graph node glow ──────────────────────────────────────────────────────── */
.graph-node-highlight {
  animation: node-glow 1.5s ease-in-out infinite;
}

@keyframes node-glow {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.6); }
}

/* ── PDF Styles ───────────────────────────────────────────────────────────── */
.pdf-page * { box-sizing: border-box; margin: 0; padding: 0; }

.pdf-page body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 40px 60px;
  color: #1a1a1a;
  line-height: 1.85;
  background: #fff;
}

.pdf-page .toolbar {
  position: sticky;
  top: 0;
  z-index: 99;
  background: #1a3a5c;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -40px -40px 36px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pdf-page .toolbar span {
  flex: 1;
  font-size: 13px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-page .btn-print {
  background: #ff2d6b;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.pdf-page .btn-print:hover { background: #e0245a; }
.pdf-page h1 { color: #0d2640; font-size: 22px; border-bottom: 2px solid #ff2d6b; padding-bottom: 10px; margin: 0 0 20px; }
.pdf-page h2 { color: #1a3a5c; font-size: 16px; border-bottom: 1px solid #dde; padding-bottom: 5px; margin: 26px 0 12px; }
.pdf-page h3 { color: #1a3a5c; font-size: 13px; margin: 18px 0 8px; }
.pdf-page h4, .pdf-page h5, .pdf-page h6 { color: #333; font-size: 12px; margin: 12px 0 6px; }
.pdf-page p { margin: 0 0 12px; text-align: justify; }
.pdf-page blockquote { background: #f8f8f8; border-left: 3px solid #ff2d6b; padding: 10px 16px; margin: 14px 0; color: #444; font-style: italic; }
.pdf-page table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 12px; }
.pdf-page th { background: #1a3a5c; color: #fff; padding: 8px 12px; text-align: left; }
.pdf-page td { border: 1px solid #ccc; padding: 7px 12px; }
.pdf-page tr:nth-child(even) td { background: #f5f7fa; }
.pdf-page code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-family: 'Courier New', monospace; font-size: 12px; }
.pdf-page pre { background: #1e2835; color: #d4f5d4; padding: 14px 16px; border-radius: 4px; overflow-x: auto; font-size: 11px; margin: 14px 0; }
.pdf-page pre code { background: none; padding: 0; color: inherit; }
.pdf-page hr { border: none; border-top: 1px solid #dde; margin: 18px 0; }
.pdf-page a { color: #0055bb; }
.pdf-page strong { font-weight: 700; }
.pdf-page em { font-style: italic; }
.pdf-page .footer { margin-top: 40px; border-top: 1px solid #dde; padding-top: 12px; font-size: 11px; color: #999; text-align: center; }

@media print {
  .pdf-page .toolbar { display: none !important; }
  .pdf-page body { padding: 0; max-width: 100%; }
  .pdf-page pre { white-space: pre-wrap; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE-FIRST
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet landscape (≤ 1200px) ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 228px 1fr;
  }
  .sidebar-right {
    display: none;
  }
  header {
    padding: 9px 14px;
  }
  .logo-text h1 {
    font-size: 14px;
    letter-spacing: 3px;
  }
  .hstat-val { font-size: 15px; }
  .tab { padding: 10px 11px; }
  #graphCanvas { height: 380px; }
}

/* ── Tablet portrait (≤ 900px) ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 200px 1fr;
  }
  .header-stats {
    gap: 5px;
  }
  .hstat { padding: 3px 7px; }
  .hstat-val { font-size: 14px; }
  .hstat-lbl { display: none; }
  .classification-banner { font-size: 8px; gap: 14px; }
  .classification-banner span { display: none; }
}

/* ── Mobile (≤ 768px) — stack layout ─────────────────────────────────────── */
@media (max-width: 768px) {
  /* Stack all columns */
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Sidebar becomes a horizontal strip */
  .sidebar-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px;
    max-height: 260px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-content: start;
  }

  /* Section titles span full width */
  .sidebar-left .section-title {
    grid-column: 1 / -1;
  }

  .sidebar-right { display: none; }

  /* Header: row-based compact layout */
  header {
    padding: 8px 12px;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
    position: relative;
  }

  .logo-block { flex-shrink: 0; }
  .logo-icon  { width: 36px; height: 36px; font-size: 12px; }
  .logo-text h1 { font-size: 13px; letter-spacing: 2px; }
  .logo-text p  { display: none; }

  .header-stats { display: none; }

  .sys-status {
    font-size: 8px;
    gap: 5px;
  }

  /* Help & notif stay inline */
  .help-btn, .notif-btn {
    width: 32px;
    height: 32px;
  }

  /* Classification banner more compact */
  .classification-banner {
    padding: 2px 10px;
    font-size: 7px;
    gap: 10px;
    letter-spacing: 2px;
    justify-content: space-around;
  }

  /* Domain bar: 2×2 grid on small */
  .domain-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .domain-tab {
    min-height: 38px;
    font-size: 8px;
    letter-spacing: 1px;
    padding: 8px 4px;
  }

  /* Tab nav: scrollable row */
  .tab-nav {
    padding: 0 6px;
    gap: 0;
  }
  .tab {
    padding: 10px 10px;
    font-size: 8px;
    letter-spacing: 1px;
    min-height: 38px;
  }

  .tab-content { padding: 10px; }

  /* Cards: 2-col grid */
  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .card { padding: 10px; }
  .card-val { font-size: 22px; }
  .card-title { font-size: 7px; }

  /* Domain stats: 2-col stays */
  .dom-stats { grid-template-columns: 1fr 1fr; gap: 6px; }

  /* Reports */
  .report-header { flex-direction: column; gap: 6px; }
  .report-actions { flex-wrap: wrap; gap: 4px; }
  .report-title { font-size: 12px; }
  .report-domain-tabs { gap: 3px; }
  .report-dtab { padding: 5px 9px; font-size: 7px; }

  /* Search */
  .search-bar { flex-wrap: wrap; }
  .search-input { min-width: 100%; }
  .search-scope, .search-btn { flex: 1; }

  /* Graph */
  .graph-controls { gap: 4px; }
  .graph-btn { padding: 5px 8px; font-size: 8px; }
  #graphCanvas { height: 260px; }

  /* Console */
  .console {
    font-size: 9px;
    max-height: 220px;
  }

  /* Phase buttons */
  .phase-btn { min-height: 40px; padding: 8px 10px; }
  .phase-name { font-size: 10px; }
  .phase-desc { font-size: 7px; }

  /* Help popup */
  .help-popup { padding: 18px 16px; width: 96%; }
  .help-popup h2 { font-size: 16px; letter-spacing: 2px; }

  /* Logs */
  .logs-controls { flex-wrap: wrap; gap: 4px; }

  /* Auto block */
  .auto-controls { flex-wrap: wrap; }
  .auto-btn { min-height: 38px; }

  /* Graph legend */
  .graph-legend { gap: 8px; font-size: 7px; }
}

/* ── Small phones (≤ 480px) ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Single column cards */
  .cards-grid { grid-template-columns: 1fr; }
  .dom-stats  { grid-template-columns: 1fr 1fr; }

  /* Domain bar: 2×2 tight */
  .domain-tab {
    font-size: 7px;
    letter-spacing: 0;
    padding: 7px 3px;
    gap: 2px;
  }
  .domain-icon { font-size: 10px; }

  /* Tabs */
  .tab { padding: 9px 8px; font-size: 7px; letter-spacing: 0; }

  /* Sidebar: single column */
  .sidebar-left { grid-template-columns: 1fr; }

  /* Smaller type on edge elements */
  .section-title { font-size: 7px; letter-spacing: 2px; }
  .card-title    { font-size: 7px; }
  .card-val      { font-size: 18px; }
  .dom-val       { font-size: 18px; }

  /* Report badges */
  .report-domain-badge { font-size: 7px; padding: 1px 5px; }
  .badge { font-size: 7px; }

  /* Kinetic chart params: single col */
  .kinetic-params { grid-template-columns: 1fr; }
  .ring-pct { font-size: 14px; }

  /* Graph */
  #graphCanvas { height: 220px; }

  /* Console */
  .console::before { font-size: 7px; letter-spacing: 1px; }

  /* Notifications */
  .help-btn, .notif-btn { width: 30px; height: 30px; }
  .notif-icon { font-size: 13px; }
}

/* ── Very small (≤ 360px) ─────────────────────────────────────────────────── */
@media (max-width: 360px) {
  header { padding: 6px 8px; }
  .logo-icon { width: 30px; height: 30px; font-size: 10px; }
  .logo-text h1 { font-size: 11px; letter-spacing: 1px; }
  .classification-banner { display: none; }
  .domain-bar { grid-template-columns: 1fr 1fr; }
  .tab { padding: 8px 7px; font-size: 7px; }
  .tab-content { padding: 8px; }
  .cards-grid { gap: 6px; }
  .card-val { font-size: 16px; }
  .phase-name { font-size: 9px; }
}

/* ═══════════════════════════════════════════════════════════════
   LECTEUR AUDIO — HUD Style
   ═══════════════════════════════════════════════════════════════ */

.audio-player {
  background: linear-gradient(160deg, #0a1628 0%, #0d1a2e 60%, #071020 100%);
  border: 1px solid rgba(0,180,255,0.25);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(0,180,255,0.1);
}

/* barre cyan en haut */
.audio-player::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,229,255,0.7) 40%, rgba(0,229,255,0.9) 50%, rgba(0,229,255,0.7) 60%, transparent 100%);
}

/* lueur subtile en bas */
.audio-player::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,120,255,0.3), transparent);
}

/* ── Track info ── */
.ap-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 12px;
  border-bottom: 1px solid rgba(0,180,255,0.15);
  min-height: 64px;
}
.ap-cover {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(0,180,255,0.4);
  flex-shrink: 0;
  background: #071020;
  box-shadow: 0 0 16px rgba(0,150,255,0.3);
}
.ap-cover[src=""] { display: none; }
.ap-track-info-wrap {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.ap-track-title {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: #e0f4ff;
  letter-spacing: 1.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 0 10px rgba(0,200,255,0.4);
}
.ap-track-artist {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(0,220,255,0.7);
  margin-top: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ap-track-idx {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: rgba(0,180,255,0.6);
  margin-top: 4px;
  letter-spacing: 1px;
}

/* ── Progress bar ── */
.ap-progress-wrap { cursor: pointer; }
.ap-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  position: relative;
  overflow: visible;
}
.ap-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0066cc, #00e5ff);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s linear;
  box-shadow: 0 0 8px rgba(0,229,255,0.6);
  pointer-events: none;
}
.ap-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,229,255,0.9), 0 0 12px rgba(0,180,255,0.5);
  left: 0%;
  transition: left 0.3s linear;
  pointer-events: none;
}
.ap-times {
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: rgba(0,200,255,0.65);
  margin-top: 5px;
  letter-spacing: 1px;
}

/* ── Controls ── */
.ap-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ap-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ap-btn {
  background: #0d2044;
  border: 1px solid rgba(0,140,255,0.35);
  border-radius: 5px;
  color: #c8e8ff;
  font-size: 11px;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  letter-spacing: 0.5px;
}
.ap-btn:hover {
  background: #0a3060;
  border-color: rgba(0,200,255,0.7);
  color: #fff;
  box-shadow: 0 0 10px rgba(0,180,255,0.3);
}
.ap-btn-main {
  width: 42px; height: 42px;
  font-size: 15px;
  background: linear-gradient(135deg, #0044aa, #0077dd);
  border: 1px solid rgba(0,180,255,0.6);
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,100,255,0.4);
}
.ap-btn-main:hover {
  background: linear-gradient(135deg, #0055cc, #0099ff);
  box-shadow: 0 0 18px rgba(0,150,255,0.6);
}
@keyframes ap-pulse {
  0%,100% { box-shadow: 0 2px 10px rgba(0,100,255,0.4); }
  50%     { box-shadow: 0 0 22px rgba(0,180,255,0.7); }
}
.ap-vol-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.ap-vol-icon {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: rgba(0,180,255,0.5);
  flex-shrink: 0;
  letter-spacing: 1px;
}
.ap-vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ap-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,180,255,0.8);
  cursor: pointer;
}
.ap-vol-slider::-moz-range-thumb {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* ── Playlist ── */
.ap-playlist {
  max-height: 140px;
  overflow-y: auto;
  border-top: 1px solid var(--border2);
  padding-top: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.ap-playlist::-webkit-scrollbar { width: 3px; }
.ap-playlist::-webkit-scrollbar-track { background: transparent; }
.ap-playlist::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ap-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.ap-item:hover {
  background: rgba(0,229,255,0.05);
  border-color: rgba(0,229,255,0.1);
}
.ap-item.active {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.25);
}
.ap-item-num {
  font-family: 'Orbitron', monospace;
  font-size: 7px;
  color: var(--textdim);
  width: 14px;
  flex-shrink: 0;
  text-align: center;
}
.ap-item.active .ap-item-num { color: var(--active); }
.ap-item-info { flex: 1; min-width: 0; }
.ap-item-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-item.active .ap-item-title { color: var(--textbright); }
.ap-item-artist {
  font-family: 'Share Tech Mono', monospace;
  font-size: 7px;
  color: var(--textdim);
}
.ap-item-play {
  font-size: 9px;
  color: var(--textdim);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.ap-item:hover .ap-item-play,
.ap-item.active .ap-item-play { opacity: 1; color: var(--active); }

.ap-error {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--cyber);
  text-align: center;
  padding: 6px;
}
.ap-loading {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: var(--textdim);
  text-align: center;
  padding: 8px;
  letter-spacing: 2px;
}

/* ── v7.9 : lecteur audio HTML5 natif → iframe YouTube retirée ── */
#ap-audio { display: none; }

/* ── Items de playlist ── */
.ap-track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Share Tech Mono', monospace;
  border-left: 2px solid transparent;
}
.ap-track-item:hover {
  background: rgba(0,100,255,0.12);
  border-left-color: rgba(0,180,255,0.4);
}
.ap-track-item.active {
  background: rgba(0,80,200,0.2);
  border-left-color: #00aaff;
  box-shadow: inset 0 0 12px rgba(0,100,255,0.08);
}
.ap-track-num {
  font-size: 8px;
  color: rgba(0,180,255,0.45);
  min-width: 14px;
  text-align: right;
  font-family: 'Orbitron', monospace;
}
.ap-track-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.ap-ti-title {
  font-size: 11px;
  color: #c8e8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.8px;
}
.ap-ti-artist {
  font-size: 8px;
  color: var(--textdim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Bouton shuffle actif ── */
.ap-btn-shuffle        { color: var(--textdim); }
.ap-btn-shuffle.active { color: var(--cyber); text-shadow: 0 0 6px var(--cyber); }

/* ── Bouton Masquer/Réafficher (Design épuré) ────────────────── */
#btn-toggle-all {
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Share Tech Mono', monospace;
}

#btn-toggle-all:hover {
  transform: translateX(-50%) scale(1.08);
  border-color: rgba(0,229,255,0.6);
  box-shadow: 0 0 40px rgba(0,0,0,0.7), 0 0 25px rgba(0,229,255,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

#btn-toggle-all:active {
  transform: translateX(-50%) scale(0.92);
}

/* Animation d'apparition */
#btn-toggle-all {
  animation: toggleBtnAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toggleBtnAppear {
  from { opacity: 0; transform: translateX(-50%) scale(0.6); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   LECTEUR SPATIAL v8 — Web Audio API · Glassmorphism · Orbital viz
   ═══════════════════════════════════════════════════════════════ */

#ap-audio-a, #ap-audio-b { display: none; }

.audio-player.ap-spatial {
  background:
    radial-gradient(ellipse at top, rgba(191,90,242,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at bottom, rgba(0,140,255,0.08) 0%, transparent 60%),
    linear-gradient(180deg, #060a18 0%, #0a1428 50%, #06080f 100%);
  border: 1px solid rgba(140,90,242,0.28);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(191,90,242,0.18),
    inset 0 -1px 0 rgba(0,229,255,0.10);
  padding: 14px 12px;
  gap: 10px;
}

/* Bordure animée gradient cosmique */
.audio-player.ap-spatial::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,229,255,0.6) 25%,
    rgba(191,90,242,0.9) 50%,
    rgba(0,229,255,0.6) 75%,
    transparent 100%);
  background-size: 200% 100%;
  animation: ap-shimmer 6s linear infinite;
}
.audio-player.ap-spatial.spatial-off::before {
  background: linear-gradient(90deg, transparent, rgba(120,120,140,0.4), transparent);
  animation: none;
}
@keyframes ap-shimmer {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Cover orbitale + visualiseur ─────────────────────── */
.ap-cover-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 6px auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-viz {
  position: absolute;
  inset: -40px;
  width: 240px;
  height: 240px;
  pointer-events: none;
}
.ap-cover-orbit {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(191,90,242,0.45);
  box-shadow:
    0 0 24px rgba(191,90,242,0.35),
    inset 0 0 18px rgba(0,0,0,0.55);
  background: radial-gradient(circle, #0a1228 0%, #03070f 100%);
  z-index: 2;
  transition: transform 0.4s ease;
}
.ap-cover-orbit.spinning {
  animation: ap-rotate 28s linear infinite;
}
@keyframes ap-rotate {
  to { transform: rotate(360deg); }
}
.ap-cover-orbit .ap-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  border-radius: 50%;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.ap-cover-halo {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transition: box-shadow 0.08s linear;
}

/* ── Infos track ── */
.audio-player.ap-spatial .ap-track {
  border-bottom: 1px solid rgba(191,90,242,0.20);
  padding: 4px 0 10px;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.audio-player.ap-spatial .ap-track-info-wrap { text-align: center; }
.audio-player.ap-spatial .ap-track-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 1.8px;
  color: #f0e8ff;
  text-shadow: 0 0 12px rgba(191,90,242,0.5);
}
.audio-player.ap-spatial .ap-track-artist {
  color: rgba(200,180,255,0.7);
}
.audio-player.ap-spatial .ap-track-idx {
  color: rgba(160,130,220,0.55);
}

/* ── Progress amélioré ── */
.audio-player.ap-spatial .ap-progress-bar {
  height: 5px;
  background: rgba(255,255,255,0.06);
  overflow: visible;
}
.ap-progress-buffer {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: rgba(191,90,242,0.18);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.4s linear;
}
.audio-player.ap-spatial .ap-progress-fill {
  background: linear-gradient(90deg, #00aaff 0%, #6f48ff 60%, #bf5af2 100%);
  box-shadow: 0 0 10px rgba(191,90,242,0.7);
  z-index: 1;
}
.audio-player.ap-spatial .ap-progress-thumb {
  width: 12px; height: 12px;
  background: radial-gradient(circle, #fff 0%, #d9c4ff 70%, #bf5af2 100%);
  box-shadow: 0 0 10px rgba(191,90,242,0.9), 0 0 20px rgba(191,90,242,0.5);
  z-index: 2;
}

/* ── Boutons retouchés ── */
.audio-player.ap-spatial .ap-btn {
  background: rgba(20,12,40,0.6);
  border: 1px solid rgba(140,90,242,0.30);
  color: #d8c8ff;
  width: 34px; height: 34px;
  font-size: 13px;
}
.audio-player.ap-spatial .ap-btn:hover {
  background: rgba(40,20,80,0.8);
  border-color: rgba(191,90,242,0.65);
  color: #fff;
  box-shadow: 0 0 14px rgba(191,90,242,0.45);
}
.audio-player.ap-spatial .ap-btn-main {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #6f48ff 0%, #bf5af2 100%);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 18px rgba(191,90,242,0.55);
}
.audio-player.ap-spatial .ap-btn-main:hover {
  background: linear-gradient(135deg, #8158ff 0%, #d56eff 100%);
  box-shadow: 0 0 25px rgba(191,90,242,0.8);
}
.ap-btn-repeat { color: var(--textdim); }
.ap-btn-repeat.active { color: #bf5af2; text-shadow: 0 0 8px rgba(191,90,242,0.8); }
.ap-btn-shuffle.active { color: #00e5ff; text-shadow: 0 0 8px rgba(0,229,255,0.8); }

/* ── Volume retouché ── */
.audio-player.ap-spatial .ap-vol-slider::-webkit-slider-thumb {
  background: radial-gradient(circle, #fff 0%, #d9c4ff 60%, #bf5af2 100%);
  box-shadow: 0 0 8px rgba(191,90,242,0.8);
}

/* ═══════ PANNEAU SPATIAL ═══════ */
.ap-spatial-panel {
  background: rgba(15,10,30,0.55);
  border: 1px solid rgba(140,90,242,0.25);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ap-spatial-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: linear-gradient(90deg, rgba(140,90,242,0.18) 0%, rgba(0,140,255,0.12) 100%);
  border: none;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: #f0e8ff;
}
.ap-spatial-header:hover { background: linear-gradient(90deg, rgba(140,90,242,0.28) 0%, rgba(0,140,255,0.2) 100%); }

.ap-sp-led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #555;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
  transition: all 0.3s;
  flex-shrink: 0;
}
.ap-sp-led.on {
  background: #bf5af2;
  box-shadow: 0 0 8px #bf5af2, 0 0 14px rgba(191,90,242,0.6);
  animation: ap-led-pulse 2.4s ease-in-out infinite;
}
@keyframes ap-led-pulse {
  0%,100% { box-shadow: 0 0 8px #bf5af2,  0 0 14px rgba(191,90,242,0.5); }
  50%     { box-shadow: 0 0 14px #bf5af2, 0 0 22px rgba(191,90,242,0.9); }
}

.ap-sp-title { flex: 1; text-align: left; }
.ap-sp-caret { font-size: 10px; color: rgba(220,200,255,0.6); transition: transform 0.3s; }

/* Toggle switch */
.ap-sp-toggle { position: relative; width: 32px; height: 16px; flex-shrink: 0; }
.ap-sp-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ap-sp-toggle label {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(191,90,242,0.30);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s;
}
.ap-sp-toggle label::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  top: 1px; left: 1px;
  transition: all 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.ap-sp-toggle input:checked + label {
  background: linear-gradient(90deg, rgba(0,140,255,0.7), rgba(191,90,242,0.85));
  border-color: rgba(191,90,242,0.7);
  box-shadow: 0 0 8px rgba(191,90,242,0.5);
}
.ap-sp-toggle input:checked + label::after { left: 18px; }

/* Mini-toggle */
.ap-mini-toggle { position: relative; width: 26px; height: 13px; flex-shrink: 0; }
.ap-mini-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ap-mini-toggle label {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(140,90,242,0.30);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.ap-mini-toggle label::after {
  content: '';
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  top: 1px; left: 1px;
  transition: all 0.2s;
}
.ap-mini-toggle input:checked + label {
  background: linear-gradient(90deg, #00aaff, #bf5af2);
  border-color: rgba(191,90,242,0.7);
}
.ap-mini-toggle input:checked + label::after { left: 14px; }

/* Corps panneau */
.ap-spatial-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 600px;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}
.ap-spatial-body.collapsed {
  max-height: 0;
  padding: 0 12px;
  opacity: 0;
}

.ap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
}
.ap-row-toggle { gap: 6px; }
.ap-row-tight { margin-top: -2px; }
.ap-row-eq { align-items: stretch; }

.ap-row-lbl {
  flex-shrink: 0;
  min-width: 64px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(220,200,255,0.85);
  text-transform: uppercase;
}
.ap-row-lbl-dim { color: rgba(180,160,220,0.55); font-size: 8px; }
.ap-row-val {
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
  font-size: 9px;
  color: rgba(0,229,255,0.85);
  letter-spacing: 1px;
}

/* Sliders horizontaux unifiés */
.ap-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ap-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #bf5af2);
  box-shadow: 0 0 6px rgba(191,90,242,0.8);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.6);
}
.ap-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #bf5af2);
  box-shadow: 0 0 6px rgba(191,90,242,0.8);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.6);
}

.ap-slider-pan::-webkit-slider-thumb    { background: radial-gradient(circle, #fff, #00e5ff); box-shadow: 0 0 6px rgba(0,229,255,0.9); }
.ap-slider-reverb::-webkit-slider-thumb { background: radial-gradient(circle, #fff, #6f48ff); }
.ap-slider-width::-webkit-slider-thumb  { background: radial-gradient(circle, #fff, #30d158); box-shadow: 0 0 6px rgba(48,209,88,0.7); }
.ap-slider-mini { flex: 1; max-width: 80px; }

/* Sliders verticaux (EQ) */
.ap-slider-vert {
  -webkit-appearance: slider-vertical;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 6px;
  height: 70px;
  background: linear-gradient(180deg, rgba(255,80,80,0.18) 0%, rgba(255,255,255,0.06) 50%, rgba(80,200,255,0.18) 100%);
  border-radius: 3px;
  margin: 0 auto;
}
.ap-slider-vert::-webkit-slider-thumb { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, #fff, #d9c4ff); box-shadow: 0 0 6px rgba(191,90,242,0.8); border: 1px solid #fff; }
.ap-slider-vert::-moz-range-thumb     { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, #fff, #d9c4ff); box-shadow: 0 0 6px rgba(191,90,242,0.8); border: 1px solid #fff; }

.ap-slider-low::-webkit-slider-thumb  { background: linear-gradient(180deg, #fff, #ff6b6b); box-shadow: 0 0 6px rgba(255,107,107,0.8); }
.ap-slider-mid::-webkit-slider-thumb  { background: linear-gradient(180deg, #fff, #ffd44d); box-shadow: 0 0 6px rgba(255,212,77,0.8); }
.ap-slider-high::-webkit-slider-thumb { background: linear-gradient(180deg, #fff, #4dd2ff); box-shadow: 0 0 6px rgba(77,210,255,0.8); }

/* EQ group */
.ap-eq-group {
  flex: 1;
  display: flex;
  justify-content: space-around;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border: 1px solid rgba(140,90,242,0.15);
}
.ap-eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 28px;
}
.ap-eq-label {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: rgba(220,200,255,0.7);
  font-family: 'Orbitron', sans-serif;
}
.ap-eq-val {
  font-size: 8px;
  color: rgba(0,229,255,0.85);
  font-family: 'Share Tech Mono', monospace;
}

.ap-eq-presets {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.ap-preset-btn {
  background: rgba(40,20,80,0.5);
  border: 1px solid rgba(140,90,242,0.25);
  color: rgba(220,200,255,0.85);
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 56px;
}
.ap-preset-btn:hover {
  background: rgba(140,90,242,0.4);
  border-color: rgba(191,90,242,0.7);
  color: #fff;
  box-shadow: 0 0 8px rgba(191,90,242,0.4);
}

/* Select reverb type */
.ap-select {
  flex: 1;
  background: rgba(15,10,30,0.6);
  border: 1px solid rgba(140,90,242,0.25);
  color: rgba(220,200,255,0.9);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.ap-select:hover { border-color: rgba(191,90,242,0.5); }
.ap-select option { background: #0a0a1a; color: #d8c8ff; }

/* Indicateur "playing" dans la playlist */
.audio-player.ap-spatial .ap-track-item {
  border-left: 2px solid transparent;
}
.audio-player.ap-spatial .ap-track-item.active {
  background: linear-gradient(90deg, rgba(191,90,242,0.20) 0%, rgba(0,140,255,0.10) 100%);
  border-left-color: #bf5af2;
  box-shadow: inset 0 0 14px rgba(191,90,242,0.08);
}
.ap-ti-playing {
  margin-left: auto;
  color: #bf5af2;
  font-size: 11px;
  animation: ap-ti-pulse 1.6s ease-in-out infinite;
}
@keyframes ap-ti-pulse {
  0%,100% { opacity: 0.5; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.2); }
}

/* État SPATIAL OFF — dim global */
.audio-player.ap-spatial.spatial-off .ap-cover-orbit { border-color: rgba(120,120,140,0.3); box-shadow: 0 0 8px rgba(80,80,100,0.2); }
.audio-player.ap-spatial.spatial-off .ap-cover-halo  { box-shadow: none !important; }
.audio-player.ap-spatial.spatial-off .ap-sp-led      { background: #555; box-shadow: none; animation: none; }

/* ═══════════════════════════════════════════════════════════════
   BANNIÈRE GPU + MODALE INSTRUCTIONS
   ═══════════════════════════════════════════════════════════════ */
.gpu-warn-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(255,159,10,0.16) 0%, rgba(40,20,8,0.92) 50%, rgba(255,159,10,0.16) 100%);
  border-bottom: 1px solid rgba(255,159,10,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.6);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #ffd9a8;
  letter-spacing: 0.5px;
  animation: gpuBannerSlide 0.5s ease-out;
}
@keyframes gpuBannerSlide { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.gpu-warn-icon {
  font-size: 16px;
  color: #ff9f0a;
  text-shadow: 0 0 8px rgba(255,159,10,0.7);
  flex-shrink: 0;
  animation: gpuPulse 2s ease-in-out infinite;
}
@keyframes gpuPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.gpu-warn-text { flex: 1; line-height: 1.5; }

.gpu-warn-btn {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,159,10,0.4);
  color: #ffd9a8;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.gpu-warn-btn:hover {
  background: rgba(255,159,10,0.18);
  border-color: rgba(255,159,10,0.7);
  color: #fff;
  box-shadow: 0 0 10px rgba(255,159,10,0.4);
}
.gpu-warn-btn-primary {
  background: linear-gradient(135deg, rgba(255,159,10,0.35), rgba(255,200,80,0.22));
  border-color: rgba(255,200,80,0.8);
  color: #fff;
  font-weight: 700;
}

/* ─── Modale instructions ─── */
.gpu-howto-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: gpuFadeIn 0.25s ease-out;
}
@keyframes gpuFadeIn { from { opacity: 0; } to { opacity: 1; } }

.gpu-howto-content {
  position: relative;
  background:
    radial-gradient(ellipse at top, rgba(255,159,10,0.10) 0%, transparent 60%),
    linear-gradient(180deg, #0a0a18 0%, #060818 100%);
  border: 1px solid rgba(255,159,10,0.45);
  border-radius: 12px;
  padding: 32px 32px 24px;
  max-width: 760px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  color: #d8d8e8;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  box-shadow: 0 12px 60px rgba(0,0,0,0.85), 0 0 30px rgba(255,159,10,0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,159,10,0.4) transparent;
}
.gpu-howto-content::-webkit-scrollbar { width: 6px; }
.gpu-howto-content::-webkit-scrollbar-thumb { background: rgba(255,159,10,0.4); border-radius: 3px; }

.gpu-howto-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: 1px solid rgba(255,159,10,0.4);
  color: #ffd9a8;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.gpu-howto-close:hover {
  background: rgba(255,159,10,0.2);
  border-color: rgba(255,159,10,0.8);
  color: #fff;
  box-shadow: 0 0 12px rgba(255,159,10,0.5);
}

.gpu-howto-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: #ffd9a8;
  letter-spacing: 2px;
  margin: 0 0 18px;
  text-shadow: 0 0 12px rgba(255,159,10,0.4);
}
.gpu-howto-content h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  color: #00e5ff;
  letter-spacing: 2px;
  margin: 22px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0,229,255,0.25);
}
.gpu-howto-content ol, .gpu-howto-content ul {
  padding-left: 22px;
  margin: 8px 0 14px;
}
.gpu-howto-content li { margin-bottom: 6px; color: #c8c8d8; }
.gpu-howto-content code {
  background: rgba(0,229,255,0.08);
  color: #00e5ff;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(0,229,255,0.25);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  user-select: all;
}
.gpu-howto-content strong { color: #ffd9a8; }
.gpu-howto-content em { color: rgba(200,200,220,0.8); }

.gpu-howto-detect {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,159,10,0.25);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 0 18px;
  font-size: 11px;
  color: #d8d8e8;
  letter-spacing: 0.5px;
}
.gpu-howto-detect code {
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}
.gpu-howto-note {
  margin-top: 18px;
  padding: 10px 14px;
  background: rgba(0,229,255,0.06);
  border-left: 3px solid #00e5ff;
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  color: rgba(200,220,240,0.85);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .gpu-warn-banner { flex-wrap: wrap; padding: 8px 12px; font-size: 10px; }
  .gpu-warn-text { width: 100%; margin-bottom: 4px; }
  .gpu-howto-content { padding: 22px 18px; font-size: 11px; }
  .gpu-howto-content h2 { font-size: 15px; }
  .gpu-howto-content h3 { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════
   MODE D'ACCÈS — Badge + modale d'authentification
   ═══════════════════════════════════════════════════════════════ */
.access-badge {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  animation: accessBadgeIn 0.5s ease-out;
}

/* Variante inline (sous DOMAINE ACTIF dans la sidebar droite) */
.access-badge.access-badge-inline {
  position: static;
  top: auto;
  right: auto;
  margin-top: 10px;
  width: 100%;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 1.2px;
  padding: 6px 10px;
  border-radius: 8px;
}
.access-badge.access-badge-inline .ab-label { flex: 1; font-size: 8px; }
.access-badge.access-badge-inline .ab-login-btn { font-size: 8px; padding: 3px 7px; }
@keyframes accessBadgeIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

.access-badge-demo {
  background: linear-gradient(135deg, rgba(255,159,10,0.25), rgba(255,90,90,0.15));
  border: 1px solid rgba(255,159,10,0.55);
  color: #ffd9a8;
}
.access-badge-full {
  background: linear-gradient(135deg, rgba(48,209,88,0.22), rgba(0,229,255,0.10));
  border: 1px solid rgba(48,209,88,0.55);
  color: #d4f7d8;
}

.access-badge .ab-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.access-badge-demo .ab-dot {
  background: #ff9f0a;
  box-shadow: 0 0 6px #ff9f0a, 0 0 10px rgba(255,159,10,0.6);
  animation: ab-pulse-warn 1.8s ease-in-out infinite;
}
.access-badge-full .ab-dot {
  background: #30d158;
  box-shadow: 0 0 6px #30d158, 0 0 10px rgba(48,209,88,0.6);
  animation: ab-pulse-ok 2.5s ease-in-out infinite;
}
@keyframes ab-pulse-warn { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.25); } }
@keyframes ab-pulse-ok   { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

.access-badge .ab-label { font-weight: 700; }

.ab-login-btn {
  background: rgba(0,0,0,0.55);
  border: 1px solid currentColor;
  color: inherit;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.ab-login-btn:hover {
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 8px currentColor;
}
.ab-logout-btn { font-size: 8px; opacity: 0.85; }

/* ─── Modale Login ─── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: authFadeIn 0.25s ease-out;
}
@keyframes authFadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-modal-content {
  position: relative;
  background:
    radial-gradient(ellipse at top, rgba(191,90,242,0.14) 0%, transparent 65%),
    linear-gradient(180deg, #0a0a1a 0%, #06080f 100%);
  border: 1px solid rgba(191,90,242,0.5);
  border-radius: 14px;
  padding: 32px 32px 24px;
  max-width: 420px;
  width: 90%;
  color: #e0d8f0;
  font-family: 'Share Tech Mono', monospace;
  box-shadow: 0 12px 60px rgba(0,0,0,0.85), 0 0 40px rgba(191,90,242,0.25);
  text-align: center;
}

.auth-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: 1px solid rgba(191,90,242,0.4);
  color: #d8c8ff;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.auth-modal-close:hover {
  background: rgba(191,90,242,0.2);
  border-color: rgba(191,90,242,0.8);
  box-shadow: 0 0 12px rgba(191,90,242,0.5);
}

.auth-modal-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: #f0e8ff;
  letter-spacing: 2px;
  margin: 0 0 12px;
  text-shadow: 0 0 12px rgba(191,90,242,0.5);
}
.auth-modal-sub {
  font-size: 11px;
  color: rgba(220,200,240,0.75);
  line-height: 1.6;
  margin: 0 0 22px;
}
.auth-modal-input {
  width: 100%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(191,90,242,0.4);
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 12px 14px;
  border-radius: 8px;
  outline: none;
  text-align: center;
  margin-bottom: 14px;
  transition: all 0.18s;
  box-sizing: border-box;
}
.auth-modal-input:focus {
  border-color: rgba(191,90,242,0.8);
  background: rgba(20,10,40,0.7);
  box-shadow: 0 0 18px rgba(191,90,242,0.45);
}
.auth-modal-submit {
  width: 100%;
  background: linear-gradient(135deg, #6f48ff 0%, #bf5af2 100%);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 3px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.18s;
  box-shadow: 0 4px 18px rgba(191,90,242,0.55);
}
.auth-modal-submit:hover {
  background: linear-gradient(135deg, #8158ff 0%, #d56eff 100%);
  box-shadow: 0 0 25px rgba(191,90,242,0.85);
  transform: translateY(-1px);
}
.auth-modal-error {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.5);
  color: #ff8b80;
  padding: 9px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 11px;
}
.auth-modal-note {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(191,90,242,0.18);
  font-size: 9px;
  color: rgba(180,160,220,0.7);
  line-height: 1.7;
  letter-spacing: 0.5px;
}
.auth-modal-note code {
  background: rgba(191,90,242,0.15);
  color: #d9c4ff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
}

/* ─── Visuel des boutons désactivés en mode démo ─── */
body.demo-mode .phase-btn,
body.demo-mode .auto-btn,
body.demo-mode #btn-init {
  position: relative;
  opacity: 0.55;
  cursor: not-allowed;
}
body.demo-mode .phase-btn::after,
body.demo-mode .auto-btn::after {
  content: '🔒';
  position: absolute;
  top: 4px; right: 6px;
  font-size: 10px;
  opacity: 0.7;
  pointer-events: none;
}
body.demo-mode .phase-btn:hover,
body.demo-mode .auto-btn:hover {
  filter: brightness(1.1);
}