/* =============================================================
   PREDICTIF — Pro Trading Dashboard
   Phase 2: demi-jauge speedometer, sparklines, vue Tableau,
            drawer détail, WAIT compact, CONFL%/CONF%, stagger.
   Identité : KRONOS War-Room Instrument (fusion A+C)
   Palette : near-black + OR SIGNAL (#e8b04b) ; grille gravée + scanline
   Typo : Geist (prose UI), Geist Mono (data), Martian Mono (brand/titres)
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600;700&family=Martian+Mono:wght@500;600;700&display=swap');

/* ─── Design tokens (cerberus dark-blue) ─────────────────────── */
:root {
  --bg:          #070a14;
  --bg-2:        #0d1528;
  --panel:       #111827;
  --panel-2:     #172035;
  --rule:        #1e2d4a;
  --rule-soft:   #152032;
  --text:        #e2e8f0;
  --text-dim:    #94a3b8;
  --text-faint:  #72809a;   /* AUDIT contraste : #4a5568 (~3.3:1 sur le fond) -> ~4.6:1 */
  --accent:      #e8b04b;   /* OR SIGNAL (fusion A+C) — ex-teal #e8b04b */
  --accent-dim:  rgba(232,176,75,.14);
  --up:          #34d399;
  --up-dim:      rgba(52,211,153,.15);
  --down:        #f87171;
  --down-dim:    rgba(248,113,113,.15);
  --warn:        #f59e0b;
  --warn-dim:    rgba(245,158,11,.15);
  --neutral:     #64748b;
  --blue:        #3b82f6;
  --purple:      #8b5cf6;
  --glow-teal:   0 0 20px rgba(232,176,75,.20);   /* glow accent OR (nom conservé) */
  --glow-green:  0 0 16px rgba(52,211,153,.20);
  --glow-red:    0 0 16px rgba(248,113,113,.20);
  --shadow-card: 0 4px 24px rgba(0,0,0,.55), 0 1px 0 rgba(232,176,75,.05) inset;
  --radius:      4px;   /* géométrie plus tranchée (war-room) — ex 8px */
  --radius-sm:   3px;
  --sans:        'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'Geist Mono', 'JetBrains Mono', 'SF Mono', monospace;
  --disp:        'Martian Mono', 'Geist Mono', monospace;  /* brand + titres de section */
  --grid:        rgba(232,176,75,.035);  /* grille gravée de fond */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Atmosphère war-room : halo OR + halo froid + grille gravée */
  background-image:
    radial-gradient(1000px 620px at 88% -12%, rgba(232,176,75,.055), transparent 68%),
    radial-gradient(760px 540px at -6% 112%, rgba(70,120,200,.045), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, 30px 30px, 30px 30px;
  background-attachment: fixed;
  min-height: 100dvh;
}

/* Scanline subtile (sous le drawer z-100/110 ; n'intercepte aucun clic) */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.13) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; opacity: .35;
}
@media (prefers-reduced-motion: reduce) { body::after { display: none; } }

/* ─── Chiffres tabulaires sur toutes les données mono ──────── */
.tnum,
.data-table td,
.data-table th,
.kpi-val,
.card-price,
.level-val,
.score-val,
.pillar-val,
.perf-value {
  font-feature-settings: "tnum" 1, "zero" 1;
}

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

/* ═══════════════════════════════════════════════════════════════
   HEADER / TOPBAR
   ═══════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--bg-2) 0%, rgba(13,21,40,.97) 100%);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--rule-soft);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), #f0c060);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  box-shadow: var(--glow-teal);
}
.brand-name {
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text);
}
.brand-sub {
  font-size: 10px; color: var(--text-faint);
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px;
}

.status-pills { display: flex; align-items: center; gap: 6px; }
.pill {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase;
}
.pill-live {
  background: var(--up-dim); color: var(--up);
  border: 1px solid rgba(52,211,153,.3);
  animation: pulse-live 2s ease-in-out infinite;
}
.pill-auto { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(232,176,75,.25); }
.pill-ro { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(245,158,11,.25); font-size: 9px; }

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: .65; }
}

/* ─── KPI Strip ──────────────────────────────────────────────── */
.kpi-strip {
  display: flex; align-items: stretch; gap: 0;
  overflow-x: auto; padding: 0 20px; scrollbar-width: none;
}
.kpi-strip::-webkit-scrollbar { display: none; }

.kpi-item {
  display: flex; flex-direction: column; justify-content: center;
  gap: 2px; padding: 8px 20px 8px 0;
  min-width: 110px; border-right: 1px solid var(--rule-soft); flex-shrink: 0;
}
.kpi-item:last-child { border-right: none; }
.kpi-item:first-child { padding-left: 0; }

.kpi-label {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint);
}
.kpi-val {
  font-family: var(--mono); font-size: 18px; font-weight: 700;
  line-height: 1; color: var(--text);
}
.kpi-val.up    { color: var(--up); }
.kpi-val.down  { color: var(--down); }
.kpi-val.warn  { color: var(--warn); }
.kpi-val.accent{ color: var(--accent); }
.kpi-sub { font-size: 10px; color: var(--text-dim); font-family: var(--mono); }

/* Fiabilité (FIAB) */
.fiab { font-family: var(--mono); font-weight: 700; letter-spacing: .05em; font-size: 9px; }
.fiab-high { color: var(--up); }
.fiab-medium { color: var(--warn); }
.fiab-low { color: var(--down); }
.fiab-insufficient { color: var(--text-faint); }

/* F&G mini gauge */
.fg-gauge-wrap { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.fg-gauge-track {
  width: 80px; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--down) 0%, var(--warn) 50%, var(--up) 100%);
  position: relative; flex-shrink: 0;
}
.fg-gauge-needle {
  position: absolute; top: -3px; width: 2px; height: 11px;
  background: var(--accent); border-radius: 1px; transform: translateX(-50%);
  box-shadow: 0 0 5px rgba(232,176,75,.8); left: 50%;
  transition: left .6s ease;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER BAR — shared, outside panels
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-bottom: 1px solid var(--rule-soft);
  flex-wrap: wrap; background: var(--bg);
  /* AUDIT : ex-sticky top:0 z40 passait SOUS la topbar sticky (top:0 z50) au scroll
     -> disparaissait. Non-sticky : la barre de filtres défile avec le contenu. */
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-family: var(--mono); color: var(--text-dim);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}
.filter-chip-count {
  font-size: 10px; background: var(--rule); color: var(--text-faint);
  border-radius: 10px; padding: 1px 6px; font-weight: 600;
}
.filter-chip.active .filter-chip-count {
  background: rgba(232,176,75,.2); color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION TABS
   ═══════════════════════════════════════════════════════════════ */
.tabs {
  display: flex; gap: 0; padding: 0 20px;
  background: var(--bg-2); border-bottom: 1px solid var(--rule);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint); padding: 11px 18px;
  cursor: pointer; font-family: var(--sans); font-size: 12px;
  font-weight: 500; letter-spacing: 0.04em; white-space: nowrap;
  transition: color .15s, border-color .15s; text-transform: uppercase;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   MAIN PANELS
   ═══════════════════════════════════════════════════════════════ */
main { padding: 16px 20px; }
.panel { display: none; }
.panel.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   Q5: STAGGER D'APPARITION DES CARTES
   ═══════════════════════════════════════════════════════════════ */
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-enter {
  animation: card-in 0.28s ease both;
}

/* ═══════════════════════════════════════════════════════════════
   ASSET CARDS GRID
   ═══════════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: 9px;
}

/* Q4: séparateur de section WAIT */
.cards-section-sep {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 4px 6px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 4px;
}
/* Séparateur des cartes à POSITION OUVERTE (paper) — démarqué + pastille live. */
.cards-section-sep.open {
  color: var(--down);
  font-weight: 700;
  border-top-color: color-mix(in srgb, var(--down) 35%, transparent);
}
.cards-section-sep.open::before {
  content: "●";
  margin-right: 6px;
  color: var(--down);
}
/* Séparateur des cartes « trades prévus » (signal armé, attend le déclenchement). */
.cards-section-sep.pending {
  color: var(--warn, #f0b429);
  font-weight: 700;
  border-top-color: color-mix(in srgb, var(--warn, #f0b429) 35%, transparent);
}
.cards-section-sep.pending::before {
  content: "⏳";
  margin-right: 6px;
}

/* Résultats paper détaillés (panneau Performance) — WR/R par catégorie. */
#paper-stats { margin-top: 18px; }
.pstats-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 2px 10px;
  border-top: 1px solid var(--rule-soft);
}
.pstats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.pstats-block {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.pstats-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, var(--text-faint));
  margin-bottom: 8px;
}
.pstats-table { width: 100%; border-collapse: collapse; }
.pstats-table th {
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 2px 6px 6px;
  font-weight: 500;
}
.pstats-table th:first-child { text-align: left; }
.pstats-table td { padding: 4px 6px; font-size: 12px; border-top: 1px solid var(--rule-soft); }
.pstats-table td.tnum { text-align: right; font-variant-numeric: tabular-nums; }
.pstats-k { color: var(--text); }
.pstats-table td.up { color: var(--up); }
.pstats-table td.down { color: var(--down); }
.pstats-foot {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-faint);
}

/* ═══════════════════════════════════════════════════════════════
   CARTE-TABLEAU DE BORD — blocs riches (refonte 2026-06-04)
   Bandeau stratégie + confluence · calculateur levier · chart · contexte
   ═══════════════════════════════════════════════════════════════ */

/* — Bandeau STRATÉGIE : badge force + barre confluence — */
.kstrat { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 2px; }
.kstrat-force {
  display: inline-flex; align-items: baseline; gap: 6px; align-self: flex-start;
  padding: 3px 9px; border-radius: 999px; font-family: var(--mono);
  border: 1px solid var(--rule);
}
.kstrat-force-lbl { font-size: 8px; letter-spacing: 0.14em; color: var(--text-faint); }
.kstrat-force-val { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.kstrat-force.high { background: var(--up-dim); border-color: rgba(52,211,153,.35); }
.kstrat-force.high .kstrat-force-val { color: var(--up); }
.kstrat-force.med  { background: var(--warn-dim); border-color: rgba(245,158,11,.35); }
.kstrat-force.med  .kstrat-force-val { color: var(--warn); }
.kstrat-force.low  { background: var(--rule-soft); }
.kstrat-force.low  .kstrat-force-val { color: var(--text-dim); }

.kconfl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.kconfl-lbl { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em; color: var(--text-faint); }
.kconfl-val { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text); font-feature-settings: "tnum" 1; }
.kconfl-track { height: 5px; background: var(--rule-soft); border-radius: 3px; overflow: hidden; }
.kconfl-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #f0c060); border-radius: 3px; transition: width .3s ease-out; }

/* — CALCULATEUR DE RISQUE & LEVIER — */
.kcalc {
  margin: 10px 0; padding: 11px 12px;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius-sm);
}
.kcalc-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.kcalc-title-txt { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.kcalc-sim { font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; color: var(--warn); background: var(--warn-dim); padding: 2px 6px; border-radius: 4px; }
.kcalc-cap { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kcalc-cap-lbl { font-size: 11px; color: var(--text-dim); min-width: 52px; }
.kcalc-cap-in {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--rule);
  border-radius: 5px; color: var(--text); font-family: var(--mono); font-size: 13px;
  padding: 5px 8px; text-align: right; font-feature-settings: "tnum" 1;
}
.kcalc-cap-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.kcalc-cap-cur { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.kcalc-btns { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; flex-wrap: wrap; }
.kcalc-btns-lbl { font-size: 10px; color: var(--text-faint); min-width: 48px; }
.kcalc-btn {
  flex: 1; min-width: 34px; padding: 5px 4px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 5px;
  color: var(--text-dim); font-family: var(--mono); font-size: 11px; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.kcalc-btn:hover { border-color: var(--accent); color: var(--text); }
.kcalc-btn.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.kcalc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 9px 0 7px; }
.kcalc-cell { background: var(--panel); border: 1px solid var(--rule-soft); border-radius: 5px; padding: 6px 4px; text-align: center; }
.kcalc-cell-val { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text); font-feature-settings: "tnum" 1; }
.kcalc-cell-lbl { font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-top: 3px; }
.kcalc-pnl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kcalc-pnl-cell { border-radius: 5px; padding: 7px 4px; text-align: center; border: 1px solid transparent; }
.kcalc-pnl-cell.pos { background: var(--up-dim); border-color: rgba(52,211,153,.25); }
.kcalc-pnl-cell.neg { background: var(--down-dim); border-color: rgba(248,113,113,.25); }
.kcalc-pnl-val { font-family: var(--mono); font-size: 13px; font-weight: 700; font-feature-settings: "tnum" 1; }
.kcalc-pnl-cell.pos .kcalc-pnl-val { color: var(--up); }
.kcalc-pnl-cell.neg .kcalc-pnl-val { color: var(--down); }
.kcalc-pnl-lbl { font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-top: 3px; }
.kcalc-note { font-family: var(--mono); font-size: 8px; line-height: 1.35; letter-spacing: 0.02em; color: var(--text-faint); margin-top: 6px; opacity: 0.85; }

/* — Pastille de prix LIVE (temps réel) sur le graphe — */
.price-live-dot { animation: priceLivePulse 1.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes priceLivePulse { 0%, 100% { opacity: 1; r: 2.6px; } 50% { opacity: 0.35; r: 4px; } }

/* — Graphe riche en façade (bougies + niveaux) — */
.kchart-rich { height: auto; }
.kchart-rich svg { width: 100%; height: auto; display: block; }

/* — Contexte : forecast détaillé + news + prédictions — */
.kctx-fc { display: flex; align-items: center; justify-content: space-between; margin: 9px 0 4px; padding-top: 8px; border-top: 1px solid var(--rule-soft); }
.kctx-fc-lbl { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.12em; color: var(--text-faint); }
.kctx-fc-val { font-family: var(--mono); font-size: 11px; font-weight: 600; font-feature-settings: "tnum" 1; }
.kctx-fc-val.pos { color: var(--up); }
.kctx-fc-val.neg { color: var(--down); }
.kctx-fc-val.neutral-s { color: var(--text-dim); }
.kctx-block { margin-top: 9px; }
.kctx-title { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px; }
.kctx-load { font-size: 11px; color: var(--text-faint); padding: 2px 0; }
.kctx-pred, .kctx-news { display: flex; flex-direction: column; gap: 4px; }

/* — Marchés de prédiction : cartes riches (source + % + volume + expiration) — */
.pmkt-list { display: flex; flex-direction: column; gap: 7px; }
.pmkt {
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.pmkt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.pmkt-src {
  font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px; color: var(--text-dim);
  background: var(--rule-soft); border: 1px solid var(--rule);
}
.pmkt-src.polymarket { color: #60a5fa; background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.3); }
.pmkt-src.manifold   { color: var(--warn); background: var(--warn-dim); border-color: rgba(245,158,11,.3); }
.pmkt-src.kalshi     { color: var(--purple); background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.3); }
.pmkt-prob { font-family: var(--mono); font-size: 13px; font-weight: 700; font-feature-settings: "tnum" 1; }
.pmkt-prob.hi { color: var(--up); }
.pmkt-prob.lo { color: var(--down); }
.pmkt-prob.mid { color: var(--warn); }
.pmkt-q { font-size: 12px; line-height: 1.35; color: var(--text); margin-bottom: 6px; }
.pmkt-bar { height: 4px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.pmkt-bar-fill { height: 100%; border-radius: 2px; }
.pmkt-bar-fill.hi { background: var(--up); }
.pmkt-bar-fill.lo { background: var(--down); }
.pmkt-bar-fill.mid { background: var(--warn); }
.pmkt-meta { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.pmkt-vol { color: var(--text-dim); font-feature-settings: "tnum" 1; }
.pmkt-exp { font-feature-settings: "tnum" 1; }
.pmkt-foot {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 7px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; color: var(--text-faint);
}
.pmkt-foot-vol { color: var(--text-dim); }

/* — Onglet Régime : grille score/sentiment par symbole (densifiée) — */
.rg-sym-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.rg-sym-rich {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-sm);
  padding: 10px 11px; display: flex; flex-direction: column; gap: 7px;
}
.rg-sym-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rg-sym-rich .rg-sym-name { font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; color: var(--text); }
.rg-sym-state { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 4px; color: var(--text-faint); background: var(--rule-soft); }
.rg-sym-state.CONFIRMED { color: var(--up); background: var(--up-dim); }
.rg-sym-state.ARMED { color: var(--warn); background: var(--warn-dim); }
.rg-sym-srow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rg-sym-s { font-family: var(--mono); font-size: 17px; font-weight: 700; font-feature-settings: "tnum" 1; }
.rg-sym-s.pos { color: var(--up); }
.rg-sym-s.neg { color: var(--down); }
.rg-sym-s.neutral-s { color: var(--warn); }
.rg-sym-sent { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }
.rg-sym-sent.bull { color: var(--up); }
.rg-sym-sent.bear { color: var(--down); }
.rg-sym-sent.neutral { color: var(--warn); }
.rg-sym-spark { height: 30px; }
.rg-sym-spark svg { width: 100%; height: 100%; display: block; }
.rg-sym-rich .rg-sym-note { font-size: 10px; color: var(--text-faint); }

.card {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  overflow: hidden; position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.card:hover {
  border-color: rgba(232,176,75,.3);
  box-shadow: var(--glow-teal), var(--shadow-card);
}

/* Q4: WAIT — compact, opacity réduite */
.card.card-wait {
  opacity: 0.78;
  background: var(--bg-2);
}
.card.card-wait:hover { opacity: 1; }

/* Card top accent line */
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232,176,75,.18), transparent);
}
.card.direction-long::before {
  background: linear-gradient(90deg, transparent, rgba(52,211,153,.4), transparent);
}
.card.direction-short::before {
  background: linear-gradient(90deg, transparent, rgba(248,113,113,.4), transparent);
}
.card.direction-armed::before {
  background: linear-gradient(90deg, transparent, rgba(245,158,11,.4), transparent);
  animation: pulse-armed 2.4s ease-in-out infinite;
}
@keyframes pulse-armed {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Q4: inner moins padded pour WAIT */
.card-inner { padding: 11px 12px; }
.card.card-wait .card-inner { padding: 10px 11px; }
/* KRONOS : carte dense — pile verticale serrée */
.kcard .card-inner { display: flex; flex-direction: column; gap: 8px; }

/* Card header */
.card-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 8px;
}
.card-symbol {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  letter-spacing: 0.05em; color: var(--text);
}
.card.card-wait .card-symbol { font-size: 13px; color: var(--text-dim); }
.card-name { font-size: 10px; color: var(--text-faint); margin-top: 1px; letter-spacing: 0.04em; }
.card-price-block { text-align: right; }
.card-price {
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  color: var(--text);
}
.card.card-wait .card-price { font-size: 12px; color: var(--text-dim); font-weight: 500; }

/* ─── Signal badge ──────────────────────────────────────────── */
.badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; padding: 4px 9px; border-radius: var(--radius-sm);
  text-transform: uppercase; display: inline-flex; align-items: center;
  gap: 4px; white-space: nowrap;
}
.badge.WAIT { background: rgba(100,116,139,.15); color: var(--neutral); border: 1px solid rgba(100,116,139,.2); }
.badge.ARMED {
  background: var(--warn-dim); color: var(--warn);
  border: 1px solid rgba(245,158,11,.3); box-shadow: 0 0 8px rgba(245,158,11,.1);
}
.badge.CONFIRMED.long {
  background: var(--up-dim); color: var(--up);
  border: 1px solid rgba(52,211,153,.3); box-shadow: var(--glow-green);
}
.badge.CONFIRMED.short {
  background: var(--down-dim); color: var(--down);
  border: 1px solid rgba(248,113,113,.3); box-shadow: var(--glow-red);
}

/* ─── M2: Score / Consensus section avec demi-jauge ─────────── */
.score-section {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft); margin-bottom: 8px;
}

/* Wrapper de la demi-jauge */
.consensus-gauge {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
}
.consensus-gauge svg { display: block; overflow: visible; }

.consensus-gauge-label {
  text-align: center; margin-top: -2px;
}
.consensus-ring-pct {
  font-family: var(--mono); font-size: 11px; font-weight: 700; line-height: 1;
}
.consensus-ring-pct.bull { color: var(--up); }
.consensus-ring-pct.bear { color: var(--down); }
.consensus-ring-pct.neutral { color: var(--warn); }
.consensus-ring-text {
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint); margin-top: 1px;
}

.score-info { flex: 1; min-width: 0; }
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.score-label-main {
  font-size: 10px; font-family: var(--mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
}
.score-val { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.score-val.pos { color: var(--up); }
.score-val.neg { color: var(--down); }
.score-val.neutral-s { color: var(--warn); }

/* Linear score bar */
.score-track {
  position: relative; height: 4px; border-radius: 3px;
  background: var(--bg-2); overflow: visible; margin-top: 2px;
}
.score-track-fill {
  position: absolute; top: 0; height: 4px; border-radius: 3px;
}
.score-track-fill.pos {
  background: linear-gradient(90deg, rgba(52,211,153,.4), var(--up)); left: 50%;
}
.score-track-fill.neg {
  background: linear-gradient(90deg, var(--down), rgba(248,113,113,.4)); right: 50%;
}
.score-mid-tick {
  position: absolute; left: 50%; top: -2px; width: 1px; height: 8px;
  background: var(--rule); transform: translateX(-50%);
}

/* Q6: rows CONFL% / CONF% / Fiabilité */
.score-align-row {
  display: flex; justify-content: space-between;
  font-size: 9px; font-family: var(--mono); color: var(--text-faint);
  margin-top: 3px; letter-spacing: 0.04em;
}
.score-align-row span:last-child { color: var(--text-dim); }
.metric-val {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  color: var(--text-dim);
}

/* ─── Pillar breakdown bars ──────────────────────────────────── */
.pillars { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.pillar { display: flex; align-items: center; gap: 6px; }
.pillar-name {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; width: 34px; flex-shrink: 0; color: var(--text-faint);
}
.pillar-bar-wrap {
  flex: 1; height: 4px; background: var(--bg-2); border-radius: 2px;
  position: relative; overflow: hidden;
}
.pillar-fill { position: absolute; top: 0; height: 4px; border-radius: 2px; transition: width .4s ease; }
.pillar-fill.pos { background: linear-gradient(90deg, rgba(52,211,153,.5), var(--up)); left: 50%; }
.pillar-fill.neg { background: linear-gradient(90deg, var(--down), rgba(248,113,113,.5)); right: 50%; }
.pillar-fill.absent { background: var(--rule); left: 50%; width: 0 !important; }
.pillar-mid {
  position: absolute; left: 50%; top: -1px; width: 1px; height: 6px;
  background: var(--rule);
}
.pillar-val {
  font-family: var(--mono); font-size: 9px; width: 36px;
  text-align: right; color: var(--text-faint); flex-shrink: 0;
}
.pillar-val.pos { color: var(--up); }
.pillar-val.neg { color: var(--down); }

/* ─── Levels block ────────────────────────────────────────────── */
.levels { border-top: 1px solid var(--rule-soft); padding-top: 8px; margin-top: 2px; }
.levels-title {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px;
}
.levels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.level-item {
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm); padding: 5px 8px;
}
.level-item.entry { background: rgba(52,211,153,.07); border-color: rgba(52,211,153,.2); }
.level-item.stop  { background: rgba(248,113,113,.07); border-color: rgba(248,113,113,.2); }
.level-item.tp    { background: rgba(232,176,75,.06); border-color: rgba(232,176,75,.15); }
.level-item.liq   { background: rgba(139,92,246,.07); border-color: rgba(139,92,246,.2); }
.level-lbl {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px;
}
.level-val { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.level-item.entry .level-val { color: var(--up); }
.level-item.stop  .level-val { color: var(--down); }
.level-item.tp    .level-val { color: var(--accent); }
.level-item.liq   .level-val { color: var(--purple); }

/* Chips row */
.chips-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.chip {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 7px;
  border-radius: 4px; border: 1px solid var(--rule);
  background: var(--bg-2); color: var(--text-dim);
}
.chip.rr          { color: var(--accent);  border-color: rgba(232,176,75,.25);  background: var(--accent-dim); }
.chip.lev         { color: var(--warn);    border-color: rgba(245,158,11,.25);  background: var(--warn-dim); }
.chip.confort     { color: var(--up);      border-color: rgba(52,211,153,.25);  background: var(--up-dim); }
.chip.reduce      { color: var(--warn);    border-color: rgba(245,158,11,.25);  background: var(--warn-dim); }
.chip.veto_conflict { color: var(--down); border-color: rgba(248,113,113,.25); background: var(--down-dim); }
.chip.neutral     { color: var(--text-faint); border-color: var(--rule); }

.card-error { color: var(--down); font-size: 10px; margin-top: 6px; font-family: var(--mono); opacity: .8; }

/* ─── M3: Sparkline Score S ──────────────────────────────────── */
.sparkline-wrap {
  margin-top: 8px;
  border-top: 1px solid var(--rule-soft);
  padding-top: 5px;
  /* SVG va être width=0 à la création — on le force via CSS */
}
.sparkline-wrap svg {
  display: block;
  width: 100% !important;
  height: 28px;
  overflow: visible;
}

/* ─── SRC pastilles ──────────────────────────────────────────── */
.src-dots {
  display: inline-flex; gap: 3px; align-items: center; vertical-align: middle;
}
.src-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rule); border: 1px solid var(--rule);
  display: inline-block;
}
.src-dot.active {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 4px rgba(232,176,75,.4);
}

/* ═══════════════════════════════════════════════════════════════
   M1: SIGNALS TABLE (vue Tableau)
   ═══════════════════════════════════════════════════════════════ */
.signals-table .tbl-symbol {
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  color: var(--text); letter-spacing: 0.04em;
}
.signals-table td { padding: 7px 12px; font-size: 11px; }
.signals-table th { padding: 8px 12px; user-select: none; }
.signals-table th[data-sort]:hover { color: var(--text); }
.signals-table th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
.signals-table th.sort-desc::after { content: ' ↓'; color: var(--accent); }
.signals-table tbody tr:nth-child(even) { background: rgba(255,255,255,.012); }
.signals-row:hover { background: var(--panel-2) !important; }

.tbl-price  { color: var(--text); font-weight: 600; }
.tbl-entry  { color: var(--up); }
.tbl-stop   { color: var(--down); }
.tbl-tp     { color: var(--accent); }
.tbl-rr     { color: var(--text-dim); }
.tbl-rr-good { color: var(--accent); font-weight: 700; }
.tbl-pct-high { color: var(--up); font-weight: 700; }
.tbl-pct-mid  { color: var(--warn); }
.tbl-pct-low  { color: var(--text-faint); }

/* ═══════════════════════════════════════════════════════════════
   TRADES TABLE (existant)
   ═══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--rule); }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table thead { background: var(--panel-2); position: sticky; top: 0; z-index: 2; }
.data-table th {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); padding: 10px 14px;
  text-align: left; white-space: nowrap; border-bottom: 1px solid var(--rule);
}
.data-table td {
  padding: 7px 12px; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 12px; white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table .long  { color: var(--up); font-weight: 600; }
.data-table .short { color: var(--down); font-weight: 600; }

.pnl-pos { color: var(--up); font-weight: 700; }
.pnl-neg { color: var(--down); font-weight: 700; }

.status-badge {
  font-size: 9px; font-family: var(--mono); letter-spacing: 0.1em;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
}
.status-badge.OPEN   { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(232,176,75,.2); }
.status-badge.PLANNED{ color: var(--warn); background: var(--warn-dim); border: 1px solid rgba(245,158,11,.25); }
.status-badge.CLOSED { color: var(--text-faint); background: var(--bg-2); border: 1px solid var(--rule); }
.status-badge.WIN    { color: var(--up);   background: var(--up-dim);   border: 1px solid rgba(52,211,153,.2); }
.status-badge.LOSS   { color: var(--down); background: var(--down-dim); border: 1px solid rgba(248,113,113,.2); }

.empty {
  color: var(--text-faint); padding: 32px; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════════════════
   PERFORMANCE
   ═══════════════════════════════════════════════════════════════ */
.perf-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.perf-card {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 20px 18px;
  box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.perf-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .25;
}
.perf-value { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1; }
.perf-value.up   { color: var(--up); }
.perf-value.warn { color: var(--warn); }
.perf-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-top: 8px; }

/* ═══════════════════════════════════════════════════════════════
   SIGNALS FUNNEL
   ═══════════════════════════════════════════════════════════════ */
.funnel-wrap { max-width: 540px; }
.funnel-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-stage { display: flex; align-items: center; gap: 10px; }
.funnel-name {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; width: 90px; flex-shrink: 0; color: var(--text-dim);
}
.funnel-bar-wrap { flex: 1; }
.funnel-bar {
  height: 28px; border-radius: 5px; display: flex; align-items: center;
  padding: 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 700;
  min-width: 48px; transition: width .5s ease;
}
.funnel-bar.ARMED      { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(245,158,11,.3); }
.funnel-bar.CONFIRMED  { background: var(--up-dim);   color: var(--up);   border: 1px solid rgba(52,211,153,.3); }
.funnel-bar.INVALIDATED{ background: var(--down-dim); color: var(--down); border: 1px solid rgba(248,113,113,.3); }

/* ═══════════════════════════════════════════════════════════════
   REGIME PANEL
   ═══════════════════════════════════════════════════════════════ */
.regime-detail {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.regime-gauge-card {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; align-items: center;
  gap: 12px; box-shadow: var(--shadow-card);
}
.regime-gauge-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint); align-self: flex-start;
}
/* Wrapper pour positionner le label au centre de la demi-jauge */
.regime-gauge-wrap { position: relative; display: inline-block; }
.regime-gauge-center {
  position: absolute;
  bottom: 6px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
.regime-gauge-val { font-family: var(--mono); font-size: 32px; font-weight: 700; line-height: 1; }

/* ═══════════════════════════════════════════════════════════════
   PHASE 6 — RÉGIME · AUTO-LEARNING (/api/regimes)
   ═══════════════════════════════════════════════════════════════ */
.regimes-wrap { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }

.rg-unavailable {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--text-faint); padding: 14px 16px; border-radius: var(--radius);
  border: 1px dashed var(--rule); background: rgba(13,21,40,.4);
}

/* ─── Section wrapper + titre micro-label ─── */
.rg-section { display: flex; flex-direction: column; gap: 12px; }
.rg-section-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-faint);
  padding-bottom: 9px; border-bottom: 1px solid var(--rule);
}

/* ─── 1) BANDEAU « RÉGIME ACTUEL » ─── */
.rg-banner {
  position: relative; display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between;
  padding: 20px 24px; border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--rg-dim) 0%, transparent 60%),
    var(--panel);
  border: 1px solid var(--rg-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: card-in .45s cubic-bezier(.22,.68,0,1.1) both;
}
.rg-banner::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: var(--rg); box-shadow: 0 0 18px 1px var(--rg);
}
.rg-banner::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--rg), transparent 70%); opacity: .5;
}
.rg-banner-left { display: flex; flex-direction: column; gap: 7px; min-width: 240px; }
.rg-banner-kicker {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-faint);
}
.rg-banner-titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rg-banner-title {
  font-family: var(--mono); font-size: 26px; font-weight: 700; line-height: 1;
  color: var(--rg); text-shadow: 0 0 22px var(--rg-dim);
}
.rg-crisis-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--down-dim); color: var(--down);
  border: 1px solid rgba(248,113,113,.4); box-shadow: var(--glow-red);
  animation: pulse-armed 1.8s ease-in-out infinite;
}
.rg-banner-strat {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim); letter-spacing: 0.02em;
}
.rg-banner-right { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }
.rg-metric {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  padding: 0 14px; border-left: 1px solid var(--rule-soft);
}
.rg-metric-val { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.rg-metric-lbl {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); margin-top: 5px;
}
.rg-risk {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: rgba(7,10,20,.55); border: 1px solid var(--rg-border);
}
.rg-risk-lbl {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
}
.rg-risk-val {
  font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--rg);
  line-height: 1.1; text-shadow: 0 0 18px var(--rg-dim);
}
.rg-risk-sub { font-family: var(--mono); font-size: 8px; color: var(--text-faint); letter-spacing: 0.06em; }

/* ─── 2) CARTES « PERFORMANCE PAR RÉGIME » ─── */
.rg-perf-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px;
}
.rg-perf-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 14px 15px;
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.rg-perf-card:hover { transform: translateY(-2px); border-color: var(--rg-border); }
.rg-perf-card.is-current {
  border-color: var(--rg-border);
  background: linear-gradient(160deg, var(--rg-dim) 0%, var(--panel) 55%);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--rg-border) inset;
}
.rg-perf-card.is-current::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--rg); box-shadow: 0 0 14px var(--rg);
}
.rg-perf-head { display: flex; align-items: center; gap: 8px; }
.rg-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--rg); box-shadow: 0 0 8px var(--rg);
}
.rg-perf-name {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rg-current-pill {
  font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: 0.12em;
  padding: 2px 7px; border-radius: 3px; color: var(--rg);
  background: var(--rg-dim); border: 1px solid var(--rg-border);
}
.rg-perf-range {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}
.rg-perf-stats { display: flex; gap: 4px; }
.rg-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: var(--radius-sm);
  background: rgba(7,10,20,.45); border: 1px solid var(--rule-soft);
}
.rg-stat-val { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text); line-height: 1; }
.rg-stat-val.pos { color: var(--up); }
.rg-stat-val.neg { color: var(--down); }
.rg-stat-val.mid { color: var(--warn); }
.rg-stat-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}
.rg-perf-risk {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 9px; border-radius: var(--radius-sm);
  background: rgba(7,10,20,.4); border: 1px solid var(--rule-soft);
}
.rg-perf-risk-lbl { font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.rg-perf-risk-val { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent); }
.rg-insuff {
  display: flex; align-items: center; gap: 7px; padding: 9px 10px;
  border-radius: var(--radius-sm); background: rgba(100,116,139,.08);
  border: 1px dashed var(--rule);
}
.rg-insuff-icon { color: var(--neutral); font-size: 12px; }
.rg-insuff-txt { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--text-faint); }
.rg-perf-strat { display: flex; flex-direction: column; gap: 5px; margin-top: auto; }
.rg-perf-strat-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.rg-strat-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rg-strat-chip {
  font-family: var(--mono); font-size: 8.5px; font-weight: 600; letter-spacing: 0.06em;
  padding: 3px 7px; border-radius: 3px; white-space: nowrap;
}
.rg-strat-chip.rev   { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(232,176,75,.25); }
.rg-strat-chip.trend { background: rgba(59,130,246,.14); color: var(--blue); border: 1px solid rgba(59,130,246,.28); }
.rg-strat-chip.none  { background: rgba(100,116,139,.1); color: var(--text-faint); border: 1px solid var(--rule-soft); }

/* ─── 3) BLOC « LOGIQUE AUTO-LEARNING » ─── */
.rg-learning {
  padding: 18px 20px; border-radius: var(--radius);
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(232,176,75,.05), transparent 70%),
    var(--panel);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
}
.rg-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 9px 22px; }
.rg-rule { display: flex; align-items: flex-start; gap: 10px; }
.rg-rule-icon {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  flex-shrink: 0; width: 16px; text-align: center; line-height: 1.45;
}
.rg-rule-txt { font-size: 11.5px; line-height: 1.45; color: var(--text-dim); }
.rg-learning-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-soft);
}
.rg-learning-foot-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.rg-learning-foot-val { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--accent); }

/* ─── 4) GRILLE « MEILLEUR / PIRE RÉGIME PAR SYMBOLE » ─── */
.rg-sym-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
}
.rg-sym-cell {
  display: flex; flex-direction: column; gap: 5px; padding: 11px 12px;
  border-radius: var(--radius-sm); background: var(--panel);
  border: 1px solid var(--rule-soft);
}
.rg-sym-name { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: 0.04em; }
.rg-sym-note { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.05em; color: var(--text-faint); }

/* ═══════════════════════════════════════════════════════════════
   M4: DETAIL DRAWER
   ═══════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 96vw;
  background: var(--panel);
  border-left: 1px solid var(--rule);
  box-shadow: -8px 0 40px rgba(0,0,0,.6);
  z-index: 110;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22,.68,0,1.2);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--rule);
  background: var(--panel-2); flex-shrink: 0;
}
.drawer-title {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; color: var(--text);
}
.drawer-close {
  background: none; border: none; color: var(--text-faint);
  font-size: 14px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color .15s, background .15s;
}
.drawer-close:hover { color: var(--text); background: var(--rule); }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}

/* Drawer — top row (badge + prix) */
.drawer-top-row {
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-price {
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  color: var(--text);
}

/* Drawer — grande jauge */
.drawer-gauge-section { display: flex; justify-content: center; }
.drawer-gauge-wrap {
  position: relative; display: inline-flex;
  flex-direction: column; align-items: center; gap: 2px;
}
.drawer-gauge-wrap svg { display: block; overflow: visible; }
.drawer-gauge-label { text-align: center; }
.drawer-gauge-pct {
  font-family: var(--mono); font-size: 20px; font-weight: 700; line-height: 1;
}
.drawer-gauge-pct.bull { color: var(--up); }
.drawer-gauge-pct.bear { color: var(--down); }
.drawer-gauge-pct.neutral { color: var(--warn); }
.drawer-gauge-sent {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint); margin-top: 2px;
}
.drawer-gauge-score {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  margin-top: 4px;
}

/* Drawer — section titles */
.drawer-section-title {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}

/* Drawer — sparkline */
.drawer-spark-section {}
.drawer-sparkline-wrap { width: 100%; }
.drawer-sparkline-wrap svg {
  display: block; width: 100% !important; height: 52px; overflow: visible;
}

/* Drawer — métriques CONFL%/CONF%/FIAB/SRC */
.drawer-metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.drawer-metric {
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm); padding: 8px 6px;
  text-align: center;
}
.drawer-metric-val {
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  color: var(--text); line-height: 1;
}
.drawer-metric-lbl {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint); margin-top: 4px;
}
/* Align src-dots inside drawer metric */
.drawer-metric .src-dots { justify-content: center; }
.drawer-metric .fiab { font-size: 10px; }

/* Drawer — pillar section */
.drawer-pillar-section .pillars { margin-bottom: 0; }
.drawer-pillar-section .pillar-bar-wrap { height: 5px; }
.drawer-pillar-section .pillar-fill { height: 5px; }
.drawer-pillar-section .pillar-val { font-size: 10px; width: 40px; }
.drawer-pillar-section .pillar-name { font-size: 10px; width: 38px; }

/* Drawer — levels */
.drawer-level-section {}
.drawer-levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.drawer-levels-grid .level-item { padding: 6px 8px; }
.drawer-levels-grid .level-val { font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; padding: 10px 20px;
  border-top: 1px solid var(--rule); color: var(--text-faint);
  font-size: 10px; font-family: var(--mono); letter-spacing: 0.06em;
  background: var(--bg-2);
}
.footer-disclaimer { display: flex; align-items: center; gap: 6px; }
.footer-disclaimer::before { content: '⚠'; font-size: 10px; color: var(--warn); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .topbar-row1 { padding: 8px 12px; }
  .kpi-strip { padding: 0 12px; }
  .kpi-item { min-width: 90px; padding: 6px 14px 6px 0; }
  .kpi-val { font-size: 15px; }
  main { padding: 12px; }
  .cards-grid { grid-template-columns: 1fr; }
  .filter-bar { padding: 8px 12px; }
  .tabs { padding: 0 12px; }
  .drawer { width: 100vw; max-width: 100vw; }
  .drawer-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .drawer-levels-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
  .kpi-item { min-width: 80px; }
  .perf-grid { grid-template-columns: 1fr 1fr; }
  .drawer-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .rg-banner { flex-direction: column; align-items: flex-start; }
  .rg-banner-right { width: 100%; justify-content: space-between; }
  .rg-metric { border-left: none; padding: 0; align-items: flex-start; }
}

/* ─── Phase 3 S1: Section MACRO dans le tableau signaux ────── */
.macro-sep-row td.macro-sep {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 8px 4px;
  border-top: 1px solid var(--rule-soft);
}
.macro-row td { color: var(--text-faint); }
.badge.macro-signal { background: rgba(100,116,139,.15); color: var(--neutral); border: 1px solid rgba(100,116,139,.2); }
.badge.macro-signal.long {
  background: var(--up-dim); color: var(--up); border: 1px solid rgba(52,211,153,.3);
}
.badge.macro-signal.short {
  background: var(--down-dim); color: var(--down); border: 1px solid rgba(248,113,113,.3);
}

/* ─── Phase 3 S2/S3: placeholder sparkline prix + RSI ──────── */
.drawer-spark-loading {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
  text-align: center; padding: 16px 0;
}
.drawer-rsi-section { margin-top: 10px; }

/* ═══════════════════════════════════════════════════════════════
   PHASE 4 — KRONOS : cartes denses + mini-graphe de prix en façade
   ═══════════════════════════════════════════════════════════════ */

/* Le flex-gap de .card-inner gère l'espacement → on neutralise les marges
   héritées des blocs réutilisés à l'intérieur d'une kcard. */
.kcard .score-section,
.kcard .pillars,
.kcard .kcard-head,
.kcard .kchips,
.kcard .kchart,
.kcard .kcard-status,
.kcard .kcard-footer { margin: 0; }
.kcard .score-section { border-top: none; border-bottom: none; padding: 0; }

/* ─── 1. HEADER dense (sym | badges | prix+Δ) ──────────────────── */
.kcard-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  gap: 8px;
}
.kcard-sym-block { min-width: 0; }
.kcard .card-symbol { font-size: 15px; line-height: 1.05; }
.kcard.card-wait .card-symbol { font-size: 13px; }
.kcard-badges {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
}
.kcard-price-block { text-align: right; }
.kcard .card-price { font-size: 14px; line-height: 1.1; }
.kcard-chg {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.02em; margin-top: 2px;
}
.kcard-chg.pos { color: var(--up); }
.kcard-chg.neg { color: var(--down); }
.kcard-chg.neutral-s { color: var(--text-faint); }

/* Badge régime FEAR/GREED/NEUTRE */
.regime-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--rule);
  background: var(--bg-2); color: var(--text-dim); white-space: nowrap;
}
.regime-badge-val {
  font-size: 9px; font-weight: 700; opacity: 0.9;
  padding-left: 4px; border-left: 1px solid currentColor;
}
.regime-badge.fear-extreme,
.regime-badge.fear { color: var(--down); border-color: rgba(248,113,113,.3); background: var(--down-dim); }
.regime-badge.greed-extreme,
.regime-badge.greed { color: var(--up); border-color: rgba(52,211,153,.3); background: var(--up-dim); }
.regime-badge.neutral-rg { color: var(--warn); border-color: rgba(245,158,11,.3); background: var(--warn-dim); }

/* ─── 2. Ligne status / signal ─────────────────────────────────── */
.kcard-status {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--rule-soft);
}
.kcard-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--neutral);
}
.kcard-status-dot.pos { background: var(--up); box-shadow: 0 0 6px rgba(52,211,153,.6); }
.kcard-status-dot.neg { background: var(--down); box-shadow: 0 0 6px rgba(248,113,113,.6); }
.kcard-status-dot.warn { background: var(--warn); box-shadow: 0 0 6px rgba(245,158,11,.5); animation: pulse-live 2s ease-in-out infinite; }
.kcard-status-dot.idle { background: var(--text-faint); }
.kcard-status-txt {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em;
  color: var(--text-dim); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kcard-mod {
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  letter-spacing: 0.08em; padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--rule); color: var(--text-faint); flex-shrink: 0;
}
.kcard-mod.confort { color: var(--up); border-color: rgba(52,211,153,.3); background: var(--up-dim); }
.kcard-mod.reduce { color: var(--warn); border-color: rgba(245,158,11,.3); background: var(--warn-dim); }
.kcard-mod.veto_conflict { color: var(--down); border-color: rgba(248,113,113,.3); background: var(--down-dim); }
.kcard-mod.neutral { color: var(--text-faint); }

/* ─── 3. Rangée dense de chips de niveaux ──────────────────────── */
.kchips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.dchip {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 5px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  min-width: 0;
}
.dchip-lbl {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint);
}
.dchip-val {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--text-dim); line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dchip.entry .dchip-val { color: var(--up); }
.dchip.stop  .dchip-val { color: var(--down); }
.dchip.tp    .dchip-val { color: var(--accent); }
.dchip.rr    .dchip-val { color: var(--text); }
.dchip.lev   .dchip-val { color: var(--warn); }
.dchip.liq   .dchip-val { color: var(--purple); }
.dchip.entry { border-color: rgba(52,211,153,.18); }
.dchip.stop  { border-color: rgba(248,113,113,.18); }
/* Chips "vides" (—) restent neutres pour ne pas crier en WAIT */
.kcard.card-wait .dchip .dchip-val { color: var(--text-faint); }

/* ─── 4. Mini-graphe de prix en façade ─────────────────────────── */
.kchart {
  position: relative;
  height: 64px;
  background: linear-gradient(180deg, rgba(13,21,40,.5), rgba(7,10,20,.3));
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.kchart .price-chart-svg {
  display: block; width: 100% !important; height: 64px;
}
.kchart-tf {
  position: absolute; top: 4px; left: 6px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; color: var(--text-faint);
  background: rgba(7,10,20,.55); padding: 1px 4px; border-radius: 3px;
  pointer-events: none;
}

/* ─── 5. Consensus compact ─────────────────────────────────────── */
.kcard .score-section { gap: 9px; padding-top: 2px; }
.kcard .consensus-gauge { padding-top: 2px; }

/* RSI : barre 0-100 */
.rsi-row { margin-top: 4px; }
.rsi-bar { margin-top: 3px; }
.rsi-bar-track {
  position: relative; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg,
    rgba(52,211,153,.22) 0%, rgba(52,211,153,.22) 30%,
    rgba(100,116,139,.22) 30%, rgba(100,116,139,.22) 70%,
    rgba(248,113,113,.22) 70%, rgba(248,113,113,.22) 100%);
  overflow: hidden;
}
.rsi-bar-fill {
  position: absolute; left: 0; top: 0; height: 4px; border-radius: 3px;
  transition: width .4s ease;
}
.rsi-bar-fill.cold { background: linear-gradient(90deg, rgba(52,211,153,.5), var(--up)); }
.rsi-bar-fill.mid  { background: linear-gradient(90deg, var(--neutral), #94a3b8); }
.rsi-bar-fill.hot  { background: linear-gradient(90deg, var(--warn), var(--down)); }

/* ─── 6. Piliers compacts ──────────────────────────────────────── */
.kpillars { gap: 3px; }
.kpillars .pillar-name { width: 38px; }

/* ─── 7. Footer : NEWS + SRC ────────────────────────────────────── */
.kcard-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding-top: 7px; border-top: 1px solid var(--rule-soft);
}
.news-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--rule); background: var(--bg-2);
}
.news-chip-lbl { font-size: 9px; letter-spacing: 0.12em; color: var(--text-faint); }
.news-chip-arrow { font-size: 8px; }
.news-chip-val { font-weight: 700; }
.news-chip.pos { color: var(--up); border-color: rgba(52,211,153,.25); }
.news-chip.neg { color: var(--down); border-color: rgba(248,113,113,.25); }
.news-chip.neutral-s { color: var(--text-faint); }

.src-counter { display: inline-flex; align-items: center; gap: 6px; }
.src-counter-txt {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  color: var(--text-faint); letter-spacing: 0.04em;
}

/* ─── Drawer : graphe de prix riche ────────────────────────────── */
.drawer-chart-wrap {
  background: linear-gradient(180deg, rgba(13,21,40,.5), rgba(7,10,20,.3));
  border: 1px solid var(--rule-soft); border-radius: var(--radius-sm);
  overflow: hidden;
}
.drawer-chart-wrap .price-chart-svg {
  display: block; width: 100% !important; height: 120px;
}

/* ─── Drawer : widget TradingView (graphe principal) ───────────── */
.drawer-tv-section { }
.drawer-tv-host {
  position: relative;
  width: 100%;
  height: 340px;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(13,21,40,.5), rgba(7,10,20,.3));
}
.drawer-tv-host .tradingview-widget-container,
.drawer-tv-host .tradingview-widget-container__widget,
.drawer-tv-host iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}
/* Masque le lien « copyright » de l'embed pour rester épuré (le widget reste fonctionnel) */
.drawer-tv-host .tradingview-widget-copyright { display: none !important; }
/* En mode repli (SVG), on laisse le wrapper interne gérer sa hauteur */
.drawer-tv-host.drawer-tv-fallback {
  height: auto;
  background: transparent;
  border: 0;
}
.drawer-tv-host.drawer-tv-fallback .drawer-chart-wrap { border: 1px solid var(--rule-soft); }
.drawer-tv-host .drawer-spark-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 120px;
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
}

/* ─── Responsive : le mur reste lisible sur petit écran ────────── */
@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
  .kchips { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 360px) {
  .kchips { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 5 — KRONOS enrichi : header, macro cards, Historique,
             Avancé, Alertes, drawer news + gros graphe.
   Reste fidèle à la palette cerberus midnight existante.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Header enrichi : brand collective + badge KRONOS + compteurs ─── */
.brand-sep { color: var(--text-faint); margin: 0 6px; font-weight: 400; }
.brand-collective {
  color: var(--accent); font-weight: 500; font-size: 13px;
  letter-spacing: 0.04em; text-transform: none;
}
.brand-engine {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(232,176,75,.3); border-radius: 4px;
  padding: 3px 8px; margin-left: 10px; align-self: center;
  box-shadow: 0 0 10px rgba(232,176,75,.12);
}

.class-counts {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
  margin-right: 6px; white-space: nowrap;
}
.class-count { display: inline-flex; align-items: center; gap: 4px; }
.class-count-lbl { color: var(--text-faint); letter-spacing: 0.06em; }
.class-count-val { color: var(--accent); font-weight: 700; }
.class-count-sep { color: var(--text-faint); opacity: 0.5; }

.pill-live { white-space: nowrap; }

/* ─── Nav : badge count Alertes ──────────────────────────────────── */
.tab-count {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  background: var(--down-dim); color: var(--down);
  border: 1px solid rgba(248,113,113,.3); border-radius: 9px;
  padding: 0 5px; margin-left: 4px; line-height: 1.5;
}
.tab-count:empty { display: none; }

/* ─── Cartes MACRO : section dédiée ──────────────────────────────── */
.macro-cards-section { margin-top: 18px; }
.macro-cards-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 6px 4px; border-top: 1px solid var(--rule-soft); margin-bottom: 9px;
}
.macro-cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.macro-card .card-name { color: var(--purple); opacity: 0.8; }
.macro-card::before {
  background: linear-gradient(90deg, transparent, rgba(139,92,246,.3), transparent);
}
.macro-card.direction-long::before {
  background: linear-gradient(90deg, transparent, rgba(52,211,153,.4), transparent);
}
.macro-card.direction-short::before {
  background: linear-gradient(90deg, transparent, rgba(248,113,113,.4), transparent);
}

/* ─── ONGLET HISTORIQUE ──────────────────────────────────────────── */
.hist-wrap { display: flex; flex-direction: column; gap: 22px; }
.hist-section-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.hist-spark-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.hist-spark-cell {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow-card);
}
.hist-spark-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.hist-spark-sym {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--text);
}
.hist-spark-val { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text-dim); }
.hist-spark-val.pos { color: var(--up); }
.hist-spark-val.neg { color: var(--down); }
.hist-spark-val.neutral-s { color: var(--warn); }
.hist-spark-svg svg { display: block; width: 100% !important; height: 40px; overflow: visible; }
.hist-table td { padding: 6px 12px; font-size: 11px; }
.hist-table .long  { color: var(--up); font-weight: 600; }
.hist-table .short { color: var(--down); font-weight: 600; }

/* ─── ONGLET AVANCÉ ──────────────────────────────────────────────── */
.adv-wrap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; align-items: start;
}
.adv-block {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.adv-block-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-soft);
}
/* Bannière exécution — très visible */
.adv-exec-banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px;
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.04em;
}
.adv-exec-banner.observe {
  background: var(--up-dim); color: var(--up);
  border: 1px solid rgba(52,211,153,.4); box-shadow: var(--glow-green);
}
.adv-exec-banner.live {
  background: var(--down-dim); color: var(--down);
  border: 1px solid rgba(248,113,113,.45); box-shadow: var(--glow-red);
  animation: pulse-armed 2s ease-in-out infinite;
}
.adv-exec-icon { font-size: 16px; }
.adv-exec-txt { font-size: 11px; }
.adv-kv-grid { display: flex; flex-direction: column; gap: 5px; }
.adv-kv {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; padding: 4px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.adv-kv:last-child { border-bottom: none; }
.adv-kv-k { color: var(--text-faint); letter-spacing: 0.02em; }
.adv-kv-v { color: var(--text-dim); font-weight: 600; }
.adv-kv-v.on  { color: var(--up); }
.adv-kv-v.off { color: var(--text-faint); }
/* Poids piliers */
.adv-weight-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.adv-weight-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); width: 46px; flex-shrink: 0;
}
.adv-weight-bar-wrap {
  flex: 1; height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden;
}
.adv-weight-fill {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(232,176,75,.5), var(--accent));
  transition: width .4s ease;
}
.adv-weight-val {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--text-dim); width: 40px; text-align: right; flex-shrink: 0;
}
.adv-weight-sum {
  font-family: var(--mono); font-size: 9px; color: var(--text-faint);
  letter-spacing: 0.06em; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--rule-soft); text-align: right;
}
.adv-syms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.adv-sym-chip {
  font-family: var(--mono); font-size: 9px; color: var(--text-dim);
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-radius: 4px; padding: 2px 6px; letter-spacing: 0.03em;
}

/* ─── PERFORMANCE PAPER (observe · 0 ordre) — onglet Avancé ────────── */
/* Section pleine largeur : occupe toute la grille .adv-wrap, sous la config. */
.paper-block { grid-column: 1 / -1; }
/* Palette WR cohérente : ≥55 vert / ≤45 rouge / sinon ambre / neutre vide */
.paper-block .good   { --paper-c: var(--up);      --paper-dim: var(--up-dim); }
.paper-block .bad    { --paper-c: var(--down);    --paper-dim: var(--down-dim); }
.paper-block .amber  { --paper-c: var(--warn);    --paper-dim: var(--warn-dim); }
.paper-block .neutral{ --paper-c: var(--text-dim);--paper-dim: var(--bg-2); }

.paper-empty {
  font-family: var(--mono); font-size: 11px; line-height: 1.5;
  color: var(--text-dim); background: var(--bg-2);
  border: 1px dashed var(--rule); border-radius: var(--radius-sm);
  padding: 14px 16px;
}

/* 1) Bandeau global */
.paper-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border-radius: var(--radius-sm); padding: 14px 18px;
  background: var(--paper-dim);
  border: 1px solid var(--paper-c);
}
.paper-banner.good { box-shadow: var(--glow-green); }
.paper-banner.bad  { box-shadow: var(--glow-red); }
.paper-banner-main { display: flex; align-items: baseline; gap: 10px; }
.paper-banner-wr {
  font-family: var(--mono); font-size: 30px; font-weight: 700;
  line-height: 1; color: var(--paper-c); letter-spacing: -0.01em;
}
.paper-banner-wr-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.paper-banner-stats { display: flex; gap: 22px; }
.paper-banner-stat { display: flex; flex-direction: column; gap: 2px; }
.paper-banner-stat-v {
  font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text);
}
.paper-banner-stat-l {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}
.paper-expired {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em;
  color: var(--text-faint); margin-top: 6px; text-align: right;
}

/* Sous-titres de groupe */
.paper-sub {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
  margin: 16px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}

/* 2) + 3) Cartes (mode / alignement) */
.paper-grid { display: grid; gap: 8px; }
.paper-grid-2 { grid-template-columns: 1fr 1fr; }
.paper-grid-regime { grid-template-columns: repeat(5, 1fr); }

.paper-card {
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.paper-card.feature {
  background: var(--panel-2);
  border-color: var(--paper-c);
  border-left: 3px solid var(--paper-c);
}
.paper-card-title {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px;
}
.paper-card-wr {
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  line-height: 1; color: var(--paper-c);
}
.paper-card-empty {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--text-faint);
}
.paper-card-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-top: 7px;
}
.paper-card-n {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em;
  color: var(--text-faint);
}
.paper-card-r {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-dim);
}

.paper-note {
  font-family: var(--sans); font-size: 10px; line-height: 1.45;
  color: var(--text-dim); margin-top: 8px;
  padding-left: 8px; border-left: 2px solid var(--warn);
}
.paper-unknown {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em;
  color: var(--text-faint); margin-top: 6px;
}

/* 4) Grille régimes */
.paper-reg {
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-sm); padding: 8px 6px; text-align: center;
}
.paper-reg-lbl {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px;
}
.paper-reg-wr {
  font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--paper-c);
}
.paper-reg-n {
  font-family: var(--mono); font-size: 8px; color: var(--text-faint);
  margin-top: 2px; min-height: 10px;
}

/* ─── ONGLET ALERTES ─────────────────────────────────────────────── */
.alerts-table td { padding: 7px 12px; font-size: 11px; }
.alerts-table .long  { color: var(--up); font-weight: 600; }
.alerts-table .short { color: var(--down); font-weight: 600; }

/* ─── DRAWER : gros graphe + news ────────────────────────────────── */
.drawer-chart-big .price-chart-svg { height: 220px !important; }
.drawer-chart-big { min-height: 220px; }

.drawer-news-wrap { display: block; }
.news-list { display: flex; flex-direction: column; gap: 8px; }
.news-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--rule-soft);
}
.news-item-dot {
  font-size: 10px; line-height: 1.3; flex-shrink: 0; font-weight: 700;
}
.news-item-dot.pos { color: var(--up); }
.news-item-dot.neg { color: var(--down); }
.news-item-dot.neutral-s { color: var(--text-faint); }
.news-item-body { min-width: 0; flex: 1; }
.news-item-title {
  font-size: 11px; color: var(--text); line-height: 1.35;
}
.news-item-src {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); margin-top: 3px;
}

@media (max-width: 768px) {
  .class-counts { display: none; }
  .adv-wrap { grid-template-columns: 1fr; }
  .paper-grid-regime { grid-template-columns: repeat(3, 1fr); }
  .paper-banner { gap: 10px; }
  .paper-banner-stats { gap: 16px; }
}

/* ── POURQUOI (mode + raison du setup) — carte + drawer ─────────────────── */
.kcard-why { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 6px;
  font-size: 10.5px; line-height: 1.35; }
.kcard-why-tag { flex: none; font-weight: 700; letter-spacing: .04em; font-size: 8.5px;
  padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }
.kcard-why-tag.reversal { color: #93c5fd; background: rgba(59,130,246,.14); border: 1px solid rgba(59,130,246,.32); }
.kcard-why-tag.continuation { color: #fbbf24; background: rgba(251,191,36,.13); border: 1px solid rgba(251,191,36,.32); }
.kcard-why-txt { color: var(--muted, #8aa0b8); }
.drawer-why-section { margin: 14px 0; }
.drawer-why-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.drawer-why-dir { font-weight: 800; font-size: 11px; letter-spacing: .05em; padding: 1px 7px;
  border-radius: 4px; }
.drawer-why-dir.pos { color: #e8b04b; background: rgba(232,176,75,.12); }
.drawer-why-dir.neg { color: #f87171; background: rgba(248,113,113,.12); }
.drawer-why-text { color: var(--text, #c7d6e6); font-size: 12.5px; line-height: 1.5;
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px; padding: 9px 11px; }

/* ═══════════════════════════════════════════════════════════════
   AGENT IA — chat headless (Claude Code côté serveur)
   ═══════════════════════════════════════════════════════════════ */
.agent-wrap {
  display: flex; flex-direction: column;
  height: calc(100vh - 260px); min-height: 420px;
  max-width: 860px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  overflow: hidden; position: relative;
}
.agent-wrap::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .3; z-index: 1;
}

/* Bandeau "non configuré" */
.agent-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; flex-shrink: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--warn); background: var(--warn-dim);
  border-bottom: 1px solid rgba(245,158,11,.25);
}
.agent-banner::before { content: '◷'; font-size: 13px; }

/* Zone de messages scrollable */
.agent-chat {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}

/* Bulle générique */
.agent-msg {
  display: flex; flex-direction: column; gap: 3px;
  max-width: 82%; animation: agent-msg-in .26s cubic-bezier(.22,.68,0,1.1) both;
}
@keyframes agent-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.agent-msg-role {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
}
.agent-bubble {
  padding: 10px 13px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; color: var(--text);
  border: 1px solid var(--rule-soft); word-wrap: break-word;
  overflow-wrap: anywhere; white-space: normal;
}

/* User — aligné à droite, teinte teal */
.agent-msg.user { align-self: flex-end; align-items: flex-end; }
.agent-msg.user .agent-bubble {
  background: var(--accent-dim); border-color: rgba(232,176,75,.25);
  color: var(--text); border-bottom-right-radius: 3px;
}

/* Agent — aligné à gauche */
.agent-msg.agent { align-self: flex-start; align-items: flex-start; }
.agent-msg.agent .agent-bubble {
  background: var(--bg-2); border-color: var(--rule);
  border-bottom-left-radius: 3px;
}

/* Erreur — rouge atténué */
.agent-msg.error .agent-bubble {
  background: var(--down-dim); border-color: rgba(248,113,113,.3);
  color: var(--down);
}

/* Markdown léger rendu dans la bulle agent */
.agent-bubble strong { color: var(--accent); font-weight: 700; }
.agent-bubble ul { margin: 5px 0 5px 2px; padding-left: 16px; list-style: none; }
.agent-bubble li { position: relative; padding-left: 14px; margin: 2px 0; }
.agent-bubble li::before {
  content: '▸'; position: absolute; left: 0; color: var(--accent); font-size: 10px;
}
.agent-bubble code {
  font-family: var(--mono); font-size: 11.5px;
  background: rgba(255,255,255,.05); padding: 1px 5px; border-radius: 4px;
  color: var(--accent);
}

/* Indicateur "l'agent réfléchit…" */
.agent-thinking .agent-bubble {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.04em;
}
.agent-dots { display: inline-flex; gap: 3px; }
.agent-dots span {
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  animation: agent-blink 1.2s ease-in-out infinite;
}
.agent-dots span:nth-child(2) { animation-delay: .2s; }
.agent-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes agent-blink {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* Chips de suggestions */
.agent-suggestions {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 0 16px 12px; flex-shrink: 0;
}
.agent-suggestions:empty { display: none; }
.agent-chip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.02em;
  background: var(--bg-2); border: 1px solid var(--rule);
  color: var(--text-dim); border-radius: 16px; padding: 5px 11px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.agent-chip:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}

/* Composer (input + boutons) */
.agent-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px; flex-shrink: 0;
  border-top: 1px solid var(--rule); background: var(--panel-2);
}
.agent-newconv {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  background: none; border: 1px solid var(--rule); color: var(--text-faint);
  border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer;
  transition: all .15s; white-space: nowrap; flex-shrink: 0; line-height: 1.2;
}
.agent-newconv:hover { color: var(--text); border-color: var(--text-dim); }
.agent-input {
  flex: 1; resize: none; min-height: 38px; max-height: 140px;
  font-family: var(--sans); font-size: 13px; line-height: 1.45;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  padding: 9px 12px; transition: border-color .15s;
}
.agent-input:focus { outline: none; border-color: var(--accent); }
.agent-input::placeholder { color: var(--text-faint); }
.agent-input:disabled { opacity: .5; cursor: not-allowed; }
.agent-send {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(232,176,75,.35); border-radius: var(--radius-sm);
  padding: 10px 16px; cursor: pointer; transition: all .15s;
  white-space: nowrap; flex-shrink: 0; line-height: 1.2;
}
.agent-send:hover:not(:disabled) {
  background: rgba(232,176,75,.22); box-shadow: var(--glow-teal);
}
.agent-send:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 768px) {
  .agent-wrap { height: calc(100vh - 220px); }
  .agent-msg { max-width: 90%; }
  .agent-newconv { padding: 8px; font-size: 0; }
  .agent-newconv::before { content: '↺'; font-size: 14px; }
}

/* Point de statut « reversal recalé » (gate score) */
.kcard-status-dot.gated { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,.6); }

/* ═══════════════════════════════════════════════════════════════
   ACTIVITÉ — fil chronologique entrées/sorties du bot (/api/activity)
   ═══════════════════════════════════════════════════════════════ */
.activity-head { margin-bottom: 14px; }
.activity-title {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
}
.activity-sub {
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
  letter-spacing: 0.04em; margin-top: 3px;
}

.activity-feed {
  display: flex; flex-direction: column;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
}
.activity-feed > .empty { border: none; }

/* Une ligne d'événement : rail (pastille) + corps (deux lignes) */
.act-row {
  display: flex; gap: 12px; align-items: stretch;
  padding: 11px 16px; border-bottom: 1px solid var(--rule-soft);
  animation: act-in .28s ease both;
}
.act-row:last-child { border-bottom: none; }
.act-row:hover { background: var(--panel-2); }

@keyframes act-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Rail vertical + pastille colorée selon sens/PnL */
.act-rail {
  position: relative; display: flex; flex-direction: column;
  align-items: center; width: 22px; flex: 0 0 22px;
}
.act-pip {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 10px; line-height: 1; flex: 0 0 22px;
  border: 1px solid var(--rule);
  font-family: var(--mono); z-index: 1;
}
.act-pip.pip-long    { color: var(--up);   background: var(--up-dim);   border-color: rgba(52,211,153,.4); }
.act-pip.pip-short   { color: var(--down); background: var(--down-dim); border-color: rgba(248,113,113,.4); }
.act-pip.pip-win     { color: var(--up);   background: var(--up-dim);   border-color: rgba(52,211,153,.4); }
.act-pip.pip-loss    { color: var(--down); background: var(--down-dim); border-color: rgba(248,113,113,.4); }
.act-pip.pip-neutral { color: var(--text-dim); background: var(--bg-2); }

/* Ligne « reliée » : trait vertical entre la pastille et la précédente */
.act-linked .act-rail::before {
  content: ''; position: absolute; top: -11px; left: 50%;
  transform: translateX(-50%); width: 2px; height: 12px;
  background: var(--rule); z-index: 0;
}

.act-body { flex: 1; min-width: 0; }
.act-line1 {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.act-kind {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase;
}
.act-kind-entry { color: var(--accent);   background: var(--accent-dim); border: 1px solid rgba(232,176,75,.2); }
.act-kind-exit  { color: var(--text-dim); background: var(--bg-2); border: 1px solid var(--rule); }
.act-sym {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--text); letter-spacing: 0.03em;
}
.act-pnl { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.act-time {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  color: var(--text-faint); white-space: nowrap;
}
.act-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 4px; font-family: var(--mono); font-size: 11px;
  color: var(--text-dim);
}
.act-dot-sep { color: var(--text-faint); }

/* Sens lisible coloré, partagé Activité + Trades */
.dir-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--text-dim);
}
.dir-tag.long  { color: var(--up); }
.dir-tag.short { color: var(--down); }

/* PnL nul / indisponible (gris) — complète .pnl-pos / .pnl-neg existants */
.pnl-zero { color: var(--text-faint); }

/* ─── Avis IA (desk read) par event d'activité ─────────────────── */
.act-desk { margin-top: 7px; }
.act-desk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; line-height: 1;
  padding: 4px 9px; border-radius: 999px; cursor: pointer;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(232,176,75,.22);
  transition: background .16s ease, border-color .16s ease, opacity .16s ease;
}
.act-desk-btn:hover { background: rgba(232,176,75,.22); border-color: rgba(232,176,75,.4); }
.act-desk-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.act-desk-btn:disabled { cursor: default; opacity: .8; }
.act-desk-btn.is-loading { color: var(--text-dim); background: var(--bg-2); border-color: var(--rule); }

/* Spinner discret : visible uniquement pendant le chargement */
.act-desk-spin { display: none; width: 9px; height: 9px; }
.act-desk-btn.is-loading .act-desk-spin {
  display: inline-block; border-radius: 50%;
  border: 1.5px solid var(--rule); border-top-color: var(--accent);
  animation: act-desk-spin .7s linear infinite;
}
@keyframes act-desk-spin { to { transform: rotate(360deg); } }

/* Encart dépliable sous l'event — reprend la surface du chat agent */
.act-desk-panel {
  margin-top: 7px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--rule-soft);
  border-left: 2px solid rgba(232,176,75,.35);
  border-radius: var(--radius-sm);
  animation: act-desk-in .22s ease both;
}
@keyframes act-desk-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.act-desk-bubble {
  font-size: 12px; line-height: 1.5; color: var(--text-dim);
  background: none; border: none; padding: 0;
}
.act-desk-regen {
  margin-top: 8px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.04em; color: var(--text-faint);
  background: none; border: none; cursor: pointer; padding: 0;
  transition: color .16s ease;
}
.act-desk-regen:hover { color: var(--accent); }
.act-desk-err {
  font-family: var(--mono); font-size: 11px; line-height: 1.45;
  color: var(--down); opacity: .82;
}
@media (prefers-reduced-motion: reduce) {
  .act-desk-panel { animation: none; }
  .act-desk-btn.is-loading .act-desk-spin { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   TRADES — deux sections (En cours / Historique)
   ═══════════════════════════════════════════════════════════════ */
.trades-section { margin-bottom: 22px; }
.trades-section:last-child { margin-bottom: 0; }
.trades-section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 9px;
}
.trades-section-title {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
}
.trades-section-hint {
  font-weight: 400; color: var(--text-faint); text-transform: none;
  letter-spacing: 0.02em;
}
.trades-section-count {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(232,176,75,.25); border-radius: 9px;
  padding: 1px 8px; line-height: 1.5;
}
.trade-mode  { color: var(--text-dim); text-transform: capitalize; }
.trade-reason { color: var(--text-dim); white-space: normal; max-width: 220px; }

/* ═══════════════════════════════════════════════════════════════
   NAV — point « activité récente » pulsant
   ═══════════════════════════════════════════════════════════════ */
.activity-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-left: 5px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(232,176,75,.5);
  animation: activity-pulse 1.8s ease-out infinite;
}
@keyframes activity-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,176,75,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(232,176,75,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,176,75,0); }
}
@media (prefers-reduced-motion: reduce) {
  .act-row { animation: none; }
  .activity-dot { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   CLARTÉ — Bandeau d'aide auto-explicatif (repliable, persistant)
   ═══════════════════════════════════════════════════════════════ */
.help-banner {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--rule-soft);
}
.help-banner-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 20px; background: none; border: none; cursor: pointer;
  text-align: left; color: var(--text);
  transition: background .15s;
}
.help-banner-toggle:hover { background: rgba(232,176,75,.04); }
.help-banner-q {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(232,176,75,.3);
}
.help-banner-head {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text);
}
.help-banner-mode {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; padding: 2px 7px; border-radius: 4px;
  background: var(--up-dim); color: var(--up);
  border: 1px solid rgba(52,211,153,.3);
}
.help-banner-caret {
  margin-left: auto; font-size: 11px; color: var(--text-faint);
  transition: transform .2s;
}
.help-banner-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px; padding: 4px 20px 14px;
  overflow: hidden; transition: max-height .3s ease, opacity .25s ease, padding .25s ease;
  max-height: 400px; opacity: 1;
}
.help-banner.collapsed .help-banner-body {
  max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0;
}
.help-card {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--rule-soft);
}
.help-card-icon {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.help-card-icon.observe { background: var(--up-dim); color: var(--up); border: 1px solid rgba(52,211,153,.3); }
.help-card-icon.states  { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(232,176,75,.3); }
.help-card-icon.pending { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(245,158,11,.3); }
.help-card-icon.look    { background: rgba(59,130,246,.14); color: #93c5fd; border: 1px solid rgba(59,130,246,.32); }
.help-card-txt {
  font-size: 11px; line-height: 1.5; color: var(--text-dim); min-width: 0;
}
.help-card-txt strong {
  display: block; color: var(--text); font-weight: 600;
  font-size: 11.5px; margin-bottom: 2px;
}
.help-card-txt em { color: var(--text); font-style: normal; font-weight: 600; }
.help-state {
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.06em; padding: 1px 5px; border-radius: 3px;
  white-space: nowrap;
}
.help-state.idle { background: rgba(100,116,139,.15); color: var(--neutral); border: 1px solid rgba(100,116,139,.25); }
.help-state.warn { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(245,158,11,.3); }
.help-state.pos  { background: var(--up-dim); color: var(--up); border: 1px solid rgba(52,211,153,.3); }

/* ═══════════════════════════════════════════════════════════════
   CLARTÉ — Bandeau « setups en cours » (paper)
   ═══════════════════════════════════════════════════════════════ */
.live-setups-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 20px; background: var(--warn-dim);
  border-bottom: 1px solid rgba(245,158,11,.25);
}
.live-setups-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--warn); box-shadow: 0 0 8px rgba(245,158,11,.7);
  animation: pulse-live 2s ease-in-out infinite;
}
.live-setups-lead {
  font-family: var(--mono); font-size: 11px; color: var(--text);
  letter-spacing: 0.03em;
}
.live-setups-lead strong { color: var(--warn); font-weight: 700; font-size: 13px; }
.live-setups-paper {
  font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); margin-left: 5px;
}
.live-setups-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.live-setups-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--rule);
}
.live-setups-chip-sym { color: var(--text); font-weight: 700; letter-spacing: 0.03em; }
.live-setups-chip-dir { font-size: 9px; text-transform: uppercase; color: var(--text-faint); }
.live-setups-chip.long  { border-color: rgba(52,211,153,.35); }
.live-setups-chip.long  .live-setups-chip-dir { color: var(--up); }
.live-setups-chip.short { border-color: rgba(248,113,113,.35); }
.live-setups-chip.short .live-setups-chip-dir { color: var(--down); }
.live-setups-more {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint); font-weight: 600;
}
.live-setups-go {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; padding: 4px 11px; border-radius: var(--radius-sm);
  background: var(--warn); color: #1a1206; border: none; cursor: pointer;
  transition: filter .15s;
}
.live-setups-go:hover { filter: brightness(1.1); }

/* ═══════════════════════════════════════════════════════════════
   CLARTÉ — WAIT hint + badge « POSITION OUVERTE » sur carte
   ═══════════════════════════════════════════════════════════════ */
.kcard-wait-hint {
  font-family: var(--sans); font-size: 9.5px; line-height: 1.35;
  color: var(--text-faint); font-style: italic;
  padding: 1px 2px;
}
.kcard-live {
  border-radius: var(--radius-sm); padding: 6px 8px;
  background: var(--warn-dim); border: 1px solid rgba(245,158,11,.3);
}
.kcard-live.long  { background: var(--up-dim);   border-color: rgba(52,211,153,.3); }
.kcard-live.short { background: var(--down-dim); border-color: rgba(248,113,113,.3); }
.kcard-live-head { display: flex; align-items: center; gap: 6px; }
.kcard-live-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--warn); box-shadow: 0 0 6px rgba(245,158,11,.6);
  animation: pulse-live 2s ease-in-out infinite;
}
.kcard-live.long  .kcard-live-dot { background: var(--up);   box-shadow: 0 0 6px rgba(52,211,153,.6); }
.kcard-live.short .kcard-live-dot { background: var(--down); box-shadow: 0 0 6px rgba(248,113,113,.6); }
.kcard-live-txt {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.05em; color: var(--text); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kcard-live-paper {
  font-family: var(--mono); font-size: 7.5px; font-weight: 700;
  letter-spacing: 0.1em; padding: 1px 5px; border-radius: 3px;
  background: rgba(0,0,0,.25); color: var(--text-dim); flex-shrink: 0;
}
.kcard-live-det { display: flex; gap: 12px; margin-top: 5px; flex-wrap: wrap; }
.kcard-live-kv { display: flex; align-items: baseline; gap: 4px; }
.kcard-live-k {
  font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
}
.kcard-live-v { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   V4a — Chip PRÉVISION KRONOS (façade carte)
   ═══════════════════════════════════════════════════════════════ */
.consensus-gauge-col {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.fc-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 3px 8px; border-radius: 12px; min-width: 64px;
  background: var(--bg-2); border: 1px solid var(--rule-soft);
}
.fc-chip-lbl {
  font-family: var(--mono); font-size: 6.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
}
.fc-chip-val { font-family: var(--mono); font-size: 11px; font-weight: 700; line-height: 1; }
.fc-chip.pos { background: var(--up-dim);   border-color: rgba(52,211,153,.32); }
.fc-chip.pos .fc-chip-val { color: var(--up); }
.fc-chip.neg { background: var(--down-dim); border-color: rgba(248,113,113,.32); }
.fc-chip.neg .fc-chip-val { color: var(--down); }
.fc-chip.neutral .fc-chip-val { color: var(--text-faint); }

/* ═══════════════════════════════════════════════════════════════
   FEEDBACK IA — chat thinking + Avis IA loading (très visible)
   ═══════════════════════════════════════════════════════════════ */
.agent-thinking-head {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--text);
}
.agent-thinking-brain { font-size: 14px; }
.agent-thinking-sub {
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
  margin-top: 5px; letter-spacing: 0.02em;
}
.act-desk-loading {
  font-family: var(--mono); font-size: 10px; line-height: 1.4;
  color: var(--warn); padding: 7px 9px; border-radius: var(--radius-sm);
  background: var(--warn-dim); border: 1px solid rgba(245,158,11,.3);
}

/* ═══════════════════════════════════════════════════════════════
   V4a — Marchés de prédiction (drawer)
   ═══════════════════════════════════════════════════════════════ */
.drawer-pred-wrap { display: block; }
.pred-contrib {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 9px; border-radius: var(--radius-sm); margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--rule-soft);
}
.pred-contrib-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
}
.pred-contrib-val { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.pred-contrib-val.pos { color: var(--up); }
.pred-contrib-val.neg { color: var(--down); }
.pred-contrib-val.neutral-s { color: var(--text-faint); }
.pred-list { display: flex; flex-direction: column; gap: 7px; }
.pred-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--rule-soft);
}
.pred-item-dot { font-size: 9px; color: var(--accent); flex-shrink: 0; line-height: 1.5; }
.pred-item-title { font-size: 11px; color: var(--text); line-height: 1.4; min-width: 0; }

/* ═══════════════════════════════════════════════════════════════
   FUSION A+C — overrides identité + UX (Lot 2)
   Placés en fin de fichier pour primer sur les définitions amont.
   ═══════════════════════════════════════════════════════════════ */
/* Brand + GROS titres de section en Martian Mono (--disp) — pas les
   micro-labels 9px (Martian y serait trop large/lourd). */
.brand-name, .rg-banner-title, .activity-title, .drawer-title,
.trades-section-title { font-family: var(--disp); }

/* A11y : focus clavier visible partout (les inputs à ring custom gardent le leur). */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
.tab:focus-visible, .filter-chip:focus-visible,
.help-banner-toggle:focus-visible, .drawer-close:focus-visible,
[role="button"]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════
   CAPITAL PAPER ÉVOLUTIF — courbe d'équité (onglet Performance)
   ═══════════════════════════════════════════════════════════════ */
.equity-block {
  border: 1px solid var(--rule); background: var(--panel);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.eq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eq-label { font-family: var(--disp); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-faint); }
.eq-val { font-family: var(--disp); font-size: 30px; font-weight: 700; margin-top: 5px; letter-spacing: 0.01em; line-height: 1; }
.eq-val.up { color: var(--up); text-shadow: 0 0 18px rgba(52,211,153,.25); }
.eq-val.down { color: var(--down); text-shadow: 0 0 18px rgba(248,113,113,.25); }
.eq-sub { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.eq-sub .up { color: var(--up); font-weight: 600; }
.eq-sub .down { color: var(--down); font-weight: 600; }
.eq-stats { display: flex; gap: 18px; }
.eq-stats > div { display: flex; flex-direction: column; align-items: flex-end; }
.eq-k { font-family: var(--disp); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.eq-v { font-family: var(--mono); font-size: 16px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.eq-chart { width: 100%; height: 132px; margin-top: 12px; display: block; }
.eq-demo { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warn); margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════════════════
   KRONOS LOCK — écran de verrouillage spectaculaire
   ══════════════════════════════════════════════════════════════════════════ */
.klock {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 50% 30%, #0d1320 0%, #060912 55%, #02040a 100%);
  color: #e8b04b; overflow: hidden;
  font-family: var(--mono, 'Martian Mono', ui-monospace, monospace);
  transition: opacity .7s ease, transform .7s ease, visibility .7s;
}
.klock.klock-hidden { opacity: 0; visibility: hidden; transform: scale(1.12); pointer-events: none; }
.klock-grid {
  position: absolute; inset: -2px;
  background-image: linear-gradient(rgba(232,176,75,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(232,176,75,.06) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(80% 80% at 50% 40%, #000 30%, transparent 100%);
}
.klock-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 220px 60px #02040a; pointer-events: none; }
.klock-scan {
  position: absolute; left: 0; right: 0; height: 140px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(232,176,75,.10), transparent);
  animation: kScan 4.5s linear infinite;
}
@keyframes kScan { 0% { transform: translateY(-160px); } 100% { transform: translateY(100vh); } }
.klock-particles { position: absolute; inset: 0; pointer-events: none; }
.klock-particles i {
  position: absolute; bottom: -10px; width: 2px; height: 2px; border-radius: 50%;
  background: #e8b04b; opacity: .5; animation: kFloat linear infinite;
}
@keyframes kFloat { to { transform: translateY(-105vh); opacity: 0; } }

.klock-core { position: relative; z-index: 2; text-align: center; padding: 24px; max-width: 380px; }
.klock-brand { font-size: 12px; letter-spacing: .5em; color: #e8b04b; opacity: .75; margin-bottom: 18px; }
.klock-ring {
  position: relative; width: 168px; height: 168px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid rgba(232,176,75,.25);
  box-shadow: 0 0 0 0 rgba(232,176,75,.35), inset 0 0 40px rgba(232,176,75,.06);
  animation: kPulse 2.6s ease-in-out infinite;
}
@keyframes kPulse {
  0%,100% { box-shadow: 0 0 30px 2px rgba(232,176,75,.18), inset 0 0 40px rgba(232,176,75,.05); }
  50%     { box-shadow: 0 0 60px 8px rgba(232,176,75,.40), inset 0 0 60px rgba(232,176,75,.12); }
}
.klock-lock { width: 92px; height: 115px; color: #e8b04b; filter: drop-shadow(0 0 10px rgba(232,176,75,.55)); transition: color .5s ease, filter .5s ease; }
.klock-lock .klock-bodyrect { fill: rgba(232,176,75,.10); stroke: currentColor; stroke-width: 4; }
.klock-lock .klock-keyhole, .klock-lock .klock-keyslot { fill: currentColor; }
.klock-shackle { transform-origin: 60px 60px; transition: transform .5s ease; }
.klock-flash {
  position: absolute; inset: -20%; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(232,176,75,.9), rgba(94,234,212,.35) 40%, transparent 70%);
}
.klock-title { font-size: 30px; font-weight: 800; letter-spacing: .18em; color: #f4f6fb; }
.klock-state { margin-top: 8px; font-size: 11px; letter-spacing: .42em; color: #e8b04b; opacity: .85; animation: kBlink 2s ease-in-out infinite; }
@keyframes kBlink { 0%,100% { opacity: .45; } 50% { opacity: .95; } }

.klock-form { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.klock-input {
  background: rgba(8,12,22,.85); border: 1px solid rgba(232,176,75,.35); border-radius: 8px;
  color: #f4f6fb; font-family: inherit; font-size: 16px; letter-spacing: .25em;
  text-align: center; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.klock-input:focus { border-color: #e8b04b; box-shadow: 0 0 0 3px rgba(232,176,75,.18), 0 0 22px rgba(232,176,75,.25); }
.klock-btn {
  background: linear-gradient(180deg, #f1c065, #d99a2e); color: #1a1206; border: none; border-radius: 8px;
  font-family: inherit; font-weight: 700; font-size: 13px; letter-spacing: .18em; padding: 13px;
  cursor: pointer; transition: transform .1s, box-shadow .2s; box-shadow: 0 6px 22px rgba(232,176,75,.28);
}
.klock-btn:hover { box-shadow: 0 8px 30px rgba(232,176,75,.45); }
.klock-btn:active { transform: translateY(1px); }
.klock-err { min-height: 18px; margin-top: 12px; font-size: 12px; letter-spacing: .04em; color: #f87171; }
.klock-foot { margin-top: 22px; font-size: 10px; letter-spacing: .3em; color: rgba(244,246,251,.35); }

/* — Erreur : secousse — */
.klock.klock-shake .klock-core { animation: kShake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes kShake { 10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-9px); } 40%,60% { transform: translateX(9px); } }

/* — Ouverture : séquence cinématique — */
.klock.klock-open .klock-shackle { transform: translateY(-26px) rotate(11deg); }
.klock.klock-open .klock-lock { color: #34d399; filter: drop-shadow(0 0 18px rgba(52,211,153,.8)); }
.klock.klock-open .klock-ring { animation: kRingBurst .9s ease-out forwards; border-color: rgba(52,211,153,.5); }
.klock.klock-open .klock-flash { animation: kFlash .85s ease-out forwards; }
.klock.klock-open .klock-state { color: #34d399; animation: none; opacity: 1; }
@keyframes kRingBurst {
  0% { box-shadow: 0 0 40px 4px rgba(232,176,75,.4); }
  45% { box-shadow: 0 0 90px 22px rgba(52,211,153,.6); }
  100% { box-shadow: 0 0 0 60px rgba(52,211,153,0); }
}
@keyframes kFlash { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }

@media (prefers-reduced-motion: reduce) {
  .klock-scan, .klock-particles, .klock-ring, .klock-state { animation: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   AGENT LOCK — verrou stylisé de l'agent IA (scoped à l'onglet Agent)
   ══════════════════════════════════════════════════════════════════════════ */
#agent-wrap { position: relative; }
.alock {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 50% 35%, rgba(13,19,32,.97) 0%, rgba(6,9,18,.98) 60%, rgba(2,4,10,.99) 100%);
  backdrop-filter: blur(3px); border-radius: 12px; overflow: hidden;
  color: #e8b04b; font-family: var(--mono, 'Martian Mono', ui-monospace, monospace);
  transition: opacity .6s ease, transform .6s ease, visibility .6s;
}
.alock.alock-hidden { opacity: 0; visibility: hidden; transform: scale(1.06); pointer-events: none; }
.alock-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(232,176,75,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(232,176,75,.05) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
}
.alock-card { position: relative; z-index: 2; text-align: center; padding: 18px 24px; max-width: 320px; }
.alock-ring {
  position: relative; width: 116px; height: 116px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid rgba(232,176,75,.22); animation: kPulse 2.6s ease-in-out infinite;
}
.alock-lock { width: 62px; height: 78px; color: #e8b04b; filter: drop-shadow(0 0 8px rgba(232,176,75,.5)); transition: color .5s, filter .5s; }
.alock-lock .alock-bodyrect { fill: rgba(232,176,75,.10); stroke: currentColor; stroke-width: 4; }
.alock-lock .alock-keyhole, .alock-lock .alock-keyslot { fill: currentColor; }
.alock-shackle { transform-origin: 60px 60px; transition: transform .5s ease; }
.alock-flash {
  position: absolute; inset: -25%; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(232,176,75,.9), rgba(94,234,212,.35) 40%, transparent 70%);
}
.alock-title { font-size: 16px; font-weight: 800; letter-spacing: .14em; color: #f4f6fb; }
.alock-sub { margin-top: 6px; font-size: 10px; letter-spacing: .22em; color: #e8b04b; opacity: .8; }
.alock-form { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.alock-input {
  background: rgba(8,12,22,.85); border: 1px solid rgba(232,176,75,.35); border-radius: 8px;
  color: #f4f6fb; font-family: inherit; font-size: 15px; letter-spacing: .22em; text-align: center;
  padding: 11px 12px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.alock-input:focus { border-color: #e8b04b; box-shadow: 0 0 0 3px rgba(232,176,75,.16), 0 0 18px rgba(232,176,75,.22); }
.alock-btn {
  background: linear-gradient(180deg, #f1c065, #d99a2e); color: #1a1206; border: none; border-radius: 8px;
  font-family: inherit; font-weight: 700; font-size: 12px; letter-spacing: .16em; padding: 11px;
  cursor: pointer; transition: transform .1s, box-shadow .2s; box-shadow: 0 5px 18px rgba(232,176,75,.26);
}
.alock-btn:hover { box-shadow: 0 7px 26px rgba(232,176,75,.42); }
.alock-btn:active { transform: translateY(1px); }
.alock-err { min-height: 16px; margin-top: 10px; font-size: 11px; color: #f87171; }
.alock.alock-shake .alock-card { animation: kShake .45s cubic-bezier(.36,.07,.19,.97); }
.alock.alock-open .alock-shackle { transform: translateY(-24px) rotate(11deg); }
.alock.alock-open .alock-lock { color: #34d399; filter: drop-shadow(0 0 14px rgba(52,211,153,.8)); }
.alock.alock-open .alock-ring { animation: kRingBurst .9s ease-out forwards; border-color: rgba(52,211,153,.5); }
.alock.alock-open .alock-flash { animation: kFlash .85s ease-out forwards; }
@media (prefers-reduced-motion: reduce) { .alock-ring { animation: none !important; } }

/* ══════════════════════════════════════════════════════════════════════════
   AGENT LOCK — interface neuronale futuriste (cerveau IA qui s'allume)
   ══════════════════════════════════════════════════════════════════════════ */
.aibrain-lock {
  background: radial-gradient(120% 120% at 50% 32%, rgba(8,16,28,.98) 0%, rgba(4,9,18,.99) 60%, rgba(1,4,10,1) 100%);
  color: #22d3ee;
}
.aibrain-lock .alock-grid {
  background-image: linear-gradient(rgba(34,211,238,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(34,211,238,.05) 1px, transparent 1px);
}
.aibrain-lock .alock-input { border-color: rgba(34,211,238,.4); }
.aibrain-lock .alock-input:focus { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.18), 0 0 20px rgba(34,211,238,.3); }
.aibrain-lock .alock-btn { background: linear-gradient(180deg, #2bd4ee, #0e9bc4); color: #03121a; box-shadow: 0 5px 20px rgba(34,211,238,.32); }
.aibrain-lock .alock-btn:hover { box-shadow: 0 8px 30px rgba(34,211,238,.5); }
.aibrain-lock .alock-title { color: #e9fbff; }
.aibrain-lock .alock-sub { color: #22d3ee; }

.aiscan {
  position: absolute; left: 0; right: 0; height: 90px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(34,211,238,.10), transparent);
  animation: kScan 4s linear infinite;
}
.aibrain-wrap { position: relative; width: 168px; height: 138px; margin: 0 auto 14px; }
.aibrain-core {
  position: absolute; left: 50%; top: 48%; width: 26px; height: 26px; transform: translate(-50%,-50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.25), transparent 70%);
  filter: blur(2px); transition: all .6s ease;
}
.aibrain { position: relative; width: 100%; height: 100%; overflow: visible; z-index: 2; }
.aibrain .syn { stroke: #22d3ee; stroke-width: 1; opacity: .12; }
.aibrain .nrn { fill: #14283a; stroke: #22d3ee; stroke-width: 1; opacity: .42; }
.aibrain .nrn.idle { animation: nrnIdle 3.2s ease-in-out infinite; }
@keyframes nrnIdle { 0%,100% { opacity: .28; } 50% { opacity: .62; } }

/* Cascade d'allumage (déclenchée via inline animation par app.js, delay par neurone) */
@keyframes synFire {
  0%   { opacity: .12; stroke: #22d3ee; }
  45%  { opacity: 1;   stroke: #a5f3fc; filter: drop-shadow(0 0 4px #22d3ee); }
  100% { opacity: .65; stroke: #67e8f9; }
}
@keyframes nrnFire {
  0%   { opacity: .42; fill: #14283a; }
  35%  { opacity: 1;   fill: #c8f9ff; filter: drop-shadow(0 0 7px #22d3ee); }
  100% { opacity: .95; fill: #67e8f9; filter: drop-shadow(0 0 4px #22d3ee); }
}
/* Cerveau « en ligne » : cœur qui s'embrase */
.aibrain-lock.alock-open .aibrain-core {
  width: 150px; height: 120px;
  background: radial-gradient(circle, rgba(34,211,238,.5), rgba(167,243,252,.18) 45%, transparent 72%);
  animation: aiCorePulse 1.6s ease-out;
}
@keyframes aiCorePulse { 0% { opacity: .2; } 35% { opacity: 1; } 100% { opacity: .8; } }
.aibrain-lock.alock-open .alock-title { color: #67e8f9; }
.aibrain-lock.alock-shake .alock-card { animation: kShake .45s cubic-bezier(.36,.07,.19,.97); }

/* ══════════════════════════════════════════════════════════════════════════
   FX SPECTACULAIRES — onde de choc, flash, anneaux d'instrument, vie neuronale
   ══════════════════════════════════════════════════════════════════════════ */
.fx-shock {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid currentColor; opacity: .9;
  pointer-events: none; z-index: 4; animation: fxShock .9s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes fxShock { 0% { width: 12px; height: 12px; opacity: .95; }
  100% { width: var(--sz, 360px); height: var(--sz, 360px); opacity: 0; border-width: 1px; } }
.fx-flash {
  position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: 0;
  background: radial-gradient(circle at 50% 42%, #eaf6ff, rgba(234,246,255,.2) 45%, transparent 72%);
  animation: fxFlash .7s ease-out forwards;
}
@keyframes fxFlash { 0% { opacity: 0; } 14% { opacity: .9; } 100% { opacity: 0; } }

/* — KRONOS : anneaux d'instrument rotatifs autour du cadenas — */
.klock-ring::before, .klock-ring::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.klock-ring::before { inset: -14px; border: 1px dashed rgba(232,176,75,.22); animation: kSpin 16s linear infinite; }
.klock-ring::after  { inset: -28px; border: 1px solid rgba(232,176,75,.10);
  border-top-color: rgba(232,176,75,.55); animation: kSpin 9s linear infinite reverse; }
@keyframes kSpin { to { transform: rotate(360deg); } }
.klock.klock-open .klock-ring::after { border-top-color: rgba(52,211,153,.7); animation-duration: 2.5s; }

/* — Cerveau IA : respiration + impulsions le long des synapses — */
.aibrain-wrap { animation: aiBreathe 4.5s ease-in-out infinite; }
@keyframes aiBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes synTravel { from { stroke-dashoffset: var(--L, 40); } to { stroke-dashoffset: 0; } }
.aibrain .syn.spark { animation: synSpark .8s ease-out; }
@keyframes synSpark { 0% { opacity: .12; stroke: #22d3ee; } 45% { opacity: .8; stroke: #a5f3fc; } 100% { opacity: .12; stroke: #22d3ee; } }
.aibrain-lock.alock-open .aibrain-wrap { animation: aiBreathe 1.4s ease-in-out; }
